-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 | |||
@@ -242,16 +242,19 @@ void CategoryTabWidget::initializeCategories(AppLnkSet* rootFolder, | |||
242 | docview->setFileSystems(fs); | 242 | docview->setFileSystems(fs); |
243 | docview->setToolsEnabled(TRUE); | 243 | docview->setToolsEnabled(TRUE); |
244 | setTabAppearance( "Documents", cfg ); // No tr | 244 | setTabAppearance( "Documents", cfg ); // No tr |
245 | 245 | ||
246 | connect( categoryBar, SIGNAL(selected(int)), stack, SLOT(raiseWidget(int)) ); | 246 | connect( categoryBar, SIGNAL(selected(int)), stack, SLOT(raiseWidget(int)) ); |
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 | } |
253 | 256 | ||
254 | void CategoryTabWidget::setTabAppearance( const QString &id, Config &cfg ) | 257 | void CategoryTabWidget::setTabAppearance( const QString &id, Config &cfg ) |
255 | { | 258 | { |
256 | QString grp( "Tab %1" ); // No tr | 259 | QString grp( "Tab %1" ); // No tr |
257 | cfg.setGroup( grp.arg(id) ); | 260 | cfg.setGroup( grp.arg(id) ); |
@@ -366,16 +369,22 @@ void CategoryTabWidget::setBusy(bool on) | |||
366 | } | 369 | } |
367 | 370 | ||
368 | LauncherView *CategoryTabWidget::view( const QString &id ) | 371 | LauncherView *CategoryTabWidget::view( const QString &id ) |
369 | { | 372 | { |
370 | int idx = ids.findIndex( id ); | 373 | int idx = ids.findIndex( id ); |
371 | return (LauncherView *)stack->widget(idx); | 374 | return (LauncherView *)stack->widget(idx); |
372 | } | 375 | } |
373 | 376 | ||
377 | void 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 | ||
376 | CategoryTabBar::CategoryTabBar( QWidget *parent, const char *name ) | 385 | CategoryTabBar::CategoryTabBar( QWidget *parent, const char *name ) |
377 | : QTabBar( parent, name ) | 386 | : QTabBar( parent, name ) |
378 | { | 387 | { |
379 | setFocusPolicy( NoFocus ); | 388 | setFocusPolicy( NoFocus ); |
380 | connect( this, SIGNAL( selected(int) ), this, SLOT( layoutTabs() ) ); | 389 | connect( this, SIGNAL( selected(int) ), this, SLOT( layoutTabs() ) ); |
381 | } | 390 | } |
@@ -1162,16 +1171,21 @@ void Launcher::launcherMessage( const QCString &msg, const QByteArray &data) | |||
1162 | int weight; | 1171 | int weight; |
1163 | stream >> weight; | 1172 | stream >> weight; |
1164 | int italic; | 1173 | int italic; |
1165 | stream >> italic; | 1174 | stream >> italic; |
1166 | if ( tabs->view(id) ) | 1175 | if ( tabs->view(id) ) |
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 | ||
1172 | void Launcher::storageChanged() | 1186 | void Launcher::storageChanged() |
1173 | { | 1187 | { |
1174 | if ( in_lnk_props ) { | 1188 | if ( in_lnk_props ) { |
1175 | got_lnk_change = TRUE; | 1189 | got_lnk_change = TRUE; |
1176 | lnk_change = QString::null; | 1190 | lnk_change = QString::null; |
1177 | } else { | 1191 | } else { |
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 | |||
@@ -58,17 +58,17 @@ public: | |||
58 | CategoryTabWidget( QWidget* parent ); | 58 | CategoryTabWidget( QWidget* parent ); |
59 | void initializeCategories(AppLnkSet* rootFolder, AppLnkSet* docFolder, | 59 | void initializeCategories(AppLnkSet* rootFolder, AppLnkSet* docFolder, |
60 | const QList<FileSystem> &); | 60 | const QList<FileSystem> &); |
61 | void updateDocs(AppLnkSet* docFolder, const QList<FileSystem> &fs); | 61 | void updateDocs(AppLnkSet* docFolder, const QList<FileSystem> &fs); |
62 | void updateLink(const QString& linkfile); | 62 | void updateLink(const QString& linkfile); |
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 ); | |
67 | signals: | 67 | signals: |
68 | void selected(const QString&); | 68 | void selected(const QString&); |
69 | void clicked(const AppLnk*); | 69 | void clicked(const AppLnk*); |
70 | void rightPressed(AppLnk*); | 70 | void rightPressed(AppLnk*); |
71 | 71 | ||
72 | public slots: | 72 | public slots: |
73 | void nextTab(); | 73 | void nextTab(); |
74 | void prevTab(); | 74 | void prevTab(); |
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 | |||
@@ -47,16 +47,21 @@ | |||
47 | class BgPixmap | 47 | class BgPixmap |
48 | { | 48 | { |
49 | public: | 49 | public: |
50 | BgPixmap( const QPixmap &p ) : pm(p), ref(1) {} | 50 | BgPixmap( const QPixmap &p ) : pm(p), ref(1) {} |
51 | QPixmap pm; | 51 | QPixmap pm; |
52 | int ref; | 52 | int ref; |
53 | }; | 53 | }; |
54 | 54 | ||
55 | enum BusyIndicatorType { | ||
56 | BIT_Normal = 0, | ||
57 | BIT_Blinking | ||
58 | }; | ||
59 | |||
55 | static QMap<QString,BgPixmap*> *bgCache = 0; | 60 | static QMap<QString,BgPixmap*> *bgCache = 0; |
56 | 61 | ||
57 | class LauncherIconView : public QIconView { | 62 | class LauncherIconView : public QIconView { |
58 | public: | 63 | public: |
59 | LauncherIconView( QWidget* parent, const char* name=0 ) : | 64 | LauncherIconView( QWidget* parent, const char* name=0 ) : |
60 | QIconView(parent,name), | 65 | QIconView(parent,name), |
61 | tf(""), | 66 | tf(""), |
62 | cf(0), | 67 | cf(0), |
@@ -77,32 +82,33 @@ public: | |||
77 | QListIterator<AppLnk> it(hidden); | 82 | QListIterator<AppLnk> it(hidden); |
78 | AppLnk* l; | 83 | AppLnk* l; |
79 | while ((l=it.current())) { | 84 | while ((l=it.current())) { |
80 | ++it; | 85 | ++it; |
81 | //qDebug("%p: hidden (should remove)",l); | 86 | //qDebug("%p: hidden (should remove)",l); |
82 | } | 87 | } |
83 | #endif | 88 | #endif |
84 | } | 89 | } |
90 | |||
91 | void setBusyIndicatorType ( BusyIndicatorType t ) { busyType = t; } | ||
85 | 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; } |
89 | 96 | ||
90 | void updateCategoriesAndMimeTypes(); | 97 | void updateCategoriesAndMimeTypes(); |
91 | 98 | ||
92 | void doAutoScroll() | 99 | void doAutoScroll() |
93 | { | 100 | { |
94 | // We don't want rubberbanding (yet) | 101 | // We don't want rubberbanding (yet) |
95 | } | 102 | } |
96 | 103 | ||
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; |
104 | bsy = c; | 110 | bsy = c; |
105 | 111 | ||
106 | if ( oldbsy ) | 112 | if ( oldbsy ) |
107 | oldbsy-> repaint ( ); | 113 | oldbsy-> repaint ( ); |
108 | 114 | ||
@@ -131,21 +137,25 @@ public: | |||
131 | int gi = gc + qGreen ( *rgb ) * ( 100 - bs ) / 100; | 137 | int gi = gc + qGreen ( *rgb ) * ( 100 - bs ) / 100; |
132 | int bi = bc + qBlue ( *rgb ) * ( 100 - bs ) / 100; | 138 | int bi = bc + qBlue ( *rgb ) * ( 100 - bs ) / 100; |
133 | int ai = qAlpha ( *rgb ); | 139 | int ai = qAlpha ( *rgb ); |
134 | *rgb = qRgba ( ri, gi, bi, ai ); | 140 | *rgb = qRgba ( ri, gi, bi, ai ); |
135 | } | 141 | } |
136 | 142 | ||
137 | bpm [i].convertFromImage( img ); | 143 | bpm [i].convertFromImage( img ); |
138 | } | 144 | } |
139 | busystate = 0; | 145 | if ( busyType == BIT_Blinking ) { |
140 | if ( busytimer ) | 146 | busystate = 0; |
141 | killTimer ( busytimer ); | 147 | if ( busytimer ) |
142 | timerEvent ( 0 ); | 148 | killTimer ( busytimer ); |
143 | busytimer = startTimer ( 200 ); | 149 | busytimer = startTimer ( 200 ); |
150 | } | ||
151 | else | ||
152 | busystate = 3; | ||
153 | timerEvent ( 0 ); | ||
144 | } | 154 | } |
145 | else { | 155 | else { |
146 | killTimer ( busytimer ); | 156 | killTimer ( busytimer ); |
147 | busytimer = 0; | 157 | busytimer = 0; |
148 | } | 158 | } |
149 | } | 159 | } |
150 | } | 160 | } |
151 | 161 | ||
@@ -332,16 +342,17 @@ private: | |||
332 | QIconViewItem* bsy; | 342 | QIconViewItem* bsy; |
333 | bool ike; | 343 | bool ike; |
334 | bool bigIcns; | 344 | bool bigIcns; |
335 | QPixmap bgPixmap; | 345 | QPixmap bgPixmap; |
336 | QPixmap bpm [6]; | 346 | QPixmap bpm [6]; |
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 | ||
343 | bool LauncherView::bsy=FALSE; | 354 | bool LauncherView::bsy=FALSE; |
344 | 355 | ||
345 | void LauncherView::setBusy(bool on) | 356 | void LauncherView::setBusy(bool on) |
346 | { | 357 | { |
347 | icons->setBusy(on); | 358 | icons->setBusy(on); |
@@ -908,8 +919,16 @@ void LauncherView::paletteChange( const QPalette &p ) | |||
908 | QVBox::paletteChange( p ); | 919 | QVBox::paletteChange( p ); |
909 | if ( bgType == Ruled ) | 920 | if ( bgType == Ruled ) |
910 | setBackgroundType( Ruled, QString::null ); | 921 | setBackgroundType( Ruled, QString::null ); |
911 | QColorGroup cg = icons->colorGroup(); | 922 | QColorGroup cg = icons->colorGroup(); |
912 | cg.setColor( QColorGroup::Text, textCol ); | 923 | cg.setColor( QColorGroup::Text, textCol ); |
913 | icons->setPalette( QPalette(cg,cg,cg) ); | 924 | icons->setPalette( QPalette(cg,cg,cg) ); |
914 | } | 925 | } |
915 | 926 | ||
927 | |||
928 | void 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 | |||
@@ -60,16 +60,18 @@ public: | |||
60 | void setBackgroundType( BackgroundType t, const QString & ); | 60 | void setBackgroundType( BackgroundType t, const QString & ); |
61 | BackgroundType backgroundType() const { return bgType; } | 61 | BackgroundType backgroundType() const { return bgType; } |
62 | 62 | ||
63 | void setTextColor( const QColor & ); | 63 | void setTextColor( const QColor & ); |
64 | QColor textColor() const { return textCol; } | 64 | QColor textColor() const { return textCol; } |
65 | 65 | ||
66 | void setViewFont( const QFont & ); | 66 | void setViewFont( const QFont & ); |
67 | 67 | ||
68 | void setBusyIndicatorType ( const QString &type ); | ||
69 | |||
68 | public slots: | 70 | public slots: |
69 | void populate( AppLnkSet *folder, const QString& categoryfilter ); | 71 | void populate( AppLnkSet *folder, const QString& categoryfilter ); |
70 | 72 | ||
71 | signals: | 73 | signals: |
72 | void clicked( const AppLnk * ); | 74 | void clicked( const AppLnk * ); |
73 | void rightPressed( AppLnk * ); | 75 | void rightPressed( AppLnk * ); |
74 | 76 | ||
75 | protected slots: | 77 | protected slots: |
@@ -92,11 +94,12 @@ private: | |||
92 | LauncherIconView* icons; | 94 | LauncherIconView* icons; |
93 | QComboBox *typemb; | 95 | QComboBox *typemb; |
94 | QStringList typelist; | 96 | QStringList typelist; |
95 | CategorySelect *catmb; | 97 | CategorySelect *catmb; |
96 | ViewMode vmode; | 98 | ViewMode vmode; |
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 |