[Kstars-devel] branches/kstars/summer/kstars/kstars/tools
Prakash Mohan
prak902000 at gmail.com
Sun May 10 10:13:28 CEST 2009
SVN commit 965970 by prakash:
Clearing the plots in the AVT plot widget when no object or when multiple objects are selected. It doesn't make sense to plot multiple objects as there is not enough space for labels.
CCMAIL: kstars-devel at kde.org
M +9 -5 observinglist.cpp
--- branches/kstars/summer/kstars/kstars/tools/observinglist.cpp #965969:965970
@@ -100,6 +100,7 @@
ui->TableView->horizontalHeader()->setStretchLastSection( true );
ui->TableView->horizontalHeader()->setResizeMode( QHeaderView::ResizeToContents );
ksal = KSAlmanac::Instance();
+ ksal->setLocation(ks->geo());
ui->View->setSunRiseSetTimes(ksal->getSunRise(),ksal->getSunSet());
ui->View->setLimits( -12.0, 12.0, -90.0, 90.0 );
ui->View->axis(KPlotWidget::BottomAxis)->setTickLabelFormat( 't' );
@@ -248,7 +249,8 @@
obsList().removeAt(k);
if ( ! isModified ) isModified = true;
-
+
+ ui->View->removeAllPlotObjects();
ui->TableView->resizeColumnsToContents();
}
@@ -314,19 +316,17 @@
}
if ( found ) {
m_CurrentObject = o;
+ plot( PlotObject );
if ( newName != i18n( "star" ) ) {
//Display the current object's user notes in the NotesEdit
//First, save the last object's user log to disk, if necessary
saveCurrentUserLog(); //uses LogObject, which is still the previous obj.
-
//set LogObject to the new selected object
LogObject = currentObject();
PlotObject = currentObject();
- plot( PlotObject );
ui->NotesLabel->setEnabled( true );
ui->NotesEdit->setEnabled( true );
-
ui->NotesLabel->setText( i18n( "observing notes for %1:", LogObject->translatedName() ) );
if ( LogObject->userLog().isEmpty() ) {
ui->NotesEdit->setPlainText( i18n("Record here observation logs and/or data on %1.", LogObject->translatedName() ) );
@@ -361,6 +361,7 @@
//Clear the user log text box.
saveCurrentUserLog();
ui->NotesEdit->setPlainText("");
+ ui->View->removeAllPlotObjects();
} else { //more than one object selected.
ui->CenterButton->setEnabled( false );
@@ -372,6 +373,7 @@
ui->NotesLabel->setEnabled( false );
ui->NotesEdit->setEnabled( false );
m_CurrentObject = 0;
+ ui->View->removeAllPlotObjects();
//Clear the user log text box.
saveCurrentUserLog();
@@ -567,7 +569,7 @@
!= i18n("Record here observation logs and/or data on %1.", currentObject()->name()) ) {
currentObject()->saveUserLog( ui->NotesEdit->toPlainText() );
}
-
+ ui->View->removeAllPlotObjects();
hide();
}
@@ -750,6 +752,8 @@
if ( h1 > 12.0 ) h1 -= 24.0;
double h2 = h1 + 24.0;
ui->View->setSecondaryLimits( h1, h2, -90.0, 90.0 );
+ ksal->setLocation(ks->geo());
+ ui->View->setSunRiseSetTimes(ksal->getSunRise(),ksal->getSunSet());
ui->View->update();
KPlotObject *po = new KPlotObject( Qt::white, KPlotObject::Lines, 2.0 );
for ( double h=-12.0; h<=12.0; h+=0.5 ) {
More information about the Kstars-devel
mailing list