[Kstars-devel] KDE/kdeedu/kstars/kstars

Jason Harris kstars at 30doradus.org
Tue Dec 6 06:26:07 CET 2005


SVN commit 485914 by harris:

Make AddCatDialog compile
CCMAIL: kstars-devel at kde.org


 M  +12 -9     addcatdialog.cpp  
 M  +9 -4      addcatdialog.h  
 M  +25 -55    addcatdialogui.ui  


--- trunk/KDE/kdeedu/kstars/kstars/addcatdialog.cpp #485913:485914
@@ -30,10 +30,15 @@
 
 #include "kstars.h"
 #include "kstarsdata.h"
-#include "customcatalog.h"
+#include "Options.h"
+#include "skycomponents/customcatalogcomponent.h"
 
 #include "addcatdialog.h"
 
+AddCatDialogUI::AddCatDialogUI( QWidget *parent ) : QFrame( parent ) {
+	setupUi(this);
+}
+
 AddCatDialog::AddCatDialog( QWidget *parent )
 	: KDialogBase( KDialogBase::Plain, i18n( "Import Catalog" ), Help|Ok|Cancel, Ok, parent ) {
 
@@ -124,7 +129,8 @@
 		dataFile.close();
 	}
 
-	//Now create a temporary file for the Catalog, and attempt to parse it into a CustomCatalog
+	//Now create a temporary file for the Catalog, and attempt to parse it 
+	//into a temporary CustomCatalogComponent
 	KTempFile ktf;
 	QFile tmpFile( ktf.name() );
 	ktf.unlink(); //just need filename
@@ -132,14 +138,11 @@
 		QTextStream ostream( &tmpFile );
 		ostream << CatalogContents;
 		tmpFile.close();
-		CustomCatalog *newCat;
+		CustomCatalogComponent newCat( 0, tmpFile.name(), true, Options::showOther );
+		newCat.init( ksw->data() );
 
-		newCat = ksw->data()->createCustomCatalog( tmpFile.name(), true ); // true = showerrs
-		if ( newCat ) {
-			int nObjects = newCat->objList().count();
-			delete newCat;
-			if ( nObjects ) return true;
-		}
+		int nObjects = newCat.objectList().size();
+		if ( nObjects ) return true;
 	}
 
 	return false;
--- trunk/KDE/kdeedu/kstars/kstars/addcatdialog.h #485913:485914
@@ -18,15 +18,20 @@
 #ifndef ADDCATDIALOG_H
 #define ADDCATDIALOG_H
 
+#include <QVBoxLayout>
 #include <kdialogbase.h>
 #include <klineedit.h>
 #include <kurlrequester.h>
+
+#include "addcatdialogui.h"
 #include "deepskyobject.h"
-#include "addcatdialogui.h"
-#include "draglistbox.h"
-//Added by qt3to4:
-#include <QVBoxLayout>
 
