-rw-r--r-- | core/launcher/documentlist.cpp | 17 | ||||
-rw-r--r-- | core/launcher/firstuse.cpp | 2 | ||||
-rw-r--r-- | core/launcher/launcher.cpp | 35 | ||||
-rw-r--r-- | core/launcher/launcher.h | 2 | ||||
-rw-r--r-- | core/settings/launcher/doctabsettings.cpp | 71 | ||||
-rw-r--r-- | core/settings/launcher/doctabsettings.h | 55 | ||||
-rw-r--r-- | core/settings/launcher/inputmethodsettings.cpp | 3 | ||||
-rw-r--r-- | core/settings/launcher/launcher.pro | 2 | ||||
-rw-r--r-- | core/settings/launcher/launchersettings.cpp | 5 | ||||
-rw-r--r-- | core/settings/launcher/launchersettings.h | 2 |
10 files changed, 184 insertions, 10 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; }; diff --git a/core/settings/launcher/doctabsettings.cpp b/core/settings/launcher/doctabsettings.cpp new file mode 100644 index 0000000..8077b8c --- a/dev/null +++ b/core/settings/launcher/doctabsettings.cpp @@ -0,0 +1,71 @@ +/* + This file is part of the OPIE Project + =. Copyright (c) 2002 Trolltech AS <info@trolltech.com> + .=l. Copyright (c) 2003 Michael Lauer <mickeyl@handhelds.org> + .>+-= + _;:, .> :=|. This file is free software; you can +.> <`_, > . <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- : the terms of the GNU General Public +.="- .-=="i, .._ License as published by the Free Software + - . .-<_> .<> Foundation; either version 2 of the License, + ._= =} : or (at your option) any later version. + .%`+i> _;_. + .i_,=:_. -<s. This file is distributed in the hope that + + . -:. = it will be useful, but WITHOUT ANY WARRANTY; + : .. .:, . . . without even the implied warranty of + =_ + =;=|` MERCHANTABILITY or FITNESS FOR A + _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General +..}^=.= = ; Public License for more details. +++= -. .` .: + : = ...= . :.=- You should have received a copy of the GNU + -. .:....=;==+<; General Public License along with this file; + -_. . . )=. = see the file COPYING. If not, write to the + -- :-=` Free Software Foundation, Inc., + 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. + +*/ + +#include "doctabsettings.h" + +#include <qpe/config.h> +#include <qpe/qlibrary.h> +#include <qpe/qpeapplication.h> + +#include <qspinbox.h> +#include <qcheckbox.h> +#include <qlayout.h> +#include <qlabel.h> +#include <qwhatsthis.h> + +DocTabSettings::DocTabSettings( QWidget *parent, const char *name ):QWidget( parent, name ) +{ + QBoxLayout *lay = new QVBoxLayout( this, 4, 4 ); + + _enable = new QCheckBox( tr( "Enable the Documents Tab" ), this ); + + Config cfg( "Launcher" ); + cfg.setGroup( "DocTab" ); + _enable->setChecked( cfg.readBoolEntry( "Enable", true ) ); + + lay->addWidget( _enable ); + lay->addWidget( new QLabel( tr( "<b>Note:</b> Changing these settings may need restarting Opie to become effective." ), this ) ); + + lay->addStretch(); + + QWhatsThis::add( _enable, tr( "Check, if you want the Documents Tab to be visible." ) ); +} + +void DocTabSettings::appletChanged() +{ +} + +void DocTabSettings::accept() +{ + qDebug( "DocTabSettings::accept()" ); + Config cfg( "Launcher" ); + cfg.setGroup( "DocTab" ); + cfg.writeEntry( "Enable", _enable->isChecked() ); + cfg.write(); +} + diff --git a/core/settings/launcher/doctabsettings.h b/core/settings/launcher/doctabsettings.h new file mode 100644 index 0000000..ad6447c --- a/dev/null +++ b/core/settings/launcher/doctabsettings.h @@ -0,0 +1,55 @@ +/* + =. This file is part of the OPIE Project + .=l. Copyright (c) 2003 Michael Lauer <mickeyl@handhelds.org> + .>+-= + _;:, .> :=|. This file is free software; you can +.> <`_, > . <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- : the terms of the GNU General Public +.="- .-=="i, .._ License as published by the Free Software + - . .-<_> .<> Foundation; either version 2 of the License, + ._= =} : or (at your option) any later version. + .%`+i> _;_. + .i_,=:_. -<s. This file is distributed in the hope that + + . -:. = it will be useful, but WITHOUT ANY WARRANTY; + : .. .:, . . . without even the implied warranty of + =_ + =;=|` MERCHANTABILITY or FITNESS FOR A + _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General +..}^=.= = ; Public License for more details. +++= -. .` .: + : = ...= . :.=- You should have received a copy of the GNU + -. .:....=;==+<; General Public License along with this file; + -_. . . )=. = see the file COPYING. If not, write to the + -- :-=` Free Software Foundation, Inc., + 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. + +*/ + +#ifndef __DOCTAB_SETTINGS_H__ +#define __DOCTAB_SETTINGS_H__ + +#include <qwidget.h> + +class QCheckBox; +class QSpinBox; + +class DocTabSettings : public QWidget +{ + Q_OBJECT + + public: + DocTabSettings ( QWidget *parent = 0, const char *name = 0 ); + + void accept ( ); + + protected slots: + void appletChanged ( ); + + protected: + void init ( ); + + private: + QCheckBox* _enable; +}; + +#endif diff --git a/core/settings/launcher/inputmethodsettings.cpp b/core/settings/launcher/inputmethodsettings.cpp index 1aa1ae8..147a00d 100644 --- a/core/settings/launcher/inputmethodsettings.cpp +++ b/core/settings/launcher/inputmethodsettings.cpp @@ -47,3 +47,3 @@ InputMethodSettings::InputMethodSettings( QWidget *parent, const char *name ):QW - QHBoxLayout* hbox = new QHBoxLayout( this, 4, 4 ); + QHBoxLayout* hbox = new QHBoxLayout( lay, 4 ); hbox->addWidget( new QLabel( "Initial Width:", this ) ); @@ -62,3 +62,2 @@ InputMethodSettings::InputMethodSettings( QWidget *parent, const char *name ):QW lay->addWidget( _float ); - lay->addLayout( hbox ); lay->addWidget( new QLabel( tr( "<b>Note:</b> Changing these settings may need restarting Opie to become effective." ), this ) ); diff --git a/core/settings/launcher/launcher.pro b/core/settings/launcher/launcher.pro index 9d05832..3261ee8 100644 --- a/core/settings/launcher/launcher.pro +++ b/core/settings/launcher/launcher.pro @@ -6,2 +6,3 @@ HEADERS = launchersettings.h \ inputmethodsettings.h \ + doctabsettings.h \ tabconfig.h \ @@ -15,2 +16,3 @@ SOURCES = main.cpp \ inputmethodsettings.cpp \ + doctabsettings.cpp \ tabdialog.cpp diff --git a/core/settings/launcher/launchersettings.cpp b/core/settings/launcher/launchersettings.cpp index efc4a86..e129849 100644 --- a/core/settings/launcher/launchersettings.cpp +++ b/core/settings/launcher/launchersettings.cpp @@ -38,2 +38,3 @@ #include "inputmethodsettings.h" +#include "doctabsettings.h" @@ -53,2 +54,3 @@ LauncherSettings::LauncherSettings (QWidget*,const char*, WFlags) m_imethods = new InputMethodSettings ( tw ); + m_doctab = new DocTabSettings ( tw ); @@ -58,3 +60,3 @@ LauncherSettings::LauncherSettings (QWidget*,const char*, WFlags) tw-> addTab ( m_imethods, "launchersettings/inputmethod.png", tr( "InputMethods" )); - + tw-> addTab ( m_doctab, "DocsIcon", tr( "DocTab" ) ); tw-> setCurrentTab ( m_taskbar ); @@ -68,2 +70,3 @@ void LauncherSettings::accept ( ) m_imethods-> accept ( ); + m_doctab-> accept ( ); diff --git a/core/settings/launcher/launchersettings.h b/core/settings/launcher/launchersettings.h index 7458d8b..9ba2942 100644 --- a/core/settings/launcher/launchersettings.h +++ b/core/settings/launcher/launchersettings.h @@ -36,2 +36,3 @@ class MenuSettings; class InputMethodSettings; +class DocTabSettings; @@ -52,2 +53,3 @@ private: InputMethodSettings* m_imethods; + DocTabSettings *m_doctab; }; |