-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | core/launcher/launcher.cpp | 1 | ||||
-rw-r--r-- | core/launcher/launcherview.cpp | 38 | ||||
-rw-r--r-- | core/launcher/launcherview.h | 5 |
4 files changed, 32 insertions, 13 deletions
@@ -1,52 +1,53 @@ | |||
1 | 2005-??-??Opie 1.2.0 | 1 | 2005-??-??Opie 1.2.0 |
2 | 2 | ||
3 | New Features | 3 | New Features |
4 | ------------ | 4 | ------------ |
5 | * Number of icon columns in Launcher is customizable through Launcher.conf (hrw,zecke,mickeyl) | ||
5 | 6 | ||
6 | Fixed Bugs | 7 | Fixed Bugs |
7 | ---------- | 8 | ---------- |
8 | * #1501 - Fixed bug in todo sql backend (eilers) | 9 | * #1501 - Fixed bug in todo sql backend (eilers) |
9 | * n.a - Removed hard coded font sizes in a couple of inputmethods (mickeyl) | 10 | * n.a - Removed hard coded font sizes in a couple of inputmethods (mickeyl) |
10 | 11 | ||
11 | Internal | 12 | Internal |
12 | -------- | 13 | -------- |
13 | * Added the Qtopia 1.7 SDK macros for quick-apps to easa compilation of 3rd party apps against our headers (mickeyl) | 14 | * Added the Qtopia 1.7 SDK macros for quick-apps to easa compilation of 3rd party apps against our headers (mickeyl) |
14 | 15 | ||
15 | 2004-11-26Opie 1.1.8 | 16 | 2004-11-26Opie 1.1.8 |
16 | 17 | ||
17 | New Features | 18 | New Features |
18 | ------------ | 19 | ------------ |
19 | * PackageManager supports installation of local ipkg files (drw) | 20 | * PackageManager supports installation of local ipkg files (drw) |
20 | * PackageManager supports linking of applications to root (drw) | 21 | * PackageManager supports linking of applications to root (drw) |
21 | * PackageManager supports src/gz feeds (drw,wimpie) | 22 | * PackageManager supports src/gz feeds (drw,wimpie) |
22 | * Added a syslog information tab to sysinfo (mickeyl) | 23 | * Added a syslog information tab to sysinfo (mickeyl) |
23 | * Added new, more consistent, PIM icons + a GIMP teplate (ar) | 24 | * Added new, more consistent, PIM icons + a GIMP teplate (ar) |
24 | 25 | ||
25 | Fixed Bugs | 26 | Fixed Bugs |
26 | ---------- | 27 | ---------- |
27 | * #1017 - Tetrix doesn't display correctly for high resolution screens (drw) | 28 | * #1017 - Tetrix doesn't display correctly for high resolution screens (drw) |
28 | * #1269 - VCards were imported into personal area if it was activated (eilers) | 29 | * #1269 - VCards were imported into personal area if it was activated (eilers) |
29 | * #1464 - Packagemanager dont set active filter after install a package (drw) | 30 | * #1464 - Packagemanager dont set active filter after install a package (drw) |
30 | * #1479 - Improved VCard-Parser to import VCards created by Evolution 2 and Apple Addressbook (eilers) | 31 | * #1479 - Improved VCard-Parser to import VCards created by Evolution 2 and Apple Addressbook (eilers) |
31 | * #1493 - Fixed one column layout bug of the launcher (hrw) | 32 | * #1493 - Fixed one column layout bug of the launcher (hrw) |
32 | * n.a. - PackageManager - (Minor UI tweak) in filter dialog, when option is enabled, set focus to widget that corresponds to that option (drw) | 33 | * n.a. - PackageManager - (Minor UI tweak) in filter dialog, when option is enabled, set focus to widget that corresponds to that option (drw) |
33 | * n.a. - PackageManager - (Minor UI tweak) fix double entry in source feed configuration when adding a new feed (drw) | 34 | * n.a. - PackageManager - (Minor UI tweak) fix double entry in source feed configuration when adding a new feed (drw) |
34 | * n.a. - Battery Applet - fix sizing of battery info popup (drw,mickeyl) | 35 | * n.a. - Battery Applet - fix sizing of battery info popup (drw,mickeyl) |
35 | 36 | ||
36 | Internal | 37 | Internal |
37 | -------- | 38 | -------- |
38 | * Moved libopie1 to unsupported (mickeyl) | 39 | * Moved libopie1 to unsupported (mickeyl) |
39 | * Implemented generic queryByExample() with incremental searching. A lot of internal changes of the Pim2-library (eilers) | 40 | * Implemented generic queryByExample() with incremental searching. A lot of internal changes of the Pim2-library (eilers) |
40 | * Added fast and full featured and incremental sorted() for SQL addressbook backend (eilers) | 41 | * Added fast and full featured and incremental sorted() for SQL addressbook backend (eilers) |
41 | 42 | ||
42 | 2004-11-14Opie 1.1.7 | 43 | 2004-11-14Opie 1.1.7 |
43 | 44 | ||
44 | New Features | 45 | New Features |
45 | ------------ | 46 | ------------ |
46 | * libOpieDB now uses SQLite V3 instead V2. Remember to upgrade your database files! (eilers) | 47 | * libOpieDB now uses SQLite V3 instead V2. Remember to upgrade your database files! (eilers) |
47 | * Backup now uses the busy indicator when backing up and restore (ar) | 48 | * Backup now uses the busy indicator when backing up and restore (ar) |
48 | * OpiePlayer2 gained adding of Directories to the playlist (zecke) | 49 | * OpiePlayer2 gained adding of Directories to the playlist (zecke) |
49 | * OpiePlayer2 better error handling (zecke) | 50 | * OpiePlayer2 better error handling (zecke) |
50 | * OpiePlayer2 progress indication while streaming (zecke) | 51 | * OpiePlayer2 progress indication while streaming (zecke) |
51 | * OpiePlayer2 ported to use libxine 1.0.0-rc6a (brad,zecke) | 52 | * OpiePlayer2 ported to use libxine 1.0.0-rc6a (brad,zecke) |
52 | * Ported brightnessapplet from Qtopia 1.7 (mickeyl) | 53 | * Ported brightnessapplet from Qtopia 1.7 (mickeyl) |
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp index 970b8cb..4f81076 100644 --- a/core/launcher/launcher.cpp +++ b/core/launcher/launcher.cpp | |||
@@ -244,96 +244,97 @@ LauncherView *LauncherTabWidget::view( const QString &id ) | |||
244 | LauncherTab *t = categoryBar->launcherTab(id); | 244 | LauncherTab *t = categoryBar->launcherTab(id); |
245 | if ( !t ) | 245 | if ( !t ) |
246 | return 0; | 246 | return 0; |
247 | return t->view; | 247 | return t->view; |
248 | } | 248 | } |
249 | 249 | ||
250 | LauncherView *LauncherTabWidget::docView() | 250 | LauncherView *LauncherTabWidget::docView() |
251 | { | 251 | { |
252 | return docview; | 252 | return docview; |
253 | } | 253 | } |
254 | 254 | ||
255 | void LauncherTabWidget::setLoadingWidgetEnabled( bool v ) | 255 | void LauncherTabWidget::setLoadingWidgetEnabled( bool v ) |
256 | { | 256 | { |
257 | if ( v != docLoadingWidgetEnabled && docLoadingWidget ) { | 257 | if ( v != docLoadingWidgetEnabled && docLoadingWidget ) { |
258 | docLoadingWidgetEnabled = v; | 258 | docLoadingWidgetEnabled = v; |
259 | raiseTabWidget(); | 259 | raiseTabWidget(); |
260 | } | 260 | } |
261 | } | 261 | } |
262 | 262 | ||
263 | void LauncherTabWidget::setLoadingProgress( int percent ) | 263 | void LauncherTabWidget::setLoadingProgress( int percent ) |
264 | { | 264 | { |
265 | docLoadingWidgetProgress->setProgress( (percent / 4) * 4 ); | 265 | docLoadingWidgetProgress->setProgress( (percent / 4) * 4 ); |
266 | } | 266 | } |
267 | 267 | ||
268 | // ### this function could more to LauncherView | 268 | // ### this function could more to LauncherView |
269 | void LauncherTabWidget::setTabViewAppearance( LauncherView *v, Config &cfg ) | 269 | void LauncherTabWidget::setTabViewAppearance( LauncherView *v, Config &cfg ) |
270 | { | 270 | { |
271 | // View | 271 | // View |
272 | QString view = cfg.readEntry( "View", "Icon" ); | 272 | QString view = cfg.readEntry( "View", "Icon" ); |
273 | if ( view == "List" ) // No tr | 273 | if ( view == "List" ) // No tr |
274 | v->setViewMode( LauncherView::List ); | 274 | v->setViewMode( LauncherView::List ); |
275 | QString bgType = cfg.readEntry( "BackgroundType", "Image" ); | 275 | QString bgType = cfg.readEntry( "BackgroundType", "Image" ); |
276 | if ( bgType == "Image" ) { // No tr | 276 | if ( bgType == "Image" ) { // No tr |
277 | QString pm = cfg.readEntry( "BackgroundImage", "launcher/opie-background" ); | 277 | QString pm = cfg.readEntry( "BackgroundImage", "launcher/opie-background" ); |
278 | v->setBackgroundType( LauncherView::Image, pm ); | 278 | v->setBackgroundType( LauncherView::Image, pm ); |
279 | } else if ( bgType == "SolidColor" ) { | 279 | } else if ( bgType == "SolidColor" ) { |
280 | QString c = cfg.readEntry( "BackgroundColor" ); | 280 | QString c = cfg.readEntry( "BackgroundColor" ); |
281 | v->setBackgroundType( LauncherView::SolidColor, c ); | 281 | v->setBackgroundType( LauncherView::SolidColor, c ); |
282 | } else { | 282 | } else { |
283 | v->setBackgroundType( LauncherView::Ruled, QString::null ); | 283 | v->setBackgroundType( LauncherView::Ruled, QString::null ); |
284 | } | 284 | } |
285 | QString textCol = cfg.readEntry( "TextColor" ); | 285 | QString textCol = cfg.readEntry( "TextColor" ); |
286 | if ( textCol.isEmpty() ) | 286 | if ( textCol.isEmpty() ) |
287 | v->setTextColor( QColor() ); | 287 | v->setTextColor( QColor() ); |
288 | else | 288 | else |
289 | v->setTextColor( QColor(textCol) ); | 289 | v->setTextColor( QColor(textCol) ); |
290 | // bool customFont = cfg.readBoolEntry( "CustomFont", FALSE ); | 290 | // bool customFont = cfg.readBoolEntry( "CustomFont", FALSE ); |
291 | 291 | ||
292 | v->setColNumber( cfg.readNumEntry( "Columns", 0 ) ); | ||
292 | 293 | ||
293 | QStringList font = cfg.readListEntry( "Font", ',' ); | 294 | QStringList font = cfg.readListEntry( "Font", ',' ); |
294 | if ( font.count() == 4 ) | 295 | if ( font.count() == 4 ) |
295 | v->setViewFont( QFont(font[0], font[1].toInt(), font[2].toInt(), font[3].toInt()!=0) ); | 296 | v->setViewFont( QFont(font[0], font[1].toInt(), font[2].toInt(), font[3].toInt()!=0) ); |
296 | 297 | ||
297 | // ### FIXME TabColor TabTextColor | 298 | // ### FIXME TabColor TabTextColor |
298 | 299 | ||
299 | } | 300 | } |
300 | 301 | ||
301 | // ### Could move to LauncherTab | 302 | // ### Could move to LauncherTab |
302 | void LauncherTabWidget::setTabAppearance( LauncherTab *tab, Config &cfg ) | 303 | void LauncherTabWidget::setTabAppearance( LauncherTab *tab, Config &cfg ) |
303 | { | 304 | { |
304 | cfg.setGroup( QString( "Tab %1" ).arg(tab->type) ); // No tr | 305 | cfg.setGroup( QString( "Tab %1" ).arg(tab->type) ); // No tr |
305 | 306 | ||
306 | setTabViewAppearance( tab->view, cfg ); | 307 | setTabViewAppearance( tab->view, cfg ); |
307 | 308 | ||
308 | // Tabs | 309 | // Tabs |
309 | QString tabCol = cfg.readEntry( "TabColor" ); | 310 | QString tabCol = cfg.readEntry( "TabColor" ); |
310 | if ( tabCol.isEmpty() ) | 311 | if ( tabCol.isEmpty() ) |
311 | tab->bgColor = QColor(); | 312 | tab->bgColor = QColor(); |
312 | else | 313 | else |
313 | tab->bgColor = QColor(tabCol); | 314 | tab->bgColor = QColor(tabCol); |
314 | QString tabTextCol = cfg.readEntry( "TabTextColor" ); | 315 | QString tabTextCol = cfg.readEntry( "TabTextColor" ); |
315 | if ( tabTextCol.isEmpty() ) | 316 | if ( tabTextCol.isEmpty() ) |
316 | tab->fgColor = QColor(); | 317 | tab->fgColor = QColor(); |
317 | else | 318 | else |
318 | tab->fgColor = QColor(tabTextCol); | 319 | tab->fgColor = QColor(tabTextCol); |
319 | } | 320 | } |
320 | 321 | ||
321 | void LauncherTabWidget::paletteChange( const QPalette &p ) | 322 | void LauncherTabWidget::paletteChange( const QPalette &p ) |
322 | { | 323 | { |
323 | QVBox::paletteChange( p ); | 324 | QVBox::paletteChange( p ); |
324 | QPalette pal = palette(); | 325 | QPalette pal = palette(); |
325 | pal.setColor( QColorGroup::Light, pal.color(QPalette::Active,QColorGroup::Shadow) ); | 326 | pal.setColor( QColorGroup::Light, pal.color(QPalette::Active,QColorGroup::Shadow) ); |
326 | pal.setColor( QColorGroup::Background, pal.active().background().light(110) ); | 327 | pal.setColor( QColorGroup::Background, pal.active().background().light(110) ); |
327 | categoryBar->setPalette( pal ); | 328 | categoryBar->setPalette( pal ); |
328 | categoryBar->update(); | 329 | categoryBar->update(); |
329 | } | 330 | } |
330 | 331 | ||
331 | void LauncherTabWidget::styleChange( QStyle & ) | 332 | void LauncherTabWidget::styleChange( QStyle & ) |
332 | { | 333 | { |
333 | QTimer::singleShot( 0, this, SLOT(setProgressStyle()) ); | 334 | QTimer::singleShot( 0, this, SLOT(setProgressStyle()) ); |
334 | } | 335 | } |
335 | 336 | ||
336 | void LauncherTabWidget::setProgressStyle() | 337 | void LauncherTabWidget::setProgressStyle() |
337 | { | 338 | { |
338 | if (docLoadingWidgetProgress) { | 339 | if (docLoadingWidgetProgress) { |
339 | docLoadingWidgetProgress->setFrameShape( QProgressBar::Box ); | 340 | docLoadingWidgetProgress->setFrameShape( QProgressBar::Box ); |
diff --git a/core/launcher/launcherview.cpp b/core/launcher/launcherview.cpp index dc4c57f..9d78c0d 100644 --- a/core/launcher/launcherview.cpp +++ b/core/launcher/launcherview.cpp | |||
@@ -1,72 +1,73 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of the Qtopia Environment. | 4 | ** This file is part of the Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include "launcherview.h" | 21 | #include "launcherview.h" |
22 | 22 | ||
23 | /* OPIE */ | 23 | /* OPIE */ |
24 | #include <opie2/odebug.h> | 24 | #include <opie2/odebug.h> |
25 | #include <qpe/config.h> | ||
25 | #include <qtopia/qpeapplication.h> | 26 | #include <qtopia/qpeapplication.h> |
26 | #include <qtopia/private/categories.h> | 27 | #include <qtopia/private/categories.h> |
27 | #include <qtopia/categoryselect.h> | 28 | #include <qtopia/categoryselect.h> |
28 | #include <qtopia/mimetype.h> | 29 | #include <qtopia/mimetype.h> |
29 | #include <qtopia/resource.h> | 30 | #include <qtopia/resource.h> |
30 | using namespace Opie::Core; | 31 | using namespace Opie::Core; |
31 | 32 | ||
32 | #include <qpe/qcopenvelope_qws.h> | 33 | #include <qpe/qcopenvelope_qws.h> |
33 | 34 | ||
34 | /* QT */ | 35 | /* QT */ |
35 | #include <qtimer.h> | 36 | #include <qtimer.h> |
36 | #include <qfileinfo.h> | 37 | #include <qfileinfo.h> |
37 | #include <qiconview.h> | 38 | #include <qiconview.h> |
38 | #include <qobjectlist.h> | 39 | #include <qobjectlist.h> |
39 | 40 | ||
40 | 41 | ||
41 | // These define how the busy icon is animated and highlighted | 42 | // These define how the busy icon is animated and highlighted |
42 | #define BRIGHTEN_BUSY_ICON | 43 | #define BRIGHTEN_BUSY_ICON |
43 | //#define ALPHA_FADE_BUSY_ICON | 44 | //#define ALPHA_FADE_BUSY_ICON |
44 | //#define USE_ANIMATED_BUSY_ICON_OVERLAY | 45 | //#define USE_ANIMATED_BUSY_ICON_OVERLAY |
45 | #define BOUNCE_BUSY_ICON | 46 | #define BOUNCE_BUSY_ICON |
46 | 47 | ||
47 | typedef QMap<QString,QPixmap>::Iterator pixiter; | 48 | typedef QMap<QString,QPixmap>::Iterator pixiter; |
48 | 49 | ||
49 | class BgPixmap | 50 | class BgPixmap |
50 | { | 51 | { |
51 | public: | 52 | public: |
52 | BgPixmap( const QPixmap &p ) : pm(p), ref(1) {} | 53 | BgPixmap( const QPixmap &p ) : pm(p), ref(1) {} |
53 | QPixmap pm; | 54 | QPixmap pm; |
54 | int ref; | 55 | int ref; |
55 | }; | 56 | }; |
56 | 57 | ||
57 | 58 | ||
58 | static QMap<QString,BgPixmap*> *bgCache = 0; | 59 | static QMap<QString,BgPixmap*> *bgCache = 0; |
59 | 60 | ||
60 | static void cleanup_cache() | 61 | static void cleanup_cache() |
61 | { | 62 | { |
62 | QMap<QString,BgPixmap*>::Iterator it = bgCache->begin(); | 63 | QMap<QString,BgPixmap*>::Iterator it = bgCache->begin(); |
63 | while ( it != bgCache->end() ) { | 64 | while ( it != bgCache->end() ) { |
64 | QMap<QString,BgPixmap*>::Iterator curr = it; | 65 | QMap<QString,BgPixmap*>::Iterator curr = it; |
65 | ++it; | 66 | ++it; |
66 | delete (*curr); | 67 | delete (*curr); |
67 | bgCache->remove( curr ); | 68 | bgCache->remove( curr ); |
68 | } | 69 | } |
69 | delete bgCache; | 70 | delete bgCache; |
70 | bgCache = 0; | 71 | bgCache = 0; |
71 | } | 72 | } |
72 | 73 | ||
@@ -237,97 +238,97 @@ void LauncherItem::animateIcon() | |||
237 | #if defined(BRIGHTEN_BUSY_ICON) | 238 | #if defined(BRIGHTEN_BUSY_ICON) |
238 | QColor c(*rgb); | 239 | QColor c(*rgb); |
239 | int h, s, v; | 240 | int h, s, v; |
240 | c.hsv(&h,&s,&v); | 241 | c.hsv(&h,&s,&v); |
241 | c.setHsv(h,QMAX(s-24,0),QMIN(v+48,255)); | 242 | c.setHsv(h,QMAX(s-24,0),QMIN(v+48,255)); |
242 | *rgb = qRgba(c.red(),c.green(),c.blue(),qAlpha(*rgb)); | 243 | *rgb = qRgba(c.red(),c.green(),c.blue(),qAlpha(*rgb)); |
243 | #elif defined(ALPHA_FADE_BUSY_ICON) | 244 | #elif defined(ALPHA_FADE_BUSY_ICON) |
244 | *rgb = qRgba(qRed(*rgb),qGreen(*rgb),qBlue(*rgb),qAlpha(*rgb)/2); | 245 | *rgb = qRgba(qRed(*rgb),qGreen(*rgb),qBlue(*rgb),qAlpha(*rgb)/2); |
245 | #endif | 246 | #endif |
246 | } | 247 | } |
247 | src.convertFromImage( img ); | 248 | src.convertFromImage( img ); |
248 | setPixmap( src ); | 249 | setPixmap( src ); |
249 | } | 250 | } |
250 | 251 | ||
251 | iteration++; | 252 | iteration++; |
252 | 253 | ||
253 | // Paint animation overlay | 254 | // Paint animation overlay |
254 | QPainter p( liv->viewport() ); | 255 | QPainter p( liv->viewport() ); |
255 | paintAnimatedIcon( &p ); | 256 | paintAnimatedIcon( &p ); |
256 | } | 257 | } |
257 | 258 | ||
258 | void LauncherItem::resetIcon() | 259 | void LauncherItem::resetIcon() |
259 | { | 260 | { |
260 | iteration = 0; | 261 | iteration = 0; |
261 | if (isEyeImage()) { | 262 | if (isEyeImage()) { |
262 | QMap<QString,QPixmap>::Iterator it = LauncherIconView::sm_EyeCache->find(appLnk()->file()); | 263 | QMap<QString,QPixmap>::Iterator it = LauncherIconView::sm_EyeCache->find(appLnk()->file()); |
263 | if (it != LauncherIconView::sm_EyeCache->end()) { | 264 | if (it != LauncherIconView::sm_EyeCache->end()) { |
264 | setPixmap(*it); | 265 | setPixmap(*it); |
265 | return; | 266 | return; |
266 | } | 267 | } |
267 | } | 268 | } |
268 | setPixmap(isBigIcon ? app->bigPixmap() : app->pixmap()); | 269 | setPixmap(isBigIcon ? app->bigPixmap() : app->pixmap()); |
269 | } | 270 | } |
270 | 271 | ||
271 | void LauncherItem::setEyePixmap(const QPixmap&aIcon) | 272 | void LauncherItem::setEyePixmap(const QPixmap&aIcon) |
272 | { | 273 | { |
273 | if (!isEyeImage()) return; | 274 | if (!isEyeImage()) return; |
274 | setPixmap(aIcon); | 275 | setPixmap(aIcon); |
275 | m_EyeImageSet = EYE_ICON; | 276 | m_EyeImageSet = EYE_ICON; |
276 | } | 277 | } |
277 | 278 | ||
278 | //=========================================================================== | 279 | //=========================================================================== |
279 | // Implemantation of LauncherIconview start | 280 | // Implemantation of LauncherIconview start |
280 | //=========================================================================== | 281 | //=========================================================================== |
281 | 282 | ||
282 | QMap<QString,QPixmap>* LauncherIconView::sm_EyeCache=0; | 283 | QMap<QString,QPixmap>* LauncherIconView::sm_EyeCache=0; |
283 | 284 | ||
284 | LauncherIconView::LauncherIconView( QWidget* parent, const char* name ) | 285 | LauncherIconView::LauncherIconView( QWidget* parent, const char* name ) |
285 | : QIconView(parent,name),tf(""),cf(0),bsy(0),busyTimer(0),bigIcns(TRUE),bgColor(white) | 286 | : QIconView(parent,name),tf(""),cf(0),bsy(0),busyTimer(0),bigIcns(TRUE),bgColor(white),numColumns(0) |
286 | { | 287 | { |
287 | m_EyeCallBack = 0; | 288 | m_EyeCallBack = 0; |
288 | if (!sm_EyeCache) sm_EyeCache = new QMap<QString,QPixmap>(); | 289 | if (!sm_EyeCache) sm_EyeCache = new QMap<QString,QPixmap>(); |
289 | sortmeth = Name; | 290 | sortmeth = Name; |
290 | hidden.setAutoDelete(TRUE); | 291 | hidden.setAutoDelete(TRUE); |
291 | ike = FALSE; | 292 | ike = FALSE; |
292 | calculateGrid( Bottom ); | 293 | calculateGrid( Bottom ); |
293 | connect(&m_eyeTimer,SIGNAL(timeout()),this,SLOT(stopEyeTimer())); | 294 | connect(&m_eyeTimer,SIGNAL(timeout()),this,SLOT(stopEyeTimer())); |
294 | } | 295 | } |
295 | 296 | ||
296 | LauncherIconView::~LauncherIconView() | 297 | LauncherIconView::~LauncherIconView() |
297 | { | 298 | { |
298 | odebug << "LauncherIconView::~LauncherIconView()" << oendl; | 299 | odebug << "LauncherIconView::~LauncherIconView()" << oendl; |
299 | #if 0 // debuggery | 300 | #if 0 // debuggery |
300 | QListIterator<AppLnk> it(hidden); | 301 | QListIterator<AppLnk> it(hidden); |
301 | AppLnk* l; | 302 | AppLnk* l; |
302 | while ((l=it.current())) { | 303 | while ((l=it.current())) { |
303 | ++it; | 304 | ++it; |
304 | //odebug << "" << l << ": hidden (should remove)" << oendl; | 305 | //odebug << "" << l << ": hidden (should remove)" << oendl; |
305 | } | 306 | } |
306 | #endif | 307 | #endif |
307 | } | 308 | } |
308 | 309 | ||
309 | int LauncherIconView::compare(const AppLnk* a, const AppLnk* b) | 310 | int LauncherIconView::compare(const AppLnk* a, const AppLnk* b) |
310 | { | 311 | { |
311 | switch (sortmeth) { | 312 | switch (sortmeth) { |
312 | case Name: | 313 | case Name: |
313 | return a->name().lower().compare(b->name().lower()); | 314 | return a->name().lower().compare(b->name().lower()); |
314 | case Date: { | 315 | case Date: { |
315 | QFileInfo fa(a->linkFileKnown() ? a->linkFile() : a->file()); | 316 | QFileInfo fa(a->linkFileKnown() ? a->linkFile() : a->file()); |
316 | QFileInfo fb(b->linkFileKnown() ? b->linkFile() : b->file()); | 317 | QFileInfo fb(b->linkFileKnown() ? b->linkFile() : b->file()); |
317 | return fa.lastModified().secsTo(fb.lastModified()); | 318 | return fa.lastModified().secsTo(fb.lastModified()); |
318 | } | 319 | } |
319 | case Type: | 320 | case Type: |
320 | return a->type().compare(b->type()); | 321 | return a->type().compare(b->type()); |
321 | } | 322 | } |
322 | return 0; | 323 | return 0; |
323 | } | 324 | } |
324 | 325 | ||
325 | void LauncherIconView::setSortMethod( SortMethod m ) | 326 | void LauncherIconView::setSortMethod( SortMethod m ) |
326 | { | 327 | { |
327 | if ( sortmeth != m ) { | 328 | if ( sortmeth != m ) { |
328 | sortmeth = m; | 329 | sortmeth = m; |
329 | sort(); | 330 | sort(); |
330 | } | 331 | } |
331 | } | 332 | } |
332 | 333 | ||
333 | void LauncherIconView::setCategoryFilter( int catfilter, bool resort ) | 334 | void LauncherIconView::setCategoryFilter( int catfilter, bool resort ) |
@@ -580,112 +581,112 @@ void LauncherIconView::addItem(AppLnk* app, bool resort) | |||
580 | void LauncherIconView::changeItem(const AppLnk&old,AppLnk*nlink) | 581 | void LauncherIconView::changeItem(const AppLnk&old,AppLnk*nlink) |
581 | { | 582 | { |
582 | QString oldfile = old.file(); | 583 | QString oldfile = old.file(); |
583 | QString newfile = nlink->file(); | 584 | QString newfile = nlink->file(); |
584 | 585 | ||
585 | if (newfile != oldfile) { | 586 | if (newfile != oldfile) { |
586 | QMap<QString,QPixmap>::Iterator it = sm_EyeCache->find(oldfile); | 587 | QMap<QString,QPixmap>::Iterator it = sm_EyeCache->find(oldfile); |
587 | if (it != sm_EyeCache->end()) { | 588 | if (it != sm_EyeCache->end()) { |
588 | (*sm_EyeCache)[newfile]=(*it); | 589 | (*sm_EyeCache)[newfile]=(*it); |
589 | } | 590 | } |
590 | removeLink(old.linkFile()); | 591 | removeLink(old.linkFile()); |
591 | } else { | 592 | } else { |
592 | removeLink(old.linkFile(),false); | 593 | removeLink(old.linkFile(),false); |
593 | } | 594 | } |
594 | addItem(nlink,false); | 595 | addItem(nlink,false); |
595 | } | 596 | } |
596 | 597 | ||
597 | void LauncherIconView::timerEvent( QTimerEvent *te ) | 598 | void LauncherIconView::timerEvent( QTimerEvent *te ) |
598 | { | 599 | { |
599 | if ( te->timerId() == busyTimer ) { | 600 | if ( te->timerId() == busyTimer ) { |
600 | if ( bsy ) | 601 | if ( bsy ) |
601 | bsy->animateIcon(); | 602 | bsy->animateIcon(); |
602 | } else { | 603 | } else { |
603 | QIconView::timerEvent( te ); | 604 | QIconView::timerEvent( te ); |
604 | } | 605 | } |
605 | } | 606 | } |
606 | 607 | ||
607 | void LauncherIconView::setBigIcons( bool bi ) | 608 | void LauncherIconView::setBigIcons( bool bi ) |
608 | { | 609 | { |
609 | sm_EyeCache->clear(); | 610 | sm_EyeCache->clear(); |
610 | bigIcns = bi; | 611 | bigIcns = bi; |
611 | #ifdef USE_ANIMATED_BUSY_ICON_OVERLAY | 612 | #ifdef USE_ANIMATED_BUSY_ICON_OVERLAY |
612 | busyPix.resize(0,0); | 613 | busyPix.resize(0,0); |
613 | #endif | 614 | #endif |
614 | } | 615 | } |
615 | 616 | ||
616 | QIconViewItem* LauncherIconView::busyItem() const | 617 | QIconViewItem* LauncherIconView::busyItem() const |
617 | { | 618 | { |
618 | return bsy; | 619 | return bsy; |
619 | } | 620 | } |
620 | 621 | ||
621 | void LauncherIconView::setBusyIndicatorType ( BusyIndicatorType t ) { busyType = t; } | 622 | void LauncherIconView::setBusyIndicatorType ( BusyIndicatorType t ) { busyType = t; } |
622 | 623 | ||
623 | void LauncherIconView::calculateGrid( ItemTextPos pos ) | 624 | void LauncherIconView::calculateGrid( ItemTextPos pos ) |
624 | { | 625 | { |
625 | int dw = QApplication::desktop()->width(); | 626 | int dw = QApplication::desktop()->width(); |
626 | int viewerWidth = dw-style().scrollBarExtent().width(); | 627 | int viewerWidth = dw-style().scrollBarExtent().width(); |
627 | if ( pos == Bottom ) { | 628 | if ( pos == Bottom ) { |
628 | int cols = 3; | 629 | if( !numColumns ) { |
629 | if ( viewerWidth <= 200 ) | 630 | if ( viewerWidth <= 200 ) numColumns = 2; |
630 | cols = 2; | 631 | else if ( viewerWidth >= 400 ) numColumns = viewerWidth/96; |
631 | else if ( viewerWidth >= 400 ) | 632 | else numColumns = 3; |
632 | cols = viewerWidth/96; | 633 | } |
633 | setSpacing( 4 ); | 634 | setSpacing( 4 ); |
634 | setGridX( (viewerWidth-(cols+1)*spacing())/cols ); | 635 | setGridX( (viewerWidth-(numColumns+1)*spacing())/numColumns ); |
635 | setGridY( fontMetrics().height()*2+24 ); | 636 | setGridY( fontMetrics().height()*2+24 ); |
636 | } else { | 637 | } else { |
637 | int cols = 2; | 638 | if( !numColumns ) { |
638 | if ( viewerWidth < 150 ) | 639 | if ( viewerWidth < 150 ) numColumns = 1; |
639 | cols = 1; | 640 | else if ( viewerWidth >= 400 ) numColumns = viewerWidth/150; |
640 | else if ( viewerWidth >= 400 ) | 641 | else numColumns = 2; |
641 | cols = viewerWidth/150; | 642 | } |
642 | setSpacing( 2 ); | 643 | setSpacing( 2 ); |
643 | setGridX( (viewerWidth-(cols+1)*spacing())/cols ); | 644 | setGridX( (viewerWidth-(numColumns+1)*spacing())/numColumns ); |
644 | setGridY( fontMetrics().height()+2 ); | 645 | setGridY( fontMetrics().height()+2 ); |
645 | } | 646 | } |
646 | } | 647 | } |
647 | 648 | ||
648 | void LauncherIconView::styleChange( QStyle &old ) | 649 | void LauncherIconView::styleChange( QStyle &old ) |
649 | { | 650 | { |
650 | QIconView::styleChange( old ); | 651 | QIconView::styleChange( old ); |
651 | calculateGrid( itemTextPos() ); | 652 | calculateGrid( itemTextPos() ); |
652 | } | 653 | } |
653 | 654 | ||
654 | void LauncherIconView::keyPressEvent(QKeyEvent* e) | 655 | void LauncherIconView::keyPressEvent(QKeyEvent* e) |
655 | { | 656 | { |
656 | ike = TRUE; | 657 | ike = TRUE; |
657 | if ( e->key() == Key_F33 /* OK button */ || e->key() == Key_Space ) { | 658 | if ( e->key() == Key_F33 /* OK button */ || e->key() == Key_Space ) { |
658 | if ( (e->state() & ShiftButton) ) | 659 | if ( (e->state() & ShiftButton) ) |
659 | emit mouseButtonPressed(ShiftButton, currentItem(), QPoint() ); | 660 | emit mouseButtonPressed(ShiftButton, currentItem(), QPoint() ); |
660 | else | 661 | else |
661 | returnPressed(currentItem()); | 662 | returnPressed(currentItem()); |
662 | } | 663 | } |
663 | 664 | ||
664 | QIconView::keyPressEvent(e); | 665 | QIconView::keyPressEvent(e); |
665 | ike = FALSE; | 666 | ike = FALSE; |
666 | } | 667 | } |
667 | 668 | ||
668 | //=========================================================================== | 669 | //=========================================================================== |
669 | // Implemantation of LauncherIconview end | 670 | // Implemantation of LauncherIconview end |
670 | //=========================================================================== | 671 | //=========================================================================== |
671 | 672 | ||
672 | 673 | ||
673 | //=========================================================================== | 674 | //=========================================================================== |
674 | LauncherView::LauncherView( QWidget* parent, const char* name, WFlags fl ) | 675 | LauncherView::LauncherView( QWidget* parent, const char* name, WFlags fl ) |
675 | : QVBox( parent, name, fl ) | 676 | : QVBox( parent, name, fl ) |
676 | { | 677 | { |
677 | catmb = 0; | 678 | catmb = 0; |
678 | icons = new LauncherIconView( this ); | 679 | icons = new LauncherIconView( this ); |
679 | setFocusProxy(icons); | 680 | setFocusProxy(icons); |
680 | QPEApplication::setStylusOperation( icons->viewport(), QPEApplication::RightOnHold ); | 681 | QPEApplication::setStylusOperation( icons->viewport(), QPEApplication::RightOnHold ); |
681 | 682 | ||
682 | icons->setItemsMovable( FALSE ); | 683 | icons->setItemsMovable( FALSE ); |
683 | icons->setAutoArrange( TRUE ); | 684 | icons->setAutoArrange( TRUE ); |
684 | icons->setSorting( TRUE ); | 685 | icons->setSorting( TRUE ); |
685 | icons->setFrameStyle( QFrame::NoFrame ); | 686 | icons->setFrameStyle( QFrame::NoFrame ); |
686 | icons->setMargin( 0 ); | 687 | icons->setMargin( 0 ); |
687 | icons->setSelectionMode( QIconView::NoSelection ); | 688 | icons->setSelectionMode( QIconView::NoSelection ); |
688 | icons->setBackgroundMode( PaletteBase ); | 689 | icons->setBackgroundMode( PaletteBase ); |
689 | icons->setResizeMode( QIconView::Adjust ); | 690 | icons->setResizeMode( QIconView::Adjust ); |
690 | vmode = (ViewMode)-1; | 691 | vmode = (ViewMode)-1; |
691 | setViewMode( Icon ); | 692 | setViewMode( Icon ); |
@@ -958,96 +959,107 @@ void LauncherView::setBackgroundType( BackgroundType t, const QString &val ) | |||
958 | bool tile = FALSE; | 959 | bool tile = FALSE; |
959 | if ( imgFile[0]!='/' || !QFile::exists(imgFile) ) { | 960 | if ( imgFile[0]!='/' || !QFile::exists(imgFile) ) { |
960 | imgFile = Resource::findPixmap( imgFile ); | 961 | imgFile = Resource::findPixmap( imgFile ); |
961 | tile = TRUE; | 962 | tile = TRUE; |
962 | } | 963 | } |
963 | QImage img = loadBackgroundImage(imgFile); | 964 | QImage img = loadBackgroundImage(imgFile); |
964 | 965 | ||
965 | 966 | ||
966 | if ( img.depth() == 1 ) | 967 | if ( img.depth() == 1 ) |
967 | img = img.convertDepth(8); | 968 | img = img.convertDepth(8); |
968 | img.setAlphaBuffer(FALSE); | 969 | img.setAlphaBuffer(FALSE); |
969 | bg.convertFromImage(img); | 970 | bg.convertFromImage(img); |
970 | bgCache->insert( bgName, new BgPixmap(bg) ); | 971 | bgCache->insert( bgName, new BgPixmap(bg) ); |
971 | } | 972 | } |
972 | } | 973 | } |
973 | break; | 974 | break; |
974 | 975 | ||
975 | case SolidColor: | 976 | case SolidColor: |
976 | default: | 977 | default: |
977 | break; | 978 | break; |
978 | } | 979 | } |
979 | 980 | ||
980 | const QObjectList *list = queryList( "QWidget", 0, FALSE ); | 981 | const QObjectList *list = queryList( "QWidget", 0, FALSE ); |
981 | QObject *obj; | 982 | QObject *obj; |
982 | for ( QObjectListIt it( *list ); (obj=it.current()); ++it ) { | 983 | for ( QObjectListIt it( *list ); (obj=it.current()); ++it ) { |
983 | if ( obj->isWidgetType() ) { | 984 | if ( obj->isWidgetType() ) { |
984 | QWidget *w = (QWidget*)obj; | 985 | QWidget *w = (QWidget*)obj; |
985 | w->setBackgroundPixmap( bg ); | 986 | w->setBackgroundPixmap( bg ); |
986 | if ( bgName.isEmpty() ) { | 987 | if ( bgName.isEmpty() ) { |
987 | // Solid Color | 988 | // Solid Color |
988 | if ( val.isEmpty() ) | 989 | if ( val.isEmpty() ) |
989 | w->setBackgroundColor( colorGroup().base() ); | 990 | w->setBackgroundColor( colorGroup().base() ); |
990 | else | 991 | else |
991 | w->setBackgroundColor( val ); | 992 | w->setBackgroundColor( val ); |
992 | } else { | 993 | } else { |
993 | // Ruled or Image pixmap | 994 | // Ruled or Image pixmap |
994 | w->setBackgroundOrigin( ParentOrigin ); | 995 | w->setBackgroundOrigin( ParentOrigin ); |
995 | } | 996 | } |
996 | } | 997 | } |
997 | } | 998 | } |
998 | delete list; | 999 | delete list; |
999 | 1000 | ||
1000 | bgType = t; | 1001 | bgType = t; |
1001 | icons->viewport()->update(); | 1002 | icons->viewport()->update(); |
1002 | 1003 | ||
1003 | QTimer::singleShot( 1000, this, SLOT(flushBgCache()) ); | 1004 | QTimer::singleShot( 1000, this, SLOT(flushBgCache()) ); |
1004 | } | 1005 | } |
1005 | 1006 | ||
1007 | void LauncherView::setColNumber( int num ) | ||
1008 | { | ||
1009 | icons->setColNumber( num ); | ||
1010 | } | ||
1011 | |||
1012 | void LauncherIconView::setColNumber( int num ) | ||
1013 | { | ||
1014 | numColumns = num; | ||
1015 | calculateGrid( Bottom ); | ||
1016 | } | ||
1017 | |||
1006 | void LauncherView::setTextColor( const QColor &tc ) | 1018 | void LauncherView::setTextColor( const QColor &tc ) |
1007 | { | 1019 | { |
1008 | textCol = tc; | 1020 | textCol = tc; |
1009 | QColorGroup cg = icons->colorGroup(); | 1021 | QColorGroup cg = icons->colorGroup(); |
1010 | cg.setColor( QColorGroup::Text, tc ); | 1022 | cg.setColor( QColorGroup::Text, tc ); |
1011 | icons->setPalette( QPalette(cg,cg,cg) ); | 1023 | icons->setPalette( QPalette(cg,cg,cg) ); |
1012 | icons->viewport()->update(); | 1024 | icons->viewport()->update(); |
1013 | } | 1025 | } |
1014 | 1026 | ||
1015 | void LauncherView::setViewFont( const QFont &f ) | 1027 | void LauncherView::setViewFont( const QFont &f ) |
1016 | { | 1028 | { |
1017 | icons->setFont( f ); | 1029 | icons->setFont( f ); |
1018 | icons->hideOrShowItems( FALSE ); | 1030 | icons->hideOrShowItems( FALSE ); |
1019 | } | 1031 | } |
1020 | 1032 | ||
1021 | void LauncherView::clearViewFont() | 1033 | void LauncherView::clearViewFont() |
1022 | { | 1034 | { |
1023 | icons->unsetFont(); | 1035 | icons->unsetFont(); |
1024 | icons->hideOrShowItems( FALSE ); | 1036 | icons->hideOrShowItems( FALSE ); |
1025 | } | 1037 | } |
1026 | 1038 | ||
1027 | void LauncherView::resizeEvent(QResizeEvent *e) | 1039 | void LauncherView::resizeEvent(QResizeEvent *e) |
1028 | { | 1040 | { |
1029 | // qDebug("LauncherView resize event"); | 1041 | // qDebug("LauncherView resize event"); |
1030 | QVBox::resizeEvent( e ); | 1042 | QVBox::resizeEvent( e ); |
1031 | // commented out for launcherview and qt/e 2.3.8 problems, probably needs real fixing somewhere... | 1043 | // commented out for launcherview and qt/e 2.3.8 problems, probably needs real fixing somewhere... |
1032 | // if ( e->size().width() != e->oldSize().width() ) | 1044 | // if ( e->size().width() != e->oldSize().width() ) |
1033 | sort(); | 1045 | sort(); |
1034 | } | 1046 | } |
1035 | 1047 | ||
1036 | void LauncherView::selectionChanged() | 1048 | void LauncherView::selectionChanged() |
1037 | { | 1049 | { |
1038 | QIconViewItem* item = icons->currentItem(); | 1050 | QIconViewItem* item = icons->currentItem(); |
1039 | if ( item && item->isSelected() ) { | 1051 | if ( item && item->isSelected() ) { |
1040 | AppLnk *appLnk = ((LauncherItem *)item)->appLnk(); | 1052 | AppLnk *appLnk = ((LauncherItem *)item)->appLnk(); |
1041 | if ( icons->inKeyEvent() ) // not for mouse press | 1053 | if ( icons->inKeyEvent() ) // not for mouse press |
1042 | emit clicked( appLnk ); | 1054 | emit clicked( appLnk ); |
1043 | item->setSelected(FALSE); | 1055 | item->setSelected(FALSE); |
1044 | } | 1056 | } |
1045 | } | 1057 | } |
1046 | 1058 | ||
1047 | void LauncherView::returnPressed( QIconViewItem *item ) | 1059 | void LauncherView::returnPressed( QIconViewItem *item ) |
1048 | { | 1060 | { |
1049 | if ( item ) { | 1061 | if ( item ) { |
1050 | AppLnk *appLnk = ((LauncherItem *)item)->appLnk(); | 1062 | AppLnk *appLnk = ((LauncherItem *)item)->appLnk(); |
1051 | emit clicked( appLnk ); | 1063 | emit clicked( appLnk ); |
1052 | } | 1064 | } |
1053 | } | 1065 | } |
diff --git a/core/launcher/launcherview.h b/core/launcher/launcherview.h index 05073ab..e2869eb 100644 --- a/core/launcher/launcherview.h +++ b/core/launcher/launcherview.h | |||
@@ -37,96 +37,98 @@ class QWidgetStack; | |||
37 | class MenuButton; | 37 | class MenuButton; |
38 | class QComboBox; | 38 | class QComboBox; |
39 | 39 | ||
40 | 40 | ||
41 | 41 | ||
42 | enum BusyIndicatorType { | 42 | enum BusyIndicatorType { |
43 | BIT_Normal = 0, | 43 | BIT_Normal = 0, |
44 | BIT_Animated | 44 | BIT_Animated |
45 | }; | 45 | }; |
46 | 46 | ||
47 | class LauncherView : public QVBox | 47 | class LauncherView : public QVBox |
48 | { | 48 | { |
49 | Q_OBJECT | 49 | Q_OBJECT |
50 | 50 | ||
51 | public: | 51 | public: |
52 | LauncherView( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); | 52 | LauncherView( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); |
53 | ~LauncherView(); | 53 | ~LauncherView(); |
54 | 54 | ||
55 | void hideIcons(); | 55 | void hideIcons(); |
56 | 56 | ||
57 | bool removeLink(const QString& linkfile); | 57 | bool removeLink(const QString& linkfile); |
58 | void addItem(AppLnk* app, bool resort=TRUE); | 58 | void addItem(AppLnk* app, bool resort=TRUE); |
59 | void changeItem(const AppLnk&old,AppLnk*nlink); | 59 | void changeItem(const AppLnk&old,AppLnk*nlink); |
60 | 60 | ||
61 | void removeAllItems(); | 61 | void removeAllItems(); |
62 | void setSortEnabled(bool); | 62 | void setSortEnabled(bool); |
63 | void setUpdatesEnabled(bool); | 63 | void setUpdatesEnabled(bool); |
64 | void sort(); | 64 | void sort(); |
65 | 65 | ||
66 | void setToolsEnabled(bool); | 66 | void setToolsEnabled(bool); |
67 | void updateTools(); | 67 | void updateTools(); |
68 | 68 | ||
69 | void setBusy(bool); | 69 | void setBusy(bool); |
70 | void setBusyIndicatorType( const QString& ); | 70 | void setBusyIndicatorType( const QString& ); |
71 | 71 | ||
72 | enum ViewMode { Icon, List }; | 72 | enum ViewMode { Icon, List }; |
73 | void setViewMode( ViewMode m ); | 73 | void setViewMode( ViewMode m ); |
74 | ViewMode viewMode() const { return vmode; } | 74 | ViewMode viewMode() const { return vmode; } |
75 | 75 | ||
76 | enum BackgroundType { Ruled, SolidColor, Image }; | 76 | enum BackgroundType { Ruled, SolidColor, Image }; |
77 | void setBackgroundType( BackgroundType t, const QString & ); | 77 | void setBackgroundType( BackgroundType t, const QString & ); |
78 | BackgroundType backgroundType() const { return bgType; } | 78 | BackgroundType backgroundType() const { return bgType; } |
79 | 79 | ||
80 | void setTextColor( const QColor & ); | 80 | void setTextColor( const QColor & ); |
81 | QColor textColor() const { return textCol; } | 81 | QColor textColor() const { return textCol; } |
82 | 82 | ||
83 | void setViewFont( const QFont & ); | 83 | void setViewFont( const QFont & ); |
84 | void clearViewFont(); | 84 | void clearViewFont(); |
85 | |||
86 | void setColNumber( int ); | ||
85 | 87 | ||
86 | void relayout(void); | 88 | void relayout(void); |
87 | 89 | ||
88 | signals: | 90 | signals: |
89 | void clicked( const AppLnk * ); | 91 | void clicked( const AppLnk * ); |
90 | void rightPressed( AppLnk * ); | 92 | void rightPressed( AppLnk * ); |
91 | 93 | ||
92 | protected slots: | 94 | protected slots: |
93 | void selectionChanged(); | 95 | void selectionChanged(); |
94 | void returnPressed( QIconViewItem *item ); | 96 | void returnPressed( QIconViewItem *item ); |
95 | void itemClicked( int, QIconViewItem * ); | 97 | void itemClicked( int, QIconViewItem * ); |
96 | void itemPressed( int, QIconViewItem * ); | 98 | void itemPressed( int, QIconViewItem * ); |
97 | void sortBy(int); | 99 | void sortBy(int); |
98 | void showType(int); | 100 | void showType(int); |
99 | void showCategory( int ); | 101 | void showCategory( int ); |
100 | void resizeEvent(QResizeEvent *); | 102 | void resizeEvent(QResizeEvent *); |
101 | void flushBgCache(); | 103 | void flushBgCache(); |
102 | 104 | ||
103 | protected: | 105 | protected: |
104 | void paletteChange( const QPalette & ); | 106 | void paletteChange( const QPalette & ); |
105 | 107 | ||
106 | void fontChanged(const QFont &); | 108 | void fontChanged(const QFont &); |
107 | 109 | ||
108 | private: | 110 | private: |
109 | static bool bsy; | 111 | static bool bsy; |
110 | QWidget* tools; | 112 | QWidget* tools; |
111 | LauncherIconView* icons; | 113 | LauncherIconView* icons; |
112 | QComboBox *typemb; | 114 | QComboBox *typemb; |
113 | QStringList typelist; | 115 | QStringList typelist; |
114 | CategorySelect *catmb; | 116 | CategorySelect *catmb; |
115 | ViewMode vmode; | 117 | ViewMode vmode; |
116 | BackgroundType bgType; | 118 | BackgroundType bgType; |
117 | QString bgName; | 119 | QString bgName; |
118 | QColor textCol; | 120 | QColor textCol; |
119 | 121 | ||
120 | QImage loadBackgroundImage(QString &fname); | 122 | QImage loadBackgroundImage(QString &fname); |
121 | 123 | ||
122 | }; | 124 | }; |
123 | 125 | ||
124 | /* from opie-eye */ | 126 | /* from opie-eye */ |
125 | struct PixmapInfo { | 127 | struct PixmapInfo { |
126 | PixmapInfo() : width( -1 ), height( -1 ) {} | 128 | PixmapInfo() : width( -1 ), height( -1 ) {} |
127 | bool operator==( const PixmapInfo& r ) { | 129 | bool operator==( const PixmapInfo& r ) { |
128 | if ( width != r.width ) return false; | 130 | if ( width != r.width ) return false; |
129 | if ( height != r.height ) return false; | 131 | if ( height != r.height ) return false; |
130 | if ( file != r.file ) return false; | 132 | if ( file != r.file ) return false; |
131 | return true; | 133 | return true; |
132 | } | 134 | } |
@@ -151,100 +153,103 @@ protected slots: | |||
151 | 153 | ||
152 | signals: | 154 | signals: |
153 | void sig_Thumbnail(const QPixmap&,const QString&,int); | 155 | void sig_Thumbnail(const QPixmap&,const QString&,int); |
154 | 156 | ||
155 | protected: | 157 | protected: |
156 | PixmapInfos m_inThumbNail; | 158 | PixmapInfos m_inThumbNail; |
157 | }; | 159 | }; |
158 | 160 | ||
159 | class LauncherIconView : public QIconView { | 161 | class LauncherIconView : public QIconView { |
160 | Q_OBJECT | 162 | Q_OBJECT |
161 | public: | 163 | public: |
162 | LauncherIconView( QWidget* parent, const char* name=0 ); | 164 | LauncherIconView( QWidget* parent, const char* name=0 ); |
163 | ~LauncherIconView(); | 165 | ~LauncherIconView(); |
164 | QIconViewItem* busyItem() const; | 166 | QIconViewItem* busyItem() const; |
165 | 167 | ||
166 | #ifdef USE_ANIMATED_BUSY_ICON_OVERLAY | 168 | #ifdef USE_ANIMATED_BUSY_ICON_OVERLAY |
167 | QPixmap busyPixmap() const { return busyPix; } | 169 | QPixmap busyPixmap() const { return busyPix; } |
168 | #endif | 170 | #endif |
169 | void setBigIcons( bool bi ); | 171 | void setBigIcons( bool bi ); |
170 | void updateCategoriesAndMimeTypes(); | 172 | void updateCategoriesAndMimeTypes(); |
171 | void setBusyIndicatorType ( BusyIndicatorType t ); | 173 | void setBusyIndicatorType ( BusyIndicatorType t ); |
172 | void doAutoScroll() | 174 | void doAutoScroll() |
173 | { | 175 | { |
174 | // We don't want rubberbanding (yet) | 176 | // We don't want rubberbanding (yet) |
175 | } | 177 | } |
176 | 178 | ||
177 | void setBusy(bool on); | 179 | void setBusy(bool on); |
178 | bool inKeyEvent() const { return ike; } | 180 | bool inKeyEvent() const { return ike; } |
179 | 181 | ||
180 | void addItem(AppLnk* app, bool resort=TRUE); | 182 | void addItem(AppLnk* app, bool resort=TRUE); |
181 | bool removeLink(const QString& linkfile,bool removeCache = true); | 183 | bool removeLink(const QString& linkfile,bool removeCache = true); |
182 | void changeItem(const AppLnk&old,AppLnk*nlink); | 184 | void changeItem(const AppLnk&old,AppLnk*nlink); |
183 | 185 | ||
184 | QStringList mimeTypes() const; | 186 | QStringList mimeTypes() const; |
185 | QStringList categories() const; | 187 | QStringList categories() const; |
186 | void clear(); | 188 | void clear(); |
187 | void addCatsAndMimes(AppLnk* app); | 189 | void addCatsAndMimes(AppLnk* app); |
188 | 190 | ||
189 | void setBackgroundOrigin( QWidget::BackgroundOrigin ) {} | 191 | void setBackgroundOrigin( QWidget::BackgroundOrigin ) {} |
190 | 192 | ||
191 | void setBackgroundPixmap( const QPixmap &pm ) { | 193 | void setBackgroundPixmap( const QPixmap &pm ) { |
192 | bgPixmap = pm; | 194 | bgPixmap = pm; |
193 | } | 195 | } |
194 | 196 | ||
195 | void setBackgroundColor( const QColor &c ) { | 197 | void setBackgroundColor( const QColor &c ) { |
196 | bgColor = c; | 198 | bgColor = c; |
197 | } | 199 | } |
198 | 200 | ||
201 | void setColNumber( int ); | ||
202 | |||
199 | void drawBackground( QPainter *p, const QRect &r ); | 203 | void drawBackground( QPainter *p, const QRect &r ); |
200 | void setItemTextPos( ItemTextPos pos ); | 204 | void setItemTextPos( ItemTextPos pos ); |
201 | void hideOrShowItems(bool resort); | 205 | void hideOrShowItems(bool resort); |
202 | 206 | ||
203 | void setTypeFilter(const QString& typefilter, bool resort); | 207 | void setTypeFilter(const QString& typefilter, bool resort); |
204 | void setCategoryFilter( int catfilter, bool resort ); | 208 | void setCategoryFilter( int catfilter, bool resort ); |
205 | 209 | ||
206 | enum SortMethod { Name, Date, Type }; | 210 | enum SortMethod { Name, Date, Type }; |
207 | 211 | ||
208 | void setSortMethod( SortMethod m ); | 212 | void setSortMethod( SortMethod m ); |
209 | int compare(const AppLnk* a, const AppLnk* b); | 213 | int compare(const AppLnk* a, const AppLnk* b); |
210 | void requestEyePix(const LauncherItem*which); | 214 | void requestEyePix(const LauncherItem*which); |
211 | 215 | ||
212 | static QMap<QString,QPixmap>* sm_EyeCache; | 216 | static QMap<QString,QPixmap>* sm_EyeCache; |
213 | 217 | ||
214 | protected: | 218 | protected: |
215 | virtual void timerEvent( QTimerEvent *te ); | 219 | virtual void timerEvent( QTimerEvent *te ); |
216 | void styleChange( QStyle &old ); | 220 | void styleChange( QStyle &old ); |
217 | void calculateGrid( ItemTextPos pos ); | 221 | void calculateGrid( ItemTextPos pos ); |
218 | void focusInEvent( QFocusEvent * ) {} | 222 | void focusInEvent( QFocusEvent * ) {} |
219 | void focusOutEvent( QFocusEvent * ) {} | 223 | void focusOutEvent( QFocusEvent * ) {} |
220 | LauncherItem*findDocItem(const QString&); | 224 | LauncherItem*findDocItem(const QString&); |
221 | void addCheckItem(AppLnk* app); | 225 | void addCheckItem(AppLnk* app); |
222 | void checkCallback(); | 226 | void checkCallback(); |
223 | virtual void keyPressEvent(QKeyEvent* e); | 227 | virtual void keyPressEvent(QKeyEvent* e); |
224 | 228 | ||
225 | protected slots: | 229 | protected slots: |
226 | void setEyePixmap(const QPixmap&,const QString&,int width); | 230 | void setEyePixmap(const QPixmap&,const QString&,int width); |
227 | void stopEyeTimer(); | 231 | void stopEyeTimer(); |
228 | 232 | ||
229 | private: | 233 | private: |
230 | QList<AppLnk> hidden; | 234 | QList<AppLnk> hidden; |
231 | QDict<void> mimes; | 235 | QDict<void> mimes; |
232 | QDict<void> cats; | 236 | QDict<void> cats; |
233 | SortMethod sortmeth; | 237 | SortMethod sortmeth; |
234 | QRegExp tf; | 238 | QRegExp tf; |
235 | int cf; | 239 | int cf; |
236 | LauncherItem* bsy; | 240 | LauncherItem* bsy; |
237 | int busyTimer; | 241 | int busyTimer; |
238 | bool ike; | 242 | bool ike; |
239 | bool bigIcns; | 243 | bool bigIcns; |
240 | QPixmap bgPixmap; | 244 | QPixmap bgPixmap; |
241 | QColor bgColor; | 245 | QColor bgColor; |
242 | LauncherThumbReceiver*m_EyeCallBack; | 246 | LauncherThumbReceiver*m_EyeCallBack; |
243 | #ifdef USE_ANIMATED_BUSY_ICON_OVERLAY | 247 | #ifdef USE_ANIMATED_BUSY_ICON_OVERLAY |
244 | QPixmap busyPix; | 248 | QPixmap busyPix; |
245 | #endif | 249 | #endif |
246 | BusyIndicatorType busyType; | 250 | BusyIndicatorType busyType; |
247 | QTimer m_eyeTimer; | 251 | QTimer m_eyeTimer; |
252 | int numColumns; | ||
248 | }; | 253 | }; |
249 | 254 | ||
250 | #endif // LAUNCHERVIEW_H | 255 | #endif // LAUNCHERVIEW_H |