+class AddCatDialogUI : public QFrame, public Ui::AddCatDialog {
+	Q_OBJECT
+	public:
+		AddCatDialogUI( QWidget *parent=0 );
+};
+
 /**@class AddCatDialog
 	*@short Dialog for adding custom object catalogs to KStars
 	*@author Jason Harris
--- trunk/KDE/kdeedu/kstars/kstars/addcatdialogui.ui #485913:485914
@@ -2,8 +2,8 @@
  <author></author>
  <comment></comment>
  <exportmacro></exportmacro>
- <class>AddCatDialogUI</class>
- <widget class="QWidget" name="AddCatDialogUI" >
+ <class>AddCatDialog</class>
+ <widget class="QWidget" name="AddCatDialog" >
   <property name="geometry" >
    <rect>
     <x>0</x>
@@ -17,7 +17,7 @@
   </property>
   <layout class="QVBoxLayout" >
    <property name="margin" >
-    <number>10</number>
+    <number>8</number>
    </property>
    <property name="spacing" >
     <number>6</number>
@@ -78,10 +78,10 @@
      </property>
      <layout class="QHBoxLayout" >
       <property name="margin" >
-       <number>10</number>
+       <number>-1</number>
       </property>
       <property name="spacing" >
-       <number>6</number>
+       <number>0</number>
       </property>
       <item>
        <layout class="QVBoxLayout" >
@@ -110,14 +110,7 @@
          </widget>
         </item>
         <item>
-         <widget class="DragListBox" name="FieldList" >
-          <property name="toolTip" >
-           <string>Data fields present in the import file</string>
-          </property>
-          <property name="whatsThis" >
-           <string>Build a list of data fields for your import data file (in the correct order from left to right), by dragging items from the &quot;Available fields&quot; list.</string>
-          </property>
-         </widget>
+         <widget class="DragListBox" name="FieldList" />
         </item>
        </layout>
       </item>
@@ -148,14 +141,7 @@
          </widget>
         </item>
         <item>
-         <widget class="DragListBox" name="FieldPool" >
-          <property name="toolTip" >
-           <string>The list of available data fields</string>
-          </property>
-          <property name="whatsThis" >
-           <string>Drag items from this box to the &quot;Catalog fields&quot; box to describe the contents of your imported data file.</string>
-          </property>
-         </widget>
+         <widget class="DragListBox" name="FieldPool" />
         </item>
        </layout>
       </item>
@@ -304,52 +290,36 @@
      </item>
     </layout>
    </item>
-   <item>
-    <spacer>
-     <property name="orientation" >
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeType" >
-      <enum>QSizePolicy::Expanding</enum>
-     </property>
-     <property name="sizeHint" >
-      <size>
-       <width>20</width>
-       <height>16</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
   </layout>
  </widget>
  <layoutdefault spacing="6" margin="11" />
  <pixmapfunction></pixmapfunction>
  <customwidgets>
   <customwidget>
-   <class>KLineEdit</class>
-   <extends></extends>
-   <header>klineedit.h</header>
+   <class>DragListBox</class>
+   <extends>KListBox</extends>
+   <header>widgets/draglistbox.h</header>
    <container>0</container>
    <pixmap></pixmap>
   </customwidget>
   <customwidget>
-   <class>KColorButton</class>
+   <class>Q3GroupBox</class>
    <extends></extends>
-   <header>kcolorbutton.h</header>
-   <container>0</container>
+   <header>Qt3Support/Q3GroupBox</header>
+   <container>1</container>
    <pixmap></pixmap>
   </customwidget>
   <customwidget>
-   <class>KListBox</class>
+   <class>KURLRequester</class>
    <extends></extends>
-   <header>klistbox.h</header>
+   <header>kurlrequester.h</header>
    <container>0</container>
    <pixmap></pixmap>
   </customwidget>
   <customwidget>
-   <class>KPushButton</class>
+   <class>KLineEdit</class>
    <extends></extends>
-   <header>kpushbutton.h</header>
+   <header>klineedit.h</header>
    <container>0</container>
    <pixmap></pixmap>
   </customwidget>
@@ -361,23 +331,23 @@
    <pixmap></pixmap>
   </customwidget>
   <customwidget>
-   <class>Q3GroupBox</class>
+   <class>KColorButton</class>
    <extends></extends>
-   <header>Qt3Support/Q3GroupBox</header>
-   <container>1</container>
+   <header>kcolorbutton.h</header>
+   <container>0</container>
    <pixmap></pixmap>
   </customwidget>
   <customwidget>
-   <class>KURLRequester</class>
+   <class>KListBox</class>
    <extends></extends>
-   <header>kurlrequester.h</header>
+   <header>klistbox.h</header>
    <container>0</container>
    <pixmap></pixmap>
   </customwidget>
   <customwidget>
-   <class>DragListBox</class>
-   <extends>KListBox</extends>
-   <header>widgets/draglistbox.h</header>
+   <class>KPushButton</class>
+   <extends></extends>
+   <header>kpushbutton.h</header>
    <container>0</container>
    <pixmap></pixmap>
   </customwidget>


More information about the Kstars-devel mailing list