[Kstars-devel] KDE/kdeedu/kstars/kstars/tools
Akarsh Simha
akarshsimha at gmail.com
Sat Jan 10 20:12:13 CET 2009
SVN commit 909005 by asimha:
Improve usability of the Observing List Wizard by making the count
update optional.
BUG: 142833
CCMAIL: kstars-devel at kde.org
M +24 -12 obslistwizard.cpp
M +1 -0 obslistwizard.h
M +15 -0 obslistwizard.ui
--- trunk/KDE/kdeedu/kstars/kstars/tools/obslistwizard.cpp #909004:909005
@@ -57,19 +57,23 @@
connect( this, SIGNAL( user1Clicked() ), this, SLOT( slotPrevPage() ) );
connect( this, SIGNAL( user2Clicked() ), this, SLOT( slotNextPage() ) );
- //Update the count of objects when certain UI elements are modified
- connect( olw->TypeList, SIGNAL( itemSelectionChanged() ), this, SLOT( slotUpdateObjectCount() ) );
- connect( olw->ConstellationList, SIGNAL( itemSelectionChanged() ), this, SLOT( slotUpdateObjectCount() ) );
+ //Update the count of objects when the user asks for it
+ connect( olw->updateButton, SIGNAL( clicked() ), this, SLOT( slotUpdateObjectCount() ) );
+
+ // Enable the update count button when certain elements are changed
+ connect( olw->TypeList, SIGNAL( itemSelectionChanged() ), this, SLOT( slotObjectCountDirty() ) );
+ connect( olw->ConstellationList, SIGNAL( itemSelectionChanged() ), this, SLOT( slotObjectCountDirty() ) );
connect( olw->RAMin, SIGNAL( lostFocus() ), this, SLOT( slotParseRegion() ) );
connect( olw->RAMax, SIGNAL( lostFocus() ), this, SLOT( slotParseRegion() ) );
connect( olw->DecMin, SIGNAL( lostFocus() ), this, SLOT( slotParseRegion() ) );
connect( olw->DecMax, SIGNAL( lostFocus() ), this, SLOT( slotParseRegion() ) );
connect( olw->RA, SIGNAL( lostFocus() ), this, SLOT( slotParseRegion() ) );
connect( olw->Dec, SIGNAL( lostFocus() ), this, SLOT( slotParseRegion() ) );
- connect( olw->Radius, SIGNAL( lostFocus() ), this, SLOT( slotUpdateObjectCount() ) );
- connect( olw->Date, SIGNAL( dateChanged(const QDate&) ), this, SLOT( slotUpdateObjectCount() ) );
- connect( olw->Mag, SIGNAL( valueChanged( double ) ), this, SLOT( slotUpdateObjectCount() ) );
- connect( olw->IncludeNoMag, SIGNAL( clicked() ), this, SLOT( slotUpdateObjectCount() ) );
+ connect( olw->Radius, SIGNAL( lostFocus() ), this, SLOT( slotObjectCountDirty() ) );
+ connect( olw->Date, SIGNAL( dateChanged(const QDate&) ), this, SLOT( slotObjectCountDirty() ) );
+ connect( olw->Mag, SIGNAL( valueChanged( double ) ), this, SLOT( slotObjectCountDirty() ) );
+ connect( olw->IncludeNoMag, SIGNAL( clicked() ), this, SLOT( slotObjectCountDirty() ) );
+
connect( olw->SelectByDate, SIGNAL( clicked() ), this, SLOT( slotToggleDateWidgets() ) );
connect( olw->SelectByMagnitude, SIGNAL( clicked() ), this, SLOT( slotToggleMagWidgets() ) );
@@ -242,15 +246,16 @@
olw->Date->setEnabled( olw->SelectByDate->isChecked() );
olw->LocationButton->setEnabled( olw->SelectByDate->isChecked() );
- slotUpdateObjectCount();
+ // slotUpdateObjectCount();
+ slotObjectCountDirty();
}
void ObsListWizard::slotToggleMagWidgets()
{
olw->Mag->setEnabled( olw->SelectByMagnitude->isChecked() );
olw->IncludeNoMag->setEnabled( olw->SelectByMagnitude->isChecked() );
-
- slotUpdateObjectCount();
+ slotObjectCountDirty();
+ // slotUpdateObjectCount();
}
void ObsListWizard::slotParseRegion()
@@ -294,7 +299,8 @@
}
}
- slotUpdateObjectCount();
+ // slotUpdateObjectCount();
+ slotObjectCountDirty();
}
} else {
@@ -315,11 +321,16 @@
return;
}
- slotUpdateObjectCount();
+ // slotUpdateObjectCount();
+ slotObjectCountDirty();
}
}
}
+void ObsListWizard::slotObjectCountDirty() {
+ olw->updateButton->setDisabled( false );
+}
+
void ObsListWizard::slotUpdateObjectCount()
{
QApplication::setOverrideCursor( Qt::WaitCursor );
@@ -345,6 +356,7 @@
applyFilters( false ); //false = only adjust counts, do not build list
QApplication::restoreOverrideCursor();
+ olw->updateButton->setDisabled( true );
}
void ObsListWizard::applyFilters( bool doBuildList )
--- trunk/KDE/kdeedu/kstars/kstars/tools/obslistwizard.h #909004:909005
@@ -66,6 +66,7 @@
/**@short Construct the observing list by applying the selected filters
*/
+ void slotObjectCountDirty();
void slotUpdateObjectCount();
void slotApplyFilters() { applyFilters( true ); }
--- trunk/KDE/kdeedu/kstars/kstars/tools/obslistwizard.ui #909004:909005
@@ -975,6 +975,10 @@
</widget>
</item>
<item>
+ <widget class="QWidget" name="horizontalLayoutWidget" >
+ <layout class="QHBoxLayout" name="horizontalLayout" >
+ <item>
+
<widget class="QLabel" name="CountLabel" >
<property name="frameShape" >
<enum>QFrame::StyledPanel</enum>
@@ -983,6 +987,17 @@
<string>Your observing list currently has 0 objects.</string>
</property>
</widget>
+ </item>
+ <item>
+ <widget class="KPushButton" name="updateButton" >
+ <property name="text" >
+ <string>Update Count</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+
</item>
</layout>
</widget>
More information about the Kstars-devel
mailing list