summaryrefslogtreecommitdiff
path: root/core/launcher
authoralwin <alwin>2004-11-11 21:10:16 (UTC)
committer alwin <alwin>2004-11-11 21:10:16 (UTC)
commitd2d25a3c1e60a34436cd93e5214a35b3edd05c6c (patch) (unidiff)
tree0c1bd62dd09e7a86292399f68c823b7eb6ae031e /core/launcher
parente85cf7184c3444e26c1858d0564fa5d3614dd7b5 (diff)
downloadopie-d2d25a3c1e60a34436cd93e5214a35b3edd05c6c.zip
opie-d2d25a3c1e60a34436cd93e5214a35b3edd05c6c.tar.gz
opie-d2d25a3c1e60a34436cd93e5214a35b3edd05c6c.tar.bz2
- flush icon cache if reloading all documents
- send QCop message when the doctab is enabled/disabled so the disabled widget appears or the doc-list will reread
Diffstat (limited to 'core/launcher') (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/documentlist.cpp10
-rw-r--r--core/launcher/documentlist.h1
-rw-r--r--core/launcher/launcher.cpp25
-rw-r--r--core/launcher/launcher.h1
-rw-r--r--core/launcher/launcherview.cpp4
-rw-r--r--core/launcher/server.cpp2
6 files changed, 37 insertions, 6 deletions
diff --git a/core/launcher/documentlist.cpp b/core/launcher/documentlist.cpp
index d8e7a83..9781a32 100644
--- a/core/launcher/documentlist.cpp
+++ b/core/launcher/documentlist.cpp
@@ -269,27 +269,35 @@ void DocumentList::reloadDocLnks()
269{ 269{
270 if ( !d->scanDocs ) 270 if ( !d->scanDocs )
271 return; 271 return;
272 272
273 if ( d->sendDocLnks && d->serverGui ) { 273 if ( d->sendDocLnks && d->serverGui ) {
274 d->serverGui->documentScanningProgress( 0 ); 274 d->serverGui->documentScanningProgress( 0 );
275 d->serverGui->allDocumentsRemoved(); 275 d->serverGui->allDocumentsRemoved();
276 } 276 }
277 277
278 rescan(); 278 rescan();
279} 279}
280 280
281void DocumentList::reforceDocuments()
282{
283 Config cfg( "Launcher" );
284 cfg.setGroup( "DocTab" );
285 d->scanDocs = cfg.readBoolEntry( "Enable", true );
286 reloadDocLnks();
287}
288
281void DocumentList::linkChanged( QString arg ) 289void DocumentList::linkChanged( QString arg )
282{ 290{
283 //odebug << "linkchanged( " << arg << " )" << oendl; 291 odebug << "linkchanged( " << arg << " )" << oendl;
284 292
285 if ( arg.isNull() || OGlobal::isAppLnkFileName( arg ) ) { 293 if ( arg.isNull() || OGlobal::isAppLnkFileName( arg ) ) {
286 reloadAppLnks(); 294 reloadAppLnks();
287 } else { 295 } else {
288 296
289 const QList<DocLnk> &list = d->dls.children(); 297 const QList<DocLnk> &list = d->dls.children();
290 QListIterator<DocLnk> it( list ); 298 QListIterator<DocLnk> it( list );
291 while ( it.current() ) { 299 while ( it.current() ) {
292 DocLnk *doc = it.current(); 300 DocLnk *doc = it.current();
293 ++it; 301 ++it;
294 if ( ( doc->linkFileKnown() && doc->linkFile() == arg ) 302 if ( ( doc->linkFileKnown() && doc->linkFile() == arg )
295 || ( doc->fileKnown() && doc->file() == arg ) ) { 303 || ( doc->fileKnown() && doc->file() == arg ) ) {
diff --git a/core/launcher/documentlist.h b/core/launcher/documentlist.h
index 232bb6a..8b69e95 100644
--- a/core/launcher/documentlist.h
+++ b/core/launcher/documentlist.h
@@ -33,24 +33,25 @@ class DocumentList : public QObject {
33public: 33public:
34 DocumentList( ServerInterface *serverGui, bool scanDocs = TRUE, 34 DocumentList( ServerInterface *serverGui, bool scanDocs = TRUE,
35 QObject *parent = 0, const char *name = 0 ); 35 QObject *parent = 0, const char *name = 0 );
36 ~DocumentList(); 36 ~DocumentList();
37 37
38 void linkChanged( QString link ); 38 void linkChanged( QString link );
39 void restoreDone(); 39 void restoreDone();
40 void storageChanged(); 40 void storageChanged();
41 void sendAllDocLinks(); 41 void sendAllDocLinks();
42 42
43 void reloadAppLnks(); 43 void reloadAppLnks();
44 void reloadDocLnks(); 44 void reloadDocLnks();
45 void reforceDocuments();
45 void DiffAppLnks(); 46 void DiffAppLnks();
46 47
47// Orig DocList stuff 48// Orig DocList stuff
48 void start(); 49 void start();
49 void pause(); 50 void pause();
50 void resume(); 51 void resume();
51 void rescan(); 52 void rescan();
52 53
53 static AppLnkSet *appLnkSet; 54 static AppLnkSet *appLnkSet;
54 55
55/* 56/*
56 void resend(); 57 void resend();
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp
index ccc2114..970b8cb 100644
--- a/core/launcher/launcher.cpp
+++ b/core/launcher/launcher.cpp
@@ -432,30 +432,51 @@ void LauncherTabWidget::launcherMessage( const QCString &msg, const QByteArray &
432 } else { 432 } else {
433 view(id)->clearViewFont(); 433 view(id)->clearViewFont();
434 } 434 }
435 } 435 }
436 }else if ( msg == "setBusyIndicatorType(QString)" ) { 436 }else if ( msg == "setBusyIndicatorType(QString)" ) {
437 QString type; 437 QString type;
438 stream >> type; 438 stream >> type;
439 setBusyIndicatorType( type ); 439 setBusyIndicatorType( type );
440 }else if ( msg == "home()" ) { 440 }else if ( msg == "home()" ) {
441 if ( isVisibleWindow( static_cast<QWidget*>(parent())->winId() ) ) { 441 if ( isVisibleWindow( static_cast<QWidget*>(parent())->winId() ) ) {
442 if (categoryBar) 442 if (categoryBar)
443 categoryBar->nextTab(); 443 categoryBar->nextTab();
444 }else 444 }else {
445 static_cast<QWidget*>(parent())->raise(); 445 static_cast<QWidget*>(parent())->raise();
446 } 446 }
447 } else if (msg=="doctabEnabled(int)") {
448 int id; stream >> id;
449 odebug << "Doctab enabled " << id << oendl;
450 reCheckDoctab(id);
451 }
447} 452}
448 453
449 454void LauncherTabWidget::reCheckDoctab(int how)
455{
456 if ((bool)how == docTabEnabled) {
457 /* nothing to do */
458 return;
459 }
460 if (docLoadingWidget) {
461 stack->removeWidget(docLoadingWidget);
462 delete docLoadingWidget;
463 docLoadingWidget = 0;
464 }
465 createDocLoadingWidget();
466 {
467 QCopEnvelope( "QPE/System", "reforceDocuments()" );
468 odebug << "Sending doc rescan" << oendl;
469 }
470}
450 471
451//--------------------------------------------------------------------------- 472//---------------------------------------------------------------------------
452 473
453Launcher::Launcher() 474Launcher::Launcher()
454 : QMainWindow( 0, "PDA User Interface", QWidget::WStyle_Customize | QWidget::WGroupLeader ) 475 : QMainWindow( 0, "PDA User Interface", QWidget::WStyle_Customize | QWidget::WGroupLeader )
455{ 476{
456 tabs = 0; 477 tabs = 0;
457 tb = 0; 478 tb = 0;
458 Config cfg( "Launcher" ); 479 Config cfg( "Launcher" );
459 cfg.setGroup( "DocTab" ); 480 cfg.setGroup( "DocTab" );
460 docTabEnabled = cfg.readBoolEntry( "Enable", true ); 481 docTabEnabled = cfg.readBoolEntry( "Enable", true );
461} 482}
diff --git a/core/launcher/launcher.h b/core/launcher/launcher.h
index db6ac54..b741064 100644
--- a/core/launcher/launcher.h
+++ b/core/launcher/launcher.h
@@ -72,24 +72,25 @@ protected slots:
72 void raiseTabWidget(); 72 void raiseTabWidget();
73 void tabProperties(); 73 void tabProperties();
74 void initLayout(); 74 void initLayout();
75 75
76private slots: 76private slots:
77 void launcherMessage( const QCString &, const QByteArray &); 77 void launcherMessage( const QCString &, const QByteArray &);
78 void appMessage( const QCString &, const QByteArray &); 78 void appMessage( const QCString &, const QByteArray &);
79 void setProgressStyle(); 79 void setProgressStyle();
80 80
81protected: 81protected:
82 void paletteChange( const QPalette &p ); 82 void paletteChange( const QPalette &p );
83 void styleChange( QStyle & ); 83 void styleChange( QStyle & );
84 void reCheckDoctab(int how);
84 85
85private: 86private:
86 Launcher *launcher; 87 Launcher *launcher;
87 LauncherView *docview; 88 LauncherView *docview;
88 89
89 QWidgetStack *stack; 90 QWidgetStack *stack;
90 LauncherView *docLoadingWidget; 91 LauncherView *docLoadingWidget;
91 QProgressBar *docLoadingWidgetProgress; 92 QProgressBar *docLoadingWidgetProgress;
92 bool docLoadingWidgetEnabled; 93 bool docLoadingWidgetEnabled;
93 bool docTabEnabled; 94 bool docTabEnabled;
94 int m_DocumentTabId; 95 int m_DocumentTabId;
95}; 96};
diff --git a/core/launcher/launcherview.cpp b/core/launcher/launcherview.cpp
index c9efacb..2783423 100644
--- a/core/launcher/launcherview.cpp
+++ b/core/launcher/launcherview.cpp
@@ -323,27 +323,24 @@ int LauncherIconView::compare(const AppLnk* a, const AppLnk* b)
323} 323}
324 324
325void LauncherIconView::setSortMethod( SortMethod m ) 325void LauncherIconView::setSortMethod( SortMethod m )
326{ 326{
327 if ( sortmeth != m ) { 327 if ( sortmeth != m ) {
328 sortmeth = m; 328 sortmeth = m;
329 sort(); 329 sort();
330 } 330 }
331} 331}
332 332
333void LauncherIconView::setCategoryFilter( int catfilter, bool resort ) 333void LauncherIconView::setCategoryFilter( int catfilter, bool resort )
334{ 334{
335 Categories cat;
336 cat.load( categoryFileName() );
337 QString str;
338 if ( catfilter == -2 ) 335 if ( catfilter == -2 )
339 cf = 0; 336 cf = 0;
340 else 337 else
341 cf = catfilter; 338 cf = catfilter;
342 hideOrShowItems(resort); 339 hideOrShowItems(resort);
343} 340}
344 341
345void LauncherIconView::setTypeFilter(const QString& typefilter, bool resort) 342void LauncherIconView::setTypeFilter(const QString& typefilter, bool resort)
346{ 343{
347 tf = QRegExp(typefilter,FALSE,TRUE); 344 tf = QRegExp(typefilter,FALSE,TRUE);
348 hideOrShowItems(resort); 345 hideOrShowItems(resort);
349} 346}
@@ -1074,24 +1071,25 @@ void LauncherView::itemPressed( int btn, QIconViewItem *item )
1074 AppLnk *appLnk = ((LauncherItem *)item)->appLnk(); 1071 AppLnk *appLnk = ((LauncherItem *)item)->appLnk();
1075 if ( btn == RightButton ) 1072 if ( btn == RightButton )
1076 emit rightPressed( appLnk ); 1073 emit rightPressed( appLnk );
1077 else if ( btn == ShiftButton ) 1074 else if ( btn == ShiftButton )
1078 emit rightPressed( appLnk ); 1075 emit rightPressed( appLnk );
1079 item->setSelected(FALSE); 1076 item->setSelected(FALSE);
1080 } 1077 }
1081} 1078}
1082 1079
1083void LauncherView::removeAllItems() 1080void LauncherView::removeAllItems()
1084{ 1081{
1085 odebug << "LauncherView::removeAllItems()" << oendl; 1082 odebug << "LauncherView::removeAllItems()" << oendl;
1083 if (LauncherIconView::sm_EyeCache) LauncherIconView::sm_EyeCache->clear();
1086 icons->clear(); 1084 icons->clear();
1087} 1085}
1088 1086
1089bool LauncherView::removeLink(const QString& linkfile) 1087bool LauncherView::removeLink(const QString& linkfile)
1090{ 1088{
1091 return icons->removeLink(linkfile); 1089 return icons->removeLink(linkfile);
1092} 1090}
1093 1091
1094void LauncherView::addItem(AppLnk* app, bool resort) 1092void LauncherView::addItem(AppLnk* app, bool resort)
1095{ 1093{
1096 icons->addItem(app,resort); 1094 icons->addItem(app,resort);
1097} 1095}
diff --git a/core/launcher/server.cpp b/core/launcher/server.cpp
index 42186d3..15cd686 100644
--- a/core/launcher/server.cpp
+++ b/core/launcher/server.cpp
@@ -333,24 +333,26 @@ void Server::systemMsg(const QCString &msg, const QByteArray &data)
333#warning FIXME support TempScreenSaverMode 333#warning FIXME support TempScreenSaverMode
334#if 0 334#if 0
335 } else if ( msg == "setTempScreenSaverMode(int,int)" ) { 335 } else if ( msg == "setTempScreenSaverMode(int,int)" ) {
336 int mode, pid; 336 int mode, pid;
337 stream >> mode >> pid; 337 stream >> mode >> pid;
338 tsmMonitor->setTempMode(mode, pid); 338 tsmMonitor->setTempMode(mode, pid);
339#endif 339#endif
340 } else if ( msg == "linkChanged(QString)" ) { 340 } else if ( msg == "linkChanged(QString)" ) {
341 QString link; 341 QString link;
342 stream >> link; 342 stream >> link;
343 odebug << "desktop.cpp systemMsg -> linkchanged( " << link << " )" << oendl; 343 odebug << "desktop.cpp systemMsg -> linkchanged( " << link << " )" << oendl;
344 docList->linkChanged(link); 344 docList->linkChanged(link);
345 } else if (msg =="reforceDocuments()") {
346 docList->reforceDocuments();
345 } else if ( msg == "serviceChanged(QString)" ) { 347 } else if ( msg == "serviceChanged(QString)" ) {
346 MimeType::updateApplications(); 348 MimeType::updateApplications();
347 } else if ( msg == "mkdir(QString)" ) { 349 } else if ( msg == "mkdir(QString)" ) {
348 QString dir; 350 QString dir;
349 stream >> dir; 351 stream >> dir;
350 if ( !dir.isEmpty() ) 352 if ( !dir.isEmpty() )
351 mkdir( dir ); 353 mkdir( dir );
352 } else if ( msg == "rdiffGenSig(QString,QString)" ) { 354 } else if ( msg == "rdiffGenSig(QString,QString)" ) {
353 QString baseFile, sigFile; 355 QString baseFile, sigFile;
354 stream >> baseFile >> sigFile; 356 stream >> baseFile >> sigFile;
355 QRsync::generateSignature( baseFile, sigFile ); 357 QRsync::generateSignature( baseFile, sigFile );
356 } else if ( msg == "rdiffGenDiff(QString,QString,QString)" ) { 358 } else if ( msg == "rdiffGenDiff(QString,QString,QString)" ) {