summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2003-11-17 15:16:13 (UTC)
committer mickeyl <mickeyl>2003-11-17 15:16:13 (UTC)
commitc4a6e9c529ea6bcb1c9a42fee33a70300f116c98 (patch) (unidiff)
tree1ee68a2035b0218ba99662db1dff4c4067064cde
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 (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
-rw-r--r--core/settings/launcher/doctabsettings.cpp71
-rw-r--r--core/settings/launcher/doctabsettings.h55
-rw-r--r--core/settings/launcher/inputmethodsettings.cpp3
-rw-r--r--core/settings/launcher/launcher.pro2
-rw-r--r--core/settings/launcher/launchersettings.cpp5
-rw-r--r--core/settings/launcher/launchersettings.h2
-rw-r--r--noncore/settings/doctab/.cvsignore4
-rw-r--r--noncore/settings/doctab/config.in4
-rw-r--r--noncore/settings/doctab/doctab.cpp94
-rw-r--r--noncore/settings/doctab/doctab.h57
-rw-r--r--noncore/settings/doctab/doctab.pro10
-rw-r--r--noncore/settings/doctab/doctabsettingsbase.ui115
-rw-r--r--noncore/settings/doctab/main.cpp25
-rw-r--r--noncore/settings/doctab/opie-doctab.control10
-rw-r--r--noncore/settings/language/config.in2
-rw-r--r--noncore/settings/language/main.cpp2
20 files changed, 504 insertions, 13 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
@@ -1,47 +1,48 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of the Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20#include "documentlist.h" 20#include "documentlist.h"
21#include "serverinterface.h" 21#include "serverinterface.h"
22#include "launcherglobal.h" 22#include "launcherglobal.h"
23 23
24#include <qtopia/config.h>
24#include <qtopia/mimetype.h> 25#include <qtopia/mimetype.h>
25#include <qtopia/resource.h> 26#include <qtopia/resource.h>
26#include <qtopia/global.h> 27#include <qtopia/global.h>
27#include <qtopia/private/categories.h> 28#include <qtopia/private/categories.h>
28#include <qtopia/qpeapplication.h> 29#include <qtopia/qpeapplication.h>
29#include <qtopia/applnk.h> 30#include <qtopia/applnk.h>
30#include <qtopia/storage.h> 31#include <qtopia/storage.h>
31#ifdef Q_WS_QWS 32#ifdef Q_WS_QWS
32#include <qtopia/qcopenvelope_qws.h> 33#include <qtopia/qcopenvelope_qws.h>
33#endif 34#endif
34 35
35#include <qtimer.h> 36#include <qtimer.h>
36#include <qfileinfo.h> 37#include <qfileinfo.h>
37#include <qtextstream.h> 38#include <qtextstream.h>
38#include <qfile.h> 39#include <qfile.h>
39#include <qdir.h> 40#include <qdir.h>
40#include <qpainter.h> 41#include <qpainter.h>
41#include <qimage.h> 42#include <qimage.h>
42#include <qcopchannel_qws.h> 43#include <qcopchannel_qws.h>
43#include <qlistview.h> 44#include <qlistview.h>
44#include <qlist.h> 45#include <qlist.h>
45#include <qpixmap.h> 46#include <qpixmap.h>
46 47
47 48
@@ -83,49 +84,63 @@ public:
83 ServerInterface *serverGui; 84 ServerInterface *serverGui;
84 85
85 bool needToSendAllDocLinks; 86 bool needToSendAllDocLinks;
86 bool sendAppLnks; 87 bool sendAppLnks;
87 bool sendDocLnks; 88 bool sendDocLnks;
88 bool scanDocs; 89 bool scanDocs;
89}; 90};
90 91
91 92
92DocumentList::DocumentList( ServerInterface *serverGui, bool scanDocs, 93DocumentList::DocumentList( ServerInterface *serverGui, bool scanDocs,
93 QObject *parent, const char *name ) 94 QObject *parent, const char *name )
94 : QObject( parent, name ) 95 : QObject( parent, name )
95{ 96{
96 appLnkSet = new AppLnkSet( MimeType::appsFolderName() ); 97 appLnkSet = new AppLnkSet( MimeType::appsFolderName() );
97 d = new DocumentListPrivate( serverGui ); 98 d = new DocumentListPrivate( serverGui );
98 d->scanDocs = scanDocs; 99 d->scanDocs = scanDocs;
99 d->needToSendAllDocLinks = false; 100 d->needToSendAllDocLinks = false;
100 101
101 QTimer::singleShot( 10, this, SLOT( startInitialScan() ) ); 102 QTimer::singleShot( 10, this, SLOT( startInitialScan() ) );
102} 103}
103 104
104void DocumentList::startInitialScan() 105void DocumentList::startInitialScan()
105{ 106{
106 reloadAppLnks(); 107 reloadAppLnks();
107 reloadDocLnks(); 108
109 Config cfg( "Launcher" );
110 cfg.setGroup( "DocTab" );
111 bool docTabEnabled = cfg.readBoolEntry( "Enable", true );
112 if ( docTabEnabled )
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}
109 124
110DocumentList::~DocumentList() 125DocumentList::~DocumentList()
111{ 126{
112 delete appLnkSet; 127 delete appLnkSet;
113 delete d; 128 delete d;
114} 129}
115 130
116 131
117void DocumentList::add( const DocLnk& doc ) 132void DocumentList::add( const DocLnk& doc )
118{ 133{
119 if ( d->serverGui && QFile::exists( doc.file() ) ) 134 if ( d->serverGui && QFile::exists( doc.file() ) )
120 d->serverGui->documentAdded( doc ); 135 d->serverGui->documentAdded( doc );
121} 136}
122 137
123 138
124void DocumentList::start() 139void DocumentList::start()
125{ 140{
126 resume(); 141 resume();
127} 142}
128 143
129 144
130void DocumentList::pause() 145void DocumentList::pause()
131{ 146{
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
@@ -57,48 +57,50 @@
57#include <qwsdisplay_qws.h> 57#include <qwsdisplay_qws.h>
58#include <qgfx_qws.h> 58#include <qgfx_qws.h>
59#endif 59#endif
60 60
61#include <qwindowsystem_qws.h> 61#include <qwindowsystem_qws.h>
62 62
63#include <stdlib.h> 63#include <stdlib.h>
64#include <sys/types.h> 64#include <sys/types.h>
65#if defined(Q_OS_LINUX) || defined(_OS_LINUX_) 65#if defined(Q_OS_LINUX) || defined(_OS_LINUX_)
66#include <unistd.h> 66#include <unistd.h>
67#endif 67#endif
68 68
69 69
70struct { 70struct {
71 bool enabled; 71 bool enabled;
72 const char *app; 72 const char *app;
73 const char *start; 73 const char *start;
74 const char *stop; 74 const char *stop;
75 const char *desc; 75 const char *desc;
76} 76}
77settingsTable [] = 77settingsTable [] =
78{ 78{
79 { FALSE, "language", "raise()", "accept()", // No tr 79 { FALSE, "language", "raise()", "accept()", // No tr
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
82 { FALSE, "systemtime", "raise()", "accept()", // No tr 84 { FALSE, "systemtime", "raise()", "accept()", // No tr
83 QT_TR_NOOP("Time and Date") }, 85 QT_TR_NOOP("Time and Date") },
84#endif 86#endif
85 { FALSE, "addressbook", "editPersonalAndClose()", "accept()", // No tr 87 { FALSE, "addressbook", "editPersonalAndClose()", "accept()", // No tr
86 QT_TR_NOOP("Personal Information") }, 88 QT_TR_NOOP("Personal Information") },
87 { FALSE, 0, 0, 0, 0 } 89 { FALSE, 0, 0, 0, 0 }
88}; 90};
89 91
90 92
91FirstUse::FirstUse(QWidget* parent, const char * name, WFlags wf) : 93FirstUse::FirstUse(QWidget* parent, const char * name, WFlags wf) :
92 QDialog( parent, name, TRUE, wf), 94 QDialog( parent, name, TRUE, wf),
93 transApp(0), transLib(0), needCalibrate(FALSE), currApp(-1), 95 transApp(0), transLib(0), needCalibrate(FALSE), currApp(-1),
94 waitForExit(-1), waitingForLaunch(FALSE), needRestart(FALSE) 96 waitForExit(-1), waitingForLaunch(FALSE), needRestart(FALSE)
95{ 97{
96 ServerApplication::allowRestart = FALSE; 98 ServerApplication::allowRestart = FALSE;
97 // we force our height beyound the maximum (which we set anyway) 99 // we force our height beyound the maximum (which we set anyway)
98 QRect desk = qApp->desktop()->geometry(); 100 QRect desk = qApp->desktop()->geometry();
99 setGeometry( 0, 0, desk.width(), desk.height() ); 101 setGeometry( 0, 0, desk.width(), desk.height() );
100 102
101 connect(qwsServer, SIGNAL(newChannel(const QString&)), 103 connect(qwsServer, SIGNAL(newChannel(const QString&)),
102 this, SLOT(newQcopChannel(const QString&))); 104 this, SLOT(newQcopChannel(const QString&)));
103 105
104 // Create a DocumentList so appLauncher has appLnkSet to search 106 // Create a DocumentList so appLauncher has appLnkSet to search
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
@@ -61,111 +61,123 @@
61#include "server.h" 61#include "server.h"
62 62
63#define QTOPIA_INTERNAL_FSLP 63#define QTOPIA_INTERNAL_FSLP
64#include <qtopia/lnkproperties.h> 64#include <qtopia/lnkproperties.h>
65#include <stdlib.h> 65#include <stdlib.h>
66#include <assert.h> 66#include <assert.h>
67 67
68#if defined(_OS_LINUX_) || defined(Q_OS_LINUX) 68#if defined(_OS_LINUX_) || defined(Q_OS_LINUX)
69#include <unistd.h> 69#include <unistd.h>
70#include <stdio.h> 70#include <stdio.h>
71#include <sys/vfs.h> 71#include <sys/vfs.h>
72#include <mntent.h> 72#include <mntent.h>
73#endif 73#endif
74 74
75#ifdef Q_WS_QWS 75#ifdef Q_WS_QWS
76#include <qkeyboard_qws.h> 76#include <qkeyboard_qws.h>
77#include <qpe/lnkproperties.h> 77#include <qpe/lnkproperties.h>
78#endif 78#endif
79 79
80 80
81static bool isVisibleWindow( int ); 81static bool isVisibleWindow( int );
82//=========================================================================== 82//===========================================================================
83 83
84LauncherTabWidget::LauncherTabWidget( Launcher* parent ) : 84LauncherTabWidget::LauncherTabWidget( Launcher* parent ) :
85 QVBox( parent ) 85 QVBox( parent ), docview( 0 )
86{ 86{
87 docLoadingWidgetEnabled = false; 87 docLoadingWidgetEnabled = false;
88 docLoadingWidget = 0; 88 docLoadingWidget = 0;
89 docLoadingWidgetProgress = 0; 89 docLoadingWidgetProgress = 0;
90 launcher = parent; 90 launcher = parent;
91 categoryBar = new LauncherTabBar( this ); 91 categoryBar = new LauncherTabBar( this );
92 QPalette pal = categoryBar->palette(); 92 QPalette pal = categoryBar->palette();
93 pal.setColor( QColorGroup::Light, pal.color(QPalette::Active,QColorGroup::Shadow) ); 93 pal.setColor( QColorGroup::Light, pal.color(QPalette::Active,QColorGroup::Shadow) );
94 pal.setColor( QColorGroup::Background, pal.active().background().light(110) ); 94 pal.setColor( QColorGroup::Background, pal.active().background().light(110) );
95 categoryBar->setPalette( pal ); 95 categoryBar->setPalette( pal );
96 stack = new QWidgetStack(this); 96 stack = new QWidgetStack(this);
97 connect( categoryBar, SIGNAL(selected(int)), this, SLOT(raiseTabWidget()) ); 97 connect( categoryBar, SIGNAL(selected(int)), this, SLOT(raiseTabWidget()) );
98 categoryBar->show(); 98 categoryBar->show();
99 stack->show(); 99 stack->show();
100 100
101#if defined(Q_WS_QWS) && !defined(QT_NO_COP) 101#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
102 QCopChannel *channel = new QCopChannel( "QPE/Launcher", this ); 102 QCopChannel *channel = new QCopChannel( "QPE/Launcher", this );
103 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), 103 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
104 this, SLOT(launcherMessage(const QCString&, const QByteArray&)) ); 104 this, SLOT(launcherMessage(const QCString&, const QByteArray&)) );
105 connect( qApp, SIGNAL(appMessage(const QCString&, const QByteArray&)), 105 connect( qApp, SIGNAL(appMessage(const QCString&, const QByteArray&)),
106 this, SLOT(appMessage(const QCString&, const QByteArray&))); 106 this, SLOT(appMessage(const QCString&, const QByteArray&)));
107#endif 107#endif
108 108
109 createDocLoadingWidget(); 109 createDocLoadingWidget();
110} 110}
111 111
112void LauncherTabWidget::createDocLoadingWidget() 112void LauncherTabWidget::createDocLoadingWidget()
113{ 113{
114 // Construct the 'doc loading widget' shown when finding documents 114 // Construct the 'doc loading widget' shown when finding documents
115 115
116 // ### LauncherView class needs changing to be more generic so 116 // ### LauncherView class needs changing to be more generic so
117 // this widget can change its background similar to the iconviews 117 // this widget can change its background similar to the iconviews
118 // so the background for this matches 118 // so the background for this matches
119 docLoadingWidget = new LauncherView( stack ); 119 docLoadingWidget = new LauncherView( stack );
120 docLoadingWidget->hideIcons(); 120 docLoadingWidget->hideIcons();
121 QVBox *docLoadingVBox = new QVBox( docLoadingWidget ); 121 QVBox *docLoadingVBox = new QVBox( docLoadingWidget );
122 122
123 docLoadingVBox->setSpacing( 20 ); 123 docLoadingVBox->setSpacing( 20 );
124 docLoadingVBox->setMargin( 10 ); 124 docLoadingVBox->setMargin( 10 );
125 125
126 QWidget *space1 = new QWidget( docLoadingVBox ); 126 QWidget *space1 = new QWidget( docLoadingVBox );
127 docLoadingVBox->setStretchFactor( space1, 1 ); 127 docLoadingVBox->setStretchFactor( space1, 1 );
128 128
129 QLabel *waitPixmap = new QLabel( docLoadingVBox ); 129 QLabel *waitPixmap = new QLabel( docLoadingVBox );
130 waitPixmap->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, waitPixmap->sizePolicy().hasHeightForWidth() ) ); 130 waitPixmap->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, waitPixmap->sizePolicy().hasHeightForWidth() ) );
131 waitPixmap->setPixmap( Resource::loadPixmap( "bigwait" ) ); 131 waitPixmap->setPixmap( Resource::loadPixmap( "bigwait" ) );
132 waitPixmap->setAlignment( int( QLabel::AlignCenter ) ); 132 waitPixmap->setAlignment( int( QLabel::AlignCenter ) );
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 );
139 docLoadingWidgetProgress->setProgress( 0 ); 141 docLoadingWidgetProgress->setProgress( 0 );
140 docLoadingWidgetProgress->setCenterIndicator( TRUE ); 142 docLoadingWidgetProgress->setCenterIndicator( TRUE );
141 docLoadingWidgetProgress->setBackgroundMode( NoBackground ); // No flicker 143 docLoadingWidgetProgress->setBackgroundMode( NoBackground ); // No flicker
142 setProgressStyle(); 144 setProgressStyle();
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 );
145 docLoadingVBox->setStretchFactor( space2, 1 ); 158 docLoadingVBox->setStretchFactor( space2, 1 );
146 159
147 Config cfg("Launcher");
148 cfg.setGroup( "Tab Documents" ); // No tr 160 cfg.setGroup( "Tab Documents" ); // No tr
149 setTabViewAppearance( docLoadingWidget, cfg ); 161 setTabViewAppearance( docLoadingWidget, cfg );
150 162
151 stack->addWidget( docLoadingWidget, 0 ); 163 stack->addWidget( docLoadingWidget, 0 );
152} 164}
153 165
154void LauncherTabWidget::initLayout() 166void LauncherTabWidget::initLayout()
155{ 167{
156 layout()->activate(); 168 layout()->activate();
157 docView()->setFocus(); 169 docView()->setFocus();
158 categoryBar->showTab("Documents"); 170 categoryBar->showTab("Documents");
159} 171}
160 172
161void LauncherTabWidget::appMessage(const QCString& message, const QByteArray&) 173void LauncherTabWidget::appMessage(const QCString& message, const QByteArray&)
162{ 174{
163 if ( message == "nextView()" ) 175 if ( message == "nextView()" )
164 categoryBar->nextTab(); 176 categoryBar->nextTab();
165} 177}
166 178
167void LauncherTabWidget::raiseTabWidget() 179void LauncherTabWidget::raiseTabWidget()
168{ 180{
169 if ( categoryBar->currentView() == docView() 181 if ( categoryBar->currentView() == docView()
170 && docLoadingWidgetEnabled ) { 182 && docLoadingWidgetEnabled ) {
171 stack->raiseWidget( docLoadingWidget ); 183 stack->raiseWidget( docLoadingWidget );
@@ -408,96 +420,99 @@ void LauncherTabWidget::launcherMessage( const QCString &msg, const QByteArray &
408 } 420 }
409 } 421 }
410 }else if ( msg == "setBusyIndicatorType(QString)" ) { 422 }else if ( msg == "setBusyIndicatorType(QString)" ) {
411 QString type; 423 QString type;
412 stream >> type; 424 stream >> type;
413 setBusyIndicatorType( type ); 425 setBusyIndicatorType( type );
414 }else if ( msg == "home()" ) { 426 }else if ( msg == "home()" ) {
415 if ( isVisibleWindow( static_cast<QWidget*>(parent())->winId() ) ) { 427 if ( isVisibleWindow( static_cast<QWidget*>(parent())->winId() ) ) {
416 if (categoryBar) 428 if (categoryBar)
417 categoryBar->nextTab(); 429 categoryBar->nextTab();
418 }else 430 }else
419 static_cast<QWidget*>(parent())->raise(); 431 static_cast<QWidget*>(parent())->raise();
420 } 432 }
421} 433}
422 434
423 435
424 436
425//--------------------------------------------------------------------------- 437//---------------------------------------------------------------------------
426 438
427Launcher::Launcher() 439Launcher::Launcher()
428 : QMainWindow( 0, "PDA User Interface", QWidget::WStyle_Customize | QWidget::WGroupLeader ) 440 : QMainWindow( 0, "PDA User Interface", QWidget::WStyle_Customize | QWidget::WGroupLeader )
429{ 441{
430 tabs = 0; 442 tabs = 0;
431 tb = 0; 443 tb = 0;
444 Config cfg( "Launcher" );
445 cfg.setGroup( "DocTab" );
446 docTabEnabled = cfg.readBoolEntry( "Enable", true );
432} 447}
433 448
434void Launcher::createGUI() 449void Launcher::createGUI()
435{ 450{
436 setCaption( tr("Launcher") ); 451 setCaption( tr("Launcher") );
437 452
438 // we have a pretty good idea how big we'll be 453 // we have a pretty good idea how big we'll be
439 setGeometry( 0, 0, qApp->desktop()->width(), qApp->desktop()->height() ); 454 setGeometry( 0, 0, qApp->desktop()->width(), qApp->desktop()->height() );
440 455
441 tb = new TaskBar; 456 tb = new TaskBar;
442 tabs = new LauncherTabWidget( this ); 457 tabs = new LauncherTabWidget( this );
443 setCentralWidget( tabs ); 458 setCentralWidget( tabs );
444 459
445 ServerInterface::dockWidget( tb, ServerInterface::Bottom ); 460 ServerInterface::dockWidget( tb, ServerInterface::Bottom );
446 tb->show(); 461 tb->show();
447 462
448 qApp->installEventFilter( this ); 463 qApp->installEventFilter( this );
449 464
450 465
451 connect( qApp, SIGNAL(symbol()), this, SLOT(toggleSymbolInput()) ); 466 connect( qApp, SIGNAL(symbol()), this, SLOT(toggleSymbolInput()) );
452 connect( qApp, SIGNAL(numLockStateToggle()), this, SLOT(toggleNumLockState()) ); 467 connect( qApp, SIGNAL(numLockStateToggle()), this, SLOT(toggleNumLockState()) );
453 connect( qApp, SIGNAL(capsLockStateToggle()), this, SLOT(toggleCapsLockState()) ); 468 connect( qApp, SIGNAL(capsLockStateToggle()), this, SLOT(toggleCapsLockState()) );
454 469
455 connect( tb, SIGNAL(tabSelected(const QString&)), 470 connect( tb, SIGNAL(tabSelected(const QString&)),
456 this, SLOT(showTab(const QString&)) ); 471 this, SLOT(showTab(const QString&)) );
457 connect( tabs, SIGNAL(selected(const QString&)), 472 connect( tabs, SIGNAL(selected(const QString&)),
458 this, SLOT(viewSelected(const QString&)) ); 473 this, SLOT(viewSelected(const QString&)) );
459 connect( tabs, SIGNAL(clicked(const AppLnk*)), 474 connect( tabs, SIGNAL(clicked(const AppLnk*)),
460 this, SLOT(select(const AppLnk*))); 475 this, SLOT(select(const AppLnk*)));
461 connect( tabs, SIGNAL(rightPressed(AppLnk*)), 476 connect( tabs, SIGNAL(rightPressed(AppLnk*)),
462 this, SLOT(properties(AppLnk*))); 477 this, SLOT(properties(AppLnk*)));
463 478
464#if defined(Q_WS_QWS) && !defined(QT_NO_COP) 479#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
465 QCopChannel* sysChannel = new QCopChannel( "QPE/System", this ); 480 QCopChannel* sysChannel = new QCopChannel( "QPE/System", this );
466 connect( sysChannel, SIGNAL(received(const QCString &, const QByteArray &)), 481 connect( sysChannel, SIGNAL(received(const QCString &, const QByteArray &)),
467 this, SLOT(systemMessage( const QCString &, const QByteArray &)) ); 482 this, SLOT(systemMessage( const QCString &, const QByteArray &)) );
468#endif 483#endif
469 484
470 // all documents 485 // all documents
471 QImage img( Resource::loadImage( "DocsIcon" ) ); 486 QImage img( Resource::loadImage( "DocsIcon" ) );
472 QPixmap pm; 487 QPixmap pm;
473 pm = img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ); 488 pm = img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() );
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() ) );
481} 496}
482 497
483Launcher::~Launcher() 498Launcher::~Launcher()
484{ 499{
485 if ( tb ) 500 if ( tb )
486 destroyGUI(); 501 destroyGUI();
487} 502}
488 503
489void Launcher::makeVisible() 504void Launcher::makeVisible()
490{ 505{
491 showMaximized(); 506 showMaximized();
492} 507}
493 508
494void Launcher::destroyGUI() 509void Launcher::destroyGUI()
495{ 510{
496 delete tb; 511 delete tb;
497 tb = 0; 512 tb = 0;
498 delete tabs; 513 delete tabs;
499 tabs =0; 514 tabs =0;
500} 515}
501 516
502bool Launcher::eventFilter( QObject*, QEvent *ev ) 517bool Launcher::eventFilter( QObject*, QEvent *ev )
503{ 518{
@@ -713,45 +728,53 @@ void Launcher::applicationStateChanged( const QString& name, ApplicationState st
713void Launcher::applicationScanningProgress( int percent ) 728void Launcher::applicationScanningProgress( int percent )
714{ 729{
715 switch ( percent ) { 730 switch ( percent ) {
716 case 0: { 731 case 0: {
717 for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) { 732 for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) {
718 tabs->view( (*it) )->setUpdatesEnabled( FALSE ); 733 tabs->view( (*it) )->setUpdatesEnabled( FALSE );
719 tabs->view( (*it) )->setSortEnabled( FALSE ); 734 tabs->view( (*it) )->setSortEnabled( FALSE );
720 } 735 }
721 break; 736 break;
722 } 737 }
723 case 100: { 738 case 100: {
724 for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) { 739 for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) {
725 tabs->view( (*it) )->setUpdatesEnabled( TRUE ); 740 tabs->view( (*it) )->setUpdatesEnabled( TRUE );
726 tabs->view( (*it) )->setSortEnabled( TRUE ); 741 tabs->view( (*it) )->setSortEnabled( TRUE );
727 } 742 }
728 break; 743 break;
729 } 744 }
730 default: 745 default:
731 break; 746 break;
732 } 747 }
733} 748}
734 749
735void Launcher::documentScanningProgress( int percent ) 750void 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 ) {
738 case 0: { 761 case 0: {
739 tabs->setLoadingProgress( 0 ); 762 tabs->setLoadingProgress( 0 );
740 tabs->setLoadingWidgetEnabled( TRUE ); 763 tabs->setLoadingWidgetEnabled( TRUE );
741 tabs->docView()->setUpdatesEnabled( FALSE ); 764 tabs->docView()->setUpdatesEnabled( FALSE );
742 tabs->docView()->setSortEnabled( FALSE ); 765 tabs->docView()->setSortEnabled( FALSE );
743 break; 766 break;
744 } 767 }
745 case 100: { 768 case 100: {
746 tabs->docView()->updateTools(); 769 tabs->docView()->updateTools();
747 tabs->docView()->setSortEnabled( TRUE ); 770 tabs->docView()->setSortEnabled( TRUE );
748 tabs->docView()->setUpdatesEnabled( TRUE ); 771 tabs->docView()->setUpdatesEnabled( TRUE );
749 tabs->setLoadingWidgetEnabled( FALSE ); 772 tabs->setLoadingWidgetEnabled( FALSE );
750 break; 773 break;
751 } 774 }
752 default: 775 default:
753 tabs->setLoadingProgress( percent ); 776 tabs->setLoadingProgress( percent );
754 break; 777 break;
755 } 778 }
756} 779}
757 780
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
@@ -129,27 +129,29 @@ public slots:
129 void properties( AppLnk * ); 129 void properties( AppLnk * );
130 void makeVisible(); 130 void makeVisible();
131 131
132signals: 132signals:
133 void executing( const AppLnk * ); 133 void executing( const AppLnk * );
134 134
135private slots: 135private slots:
136 void systemMessage( const QCString &, const QByteArray &); 136 void systemMessage( const QCString &, const QByteArray &);
137 void toggleSymbolInput(); 137 void toggleSymbolInput();
138 void toggleNumLockState(); 138 void toggleNumLockState();
139 void toggleCapsLockState(); 139 void toggleCapsLockState();
140 140
141protected: 141protected:
142 bool eventFilter( QObject *o, QEvent *ev ); 142 bool eventFilter( QObject *o, QEvent *ev );
143 143
144private: 144private:
145 void updateApps(); 145 void updateApps();
146 void loadDocs(); 146 void loadDocs();
147 void updateDocs(); 147 void updateDocs();
148 void updateTabs(); 148 void updateTabs();
149 149
150 LauncherTabWidget *tabs; 150 LauncherTabWidget *tabs;
151 QStringList ids; 151 QStringList ids;
152 TaskBar *tb; 152 TaskBar *tb;
153
154 bool docTabEnabled;
153}; 155};
154 156
155#endif // LAUNCHERVIEW_H 157#endif // LAUNCHERVIEW_H
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
41DocTabSettings::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
59void DocTabSettings::appletChanged()
60{
61}
62
63void 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
33class QCheckBox;
34class QSpinBox;
35
36class 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
@@ -24,64 +24,63 @@
24 59 Temple Place - Suite 330, 24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#include "inputmethodsettings.h" 29#include "inputmethodsettings.h"
30 30
31#include <qpe/config.h> 31#include <qpe/config.h>
32#include <qpe/qlibrary.h> 32#include <qpe/qlibrary.h>
33#include <qpe/qpeapplication.h> 33#include <qpe/qpeapplication.h>
34 34
35#include <qspinbox.h> 35#include <qspinbox.h>
36#include <qcheckbox.h> 36#include <qcheckbox.h>
37#include <qlayout.h> 37#include <qlayout.h>
38#include <qlabel.h> 38#include <qlabel.h>
39#include <qwhatsthis.h> 39#include <qwhatsthis.h>
40 40
41InputMethodSettings::InputMethodSettings( QWidget *parent, const char *name ):QWidget( parent, name ) 41InputMethodSettings::InputMethodSettings( QWidget *parent, const char *name ):QWidget( parent, name )
42{ 42{
43 QBoxLayout *lay = new QVBoxLayout( this, 4, 4 ); 43 QBoxLayout *lay = new QVBoxLayout( this, 4, 4 );
44 44
45 _resize = new QCheckBox( tr( "Resize application on Popup" ), this ); 45 _resize = new QCheckBox( tr( "Resize application on Popup" ), this );
46 _float = new QCheckBox( tr( "Enable floating and resizing" ), this ); 46 _float = new QCheckBox( tr( "Enable floating and resizing" ), this );
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 ) );
50 _size = new QSpinBox( 10, 100, 10, this ); 50 _size = new QSpinBox( 10, 100, 10, this );
51 _size->setSuffix( "%" ); 51 _size->setSuffix( "%" );
52 hbox->addWidget( _size ); 52 hbox->addWidget( _size );
53 hbox->addStretch(); 53 hbox->addStretch();
54 54
55 Config cfg( "Launcher" ); 55 Config cfg( "Launcher" );
56 cfg.setGroup( "InputMethods" ); 56 cfg.setGroup( "InputMethods" );
57 _resize->setChecked( cfg.readBoolEntry( "Resize", true ) ); 57 _resize->setChecked( cfg.readBoolEntry( "Resize", true ) );
58 _float->setChecked( cfg.readBoolEntry( "Float", false ) ); 58 _float->setChecked( cfg.readBoolEntry( "Float", false ) );
59 _size->setValue( cfg.readNumEntry( "Width", 100 ) ); 59 _size->setValue( cfg.readNumEntry( "Width", 100 ) );
60 60
61 lay->addWidget( _resize ); 61 lay->addWidget( _resize );
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 ) );
65 64
66 lay->addStretch(); 65 lay->addStretch();
67 66
68 QWhatsThis::add( _resize, tr( "Check, if you want the application to be automatically resized if the input method pops up." ) ); 67 QWhatsThis::add( _resize, tr( "Check, if you want the application to be automatically resized if the input method pops up." ) );
69 QWhatsThis::add( _float, tr( "Check, if you want to move and/or resize input methods" ) ); 68 QWhatsThis::add( _float, tr( "Check, if you want to move and/or resize input methods" ) );
70 QWhatsThis::add( _size, tr( "Specify the percentage of the screen width for the input method" ) ); 69 QWhatsThis::add( _size, tr( "Specify the percentage of the screen width for the input method" ) );
71} 70}
72 71
73void InputMethodSettings::appletChanged() 72void InputMethodSettings::appletChanged()
74{ 73{
75} 74}
76 75
77void InputMethodSettings::accept() 76void InputMethodSettings::accept()
78{ 77{
79 qDebug( "InputMethodSettings::accept()" ); 78 qDebug( "InputMethodSettings::accept()" );
80 Config cfg( "Launcher" ); 79 Config cfg( "Launcher" );
81 cfg.setGroup( "InputMethods" ); 80 cfg.setGroup( "InputMethods" );
82 cfg.writeEntry( "Resize", _resize->isChecked() ); 81 cfg.writeEntry( "Resize", _resize->isChecked() );
83 cfg.writeEntry( "Float", _float->isChecked() ); 82 cfg.writeEntry( "Float", _float->isChecked() );
84 cfg.writeEntry( "Width", _size->value() ); 83 cfg.writeEntry( "Width", _size->value() );
85 cfg.write(); 84 cfg.write();
86} 85}
87 86
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
@@ -1,26 +1,28 @@
1CONFIG += qt warn_on release quick-app 1CONFIG += qt warn_on release quick-app
2HEADERS = launchersettings.h \ 2HEADERS = launchersettings.h \
3 tabssettings.h \ 3 tabssettings.h \
4 taskbarsettings.h \ 4 taskbarsettings.h \
5 menusettings.h \ 5 menusettings.h \
6 inputmethodsettings.h \ 6 inputmethodsettings.h \
7 doctabsettings.h \
7 tabconfig.h \ 8 tabconfig.h \
8 tabdialog.h 9 tabdialog.h
9 10
10SOURCES = main.cpp \ 11SOURCES = main.cpp \
11 launchersettings.cpp \ 12 launchersettings.cpp \
12 tabssettings.cpp \ 13 tabssettings.cpp \
13 taskbarsettings.cpp \ 14 taskbarsettings.cpp \
14 menusettings.cpp \ 15 menusettings.cpp \
15 inputmethodsettings.cpp \ 16 inputmethodsettings.cpp \
17 doctabsettings.cpp \
16 tabdialog.cpp 18 tabdialog.cpp
17 19
18INCLUDEPATH += $(OPIEDIR)/include 20INCLUDEPATH += $(OPIEDIR)/include
19DEPENDPATH += $(OPIEDIR)/include 21DEPENDPATH += $(OPIEDIR)/include
20LIBS += -lqpe -lopie 22LIBS += -lqpe -lopie
21TARGET = launchersettings 23TARGET = launchersettings
22 24
23 25
24 26
25 27
26include ( $(OPIEDIR)/include.pro ) 28include ( $(OPIEDIR)/include.pro )
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
@@ -15,63 +15,66 @@
15    : ..    .:,     . . . without even the implied warranty of 15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details. 18..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .: 19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU 20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file; 21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the 22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc., 23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330, 24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#include <qlayout.h> 29#include <qlayout.h>
30#include <qapplication.h> 30#include <qapplication.h>
31 31
32#include <opie/otabwidget.h> 32#include <opie/otabwidget.h>
33 33
34#include "launchersettings.h" 34#include "launchersettings.h"
35#include "tabssettings.h" 35#include "tabssettings.h"
36#include "menusettings.h" 36#include "menusettings.h"
37#include "taskbarsettings.h" 37#include "taskbarsettings.h"
38#include "inputmethodsettings.h" 38#include "inputmethodsettings.h"
39#include "doctabsettings.h"
39 40
40LauncherSettings::LauncherSettings (QWidget*,const char*, WFlags) 41LauncherSettings::LauncherSettings (QWidget*,const char*, WFlags)
41 : QDialog ( 0, "LauncherSettings", false, WStyle_ContextHelp ) 42 : QDialog ( 0, "LauncherSettings", false, WStyle_ContextHelp )
42{ 43{
43 setCaption ( tr( "Launcher Settings" )); 44 setCaption ( tr( "Launcher Settings" ));
44 45
45 QVBoxLayout *lay = new QVBoxLayout ( this, 4, 4 ); 46 QVBoxLayout *lay = new QVBoxLayout ( this, 4, 4 );
46 47
47 OTabWidget *tw = new OTabWidget ( this, "otab" ); 48 OTabWidget *tw = new OTabWidget ( this, "otab" );
48 lay-> addWidget ( tw ); 49 lay-> addWidget ( tw );
49 50
50 m_tabs = new TabsSettings ( tw ); 51 m_tabs = new TabsSettings ( tw );
51 m_taskbar = new TaskbarSettings ( tw ); 52 m_taskbar = new TaskbarSettings ( tw );
52 m_menu = new MenuSettings ( tw ); 53 m_menu = new MenuSettings ( tw );
53 m_imethods = new InputMethodSettings ( tw ); 54 m_imethods = new InputMethodSettings ( tw );
55 m_doctab = new DocTabSettings ( tw );
54 56
55 tw-> addTab ( m_taskbar, "wait", tr( "Taskbar" )); 57 tw-> addTab ( m_taskbar, "wait", tr( "Taskbar" ));
56 tw-> addTab ( m_menu, "go", tr( "O-Menu" )); 58 tw-> addTab ( m_menu, "go", tr( "O-Menu" ));
57 tw-> addTab ( m_tabs, "launchersettings/tabstab.png", tr( "Tabs" )); 59 tw-> addTab ( m_tabs, "launchersettings/tabstab.png", tr( "Tabs" ));
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 );
61} 63}
62 64
63void LauncherSettings::accept ( ) 65void LauncherSettings::accept ( )
64{ 66{
65 m_taskbar-> accept ( ); 67 m_taskbar-> accept ( );
66 m_menu-> accept ( ); 68 m_menu-> accept ( );
67 m_tabs-> accept ( ); 69 m_tabs-> accept ( );
68 m_imethods-> accept ( ); 70 m_imethods-> accept ( );
71 m_doctab-> accept ( );
69 72
70 QDialog::accept ( ); 73 QDialog::accept ( );
71} 74}
72 75
73void LauncherSettings::done ( int r ) 76void LauncherSettings::done ( int r )
74{ 77{
75 QDialog::done ( r ); 78 QDialog::done ( r );
76 close ( ); 79 close ( );
77} 80}
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
@@ -13,43 +13,45 @@
13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
14    : ..    .:,     . . . without even the implied warranty of 14    : ..    .:,     . . . without even the implied warranty of
15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
17..}^=.=       =       ; Public License for more details. 17..}^=.=       =       ; Public License for more details.
18++=   -.     .`     .: 18++=   -.     .`     .:
19 :     =  ...= . :.=- You should have received a copy of the GNU 19 :     =  ...= . :.=- You should have received a copy of the GNU
20 -.   .:....=;==+<; General Public License along with this file; 20 -.   .:....=;==+<; General Public License along with this file;
21  -_. . .   )=.  = see the file COPYING. If not, write to the 21  -_. . .   )=.  = see the file COPYING. If not, write to the
22    --        :-=` Free Software Foundation, Inc., 22    --        :-=` Free Software Foundation, Inc.,
23 59 Temple Place - Suite 330, 23 59 Temple Place - Suite 330,
24 Boston, MA 02111-1307, USA. 24 Boston, MA 02111-1307, USA.
25 25
26*/ 26*/
27 27
28#ifndef __LAUNCHER_SETTINGS_H__ 28#ifndef __LAUNCHER_SETTINGS_H__
29#define __LAUNCHER_SETTINGS_H__ 29#define __LAUNCHER_SETTINGS_H__
30 30
31#include <qdialog.h> 31#include <qdialog.h>
32 32
33class TabsSettings; 33class TabsSettings;
34class TaskbarSettings; 34class TaskbarSettings;
35class MenuSettings; 35class MenuSettings;
36class InputMethodSettings; 36class InputMethodSettings;
37class DocTabSettings;
37 38
38class LauncherSettings : public QDialog { 39class LauncherSettings : public QDialog {
39 Q_OBJECT 40 Q_OBJECT
40 41
41public: 42public:
42 static QString appName() { return QString::fromLatin1("launchersettings"); } 43 static QString appName() { return QString::fromLatin1("launchersettings"); }
43 LauncherSettings (QWidget *parent = 0, const char* name = 0, WFlags fl = 0 ); 44 LauncherSettings (QWidget *parent = 0, const char* name = 0, WFlags fl = 0 );
44 45
45 virtual void accept ( ); 46 virtual void accept ( );
46 virtual void done ( int r ); 47 virtual void done ( int r );
47 48
48private: 49private:
49 TabsSettings *m_tabs; 50 TabsSettings *m_tabs;
50 TaskbarSettings *m_taskbar; 51 TaskbarSettings *m_taskbar;
51 MenuSettings *m_menu; 52 MenuSettings *m_menu;
52 InputMethodSettings* m_imethods; 53 InputMethodSettings* m_imethods;
54 DocTabSettings *m_doctab;
53}; 55};
54 56
55#endif 57#endif
diff --git a/noncore/settings/doctab/.cvsignore b/noncore/settings/doctab/.cvsignore
new file mode 100644
index 0000000..50a4b1c
--- a/dev/null
+++ b/noncore/settings/doctab/.cvsignore
@@ -0,0 +1,4 @@
1Makefile*
2languagesettingsbase.cpp
3languagesettingsbase.h
4moc_*
diff --git a/noncore/settings/doctab/config.in b/noncore/settings/doctab/config.in
new file mode 100644
index 0000000..5decda5
--- a/dev/null
+++ b/noncore/settings/doctab/config.in
@@ -0,0 +1,4 @@
1 config DOCTAB
2 boolean "opie-doctab (select doctab for Opie)"
3 default "y"
4 depends ( LIBQPE || LIBQPE-X11 )
diff --git a/noncore/settings/doctab/doctab.cpp b/noncore/settings/doctab/doctab.cpp
new file mode 100644
index 0000000..feaf538
--- a/dev/null
+++ b/noncore/settings/doctab/doctab.cpp
@@ -0,0 +1,94 @@
1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3**
4** This file is part of Qtopia Environment.
5**
6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file.
10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15**
16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you.
18**
19**********************************************************************/
20
21#include "doctab.h"
22
23#include <qpe/global.h>
24#include <qpe/fontmanager.h>
25#include <qpe/config.h>
26#include <qpe/applnk.h>
27#include <qpe/qpedialog.h>
28#include <qpe/qpeapplication.h>
29#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
30#include <qpe/qcopenvelope_qws.h>
31#endif
32
33#include <qlabel.h>
34#include <qcheckbox.h>
35#include <qradiobutton.h>
36#include <qtabwidget.h>
37#include <qslider.h>
38#include <qfile.h>
39#include <qtextstream.h>
40#include <qdatastream.h>
41#include <qmessagebox.h>
42#include <qcombobox.h>
43#include <qspinbox.h>
44#include <qlistbox.h>
45#include <qdir.h>
46#if QT_VERSION >= 300
47#include <qstylefactory.h>
48#endif
49
50#include <stdlib.h>
51
52
53DocTabSettings::DocTabSettings( QWidget* parent, const char* name, WFlags fl )
54 : DocTabSettingsBase( parent, name, TRUE, fl )
55{
56 dl = new QPEDialogListener(this);
57 reset();
58}
59
60DocTabSettings::~DocTabSettings()
61{}
62
63void DocTabSettings::accept()
64{
65 applyDocTab();
66 QDialog::accept();
67}
68
69void DocTabSettings::applyDocTab()
70{
71 Config cfg( "Launcher" );
72 cfg.setGroup( "DocTab" );
73 cfg.writeEntry( "Enable", yes->isChecked() );
74 cfg.write();
75}
76
77
78void DocTabSettings::reject()
79{
80 reset();
81 QDialog::reject();
82}
83
84void DocTabSettings::reset()
85{
86}
87
88QString DocTabSettings::actualDocTab;
89
90void DocTabSettings::done(int r)
91{
92 QDialog::done(r);
93 close();
94}
diff --git a/noncore/settings/doctab/doctab.h b/noncore/settings/doctab/doctab.h
new file mode 100644
index 0000000..ed71978
--- a/dev/null
+++ b/noncore/settings/doctab/doctab.h
@@ -0,0 +1,57 @@
1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3**
4** This file is part of Qtopia Environment.
5**
6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file.
10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15**
16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you.
18**
19**********************************************************************/
20#ifndef DOCTAB_H
21#define DOCTAB_H
22
23
24#include <qstrlist.h>
25#include <qasciidict.h>
26#include "doctabsettingsbase.h"
27
28class QPEDialogListener;
29
30class DocTabSettings : public DocTabSettingsBase
31{
32 Q_OBJECT
33
34public:
35 DocTabSettings( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
36 ~DocTabSettings();
37
38 static QString appName() { return QString::fromLatin1("doctab"); }
39
40protected:
41 void accept();
42 void reject();
43 void done(int);
44
45private slots:
46 void applyDocTab();
47 void reset();
48
49private:
50 static QString actualDocTab;
51
52 QPEDialogListener *dl;
53};
54
55
56#endif // SETTINGS_H
57
diff --git a/noncore/settings/doctab/doctab.pro b/noncore/settings/doctab/doctab.pro
new file mode 100644
index 0000000..d12ac2d
--- a/dev/null
+++ b/noncore/settings/doctab/doctab.pro
@@ -0,0 +1,10 @@
1 CONFIG += qt warn_on release quick-app
2 HEADERS = doctab.h
3 SOURCES = doctab.cpp main.cpp
4 INTERFACES= doctabsettingsbase.ui
5INCLUDEPATH += $(OPIEDIR)/include
6 DEPENDPATH+= ../$(OPIEDIR)/include
7LIBS += -lqpe
8 TARGET = doctab
9
10include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/settings/doctab/doctabsettingsbase.ui b/noncore/settings/doctab/doctabsettingsbase.ui
new file mode 100644
index 0000000..e3bb39b
--- a/dev/null
+++ b/noncore/settings/doctab/doctabsettingsbase.ui
@@ -0,0 +1,115 @@
1<!DOCTYPE UI><UI>
2<class>DocTabSettingsBase</class>
3<widget>
4 <class>QDialog</class>
5 <property stdset="1">
6 <name>name</name>
7 <cstring>DocTabSettingsBase</cstring>
8 </property>
9 <property stdset="1">
10 <name>geometry</name>
11 <rect>
12 <x>0</x>
13 <y>0</y>
14 <width>273</width>
15 <height>293</height>
16 </rect>
17 </property>
18 <property stdset="1">
19 <name>caption</name>
20 <string>DocTab Settings</string>
21 </property>
22 <vbox>
23 <property stdset="1">
24 <name>margin</name>
25 <number>11</number>
26 </property>
27 <property stdset="1">
28 <name>spacing</name>
29 <number>6</number>
30 </property>
31 <widget>
32 <class>QLabel</class>
33 <property stdset="1">
34 <name>name</name>
35 <cstring>TextLabel1</cstring>
36 </property>
37 <property stdset="1">
38 <name>text</name>
39 <string>&lt;b&gt;Do you want a Documents Tab?&lt;/b&gt;&lt;p&gt;
40(Note that such a tab scans &lt;i&gt;all&lt;/i&gt; documents
41on &lt;i&gt;all&lt;/i&gt; external media, which can be quite
42slow and annyoing...)</string>
43 </property>
44 </widget>
45 <widget>
46 <class>QButtonGroup</class>
47 <property stdset="1">
48 <name>name</name>
49 <cstring>ButtonGroup1</cstring>
50 </property>
51 <property stdset="1">
52 <name>title</name>
53 <string>Enable the DocTab</string>
54 </property>
55 <vbox>
56 <property stdset="1">
57 <name>margin</name>
58 <number>11</number>
59 </property>
60 <property stdset="1">
61 <name>spacing</name>
62 <number>6</number>
63 </property>
64 <widget>
65 <class>QRadioButton</class>
66 <property stdset="1">
67 <name>name</name>
68 <cstring>yes</cstring>
69 </property>
70 <property stdset="1">
71 <name>text</name>
72 <string>Yes, please!</string>
73 </property>
74 <property stdset="1">
75 <name>checked</name>
76 <bool>true</bool>
77 </property>
78 </widget>
79 <widget>
80 <class>QRadioButton</class>
81 <property stdset="1">
82 <name>name</name>
83 <cstring>no</cstring>
84 </property>
85 <property stdset="1">
86 <name>text</name>
87 <string>No, thanks.</string>
88 </property>
89 </widget>
90 </vbox>
91 </widget>
92 <spacer>
93 <property>
94 <name>name</name>
95 <cstring>Spacer1</cstring>
96 </property>
97 <property stdset="1">
98 <name>orientation</name>
99 <enum>Vertical</enum>
100 </property>
101 <property stdset="1">
102 <name>sizeType</name>
103 <enum>Expanding</enum>
104 </property>
105 <property>
106 <name>sizeHint</name>
107 <size>
108 <width>20</width>
109 <height>20</height>
110 </size>
111 </property>
112 </spacer>
113 </vbox>
114</widget>
115</UI>
diff --git a/noncore/settings/doctab/main.cpp b/noncore/settings/doctab/main.cpp
new file mode 100644
index 0000000..bfeb2a3
--- a/dev/null
+++ b/noncore/settings/doctab/main.cpp
@@ -0,0 +1,25 @@
1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3**
4** This file is part of Qtopia Environment.
5**
6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file.
10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15**
16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you.
18**
19**********************************************************************/
20
21#include "settings.h"
22
23#include <opie/oapplicationfactory.h>
24
25OPIE_EXPORT_APP( OApplicationFactory<DocTabSettings> )
diff --git a/noncore/settings/doctab/opie-doctab.control b/noncore/settings/doctab/opie-doctab.control
new file mode 100644
index 0000000..9951561
--- a/dev/null
+++ b/noncore/settings/doctab/opie-doctab.control
@@ -0,0 +1,10 @@
1Package: opie-doctab
2Files: plugins/application/libdoctab.so* bin/doctab apps/Settings/DocTab.desktop
3Priority: optional
4Section: opie/settings
5Maintainer: The Opie Team <opie-devel@handhelds.org>
6Architecture: arm
7Depends: task-opie-minimal
8Description: DocTab settings dialog
9 For the Opie environment.
10Version: $QPE_VERSION$EXTRAVERSION
diff --git a/noncore/settings/language/config.in b/noncore/settings/language/config.in
index dbdfdab..489d11c 100644
--- a/noncore/settings/language/config.in
+++ b/noncore/settings/language/config.in
@@ -1,4 +1,4 @@
1 config LANGUAGE 1 config LANGUAGE
2 boolean "opie-language (select language for Opie)" 2 boolean "opie-language (select language for Opie)"
3 default "y" 3 default "y"
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE 4 depends ( LIBQPE || LIBQPE-X11 )
diff --git a/noncore/settings/language/main.cpp b/noncore/settings/language/main.cpp
index 8bdf8a5..709a3f8 100644
--- a/noncore/settings/language/main.cpp
+++ b/noncore/settings/language/main.cpp
@@ -1,27 +1,25 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#include "settings.h" 21#include "settings.h"
22 22
23#include <qpe/qpeapplication.h>
24#include <opie/oapplicationfactory.h> 23#include <opie/oapplicationfactory.h>
25 24
26
27OPIE_EXPORT_APP( OApplicationFactory<LanguageSettings> ) 25OPIE_EXPORT_APP( OApplicationFactory<LanguageSettings> )