-rw-r--r-- | core/launcher/documentlist.cpp | 15 | ||||
-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, 183 insertions, 9 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 @@ | |||
23 | 23 | ||
24 | #include <qtopia/config.h> | ||
24 | #include <qtopia/mimetype.h> | 25 | #include <qtopia/mimetype.h> |
@@ -106,3 +107,17 @@ void DocumentList::startInitialScan() | |||
106 | reloadAppLnks(); | 107 | reloadAppLnks(); |
108 | |||
109 | Config cfg( "Launcher" ); | ||
110 | cfg.setGroup( "DocTab" ); | ||
111 | bool docTabEnabled = cfg.readBoolEntry( "Enable", true ); | ||
112 | if ( docTabEnabled ) | ||
107 | reloadDocLnks(); | 113 | reloadDocLnks(); |
114 | else | ||
115 | { | ||
116 | if ( d->sendDocLnks && d->serverGui ) | ||
117 | { | ||
118 | d->serverGui->documentScanningProgress( 0 ); | ||
119 | d->serverGui->allDocumentsRemoved(); | ||
120 | } | ||
121 | } | ||
122 | |||
108 | } | 123 | } |
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 [] = | |||
80 | QT_TR_NOOP("Language") }, | 80 | QT_TR_NOOP("Language") }, |
81 | { FALSE, "doctab", "raise()", "accept()", // No tr | ||
82 | QT_TR_NOOP("DocTab") }, | ||
81 | #ifndef Q_OS_WIN32 | 83 | #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 ); | |||
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 ) { |
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: | |||
152 | TaskBar *tb; | 152 | TaskBar *tb; |
153 | |||
154 | bool docTabEnabled; | ||
153 | }; | 155 | }; |
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 @@ | |||
1 | /* | ||
2 | This file is part of the OPIE Project | ||
3 | =. Copyright (c) 2002 Trolltech AS <info@trolltech.com> | ||
4 | .=l. Copyright (c) 2003 Michael Lauer <mickeyl@handhelds.org> | ||
5 | .>+-= | ||
6 | _;:, .> :=|. This file is free software; you can | ||
7 | .> <`_, > . <= redistribute it and/or modify it under | ||
8 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | ||
9 | .="- .-=="i, .._ License as published by the Free Software | ||
10 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
11 | ._= =} : or (at your option) any later version. | ||
12 | .%`+i> _;_. | ||
13 | .i_,=:_. -<s. This file is distributed in the hope that | ||
14 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
15 | : .. .:, . . . without even the implied warranty of | ||
16 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General | ||
18 | ..}^=.= = ; Public License for more details. | ||
19 | ++= -. .` .: | ||
20 | : = ...= . :.=- You should have received a copy of the GNU | ||
21 | -. .:....=;==+<; General Public License along with this file; | ||
22 | -_. . . )=. = see the file COPYING. If not, write to the | ||
23 | -- :-=` Free Software Foundation, Inc., | ||
24 | 59 Temple Place - Suite 330, | ||
25 | Boston, MA 02111-1307, USA. | ||
26 | |||
27 | */ | ||
28 | |||
29 | #include "doctabsettings.h" | ||
30 | |||
31 | #include <qpe/config.h> | ||
32 | #include <qpe/qlibrary.h> | ||
33 | #include <qpe/qpeapplication.h> | ||
34 | |||
35 | #include <qspinbox.h> | ||
36 | #include <qcheckbox.h> | ||
37 | #include <qlayout.h> | ||
38 | #include <qlabel.h> | ||
39 | #include <qwhatsthis.h> | ||
40 | |||
41 | DocTabSettings::DocTabSettings( QWidget *parent, const char *name ):QWidget( parent, name ) | ||
42 | { | ||
43 | QBoxLayout *lay = new QVBoxLayout( this, 4, 4 ); | ||
44 | |||
45 | _enable = new QCheckBox( tr( "Enable the Documents Tab" ), this ); | ||
46 | |||
47 | Config cfg( "Launcher" ); | ||
48 | cfg.setGroup( "DocTab" ); | ||
49 | _enable->setChecked( cfg.readBoolEntry( "Enable", true ) ); | ||
50 | |||
51 | lay->addWidget( _enable ); | ||
52 | lay->addWidget( new QLabel( tr( "<b>Note:</b> Changing these settings may need restarting Opie to become effective." ), this ) ); | ||
53 | |||
54 | lay->addStretch(); | ||
55 | |||
56 | QWhatsThis::add( _enable, tr( "Check, if you want the Documents Tab to be visible." ) ); | ||
57 | } | ||
58 | |||
59 | void DocTabSettings::appletChanged() | ||
60 | { | ||
61 | } | ||
62 | |||
63 | void DocTabSettings::accept() | ||
64 | { | ||
65 | qDebug( "DocTabSettings::accept()" ); | ||
66 | Config cfg( "Launcher" ); | ||
67 | cfg.setGroup( "DocTab" ); | ||
68 | cfg.writeEntry( "Enable", _enable->isChecked() ); | ||
69 | cfg.write(); | ||
70 | } | ||
71 | |||
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 @@ | |||
1 | /* | ||
2 | =. This file is part of the OPIE Project | ||
3 | .=l. Copyright (c) 2003 Michael Lauer <mickeyl@handhelds.org> | ||
4 | .>+-= | ||
5 | _;:, .> :=|. This file is free software; you can | ||
6 | .> <`_, > . <= redistribute it and/or modify it under | ||
7 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | ||
8 | .="- .-=="i, .._ License as published by the Free Software | ||
9 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
10 | ._= =} : or (at your option) any later version. | ||
11 | .%`+i> _;_. | ||
12 | .i_,=:_. -<s. This file is distributed in the hope that | ||
13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
14 | : .. .:, . . . without even the implied warranty of | ||
15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General | ||
17 | ..}^=.= = ; Public License for more details. | ||
18 | ++= -. .` .: | ||
19 | : = ...= . :.=- You should have received a copy of the GNU | ||
20 | -. .:....=;==+<; General Public License along with this file; | ||
21 | -_. . . )=. = see the file COPYING. If not, write to the | ||
22 | -- :-=` Free Software Foundation, Inc., | ||
23 | 59 Temple Place - Suite 330, | ||
24 | Boston, MA 02111-1307, USA. | ||
25 | |||
26 | */ | ||
27 | |||
28 | #ifndef __DOCTAB_SETTINGS_H__ | ||
29 | #define __DOCTAB_SETTINGS_H__ | ||
30 | |||
31 | #include <qwidget.h> | ||
32 | |||
33 | class QCheckBox; | ||
34 | class QSpinBox; | ||
35 | |||
36 | class DocTabSettings : public QWidget | ||
37 | { | ||
38 | Q_OBJECT | ||
39 | |||
40 | public: | ||
41 | DocTabSettings ( QWidget *parent = 0, const char *name = 0 ); | ||
42 | |||
43 | void accept ( ); | ||
44 | |||
45 | protected slots: | ||
46 | void appletChanged ( ); | ||
47 | |||
48 | protected: | ||
49 | void init ( ); | ||
50 | |||
51 | private: | ||
52 | QCheckBox* _enable; | ||
53 | }; | ||
54 | |||
55 | #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 | |||
47 | 47 | ||
48 | QHBoxLayout* hbox = new QHBoxLayout( this, 4, 4 ); | 48 | QHBoxLayout* hbox = new QHBoxLayout( lay, 4 ); |
49 | hbox->addWidget( new QLabel( "Initial Width:", this ) ); | 49 | hbox->addWidget( new QLabel( "Initial Width:", this ) ); |
@@ -62,3 +62,2 @@ InputMethodSettings::InputMethodSettings( QWidget *parent, const char *name ):QW | |||
62 | lay->addWidget( _float ); | 62 | lay->addWidget( _float ); |
63 | lay->addLayout( hbox ); | ||
64 | lay->addWidget( new QLabel( tr( "<b>Note:</b> Changing these settings may need restarting Opie to become effective." ), this ) ); | 63 | 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 \ | |||
6 | inputmethodsettings.h \ | 6 | inputmethodsettings.h \ |
7 | doctabsettings.h \ | ||
7 | tabconfig.h \ | 8 | tabconfig.h \ |
@@ -15,2 +16,3 @@ SOURCES = main.cpp \ | |||
15 | inputmethodsettings.cpp \ | 16 | inputmethodsettings.cpp \ |
17 | doctabsettings.cpp \ | ||
16 | tabdialog.cpp | 18 | 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 @@ | |||
38 | #include "inputmethodsettings.h" | 38 | #include "inputmethodsettings.h" |
39 | #include "doctabsettings.h" | ||
39 | 40 | ||
@@ -53,2 +54,3 @@ LauncherSettings::LauncherSettings (QWidget*,const char*, WFlags) | |||
53 | m_imethods = new InputMethodSettings ( tw ); | 54 | m_imethods = new InputMethodSettings ( tw ); |
55 | m_doctab = new DocTabSettings ( tw ); | ||
54 | 56 | ||
@@ -58,3 +60,3 @@ LauncherSettings::LauncherSettings (QWidget*,const char*, WFlags) | |||
58 | tw-> addTab ( m_imethods, "launchersettings/inputmethod.png", tr( "InputMethods" )); | 60 | tw-> addTab ( m_imethods, "launchersettings/inputmethod.png", tr( "InputMethods" )); |
59 | 61 | tw-> addTab ( m_doctab, "DocsIcon", tr( "DocTab" ) ); | |
60 | tw-> setCurrentTab ( m_taskbar ); | 62 | tw-> setCurrentTab ( m_taskbar ); |
@@ -68,2 +70,3 @@ void LauncherSettings::accept ( ) | |||
68 | m_imethods-> accept ( ); | 70 | m_imethods-> accept ( ); |
71 | m_doctab-> accept ( ); | ||
69 | 72 | ||
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; | |||
36 | class InputMethodSettings; | 36 | class InputMethodSettings; |
37 | class DocTabSettings; | ||
37 | 38 | ||
@@ -52,2 +53,3 @@ private: | |||
52 | InputMethodSettings* m_imethods; | 53 | InputMethodSettings* m_imethods; |
54 | DocTabSettings *m_doctab; | ||
53 | }; | 55 | }; |