summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/launcher.cpp14
-rw-r--r--core/launcher/launcher.h2
-rw-r--r--core/launcher/launcherview.cpp23
-rw-r--r--core/launcher/launcherview.h3
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
@@ -247,6 +247,9 @@ void CategoryTabWidget::initializeCategories(AppLnkSet* rootFolder,
247 247
248 ((LauncherView*)stack->widget(0))->setFocus(); 248 ((LauncherView*)stack->widget(0))->setFocus();
249 249
250 cfg. setGroup ( "GUI" );
251 setBusyIndicatorType ( cfg. readEntry ( "BusyType", QString::null ));
252
250 categoryBar->show(); 253 categoryBar->show();
251 stack->show(); 254 stack->show();
252} 255}
@@ -371,6 +374,12 @@ LauncherView *CategoryTabWidget::view( const QString &id )
371 return (LauncherView *)stack->widget(idx); 374 return (LauncherView *)stack->widget(idx);
372} 375}
373 376
377void CategoryTabWidget::setBusyIndicatorType ( const QString &type )
378{
379 for ( QStringList::Iterator it = ids. begin ( ); it != ids. end ( ); ++it )
380 view ( *it )-> setBusyIndicatorType ( type );
381}
382
374//=========================================================================== 383//===========================================================================
375 384
376CategoryTabBar::CategoryTabBar( QWidget *parent, const char *name ) 385CategoryTabBar::CategoryTabBar( QWidget *parent, const char *name )
@@ -1167,6 +1176,11 @@ void Launcher::launcherMessage( const QCString &msg, const QByteArray &data)
1167 tabs->view(id)->setViewFont( QFont(fam, size, weight, italic!=0) ); 1176 tabs->view(id)->setViewFont( QFont(fam, size, weight, italic!=0) );
1168 qDebug( "setFont: %s, %d, %d, %d", fam.latin1(), size, weight, italic ); 1177 qDebug( "setFont: %s, %d, %d, %d", fam.latin1(), size, weight, italic );
1169 } 1178 }
1179 else if ( msg == "setBusyIndicatorType(QString)" ) {
1180 QString type;
1181 stream >> type;
1182 tabs->setBusyIndicatorType(type);
1183 }
1170} 1184}
1171 1185
1172void Launcher::storageChanged() 1186void 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
@@ -63,7 +63,7 @@ public:
63 void setBusy(bool on); 63 void setBusy(bool on);
64 QString getAllDocLinkInfo() const; 64 QString getAllDocLinkInfo() const;
65 LauncherView *view( const QString &id ); 65 LauncherView *view( const QString &id );
66 66 void setBusyIndicatorType ( const QString &type );
67signals: 67signals:
68 void selected(const QString&); 68 void selected(const QString&);
69 void clicked(const AppLnk*); 69 void clicked(const 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
@@ -52,6 +52,11 @@ public:
52 int ref; 52 int ref;
53}; 53};
54 54
55enum BusyIndicatorType {
56 BIT_Normal = 0,
57 BIT_Blinking
58};
59
55static QMap<QString,BgPixmap*> *bgCache = 0; 60static QMap<QString,BgPixmap*> *bgCache = 0;
56 61
57class LauncherIconView : public QIconView { 62class LauncherIconView : public QIconView {
@@ -83,6 +88,8 @@ public:
83#endif 88#endif
84 } 89 }
85 90
91 void setBusyIndicatorType ( BusyIndicatorType t ) { busyType = t; }
92
86 QPixmap* busyPixmap() const { return (QPixmap*)&bpm[::abs(busystate)]; } 93 QPixmap* busyPixmap() const { return (QPixmap*)&bpm[::abs(busystate)]; }
87 QIconViewItem* busyItem() const { return bsy; } 94 QIconViewItem* busyItem() const { return bsy; }
88 void setBigIcons( bool bi ) { bigIcns = bi; } 95 void setBigIcons( bool bi ) { bigIcns = bi; }
@@ -97,7 +104,6 @@ public:
97 void setBusy(bool on) 104 void setBusy(bool on)
98 { 105 {
99 QIconViewItem *c = on ? currentItem() : 0; 106 QIconViewItem *c = on ? currentItem() : 0;
100 qDebug ( "set busy %d -> %s", on, c ? c-> text ().latin1() : "(null)" );
101 107
102 if ( bsy != c ) { 108 if ( bsy != c ) {
103 QIconViewItem *oldbsy = bsy; 109 QIconViewItem *oldbsy = bsy;
@@ -136,12 +142,16 @@ public:
136 142
137 bpm [i].convertFromImage( img ); 143 bpm [i].convertFromImage( img );
138 } 144 }
145 if ( busyType == BIT_Blinking ) {
139 busystate = 0; 146 busystate = 0;
140 if ( busytimer ) 147 if ( busytimer )
141 killTimer ( busytimer ); 148 killTimer ( busytimer );
142 timerEvent ( 0 );
143 busytimer = startTimer ( 200 ); 149 busytimer = startTimer ( 200 );
144 } 150 }
151 else
152 busystate = 3;
153 timerEvent ( 0 );
154 }
145 else { 155 else {
146 killTimer ( busytimer ); 156 killTimer ( busytimer );
147 busytimer = 0; 157 busytimer = 0;
@@ -337,6 +347,7 @@ private:
337 QColor bgColor; 347 QColor bgColor;
338 int busytimer; 348 int busytimer;
339 int busystate; 349 int busystate;
350 BusyIndicatorType busyType;
340}; 351};
341 352
342 353
@@ -913,3 +924,11 @@ void LauncherView::paletteChange( const QPalette &p )
913 icons->setPalette( QPalette(cg,cg,cg) ); 924 icons->setPalette( QPalette(cg,cg,cg) );
914} 925}
915 926
927
928void LauncherView::setBusyIndicatorType ( const QString &type )
929{
930 if ( type. lower ( ) == "blink" )
931 icons-> setBusyIndicatorType ( BIT_Blinking );
932 else
933 icons-> setBusyIndicatorType ( BIT_Normal );
934}
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
@@ -65,6 +65,8 @@ public:
65 65
66 void setViewFont( const QFont & ); 66 void setViewFont( const QFont & );
67 67
68 void setBusyIndicatorType ( const QString &type );
69
68public slots: 70public slots:
69 void populate( AppLnkSet *folder, const QString& categoryfilter ); 71 void populate( AppLnkSet *folder, const QString& categoryfilter );
70 72
@@ -97,6 +99,7 @@ private:
97 BackgroundType bgType; 99 BackgroundType bgType;
98 QString bgName; 100 QString bgName;
99 QColor textCol; 101 QColor textCol;
102 int busyType;
100}; 103};
101 104
102#endif // LAUNCHERVIEW_H 105#endif // LAUNCHERVIEW_H