-rw-r--r-- | core/launcher/launcher.cpp | 4 | ||||
-rw-r--r-- | core/launcher/launcherview.cpp | 27 | ||||
-rw-r--r-- | core/launcher/launcherview.h | 1 |
3 files changed, 13 insertions, 19 deletions
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp index 010a2e9..5ec1cf8 100644 --- a/core/launcher/launcher.cpp +++ b/core/launcher/launcher.cpp | |||
@@ -600,13 +600,15 @@ void Launcher::properties( AppLnk *appLnk ) | |||
600 | if ( appLnk->type() == "Folder" ) { // No tr | 600 | if ( appLnk->type() == "Folder" ) { // No tr |
601 | // Not supported: flat is simpler for the user | 601 | // Not supported: flat is simpler for the user |
602 | } else { | 602 | } else { |
603 | /* ### libqtopia FIXME also moving docLnks... */ | 603 | /* ### libqtopia FIXME also moving docLnks... */ |
604 | LnkProperties prop(appLnk,0 ); | 604 | LnkProperties prop(appLnk,0 ); |
605 | 605 | ||
606 | QPEApplication::execDialog( &prop ); | 606 | if (QPEApplication::execDialog( &prop )==QDialog::Accepted && tabs->currentView()==tabs->docView()) { |
607 | tabs->docView()->updateTools(); | ||
608 | } | ||
607 | } | 609 | } |
608 | } | 610 | } |
609 | 611 | ||
610 | void Launcher::storageChanged( const QList<FileSystem> & ) | 612 | void Launcher::storageChanged( const QList<FileSystem> & ) |
611 | { | 613 | { |
612 | // ### update combo boxes if we had a combo box for the storage type | 614 | // ### update combo boxes if we had a combo box for the storage type |
diff --git a/core/launcher/launcherview.cpp b/core/launcher/launcherview.cpp index 72313e3..ff26133 100644 --- a/core/launcher/launcherview.cpp +++ b/core/launcher/launcherview.cpp | |||
@@ -273,12 +273,13 @@ LauncherIconView::LauncherIconView( QWidget* parent, const char* name ) | |||
273 | calculateGrid( Bottom ); | 273 | calculateGrid( Bottom ); |
274 | connect(&m_eyeTimer,SIGNAL(timeout()),this,SLOT(stopEyeTimer())); | 274 | connect(&m_eyeTimer,SIGNAL(timeout()),this,SLOT(stopEyeTimer())); |
275 | } | 275 | } |
276 | 276 | ||
277 | LauncherIconView::~LauncherIconView() | 277 | LauncherIconView::~LauncherIconView() |
278 | { | 278 | { |
279 | odebug << "LauncherIconView::~LauncherIconView()" << oendl; | ||
279 | #if 0 // debuggery | 280 | #if 0 // debuggery |
280 | QListIterator<AppLnk> it(hidden); | 281 | QListIterator<AppLnk> it(hidden); |
281 | AppLnk* l; | 282 | AppLnk* l; |
282 | while ((l=it.current())) { | 283 | while ((l=it.current())) { |
283 | ++it; | 284 | ++it; |
284 | //odebug << "" << l << ": hidden (should remove)" << oendl; | 285 | //odebug << "" << l << ": hidden (should remove)" << oendl; |
@@ -426,20 +427,13 @@ LauncherItem*LauncherIconView::findDocItem(const QString&fname) | |||
426 | } | 427 | } |
427 | 428 | ||
428 | void LauncherIconView::setEyePixmap(const QPixmap&aPixmap,const QString&aFile,int width) | 429 | void LauncherIconView::setEyePixmap(const QPixmap&aPixmap,const QString&aFile,int width) |
429 | { | 430 | { |
430 | int s = ( bigIcns ) ? AppLnk::bigIconSize() : AppLnk::smallIconSize(); | 431 | int s = ( bigIcns ) ? AppLnk::bigIconSize() : AppLnk::smallIconSize(); |
431 | if (s!=width) return; | 432 | if (s!=width) return; |
432 | LauncherItem*item = 0; | 433 | LauncherItem*item = findDocItem(aFile); |
433 | QMap<QString,LauncherItem*>::Iterator it; | ||
434 | if ( ( it = m_itemCache.find(aFile))!=m_itemCache.end()) { | ||
435 | item = it.data(); | ||
436 | m_itemCache.remove(it); | ||
437 | } else { | ||
438 | item = findDocItem(aFile); | ||
439 | } | ||
440 | if (!item||!item->isEyeImage()) return; | 434 | if (!item||!item->isEyeImage()) return; |
441 | item->setEyePixmap(aPixmap); | 435 | item->setEyePixmap(aPixmap); |
442 | } | 436 | } |
443 | 437 | ||
444 | void LauncherIconView::checkCallback() | 438 | void LauncherIconView::checkCallback() |
445 | { | 439 | { |
@@ -462,24 +456,22 @@ void LauncherIconView::addCheckItem(AppLnk* app) | |||
462 | void LauncherIconView::requestEyePix(const LauncherItem*item) | 456 | void LauncherIconView::requestEyePix(const LauncherItem*item) |
463 | { | 457 | { |
464 | if (!item) return; | 458 | if (!item) return; |
465 | if (item->isEyeImage()) { | 459 | if (item->isEyeImage()) { |
466 | checkCallback(); | 460 | checkCallback(); |
467 | int s = ( bigIcns ) ? AppLnk::bigIconSize() : AppLnk::smallIconSize(); | 461 | int s = ( bigIcns ) ? AppLnk::bigIconSize() : AppLnk::smallIconSize(); |
468 | m_itemCache[item->appLnk()->file()]=(LauncherItem*)item; | ||
469 | m_EyeCallBack->requestThumb(item->appLnk()->file(),s,s); | 462 | m_EyeCallBack->requestThumb(item->appLnk()->file(),s,s); |
470 | } | 463 | } |
471 | } | 464 | } |
472 | 465 | ||
473 | void LauncherIconView::stopEyeTimer() | 466 | void LauncherIconView::stopEyeTimer() |
474 | { | 467 | { |
475 | if (m_EyeCallBack) { | 468 | if (m_EyeCallBack) { |
476 | delete m_EyeCallBack; | 469 | delete m_EyeCallBack; |
477 | m_EyeCallBack=0; | 470 | m_EyeCallBack=0; |
478 | } | 471 | } |
479 | m_itemCache.clear(); | ||
480 | m_eyeTimer.stop(); | 472 | m_eyeTimer.stop(); |
481 | } | 473 | } |
482 | 474 | ||
483 | void LauncherIconView::addItem(AppLnk* app, bool resort) | 475 | void LauncherIconView::addItem(AppLnk* app, bool resort) |
484 | { | 476 | { |
485 | addCatsAndMimes(app); | 477 | addCatsAndMimes(app); |
@@ -701,36 +693,34 @@ void LauncherView::hideIcons() | |||
701 | 693 | ||
702 | void LauncherView::setToolsEnabled(bool y) | 694 | void LauncherView::setToolsEnabled(bool y) |
703 | { | 695 | { |
704 | if ( !y != !tools ) { | 696 | if ( !y != !tools ) { |
705 | if ( y ) { | 697 | if ( y ) { |
706 | tools = new QHBox(this); | 698 | tools = new QHBox(this); |
707 | |||
708 | // Type filter | 699 | // Type filter |
709 | typemb = new QComboBox(tools); | 700 | typemb = new QComboBox(tools); |
710 | QSizePolicy p = typemb->sizePolicy(); | 701 | QSizePolicy p = typemb->sizePolicy(); |
711 | p.setHorData(QSizePolicy::Expanding); | 702 | p.setHorData(QSizePolicy::Expanding); |
712 | typemb->setSizePolicy(p); | 703 | typemb->setSizePolicy(p); |
713 | |||
714 | // Category filter | 704 | // Category filter |
715 | updateTools(); | 705 | updateTools(); |
716 | tools->show(); | 706 | tools->show(); |
717 | |||
718 | } else { | 707 | } else { |
719 | delete tools; | 708 | delete tools; |
720 | tools = 0; | 709 | tools = 0; |
721 | } | 710 | } |
722 | } | 711 | } |
723 | } | 712 | } |
724 | 713 | ||
725 | void LauncherView::updateTools() | 714 | void LauncherView::updateTools() |
726 | { | 715 | { |
727 | disconnect( typemb, SIGNAL(activated(int)), | 716 | disconnect( typemb, SIGNAL(activated(int)), |
728 | this, SLOT(showType(int)) ); | 717 | this, SLOT(showType(int)) ); |
729 | if ( catmb ) disconnect( catmb, SIGNAL(signalSelected(int)), | 718 | if ( catmb ) { |
730 | this, SLOT(showCategory(int)) ); | 719 | disconnect( catmb, SIGNAL(signalSelected(int)),this,SLOT(showCategory(int))); |
720 | } | ||
731 | 721 | ||
732 | // ### I want to remove this | 722 | // ### I want to remove this |
733 | icons->updateCategoriesAndMimeTypes(); | 723 | icons->updateCategoriesAndMimeTypes(); |
734 | 724 | ||
735 | QString prev; | 725 | QString prev; |
736 | 726 | ||
@@ -758,14 +748,15 @@ void LauncherView::updateTools() | |||
758 | for (int i=0; i<typemb->count(); i++) { | 748 | for (int i=0; i<typemb->count(); i++) { |
759 | if ( typemb->text(i) == prev ) { | 749 | if ( typemb->text(i) == prev ) { |
760 | typemb->setCurrentItem(i); | 750 | typemb->setCurrentItem(i); |
761 | break; | 751 | break; |
762 | } | 752 | } |
763 | } | 753 | } |
764 | if ( prev.isNull() ) | 754 | if ( prev.isNull() ) { |
765 | typemb->setCurrentItem(typemb->count()-1); | 755 | typemb->setCurrentItem(typemb->count()-1); |
756 | } | ||
766 | 757 | ||
767 | int pcat = catmb ? catmb->currentCategory() : -2; | 758 | int pcat = catmb ? catmb->currentCategory() : -2; |
768 | if ( !catmb ) | 759 | if ( !catmb ) |
769 | catmb = new CategorySelect(tools); | 760 | catmb = new CategorySelect(tools); |
770 | Categories cats( 0 ); | 761 | Categories cats( 0 ); |
771 | cats.load( categoryFileName() ); | 762 | cats.load( categoryFileName() ); |
@@ -805,12 +796,13 @@ void LauncherView::showCategory( int c ) | |||
805 | { | 796 | { |
806 | icons->setCategoryFilter( c, TRUE ); | 797 | icons->setCategoryFilter( c, TRUE ); |
807 | } | 798 | } |
808 | 799 | ||
809 | void LauncherView::setViewMode( ViewMode m ) | 800 | void LauncherView::setViewMode( ViewMode m ) |
810 | { | 801 | { |
802 | odebug << "LauncherView::setViewMode( ViewMode m )" << oendl; | ||
811 | if ( vmode != m ) { | 803 | if ( vmode != m ) { |
812 | bool bigIcons = m == Icon; | 804 | bool bigIcons = m == Icon; |
813 | icons->viewport()->setUpdatesEnabled( FALSE ); | 805 | icons->viewport()->setUpdatesEnabled( FALSE ); |
814 | icons->setBigIcons( bigIcons ); | 806 | icons->setBigIcons( bigIcons ); |
815 | switch ( m ) { | 807 | switch ( m ) { |
816 | case List: | 808 | case List: |
@@ -1043,12 +1035,13 @@ void LauncherView::itemPressed( int btn, QIconViewItem *item ) | |||
1043 | item->setSelected(FALSE); | 1035 | item->setSelected(FALSE); |
1044 | } | 1036 | } |
1045 | } | 1037 | } |
1046 | 1038 | ||
1047 | void LauncherView::removeAllItems() | 1039 | void LauncherView::removeAllItems() |
1048 | { | 1040 | { |
1041 | odebug << "LauncherView::removeAllItems()" << oendl; | ||
1049 | icons->clear(); | 1042 | icons->clear(); |
1050 | } | 1043 | } |
1051 | 1044 | ||
1052 | bool LauncherView::removeLink(const QString& linkfile) | 1045 | bool LauncherView::removeLink(const QString& linkfile) |
1053 | { | 1046 | { |
1054 | return icons->removeLink(linkfile); | 1047 | return icons->removeLink(linkfile); |
@@ -1165,13 +1158,13 @@ void LauncherThumbReceiver::requestThumb(const QString&file,int width,int height | |||
1165 | { | 1158 | { |
1166 | PixmapInfo rItem; | 1159 | PixmapInfo rItem; |
1167 | rItem.file = file; | 1160 | rItem.file = file; |
1168 | rItem.width = width; | 1161 | rItem.width = width; |
1169 | rItem.height = height; | 1162 | rItem.height = height; |
1170 | m_inThumbNail.append(rItem); | 1163 | m_inThumbNail.append(rItem); |
1171 | QTimer::singleShot(0, this, SLOT(sendRequest())); | 1164 | QTimer::singleShot(2, this, SLOT(sendRequest())); |
1172 | } | 1165 | } |
1173 | 1166 | ||
1174 | void LauncherThumbReceiver::sendRequest() | 1167 | void LauncherThumbReceiver::sendRequest() |
1175 | { | 1168 | { |
1176 | if (m_inThumbNail.count()>0) { | 1169 | if (m_inThumbNail.count()>0) { |
1177 | QCopEnvelope env("QPE/opie-eye_slave", "pixmapInfos(PixmapInfos)" ); | 1170 | QCopEnvelope env("QPE/opie-eye_slave", "pixmapInfos(PixmapInfos)" ); |
diff --git a/core/launcher/launcherview.h b/core/launcher/launcherview.h index 94c367c..6d94539 100644 --- a/core/launcher/launcherview.h +++ b/core/launcher/launcherview.h | |||
@@ -237,10 +237,9 @@ private: | |||
237 | LauncherThumbReceiver*m_EyeCallBack; | 237 | LauncherThumbReceiver*m_EyeCallBack; |
238 | #ifdef USE_ANIMATED_BUSY_ICON_OVERLAY | 238 | #ifdef USE_ANIMATED_BUSY_ICON_OVERLAY |
239 | QPixmap busyPix; | 239 | QPixmap busyPix; |
240 | #endif | 240 | #endif |
241 | BusyIndicatorType busyType; | 241 | BusyIndicatorType busyType; |
242 | QTimer m_eyeTimer; | 242 | QTimer m_eyeTimer; |
243 | QMap<QString,LauncherItem*> m_itemCache; | ||
244 | }; | 243 | }; |
245 | 244 | ||
246 | #endif // LAUNCHERVIEW_H | 245 | #endif // LAUNCHERVIEW_H |