[Kstars-devel] branches/kstars/summer/kstars/kstars/tools

Prakash Mohan prak902000 at gmail.com
Sat May 30 15:21:49 CEST 2009


SVN commit 975496 by prakash:

When the WUT button is triggered in the Session view, it should add objects to the Session List.

CCMAIL: kstars-devel at kde.org


 M  +14 -10    observinglist.cpp  
 M  +8 -5      wutdialog.cpp  
 M  +2 -2      wutdialog.h  


--- branches/kstars/summer/kstars/kstars/tools/observinglist.cpp #975495:975496
@@ -719,7 +719,10 @@
 }
 
 void ObservingList::slotWUT() {
-    WUTDialog w( ks );    
+    bool session = false;
+    if( ui->tabWidget->currentIndex() )
+        session = true;
+    WUTDialog w( ks, session );
     w.exec();
 }
 
@@ -736,15 +739,16 @@
 }
 
 void ObservingList::slotFind() {
-    FindDialog fd( ks );    
-    if ( fd.exec() == QDialog::Accepted ) {
-        SkyObject *o = fd.selectedObject();
-        if( o!= 0 )
-            if( ui->tabWidget->currentIndex() )
-                slotAddObject( o, true );
-            else
-                slotAddObject( o );  
-    }
+   FindDialog fd( ks );    
+   if ( fd.exec() == QDialog::Accepted ) {
+       SkyObject *o = fd.selectedObject();
+       if( o!= 0 ) {
+           if( ui->tabWidget->currentIndex() )
+               slotAddObject( o, true );
+           else
+               slotAddObject( o );  
+       }
+   }
 
 }
 
--- branches/kstars/summer/kstars/kstars/tools/wutdialog.cpp #975495:975496
@@ -42,7 +42,7 @@
     setupUi( this );
 }
 
-WUTDialog::WUTDialog(KStars *ks) :
+WUTDialog::WUTDialog( KStars *ks, bool _session ) :
         KDialog( (QWidget*)ks ), kstars(ks), EveningFlag(0)
 {
 
@@ -54,7 +54,7 @@
 
     //initialize location and date to current KStars settings:
     geo = kstars->geo();
-
+    session = _session;
     T0 = kstars->data()->lt();
     //If the Time is earlier than 6:00 am, assume the user wants the night of the previous date
     if ( T0.time().hour() < 6 )
@@ -436,9 +436,12 @@
     if (WUT->ObjectListWidget->currentItem() != 0) {
         o = kstars->data()->objectNamed( WUT->ObjectListWidget->currentItem()->text() );
     }
-    if(o != 0) 
-        kstars->observingList()->slotAddObject( o ) ;
- 
+    if(o != 0) {
+        if(!session)
+            kstars->observingList()->slotAddObject( o ) ;
+        else
+            kstars->observingList()->slotAddObject( o, true );
+    }
 }
 
 void WUTDialog::slotChangeDate() {
--- branches/kstars/summer/kstars/kstars/tools/wutdialog.h #975495:975496
@@ -48,7 +48,7 @@
 public:
 
     /**@short Constructor*/
-    WUTDialog(KStars *ks);
+    WUTDialog(KStars *ks, bool session = false);
     /**@short Destructor*/
     ~WUTDialog();
 
@@ -101,7 +101,7 @@
 
     KStars *kstars;
     WUTDialogUI *WUT;
-
+    bool session;
     QList<SkyObject*>& visibleObjects( const QString &category );
     bool isCategoryInitialized( const QString &category );
 


More information about the Kstars-devel mailing list