author | sandman <sandman> | 2002-10-01 22:44:28 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-10-01 22:44:28 (UTC) |
commit | 8f904d99e7b6e04b6043226a63f6c417171a7cad (patch) (side-by-side diff) | |
tree | 07d5f2b7e1338cf1035fe92436328a9c74208b03 /core/launcher | |
parent | 895280b5ff189fff2e77d6f5f27668e7dad0d88d (diff) | |
download | opie-8f904d99e7b6e04b6043226a63f6c417171a7cad.zip opie-8f904d99e7b6e04b6043226a63f6c417171a7cad.tar.gz opie-8f904d99e7b6e04b6043226a63f6c417171a7cad.tar.bz2 |
busyindicator type can now be changed at run-time
-rw-r--r-- | core/launcher/launcher.cpp | 14 | ||||
-rw-r--r-- | core/launcher/launcher.h | 2 | ||||
-rw-r--r-- | core/launcher/launcherview.cpp | 31 | ||||
-rw-r--r-- | core/launcher/launcherview.h | 3 |
4 files changed, 43 insertions, 7 deletions
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp index 6948976..66cc3e6 100644 --- a/core/launcher/launcher.cpp +++ b/core/launcher/launcher.cpp @@ -249,2 +249,5 @@ void CategoryTabWidget::initializeCategories(AppLnkSet* rootFolder, + cfg. setGroup ( "GUI" ); + setBusyIndicatorType ( cfg. readEntry ( "BusyType", QString::null )); + categoryBar->show(); @@ -373,2 +376,8 @@ LauncherView *CategoryTabWidget::view( const QString &id ) +void CategoryTabWidget::setBusyIndicatorType ( const QString &type ) +{ + for ( QStringList::Iterator it = ids. begin ( ); it != ids. end ( ); ++it ) + view ( *it )-> setBusyIndicatorType ( type ); +} + //=========================================================================== @@ -1169,2 +1178,7 @@ void Launcher::launcherMessage( const QCString &msg, const QByteArray &data) } + else if ( msg == "setBusyIndicatorType(QString)" ) { + QString type; + stream >> type; + tabs->setBusyIndicatorType(type); + } } diff --git a/core/launcher/launcher.h b/core/launcher/launcher.h index e3881ea..89bf6f3 100644 --- a/core/launcher/launcher.h +++ b/core/launcher/launcher.h @@ -65,3 +65,3 @@ public: LauncherView *view( const QString &id ); - + void setBusyIndicatorType ( const QString &type ); signals: diff --git a/core/launcher/launcherview.cpp b/core/launcher/launcherview.cpp index e15b150..fa46543 100644 --- a/core/launcher/launcherview.cpp +++ b/core/launcher/launcherview.cpp @@ -54,2 +54,7 @@ public: +enum BusyIndicatorType { + BIT_Normal = 0, + BIT_Blinking +}; + static QMap<QString,BgPixmap*> *bgCache = 0; @@ -84,2 +89,4 @@ public: } + + void setBusyIndicatorType ( BusyIndicatorType t ) { busyType = t; } @@ -99,3 +106,2 @@ public: QIconViewItem *c = on ? currentItem() : 0; - qDebug ( "set busy %d -> %s", on, c ? c-> text ().latin1() : "(null)" ); @@ -138,7 +144,11 @@ public: } - busystate = 0; - if ( busytimer ) - killTimer ( busytimer ); - timerEvent ( 0 ); - busytimer = startTimer ( 200 ); + if ( busyType == BIT_Blinking ) { + busystate = 0; + if ( busytimer ) + killTimer ( busytimer ); + busytimer = startTimer ( 200 ); + } + else + busystate = 3; + timerEvent ( 0 ); } @@ -339,2 +349,3 @@ private: int busystate; + BusyIndicatorType busyType; }; @@ -915 +926,9 @@ void LauncherView::paletteChange( const QPalette &p ) + +void LauncherView::setBusyIndicatorType ( const QString &type ) +{ + if ( type. lower ( ) == "blink" ) + icons-> setBusyIndicatorType ( BIT_Blinking ); + else + icons-> setBusyIndicatorType ( BIT_Normal ); +} diff --git a/core/launcher/launcherview.h b/core/launcher/launcherview.h index 2fb37b6..194e4a2 100644 --- a/core/launcher/launcherview.h +++ b/core/launcher/launcherview.h @@ -67,2 +67,4 @@ public: + void setBusyIndicatorType ( const QString &type ); + public slots: @@ -99,2 +101,3 @@ private: QColor textCol; + int busyType; }; |