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

Akarsh Simha akarshsimha at gmail.com
Mon Jan 12 19:32:28 CET 2009


SVN commit 910117 by asimha:

Adding functionality to set maximum permissible separation in the
front-end for the Conjunctions tool. The functionality was already
implemented in the backend and I had been postponing this far too
long.

CCMAIL: kstars-devel at kde.org



 M  +11 -5     conjunctions.cpp  
 M  +32 -16    conjunctions.ui  


--- trunk/KDE/kdeedu/kstars/kstars/tools/conjunctions.cpp #910116:910117
@@ -88,6 +88,10 @@
         Obj2ComboBox->insertItem( i, pNames[i] );
     }
 
+    // Initialize the Maximum Separation box to 1 degree
+    maxSeparationBox->setDegType( true );
+    maxSeparationBox->setDMS( "01 00 00.0" );
+
     // signals and slots connections
     connect(LocationButton, SIGNAL(clicked()), this, SLOT(slotLocation()));
     connect(Obj1FindButton, SIGNAL(clicked()), this, SLOT(slotFindObject()));
@@ -170,12 +174,14 @@
     KStarsDateTime dtStop = stopDate -> dateTime();
     long double startJD = dtStart.djd();
     long double stopJD = dtStop.djd();
-    dms maxSeparation(1.0); // TODO: Make maxSeparation user-specifiable
-    // TODO: Get geoPlace from user.
-    //    dms LST( geoPlace->GSTtoLST( dt.gst() ) );
-
+    dms maxSeparation( 0.0 );
+    bool ok;
+    maxSeparation = maxSeparationBox->createDms( true, &ok );
+    if( !ok ) {
+        KMessageBox::sorry( 0, i18n("Maximum separation entered is not a valid angle. Use the What's this help feature for information on how to enter a valid angle") );
+        return;
+    }
     if( !Object1 ) {
-        // TODO: Display some error message
         KMessageBox::sorry( 0, i18n("Please select an object to check conjunctions with, by clicking on the \'Find Object\' button.") );
         return;
     }
--- trunk/KDE/kdeedu/kstars/kstars/tools/conjunctions.ui #910116:910117
@@ -90,6 +90,33 @@
        </property>
       </widget>
      </item>
+     <item row="4" column="0" >
+      <widget class="QLabel" name="label_5" >
+       <property name="text" >
+        <string>Maximum allowed separation:</string>
+       </property>
+      </widget>
+     </item>
+     <item row="4" column="1" >
+      <layout class="QHBoxLayout" name="horizontalLayout_5" >
+       <item>
+        <spacer name="horizontalSpacer_3" >
+         <property name="orientation" >
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeHint" stdset="0" >
+          <size>
+           <width>40</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
+        <widget class="dmsBox" name="maxSeparationBox" />
+       </item>
+      </layout>
+     </item>
     </layout>
    </item>
    <item>
@@ -104,14 +131,6 @@
       <number>0</number>
      </property>
      <widget class="QWidget" name="page" >
-      <property name="geometry" >
-       <rect>
-        <x>0</x>
-        <y>0</y>
-        <width>456</width>
-        <height>38</height>
-       </rect>
-      </property>
       <property name="sizePolicy" >
        <sizepolicy vsizetype="Minimum" hsizetype="Preferred" >
         <horstretch>0</horstretch>
@@ -159,14 +178,6 @@
       </layout>
      </widget>
      <widget class="QWidget" name="page_2" >
-      <property name="geometry" >
-       <rect>
-        <x>0</x>
-        <y>0</y>
-        <width>456</width>
-        <height>40</height>
-       </rect>
-      </property>
       <property name="sizePolicy" >
        <sizepolicy vsizetype="Minimum" hsizetype="Preferred" >
         <horstretch>0</horstretch>
@@ -217,6 +228,11 @@
    <extends>QPushButton</extends>
    <header>kpushbutton.h</header>
   </customwidget>
+  <customwidget>
+   <class>dmsBox</class>
+   <extends>KLineEdit</extends>
+   <header>widgets/dmsbox.h</header>
+  </customwidget>
  </customwidgets>
  <resources/>
  <connections/>


More information about the Kstars-devel mailing list