-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 ); LauncherTabWidget::LauncherTabWidget( Launcher* parent ) : - QVBox( parent ) + QVBox( parent ), docview( 0 ) { @@ -133,6 +133,8 @@ void LauncherTabWidget::createDocLoadingWidget() + Config cfg( "Launcher" ); + cfg.setGroup( "DocTab" ); + bool docTabEnabled = cfg.readBoolEntry( "Enable", true ); + QLabel *textLabel = new QLabel( docLoadingVBox ); - textLabel->setText( tr( "<b>Finding Documents...</b>" ) ); textLabel->setAlignment( int( QLabel::AlignCenter ) ); - docLoadingWidgetProgress = new QProgressBar( docLoadingVBox ); @@ -143,2 +145,13 @@ void LauncherTabWidget::createDocLoadingWidget() + if ( docTabEnabled ) + { + textLabel->setText( tr( "<b>Finding Documents...</b>" ) ); + } + else + { + textLabel->setText( tr( "<b>The Documents Tab<p>has been disabled.<p>" + "Use Settings->Launcher->DocTab<p>to reenable it.</b></center>" ) ); + docLoadingWidgetProgress->hide(); + } + QWidget *space2 = new QWidget( docLoadingVBox ); @@ -146,3 +159,2 @@ void LauncherTabWidget::createDocLoadingWidget() - Config cfg("Launcher"); cfg.setGroup( "Tab Documents" ); // No tr @@ -431,2 +443,5 @@ Launcher::Launcher() tb = 0; + Config cfg( "Launcher" ); + cfg.setGroup( "DocTab" ); + docTabEnabled = cfg.readBoolEntry( "Enable", true ); } @@ -474,7 +489,7 @@ void Launcher::createGUI() // It could add this itself if it handles docs + tabs->newView("Documents", pm, tr("Documents") )->setToolsEnabled( TRUE ); - QTimer::singleShot( 0, tabs, SLOT( initLayout() ) ); + QTimer::singleShot( 0, tabs, SLOT( initLayout() ) ); qApp->setMainWidget( this ); - QTimer::singleShot( 500, this, SLOT( makeVisible() ) ); @@ -736,2 +751,10 @@ void Launcher::documentScanningProgress( int percent ) { + if ( !docTabEnabled ) + { + qDebug( "Launcher: document tab disabled!" ); + tabs->setLoadingProgress( 100 ); + tabs->setLoadingWidgetEnabled( TRUE ); + return; + } + switch ( percent ) { |