-rw-r--r-- | core/launcher/launcher.cpp | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp index d697c43..b312672 100644 --- a/core/launcher/launcher.cpp +++ b/core/launcher/launcher.cpp | |||
@@ -84,3 +84,3 @@ static bool isVisibleWindow( int ); | |||
84 | LauncherTabWidget::LauncherTabWidget( Launcher* parent ) : | 84 | LauncherTabWidget::LauncherTabWidget( Launcher* parent ) : |
85 | QVBox( parent ) | 85 | QVBox( parent ), docview( 0 ) |
86 | { | 86 | { |
@@ -133,6 +133,8 @@ void LauncherTabWidget::createDocLoadingWidget() | |||
133 | 133 | ||
134 | Config cfg( "Launcher" ); | ||
135 | cfg.setGroup( "DocTab" ); | ||
136 | bool docTabEnabled = cfg.readBoolEntry( "Enable", true ); | ||
137 | |||
134 | QLabel *textLabel = new QLabel( docLoadingVBox ); | 138 | QLabel *textLabel = new QLabel( docLoadingVBox ); |
135 | textLabel->setText( tr( "<b>Finding Documents...</b>" ) ); | ||
136 | textLabel->setAlignment( int( QLabel::AlignCenter ) ); | 139 | textLabel->setAlignment( int( QLabel::AlignCenter ) ); |
137 | |||
138 | docLoadingWidgetProgress = new QProgressBar( docLoadingVBox ); | 140 | docLoadingWidgetProgress = new QProgressBar( docLoadingVBox ); |
@@ -143,2 +145,13 @@ void LauncherTabWidget::createDocLoadingWidget() | |||
143 | 145 | ||
146 | if ( docTabEnabled ) | ||
147 | { | ||
148 | textLabel->setText( tr( "<b>Finding Documents...</b>" ) ); | ||
149 | } | ||
150 | else | ||
151 | { | ||
152 | textLabel->setText( tr( "<b>The Documents Tab<p>has been disabled.<p>" | ||
153 | "Use Settings->Launcher->DocTab<p>to reenable it.</b></center>" ) ); | ||
154 | docLoadingWidgetProgress->hide(); | ||
155 | } | ||
156 | |||
144 | QWidget *space2 = new QWidget( docLoadingVBox ); | 157 | QWidget *space2 = new QWidget( docLoadingVBox ); |
@@ -146,3 +159,2 @@ void LauncherTabWidget::createDocLoadingWidget() | |||
146 | 159 | ||
147 | Config cfg("Launcher"); | ||
148 | cfg.setGroup( "Tab Documents" ); // No tr | 160 | cfg.setGroup( "Tab Documents" ); // No tr |
@@ -431,2 +443,5 @@ Launcher::Launcher() | |||
431 | tb = 0; | 443 | tb = 0; |
444 | Config cfg( "Launcher" ); | ||
445 | cfg.setGroup( "DocTab" ); | ||
446 | docTabEnabled = cfg.readBoolEntry( "Enable", true ); | ||
432 | } | 447 | } |
@@ -474,7 +489,7 @@ void Launcher::createGUI() | |||
474 | // It could add this itself if it handles docs | 489 | // It could add this itself if it handles docs |
490 | |||
475 | tabs->newView("Documents", pm, tr("Documents") )->setToolsEnabled( TRUE ); | 491 | tabs->newView("Documents", pm, tr("Documents") )->setToolsEnabled( TRUE ); |
476 | QTimer::singleShot( 0, tabs, SLOT( initLayout() ) ); | ||
477 | 492 | ||
493 | QTimer::singleShot( 0, tabs, SLOT( initLayout() ) ); | ||
478 | qApp->setMainWidget( this ); | 494 | qApp->setMainWidget( this ); |
479 | |||
480 | QTimer::singleShot( 500, this, SLOT( makeVisible() ) ); | 495 | QTimer::singleShot( 500, this, SLOT( makeVisible() ) ); |
@@ -736,2 +751,10 @@ void Launcher::documentScanningProgress( int percent ) | |||
736 | { | 751 | { |
752 | if ( !docTabEnabled ) | ||
753 | { | ||
754 | qDebug( "Launcher: document tab disabled!" ); | ||
755 | tabs->setLoadingProgress( 100 ); | ||
756 | tabs->setLoadingWidgetEnabled( TRUE ); | ||
757 | return; | ||
758 | } | ||
759 | |||
737 | switch ( percent ) { | 760 | switch ( percent ) { |