-rw-r--r-- | core/launcher/launcher.cpp | 14 | ||||
-rw-r--r-- | core/launcher/launcher.h | 2 | ||||
-rw-r--r-- | core/launcher/launcherview.cpp | 23 | ||||
-rw-r--r-- | core/launcher/launcherview.h | 3 |
4 files changed, 39 insertions, 3 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 @@ -246,8 +246,11 @@ void CategoryTabWidget::initializeCategories(AppLnkSet* rootFolder, connect( categoryBar, SIGNAL(selected(int)), stack, SLOT(raiseWidget(int)) ); ((LauncherView*)stack->widget(0))->setFocus(); + cfg. setGroup ( "GUI" ); + setBusyIndicatorType ( cfg. readEntry ( "BusyType", QString::null )); + categoryBar->show(); stack->show(); } @@ -370,8 +373,14 @@ LauncherView *CategoryTabWidget::view( const QString &id ) int idx = ids.findIndex( id ); return (LauncherView *)stack->widget(idx); } +void CategoryTabWidget::setBusyIndicatorType ( const QString &type ) +{ + for ( QStringList::Iterator it = ids. begin ( ); it != ids. end ( ); ++it ) + view ( *it )-> setBusyIndicatorType ( type ); +} + //=========================================================================== CategoryTabBar::CategoryTabBar( QWidget *parent, const char *name ) : QTabBar( parent, name ) @@ -1166,8 +1175,13 @@ void Launcher::launcherMessage( const QCString &msg, const QByteArray &data) if ( tabs->view(id) ) tabs->view(id)->setViewFont( QFont(fam, size, weight, italic!=0) ); qDebug( "setFont: %s, %d, %d, %d", fam.latin1(), size, weight, italic ); } + else if ( msg == "setBusyIndicatorType(QString)" ) { + QString type; + stream >> type; + tabs->setBusyIndicatorType(type); + } } void Launcher::storageChanged() { 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 @@ -62,9 +62,9 @@ public: void updateLink(const QString& linkfile); void setBusy(bool on); QString getAllDocLinkInfo() const; LauncherView *view( const QString &id ); - + void setBusyIndicatorType ( const QString &type ); signals: void selected(const QString&); void clicked(const AppLnk*); void rightPressed(AppLnk*); 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 @@ -51,8 +51,13 @@ public: QPixmap pm; int ref; }; +enum BusyIndicatorType { + BIT_Normal = 0, + BIT_Blinking +}; + static QMap<QString,BgPixmap*> *bgCache = 0; class LauncherIconView : public QIconView { public: @@ -82,8 +87,10 @@ public: } #endif } + void setBusyIndicatorType ( BusyIndicatorType t ) { busyType = t; } + QPixmap* busyPixmap() const { return (QPixmap*)&bpm[::abs(busystate)]; } QIconViewItem* busyItem() const { return bsy; } void setBigIcons( bool bi ) { bigIcns = bi; } @@ -96,9 +103,8 @@ public: void setBusy(bool on) { QIconViewItem *c = on ? currentItem() : 0; - qDebug ( "set busy %d -> %s", on, c ? c-> text ().latin1() : "(null)" ); if ( bsy != c ) { QIconViewItem *oldbsy = bsy; bsy = c; @@ -135,14 +141,18 @@ public: } bpm [i].convertFromImage( img ); } + if ( busyType == BIT_Blinking ) { busystate = 0; if ( busytimer ) killTimer ( busytimer ); - timerEvent ( 0 ); busytimer = startTimer ( 200 ); } + else + busystate = 3; + timerEvent ( 0 ); + } else { killTimer ( busytimer ); busytimer = 0; } @@ -336,8 +346,9 @@ private: QPixmap bpm [6]; QColor bgColor; int busytimer; int busystate; + BusyIndicatorType busyType; }; bool LauncherView::bsy=FALSE; @@ -912,4 +923,12 @@ void LauncherView::paletteChange( const QPalette &p ) cg.setColor( QColorGroup::Text, textCol ); icons->setPalette( QPalette(cg,cg,cg) ); } + +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 @@ -64,8 +64,10 @@ public: QColor textColor() const { return textCol; } void setViewFont( const QFont & ); + void setBusyIndicatorType ( const QString &type ); + public slots: void populate( AppLnkSet *folder, const QString& categoryfilter ); signals: @@ -96,7 +98,8 @@ private: ViewMode vmode; BackgroundType bgType; QString bgName; QColor textCol; + int busyType; }; #endif // LAUNCHERVIEW_H |