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

Prakash Mohan prak902000 at gmail.com
Tue May 26 02:03:46 CEST 2009


SVN commit 972921 by prakash:

Resetting the state of the pushButtons and the AVT plot widget when switching views.

CCMAIL: kstars-devel at kde.org


 M  +33 -0     observinglist.cpp  
 M  +4 -0      observinglist.h  


--- branches/kstars/summer/kstars/kstars/tools/observinglist.cpp #972920:972921
@@ -160,6 +160,8 @@
              this, SLOT( slotWizard() ) );
     connect( ui->MiniButton, SIGNAL( clicked() ),
              this, SLOT( slotToggleSize() ) );
+    connect( ui->tabWidget, SIGNAL( currentChanged(int) ),
+             this, SLOT( slotChangeTab(int) ) );
     //Add icons to Push Buttons
     ui->OpenButton->setIcon( KIcon("document-open") );
     ui->SaveButton->setIcon( KIcon("document-save") );
@@ -1060,4 +1062,35 @@
     }
 }
 
+void ObservingList::slotChangeTab(int index)
+{
+    if(index) {
+        ui->AddToSession->hide();
+        ui->SetDate->show();
+        ui->SetLocation->show();
+        ui->timeEdit->show();
+        ui->lineEdit->show();
+    } else {
+        ui->AddToSession->show();
+        ui->SetDate->hide();
+        ui->SetLocation->hide();
+        ui->timeEdit->hide();
+        ui->lineEdit->hide();
+    }
+        ui->CenterButton->setEnabled( false );
+        ui->ScopeButton->setEnabled( false );
+        ui->DetailsButton->setEnabled( false );
+        ui->AVTButton->setEnabled( false );
+        ui->RemoveButton->setEnabled( false );
+        ui->NotesLabel->setText( i18n( "Select an object to record notes on it here:" ) );
+        ui->NotesLabel->setEnabled( false );
+        ui->NotesEdit->setEnabled( false );
+        ui->AddToSession->setEnabled( false );
+        m_CurrentObject = 0;
+
+        //Clear the user log text box.
+        saveCurrentUserLog();
+        ui->NotesEdit->setPlainText("");
+        ui->View->removeAllPlotObjects();
+}
 #include "observinglist.moc"
--- branches/kstars/summer/kstars/kstars/tools/observinglist.h #972920:972921
@@ -180,6 +180,7 @@
         */
     void slotSaveSessionAs();
     
+
     /**@short save the current session
         */
     void slotSaveSession();
@@ -200,6 +201,9 @@
     void plot( SkyObject *o );
 
     double findAltitude( SkyPoint *p, double hour=0);
+
+    void slotChangeTab(int index);
+
 protected slots:
     void slotClose();
 


More information about the Kstars-devel mailing list