summaryrefslogtreecommitdiff
path: root/core/launcher
Side-by-side diff
Diffstat (limited to 'core/launcher') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/documentlist.cpp17
-rw-r--r--core/launcher/firstuse.cpp2
-rw-r--r--core/launcher/launcher.cpp35
-rw-r--r--core/launcher/launcher.h2
4 files changed, 49 insertions, 7 deletions
diff --git a/core/launcher/documentlist.cpp b/core/launcher/documentlist.cpp
index 7f9366e..dcea4b9 100644
--- a/core/launcher/documentlist.cpp
+++ b/core/launcher/documentlist.cpp
@@ -21,6 +21,7 @@
#include "serverinterface.h"
#include "launcherglobal.h"
+#include <qtopia/config.h>
#include <qtopia/mimetype.h>
#include <qtopia/resource.h>
#include <qtopia/global.h>
@@ -104,7 +105,21 @@ DocumentList::DocumentList( ServerInterface *serverGui, bool scanDocs,
void DocumentList::startInitialScan()
{
reloadAppLnks();
- reloadDocLnks();
+
+ Config cfg( "Launcher" );
+ cfg.setGroup( "DocTab" );
+ bool docTabEnabled = cfg.readBoolEntry( "Enable", true );
+ if ( docTabEnabled )
+ reloadDocLnks();
+ else
+ {
+ if ( d->sendDocLnks && d->serverGui )
+ {
+ d->serverGui->documentScanningProgress( 0 );
+ d->serverGui->allDocumentsRemoved();
+ }
+ }
+
}
DocumentList::~DocumentList()
diff --git a/core/launcher/firstuse.cpp b/core/launcher/firstuse.cpp
index 57469cf..e07920f 100644
--- a/core/launcher/firstuse.cpp
+++ b/core/launcher/firstuse.cpp
@@ -78,6 +78,8 @@ settingsTable [] =
{
{ FALSE, "language", "raise()", "accept()", // No tr
QT_TR_NOOP("Language") },
+ { FALSE, "doctab", "raise()", "accept()", // No tr
+ QT_TR_NOOP("DocTab") },
#ifndef Q_OS_WIN32
{ FALSE, "systemtime", "raise()", "accept()", // No tr
QT_TR_NOOP("Time and Date") },
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
@@ -82,7 +82,7 @@ static bool isVisibleWindow( int );
//===========================================================================
LauncherTabWidget::LauncherTabWidget( Launcher* parent ) :
- QVBox( parent )
+ QVBox( parent ), docview( 0 )
{
docLoadingWidgetEnabled = false;
docLoadingWidget = 0;
@@ -131,20 +131,32 @@ void LauncherTabWidget::createDocLoadingWidget()
waitPixmap->setPixmap( Resource::loadPixmap( "bigwait" ) );
waitPixmap->setAlignment( int( QLabel::AlignCenter ) );
+ 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 );
docLoadingWidgetProgress->setProgress( 0 );
docLoadingWidgetProgress->setCenterIndicator( TRUE );
docLoadingWidgetProgress->setBackgroundMode( NoBackground ); // No flicker
setProgressStyle();
+ 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 );
docLoadingVBox->setStretchFactor( space2, 1 );
- Config cfg("Launcher");
cfg.setGroup( "Tab Documents" ); // No tr
setTabViewAppearance( docLoadingWidget, cfg );
@@ -429,6 +441,9 @@ Launcher::Launcher()
{
tabs = 0;
tb = 0;
+ Config cfg( "Launcher" );
+ cfg.setGroup( "DocTab" );
+ docTabEnabled = cfg.readBoolEntry( "Enable", true );
}
void Launcher::createGUI()
@@ -472,11 +487,11 @@ void Launcher::createGUI()
QPixmap pm;
pm = img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() );
// 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() ) );
}
@@ -734,6 +749,14 @@ void Launcher::applicationScanningProgress( int percent )
void Launcher::documentScanningProgress( int percent )
{
+ if ( !docTabEnabled )
+ {
+ qDebug( "Launcher: document tab disabled!" );
+ tabs->setLoadingProgress( 100 );
+ tabs->setLoadingWidgetEnabled( TRUE );
+ return;
+ }
+
switch ( percent ) {
case 0: {
tabs->setLoadingProgress( 0 );
diff --git a/core/launcher/launcher.h b/core/launcher/launcher.h
index 2917027..1d046ee 100644
--- a/core/launcher/launcher.h
+++ b/core/launcher/launcher.h
@@ -150,6 +150,8 @@ private:
LauncherTabWidget *tabs;
QStringList ids;
TaskBar *tb;
+
+ bool docTabEnabled;
};
#endif // LAUNCHERVIEW_H