[Kstars-devel] branches/kstars/unfrozen/kstars/kstars
Jason Harris
kstars at 30doradus.org
Wed Jun 25 08:40:47 CEST 2008
SVN commit 824175 by harris:
Presto, chango!
The statusbar now has a (non-functional) KLed on its
right side. If you want it on the left, move the new
lines to the top of initStatusBar().
The public accessor is KLed* KStars::diskLED()
The relevant functions to call are diskLED()->on() and
diskLed()->off() (or diskLED()->toggle()).
(BTW, FYI: this is going to be used to indicate when the
disk is being accessed to dynamically load more stars.
It will probably be configured to only show up for debug
builds, or at least will be hidden by default)
CCMAIL: kstars-devel at kde.org
M +4 -0 kstars.h
M +6 -1 kstarsinit.cpp
--- branches/kstars/unfrozen/kstars/kstars/kstars.h #824174:824175
@@ -26,6 +26,7 @@
// forward declaration is enough. We only need pointers
class QPalette;
class KActionMenu;
+class KLed;
class dms;
class KStarsData;
@@ -102,6 +103,8 @@
*/
InfoBoxes* infoBoxes();
+ inline KLed* diskLED() { return m_DiskLED; }
+
/**@return pointer to the INDI driver
*/
INDIDriver* getINDIDriver() { return indidriver; }
@@ -705,6 +708,7 @@
QPalette OriginalPalette, DarkPalette;
+ KLed *m_DiskLED;
};
#endif
--- branches/kstars/unfrozen/kstars/kstars/kstarsinit.cpp #824174:824175
@@ -25,6 +25,7 @@
#include <kmenu.h>
#include <kstatusbar.h>
#include <ktip.h>
+#include <kled.h>
#include <kmessagebox.h>
#include <kstandardaction.h>
#include <kstandarddirs.h>
@@ -548,7 +549,7 @@
void KStars::initStatusBar() {
statusBar()->insertPermanentItem( i18n( " Welcome to KStars " ), 0, 1 );
statusBar()->setItemAlignment( 0, Qt::AlignLeft | Qt::AlignVCenter );
-
+
QString s = "000d 00m 00s, +00d 00\' 00\""; //only need this to set the width
if ( Options::showAltAzField() ) {
statusBar()->insertPermanentFixedItem( s, 1 );
@@ -562,6 +563,10 @@
statusBar()->changeItem( QString(), 2 );
}
+ m_DiskLED = new KLed( Qt::red, statusBar() );
+ m_DiskLED->off();
+ statusBar()->addPermanentWidget( m_DiskLED );
+
if ( ! Options::showStatusBar() ) statusBar()->hide();
}
More information about the Kstars-devel
mailing list