summaryrefslogtreecommitdiff
path: root/core/launcher
authormickeyl <mickeyl>2003-11-17 15:16:13 (UTC)
committer mickeyl <mickeyl>2003-11-17 15:16:13 (UTC)
commitc4a6e9c529ea6bcb1c9a42fee33a70300f116c98 (patch) (side-by-side diff)
tree1ee68a2035b0218ba99662db1dff4c4067064cde /core/launcher
parent725e2723291fe1d71ca68cb59cec83428d40b8af (diff)
downloadopie-c4a6e9c529ea6bcb1c9a42fee33a70300f116c98.zip
opie-c4a6e9c529ea6bcb1c9a42fee33a70300f116c98.tar.gz
opie-c4a6e9c529ea6bcb1c9a42fee33a70300f116c98.tar.bz2
This patch makes the famous Documents Tab customizably optional.
Note that the document tab is so tight coupled to the rest of the launcher that it proved impossible for me to remove the tab as is. However I could make all the scanning and the displaying optional. The customization can be done via the launcher settings applications - a new doc tab category has been added. Further customization can be added to that tab. I also added a doc tab settings application for use with the "first usage wizard"
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
@@ -23,2 +23,3 @@
+#include <qtopia/config.h>
#include <qtopia/mimetype.h>
@@ -106,3 +107,17 @@ 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();
+ }
+ }
+
}
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
@@ -80,2 +80,4 @@ settingsTable [] =
QT_TR_NOOP("Language") },
+ { FALSE, "doctab", "raise()", "accept()", // No tr
+ QT_TR_NOOP("DocTab") },
#ifndef Q_OS_WIN32
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 ) {
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
@@ -152,2 +152,4 @@ private:
TaskBar *tb;
+
+ bool docTabEnabled;
};