[Kstars-devel] KDE/kdeedu/kstars/kstars
Jason Harris
kstars at 30doradus.org
Sun Dec 2 07:13:23 CET 2007
SVN commit 743860 by harris:
Observing list wizard:
The magnitude limit spinbo is now enabled when its
checkbox is checked.
When defining a circular or rectangular region, the
object count is not updated until all fields are filled in.
CCMAIL: kstars-devel at kde.org
M +32 -6 tools/obslistwizard.cpp
M +3 -0 tools/obslistwizard.h
M +2 -0 widgets/dmsbox.h
--- trunk/KDE/kdeedu/kstars/kstars/tools/obslistwizard.cpp #743859:743860
@@ -59,17 +59,18 @@
//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() ) );
- connect( olw->RAMin, SIGNAL( lostFocus() ), this, SLOT( slotUpdateObjectCount() ) );
- connect( olw->RAMax, SIGNAL( lostFocus() ), this, SLOT( slotUpdateObjectCount() ) );
- connect( olw->DecMin, SIGNAL( lostFocus() ), this, SLOT( slotUpdateObjectCount() ) );
- connect( olw->DecMax, SIGNAL( lostFocus() ), this, SLOT( slotUpdateObjectCount() ) );
- connect( olw->RA, SIGNAL( lostFocus() ), this, SLOT( slotUpdateObjectCount() ) );
- connect( olw->Dec, SIGNAL( lostFocus() ), this, SLOT( slotUpdateObjectCount() ) );
+ connect( olw->RAMin, SIGNAL( lostFocus() ), this, SLOT( slotCheckRegion() ) );
+ connect( olw->RAMax, SIGNAL( lostFocus() ), this, SLOT( slotCheckRegion() ) );
+ connect( olw->DecMin, SIGNAL( lostFocus() ), this, SLOT( slotCheckRegion() ) );
+ connect( olw->DecMax, SIGNAL( lostFocus() ), this, SLOT( slotCheckRegion() ) );
+ connect( olw->RA, SIGNAL( lostFocus() ), this, SLOT( slotCheckRegion() ) );
+ connect( olw->Dec, SIGNAL( lostFocus() ), this, SLOT( slotCheckRegion() ) );
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->SelectByDate, SIGNAL( clicked() ), this, SLOT( slotToggleDateWidgets() ) );
+ connect( olw->SelectByMagnitude, SIGNAL( clicked() ), this, SLOT( slotToggleMagWidget() ) );
connect( this, SIGNAL( okClicked() ), this, SLOT( slotApplyFilters() ) );
@@ -243,6 +244,31 @@
slotUpdateObjectCount();
}
+void ObsListWizard::slotToggleMagWidgets()
+{
+ olw->Mag->setEnabled( olw->SelectByMagnitude->isChecked() );
+ olw->IncludeNoMag->setEnabled( olw->SelectByMagnitude->isChecked() );
+
+ slotUpdateObjectCount();
+}
+
+void ObsListWizard::slotCheckRegion()
+{
+ if ( sender()->objectName() == "RAMin" || sender()->objectName() == "RAMax"
+ || sender()->objectName() == "DecMin" || sender()->objectName() == "DecMax" ) {
+ if ( ! olw->RAMin->isEmpty() && ! olw->RAMax->isEmpty()
+ && ! olw->DecMin->isEmpty() && ! olw->DecMax->isEmpty() ) {
+ slotUpdateObjectCount();
+ }
+
+ } else {
+ if ( ! olw->RA->isEmpty() && ! olw->Dec->isEmpty()
+ && ! olw->Radius->isEmpty() ) {
+ slotUpdateObjectCount();
+ }
+ }
+}
+
void ObsListWizard::slotUpdateObjectCount()
{
QApplication::setOverrideCursor( Qt::WaitCursor );
--- trunk/KDE/kdeedu/kstars/kstars/tools/obslistwizard.h #743859:743860
@@ -59,7 +59,10 @@
void slotSolarSystemButton();
void slotChangeLocation();
void slotToggleDateWidgets();
+ void slotToggleMagWidgets();
+ void slotCheckRegion();
+
/**@short Construct the observing list by applying the selected filters
*/
void slotUpdateObjectCount();
--- trunk/KDE/kdeedu/kstars/kstars/widgets/dmsbox.h #743859:743860
@@ -127,6 +127,8 @@
*/
void clearFields (void) { setDMS(QString()); }
+ inline bool isEmpty() { return EmptyFlag; }
+
protected:
void focusInEvent( QFocusEvent *e );
void focusOutEvent( QFocusEvent *e );
More information about the Kstars-devel
mailing list