summaryrefslogtreecommitdiff
path: root/core
Unidiff
Diffstat (limited to 'core') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/documentlist.cpp22
-rw-r--r--core/launcher/launcher.cpp16
-rw-r--r--core/launcher/launcher.h2
3 files changed, 15 insertions, 25 deletions
diff --git a/core/launcher/documentlist.cpp b/core/launcher/documentlist.cpp
index dcea4b9..1a7de33 100644
--- a/core/launcher/documentlist.cpp
+++ b/core/launcher/documentlist.cpp
@@ -51,120 +51,110 @@ AppLnkSet *DocumentList::appLnkSet = 0;
51static const int MAX_SEARCH_DEPTH = 10; 51static const int MAX_SEARCH_DEPTH = 10;
52 52
53 53
54class DocumentListPrivate : public QObject { 54class DocumentListPrivate : public QObject {
55 Q_OBJECT 55 Q_OBJECT
56public: 56public:
57 DocumentListPrivate( ServerInterface *gui ); 57 DocumentListPrivate( ServerInterface *gui );
58 ~DocumentListPrivate(); 58 ~DocumentListPrivate();
59 59
60 void initialize(); 60 void initialize();
61 61
62 const QString nextFile(); 62 const QString nextFile();
63 const DocLnk *iterate(); 63 const DocLnk *iterate();
64 bool store( DocLnk* dl ); 64 bool store( DocLnk* dl );
65 void estimatedPercentScanned(); 65 void estimatedPercentScanned();
66 66
67 DocLnkSet dls; 67 DocLnkSet dls;
68 QDict<void> reference; 68 QDict<void> reference;
69 QDictIterator<void> *dit; 69 QDictIterator<void> *dit;
70 enum { Find, RemoveKnownFiles, MakeUnknownFiles, Done } state; 70 enum { Find, RemoveKnownFiles, MakeUnknownFiles, Done } state;
71 71
72 QStringList docPaths; 72 QStringList docPaths;
73 unsigned int docPathsSearched; 73 unsigned int docPathsSearched;
74 74
75 int searchDepth; 75 int searchDepth;
76 QDir *listDirs[MAX_SEARCH_DEPTH]; 76 QDir *listDirs[MAX_SEARCH_DEPTH];
77 const QFileInfoList *lists[MAX_SEARCH_DEPTH]; 77 const QFileInfoList *lists[MAX_SEARCH_DEPTH];
78 unsigned int listPositions[MAX_SEARCH_DEPTH]; 78 unsigned int listPositions[MAX_SEARCH_DEPTH];
79 79
80 StorageInfo *storage; 80 StorageInfo *storage;
81 81
82 int tid; 82 int tid;
83 83
84 ServerInterface *serverGui; 84 ServerInterface *serverGui;
85 85
86 bool needToSendAllDocLinks; 86 bool needToSendAllDocLinks;
87 bool sendAppLnks; 87 bool sendAppLnks;
88 bool sendDocLnks; 88 bool sendDocLnks;
89 bool scanDocs; 89 bool scanDocs;
90}; 90};
91 91
92 92
93DocumentList::DocumentList( ServerInterface *serverGui, bool scanDocs, 93DocumentList::DocumentList( ServerInterface *serverGui, bool scanDocs,
94 QObject *parent, const char *name ) 94 QObject *parent, const char *name )
95 : QObject( parent, name ) 95 : QObject( parent, name )
96{ 96{
97 appLnkSet = new AppLnkSet( MimeType::appsFolderName() ); 97 appLnkSet = new AppLnkSet( MimeType::appsFolderName() );
98 d = new DocumentListPrivate( serverGui ); 98 d = new DocumentListPrivate( serverGui );
99 d->scanDocs = scanDocs;
100 d->needToSendAllDocLinks = false; 99 d->needToSendAllDocLinks = false;
101 100
101 Config cfg( "Launcher" );
102 cfg.setGroup( "DocTab" );
103 d->scanDocs = cfg.readBoolEntry( "Enable", true );
104 qDebug( "DocumentList::DocumentList() : scanDocs = %d", d->scanDocs );
105
102 QTimer::singleShot( 10, this, SLOT( startInitialScan() ) ); 106 QTimer::singleShot( 10, this, SLOT( startInitialScan() ) );
103} 107}
104 108
105void DocumentList::startInitialScan() 109void DocumentList::startInitialScan()
106{ 110{
107 reloadAppLnks(); 111 reloadAppLnks();
108 112 reloadDocLnks();
109 Config cfg( "Launcher" );
110 cfg.setGroup( "DocTab" );
111 bool docTabEnabled = cfg.readBoolEntry( "Enable", true );
112 if ( docTabEnabled )
113 reloadDocLnks();
114 else
115 {
116 if ( d->sendDocLnks && d->serverGui )
117 {
118 d->serverGui->documentScanningProgress( 0 );
119 d->serverGui->allDocumentsRemoved();
120 }
121 }
122
123} 113}
124 114
125DocumentList::~DocumentList() 115DocumentList::~DocumentList()
126{ 116{
127 delete appLnkSet; 117 delete appLnkSet;
128 delete d; 118 delete d;
129} 119}
130 120
131 121
132void DocumentList::add( const DocLnk& doc ) 122void DocumentList::add( const DocLnk& doc )
133{ 123{
134 if ( d->serverGui && QFile::exists( doc.file() ) ) 124 if ( d->serverGui && QFile::exists( doc.file() ) )
135 d->serverGui->documentAdded( doc ); 125 d->serverGui->documentAdded( doc );
136} 126}
137 127
138 128
139void DocumentList::start() 129void DocumentList::start()
140{ 130{
141 resume(); 131 resume();
142} 132}
143 133
144 134
145void DocumentList::pause() 135void DocumentList::pause()
146{ 136{
147 //qDebug("pause %i", d->tid); 137 //qDebug("pause %i", d->tid);
148 killTimer( d->tid ); 138 killTimer( d->tid );
149 d->tid = 0; 139 d->tid = 0;
150} 140}
151 141
152 142
153void DocumentList::resume() 143void DocumentList::resume()
154{ 144{
155 if ( d->tid == 0 ) { 145 if ( d->tid == 0 ) {
156 d->tid = startTimer( 0 ); 146 d->tid = startTimer( 0 );
157 //qDebug("resumed %i", d->tid); 147 //qDebug("resumed %i", d->tid);
158 } 148 }
159} 149}
160 150
161/* 151/*
162void DocumentList::resend() 152void DocumentList::resend()
163{ 153{
164 // Re-emits all the added items to the list (firstly letting everyone know to 154 // Re-emits all the added items to the list (firstly letting everyone know to
165 // clear what they have as it is being sent again) 155 // clear what they have as it is being sent again)
166 pause(); 156 pause();
167 emit allRemoved(); 157 emit allRemoved();
168 QTimer::singleShot( 5, this, SLOT( resendWorker() ) ); 158 QTimer::singleShot( 5, this, SLOT( resendWorker() ) );
169} 159}
170 160
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp
index b312672..344cd46 100644
--- a/core/launcher/launcher.cpp
+++ b/core/launcher/launcher.cpp
@@ -107,96 +107,97 @@ LauncherTabWidget::LauncherTabWidget( Launcher* parent ) :
107#endif 107#endif
108 108
109 createDocLoadingWidget(); 109 createDocLoadingWidget();
110} 110}
111 111
112void LauncherTabWidget::createDocLoadingWidget() 112void LauncherTabWidget::createDocLoadingWidget()
113{ 113{
114 // Construct the 'doc loading widget' shown when finding documents 114 // Construct the 'doc loading widget' shown when finding documents
115 115
116 // ### LauncherView class needs changing to be more generic so 116 // ### LauncherView class needs changing to be more generic so
117 // this widget can change its background similar to the iconviews 117 // this widget can change its background similar to the iconviews
118 // so the background for this matches 118 // so the background for this matches
119 docLoadingWidget = new LauncherView( stack ); 119 docLoadingWidget = new LauncherView( stack );
120 docLoadingWidget->hideIcons(); 120 docLoadingWidget->hideIcons();
121 QVBox *docLoadingVBox = new QVBox( docLoadingWidget ); 121 QVBox *docLoadingVBox = new QVBox( docLoadingWidget );
122 122
123 docLoadingVBox->setSpacing( 20 ); 123 docLoadingVBox->setSpacing( 20 );
124 docLoadingVBox->setMargin( 10 ); 124 docLoadingVBox->setMargin( 10 );
125 125
126 QWidget *space1 = new QWidget( docLoadingVBox ); 126 QWidget *space1 = new QWidget( docLoadingVBox );
127 docLoadingVBox->setStretchFactor( space1, 1 ); 127 docLoadingVBox->setStretchFactor( space1, 1 );
128 128
129 QLabel *waitPixmap = new QLabel( docLoadingVBox ); 129 QLabel *waitPixmap = new QLabel( docLoadingVBox );
130 waitPixmap->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, waitPixmap->sizePolicy().hasHeightForWidth() ) ); 130 waitPixmap->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, waitPixmap->sizePolicy().hasHeightForWidth() ) );
131 waitPixmap->setPixmap( Resource::loadPixmap( "bigwait" ) ); 131 waitPixmap->setPixmap( Resource::loadPixmap( "bigwait" ) );
132 waitPixmap->setAlignment( int( QLabel::AlignCenter ) ); 132 waitPixmap->setAlignment( int( QLabel::AlignCenter ) );
133 133
134 Config cfg( "Launcher" ); 134 Config cfg( "Launcher" );
135 cfg.setGroup( "DocTab" ); 135 cfg.setGroup( "DocTab" );
136 bool docTabEnabled = cfg.readBoolEntry( "Enable", true ); 136 bool docTabEnabled = cfg.readBoolEntry( "Enable", true );
137 137
138 QLabel *textLabel = new QLabel( docLoadingVBox ); 138 QLabel *textLabel = new QLabel( docLoadingVBox );
139 textLabel->setAlignment( int( QLabel::AlignCenter ) ); 139 textLabel->setAlignment( int( QLabel::AlignCenter ) );
140 docLoadingWidgetProgress = new QProgressBar( docLoadingVBox ); 140 docLoadingWidgetProgress = new QProgressBar( docLoadingVBox );
141 docLoadingWidgetProgress->setProgress( 0 ); 141 docLoadingWidgetProgress->setProgress( 0 );
142 docLoadingWidgetProgress->setCenterIndicator( TRUE ); 142 docLoadingWidgetProgress->setCenterIndicator( TRUE );
143 docLoadingWidgetProgress->setBackgroundMode( NoBackground ); // No flicker 143 docLoadingWidgetProgress->setBackgroundMode( NoBackground ); // No flicker
144 setProgressStyle(); 144 setProgressStyle();
145 145
146 if ( docTabEnabled ) 146 if ( docTabEnabled )
147 { 147 {
148 textLabel->setText( tr( "<b>Finding Documents...</b>" ) ); 148 textLabel->setText( tr( "<b>Finding Documents...</b>" ) );
149 } 149 }
150 else 150 else
151 { 151 {
152 textLabel->setText( tr( "<b>The Documents Tab<p>has been disabled.<p>" 152 textLabel->setText( tr( "<b>The Documents Tab<p>has been disabled.<p>"
153 "Use Settings->Launcher->DocTab<p>to reenable it.</b></center>" ) ); 153 "Use Settings->Launcher->DocTab<p>to reenable it.</b></center>" ) );
154 docLoadingWidgetProgress->hide(); 154 docLoadingWidgetProgress->hide();
155 docLoadingWidgetEnabled = true;
155 } 156 }
156 157
157 QWidget *space2 = new QWidget( docLoadingVBox ); 158 QWidget *space2 = new QWidget( docLoadingVBox );
158 docLoadingVBox->setStretchFactor( space2, 1 ); 159 docLoadingVBox->setStretchFactor( space2, 1 );
159 160
160 cfg.setGroup( "Tab Documents" ); // No tr 161 cfg.setGroup( "Tab Documents" ); // No tr
161 setTabViewAppearance( docLoadingWidget, cfg ); 162 setTabViewAppearance( docLoadingWidget, cfg );
162 163
163 stack->addWidget( docLoadingWidget, 0 ); 164 stack->addWidget( docLoadingWidget, 0 );
164} 165}
165 166
166void LauncherTabWidget::initLayout() 167void LauncherTabWidget::initLayout()
167{ 168{
168 layout()->activate(); 169 layout()->activate();
169 docView()->setFocus(); 170 docView()->setFocus();
170 categoryBar->showTab("Documents"); 171 categoryBar->showTab("Documents");
171} 172}
172 173
173void LauncherTabWidget::appMessage(const QCString& message, const QByteArray&) 174void LauncherTabWidget::appMessage(const QCString& message, const QByteArray&)
174{ 175{
175 if ( message == "nextView()" ) 176 if ( message == "nextView()" )
176 categoryBar->nextTab(); 177 categoryBar->nextTab();
177} 178}
178 179
179void LauncherTabWidget::raiseTabWidget() 180void LauncherTabWidget::raiseTabWidget()
180{ 181{
181 if ( categoryBar->currentView() == docView() 182 if ( categoryBar->currentView() == docView()
182 && docLoadingWidgetEnabled ) { 183 && docLoadingWidgetEnabled ) {
183 stack->raiseWidget( docLoadingWidget ); 184 stack->raiseWidget( docLoadingWidget );
184 docLoadingWidget->updateGeometry(); 185 docLoadingWidget->updateGeometry();
185 } else { 186 } else {
186 stack->raiseWidget( categoryBar->currentView() ); 187 stack->raiseWidget( categoryBar->currentView() );
187 } 188 }
188} 189}
189 190
190void LauncherTabWidget::tabProperties() 191void LauncherTabWidget::tabProperties()
191{ 192{
192 LauncherView *view = categoryBar->currentView(); 193 LauncherView *view = categoryBar->currentView();
193 QPopupMenu *m = new QPopupMenu( this ); 194 QPopupMenu *m = new QPopupMenu( this );
194 m->insertItem( tr("Icon View"), LauncherView::Icon ); 195 m->insertItem( tr("Icon View"), LauncherView::Icon );
195 m->insertItem( tr("List View"), LauncherView::List ); 196 m->insertItem( tr("List View"), LauncherView::List );
196 m->setItemChecked( (int)view->viewMode(), TRUE ); 197 m->setItemChecked( (int)view->viewMode(), TRUE );
197 int rv = m->exec( QCursor::pos() ); 198 int rv = m->exec( QCursor::pos() );
198 if ( rv >= 0 && rv != view->viewMode() ) { 199 if ( rv >= 0 && rv != view->viewMode() ) {
199 view->setViewMode( (LauncherView::ViewMode)rv ); 200 view->setViewMode( (LauncherView::ViewMode)rv );
200 } 201 }
201 202
202 delete m; 203 delete m;
@@ -456,96 +457,103 @@ void Launcher::createGUI()
456 tb = new TaskBar; 457 tb = new TaskBar;
457 tabs = new LauncherTabWidget( this ); 458 tabs = new LauncherTabWidget( this );
458 setCentralWidget( tabs ); 459 setCentralWidget( tabs );
459 460
460 ServerInterface::dockWidget( tb, ServerInterface::Bottom ); 461 ServerInterface::dockWidget( tb, ServerInterface::Bottom );
461 tb->show(); 462 tb->show();
462 463
463 qApp->installEventFilter( this ); 464 qApp->installEventFilter( this );
464 465
465 466
466 connect( qApp, SIGNAL(symbol()), this, SLOT(toggleSymbolInput()) ); 467 connect( qApp, SIGNAL(symbol()), this, SLOT(toggleSymbolInput()) );
467 connect( qApp, SIGNAL(numLockStateToggle()), this, SLOT(toggleNumLockState()) ); 468 connect( qApp, SIGNAL(numLockStateToggle()), this, SLOT(toggleNumLockState()) );
468 connect( qApp, SIGNAL(capsLockStateToggle()), this, SLOT(toggleCapsLockState()) ); 469 connect( qApp, SIGNAL(capsLockStateToggle()), this, SLOT(toggleCapsLockState()) );
469 470
470 connect( tb, SIGNAL(tabSelected(const QString&)), 471 connect( tb, SIGNAL(tabSelected(const QString&)),
471 this, SLOT(showTab(const QString&)) ); 472 this, SLOT(showTab(const QString&)) );
472 connect( tabs, SIGNAL(selected(const QString&)), 473 connect( tabs, SIGNAL(selected(const QString&)),
473 this, SLOT(viewSelected(const QString&)) ); 474 this, SLOT(viewSelected(const QString&)) );
474 connect( tabs, SIGNAL(clicked(const AppLnk*)), 475 connect( tabs, SIGNAL(clicked(const AppLnk*)),
475 this, SLOT(select(const AppLnk*))); 476 this, SLOT(select(const AppLnk*)));
476 connect( tabs, SIGNAL(rightPressed(AppLnk*)), 477 connect( tabs, SIGNAL(rightPressed(AppLnk*)),
477 this, SLOT(properties(AppLnk*))); 478 this, SLOT(properties(AppLnk*)));
478 479
479#if defined(Q_WS_QWS) && !defined(QT_NO_COP) 480#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
480 QCopChannel* sysChannel = new QCopChannel( "QPE/System", this ); 481 QCopChannel* sysChannel = new QCopChannel( "QPE/System", this );
481 connect( sysChannel, SIGNAL(received(const QCString &, const QByteArray &)), 482 connect( sysChannel, SIGNAL(received(const QCString &, const QByteArray &)),
482 this, SLOT(systemMessage( const QCString &, const QByteArray &)) ); 483 this, SLOT(systemMessage( const QCString &, const QByteArray &)) );
483#endif 484#endif
484 485
485 // all documents 486 // all documents
486 QImage img( Resource::loadImage( "DocsIcon" ) ); 487 QImage img( Resource::loadImage( "DocsIcon" ) );
487 QPixmap pm; 488 QPixmap pm;
488 pm = img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ); 489 pm = img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() );
489 // It could add this itself if it handles docs 490 // It could add this itself if it handles docs
490 491
491 tabs->newView("Documents", pm, tr("Documents") )->setToolsEnabled( TRUE ); 492 tabs->newView("Documents", pm, tr("Documents") )->setToolsEnabled( TRUE );
492 493
493 QTimer::singleShot( 0, tabs, SLOT( initLayout() ) ); 494 QTimer::singleShot( 0, tabs, SLOT( initLayout() ) );
494 qApp->setMainWidget( this ); 495 qApp->setMainWidget( this );
495 QTimer::singleShot( 500, this, SLOT( makeVisible() ) ); 496 QTimer::singleShot( 500, this, SLOT( makeVisible() ) );
496} 497}
497 498
498Launcher::~Launcher() 499Launcher::~Launcher()
499{ 500{
500 if ( tb ) 501 if ( tb )
501 destroyGUI(); 502 destroyGUI();
502} 503}
503 504
505 bool Launcher::requiresDocuments() const
506 {
507 Config cfg( "Launcher" );
508 cfg.setGroup( "DocTab" );
509 return cfg.readBoolEntry( "Enable", true );
510}
511
504void Launcher::makeVisible() 512void Launcher::makeVisible()
505{ 513{
506 showMaximized(); 514 showMaximized();
507} 515}
508 516
509void Launcher::destroyGUI() 517void Launcher::destroyGUI()
510{ 518{
511 delete tb; 519 delete tb;
512 tb = 0; 520 tb = 0;
513 delete tabs; 521 delete tabs;
514 tabs =0; 522 tabs =0;
515} 523}
516 524
517bool Launcher::eventFilter( QObject*, QEvent *ev ) 525bool Launcher::eventFilter( QObject*, QEvent *ev )
518{ 526{
519#ifdef QT_QWS_CUSTOM 527#ifdef QT_QWS_CUSTOM
520 if ( ev->type() == QEvent::KeyPress ) { 528 if ( ev->type() == QEvent::KeyPress ) {
521 QKeyEvent *ke = (QKeyEvent *)ev; 529 QKeyEvent *ke = (QKeyEvent *)ev;
522 if ( ke->key() == Qt::Key_F11 ) { // menu key 530 if ( ke->key() == Qt::Key_F11 ) { // menu key
523 QWidget *active = qApp->activeWindow(); 531 QWidget *active = qApp->activeWindow();
524 if ( active && active->isPopup() ) 532 if ( active && active->isPopup() )
525 active->close(); 533 active->close();
526 else { 534 else {
527 Global::terminateBuiltin("calibrate"); // No tr 535 Global::terminateBuiltin("calibrate"); // No tr
528 tb->launchStartMenu(); 536 tb->launchStartMenu();
529 } 537 }
530 return TRUE; 538 return TRUE;
531 } 539 }
532 } 540 }
533#else 541#else
534 Q_UNUSED(ev); 542 Q_UNUSED(ev);
535#endif 543#endif
536 return FALSE; 544 return FALSE;
537} 545}
538 546
539void Launcher::toggleSymbolInput() 547void Launcher::toggleSymbolInput()
540{ 548{
541 tb->toggleSymbolInput(); 549 tb->toggleSymbolInput();
542} 550}
543 551
544void Launcher::toggleNumLockState() 552void Launcher::toggleNumLockState()
545{ 553{
546 tb->toggleNumLockState(); 554 tb->toggleNumLockState();
547} 555}
548 556
549void Launcher::toggleCapsLockState() 557void Launcher::toggleCapsLockState()
550{ 558{
551 tb->toggleCapsLockState(); 559 tb->toggleCapsLockState();
@@ -704,77 +712,69 @@ void Launcher::showDocTab()
704 tabs->docView()->show(); 712 tabs->docView()->show();
705} 713}
706 714
707void Launcher::documentRemoved( const DocLnk& doc ) 715void Launcher::documentRemoved( const DocLnk& doc )
708{ 716{
709 tabs->docView()->removeLink( doc.linkFile() ); 717 tabs->docView()->removeLink( doc.linkFile() );
710} 718}
711 719
712void Launcher::documentChanged( const DocLnk& oldDoc, const DocLnk& newDoc ) 720void Launcher::documentChanged( const DocLnk& oldDoc, const DocLnk& newDoc )
713{ 721{
714 documentRemoved( oldDoc ); 722 documentRemoved( oldDoc );
715 documentAdded( newDoc ); 723 documentAdded( newDoc );
716} 724}
717 725
718void Launcher::allDocumentsRemoved() 726void Launcher::allDocumentsRemoved()
719{ 727{
720 tabs->docView()->removeAllItems(); 728 tabs->docView()->removeAllItems();
721} 729}
722 730
723void Launcher::applicationStateChanged( const QString& name, ApplicationState state ) 731void Launcher::applicationStateChanged( const QString& name, ApplicationState state )
724{ 732{
725 tb->setApplicationState( name, state ); 733 tb->setApplicationState( name, state );
726} 734}
727 735
728void Launcher::applicationScanningProgress( int percent ) 736void Launcher::applicationScanningProgress( int percent )
729{ 737{
730 switch ( percent ) { 738 switch ( percent ) {
731 case 0: { 739 case 0: {
732 for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) { 740 for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) {
733 tabs->view( (*it) )->setUpdatesEnabled( FALSE ); 741 tabs->view( (*it) )->setUpdatesEnabled( FALSE );
734 tabs->view( (*it) )->setSortEnabled( FALSE ); 742 tabs->view( (*it) )->setSortEnabled( FALSE );
735 } 743 }
736 break; 744 break;
737 } 745 }
738 case 100: { 746 case 100: {
739 for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) { 747 for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) {
740 tabs->view( (*it) )->setUpdatesEnabled( TRUE ); 748 tabs->view( (*it) )->setUpdatesEnabled( TRUE );
741 tabs->view( (*it) )->setSortEnabled( TRUE ); 749 tabs->view( (*it) )->setSortEnabled( TRUE );
742 } 750 }
743 break; 751 break;
744 } 752 }
745 default: 753 default:
746 break; 754 break;
747 } 755 }
748} 756}
749 757
750void Launcher::documentScanningProgress( int percent ) 758void Launcher::documentScanningProgress( int percent )
751{ 759{
752 if ( !docTabEnabled )
753 {
754 qDebug( "Launcher: document tab disabled!" );
755 tabs->setLoadingProgress( 100 );
756 tabs->setLoadingWidgetEnabled( TRUE );
757 return;
758 }
759
760 switch ( percent ) { 760 switch ( percent ) {
761 case 0: { 761 case 0: {
762 tabs->setLoadingProgress( 0 ); 762 tabs->setLoadingProgress( 0 );
763 tabs->setLoadingWidgetEnabled( TRUE ); 763 tabs->setLoadingWidgetEnabled( TRUE );
764 tabs->docView()->setUpdatesEnabled( FALSE ); 764 tabs->docView()->setUpdatesEnabled( FALSE );
765 tabs->docView()->setSortEnabled( FALSE ); 765 tabs->docView()->setSortEnabled( FALSE );
766 break; 766 break;
767 } 767 }
768 case 100: { 768 case 100: {
769 tabs->docView()->updateTools(); 769 tabs->docView()->updateTools();
770 tabs->docView()->setSortEnabled( TRUE ); 770 tabs->docView()->setSortEnabled( TRUE );
771 tabs->docView()->setUpdatesEnabled( TRUE ); 771 tabs->docView()->setUpdatesEnabled( TRUE );
772 tabs->setLoadingWidgetEnabled( FALSE ); 772 tabs->setLoadingWidgetEnabled( FALSE );
773 break; 773 break;
774 } 774 }
775 default: 775 default:
776 tabs->setLoadingProgress( percent ); 776 tabs->setLoadingProgress( percent );
777 break; 777 break;
778 } 778 }
779} 779}
780 780
diff --git a/core/launcher/launcher.h b/core/launcher/launcher.h
index 1d046ee..4f3ff8c 100644
--- a/core/launcher/launcher.h
+++ b/core/launcher/launcher.h
@@ -71,87 +71,87 @@ signals:
71protected slots: 71protected 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 84
85private: 85private:
86 Launcher *launcher; 86 Launcher *launcher;
87 LauncherView *docview; 87 LauncherView *docview;
88 88
89 QWidgetStack *stack; 89 QWidgetStack *stack;
90 LauncherView *docLoadingWidget; 90 LauncherView *docLoadingWidget;
91 QProgressBar *docLoadingWidgetProgress; 91 QProgressBar *docLoadingWidgetProgress;
92 bool docLoadingWidgetEnabled; 92 bool docLoadingWidgetEnabled;
93}; 93};
94 94
95class Launcher : public QMainWindow, public ServerInterface 95class Launcher : public QMainWindow, public ServerInterface
96{ 96{
97 Q_OBJECT 97 Q_OBJECT
98public: 98public:
99 Launcher(); 99 Launcher();
100 ~Launcher(); 100 ~Launcher();
101 101
102 // implementing ServerInterface 102 // implementing ServerInterface
103 void createGUI(); 103 void createGUI();
104 void destroyGUI(); 104 void destroyGUI();
105 void typeAdded( const QString& type, const QString& name, const QPixmap& pixmap, const QPixmap& bgPixmap ); 105 void typeAdded( const QString& type, const QString& name, const QPixmap& pixmap, const QPixmap& bgPixmap );
106 void typeRemoved( const QString& type ); 106 void typeRemoved( const QString& type );
107 void applicationAdded( const QString& type, const AppLnk& doc ); 107 void applicationAdded( const QString& type, const AppLnk& doc );
108 void applicationRemoved( const QString& type, const AppLnk& doc ); 108 void applicationRemoved( const QString& type, const AppLnk& doc );
109 void allApplicationsRemoved(); 109 void allApplicationsRemoved();
110 void applicationStateChanged( const QString& name, ApplicationState state ); 110 void applicationStateChanged( const QString& name, ApplicationState state );
111 void documentAdded( const DocLnk& doc ); 111 void documentAdded( const DocLnk& doc );
112 void documentRemoved( const DocLnk& doc ); 112 void documentRemoved( const DocLnk& doc );
113 void allDocumentsRemoved(); 113 void allDocumentsRemoved();
114 void documentChanged( const DocLnk& oldDoc, const DocLnk& newDoc ); 114 void documentChanged( const DocLnk& oldDoc, const DocLnk& newDoc );
115 void storageChanged( const QList<FileSystem> & ); 115 void storageChanged( const QList<FileSystem> & );
116 void applicationScanningProgress( int percent ); 116 void applicationScanningProgress( int percent );
117 void documentScanningProgress( int percent ); 117 void documentScanningProgress( int percent );
118 bool requiresApplications() const { return TRUE; } 118 bool requiresApplications() const { return TRUE; }
119 bool requiresDocuments() const { return TRUE; } 119 bool requiresDocuments() const;
120 void showLoadingDocs(); 120 void showLoadingDocs();
121 void showDocTab(); 121 void showDocTab();
122 122
123 QStringList idList() const { return ids; } 123 QStringList idList() const { return ids; }
124 124
125public slots: 125public slots:
126 void viewSelected(const QString&); 126 void viewSelected(const QString&);
127 void showTab(const QString&); 127 void showTab(const QString&);
128 void select( const AppLnk * ); 128 void select( const AppLnk * );
129 void properties( AppLnk * ); 129 void properties( AppLnk * );
130 void makeVisible(); 130 void makeVisible();
131 131
132signals: 132signals:
133 void executing( const AppLnk * ); 133 void executing( const AppLnk * );
134 134
135private slots: 135private slots:
136 void systemMessage( const QCString &, const QByteArray &); 136 void systemMessage( const QCString &, const QByteArray &);
137 void toggleSymbolInput(); 137 void toggleSymbolInput();
138 void toggleNumLockState(); 138 void toggleNumLockState();
139 void toggleCapsLockState(); 139 void toggleCapsLockState();
140 140
141protected: 141protected:
142 bool eventFilter( QObject *o, QEvent *ev ); 142 bool eventFilter( QObject *o, QEvent *ev );
143 143
144private: 144private:
145 void updateApps(); 145 void updateApps();
146 void loadDocs(); 146 void loadDocs();
147 void updateDocs(); 147 void updateDocs();
148 void updateTabs(); 148 void updateTabs();
149 149
150 LauncherTabWidget *tabs; 150 LauncherTabWidget *tabs;
151 QStringList ids; 151 QStringList ids;
152 TaskBar *tb; 152 TaskBar *tb;
153 153
154 bool docTabEnabled; 154 bool docTabEnabled;
155}; 155};
156 156
157#endif // LAUNCHERVIEW_H 157#endif // LAUNCHERVIEW_H