summaryrefslogtreecommitdiff
path: root/core
Side-by-side diff
Diffstat (limited to 'core') (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
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
@@ -12,24 +12,25 @@
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include "documentlist.h"
#include "serverinterface.h"
#include "launcherglobal.h"
+#include <qtopia/config.h>
#include <qtopia/mimetype.h>
#include <qtopia/resource.h>
#include <qtopia/global.h>
#include <qtopia/private/categories.h>
#include <qtopia/qpeapplication.h>
#include <qtopia/applnk.h>
#include <qtopia/storage.h>
#ifdef Q_WS_QWS
#include <qtopia/qcopenvelope_qws.h>
#endif
#include <qtimer.h>
@@ -95,25 +96,39 @@ DocumentList::DocumentList( ServerInterface *serverGui, bool scanDocs,
{
appLnkSet = new AppLnkSet( MimeType::appsFolderName() );
d = new DocumentListPrivate( serverGui );
d->scanDocs = scanDocs;
d->needToSendAllDocLinks = false;
QTimer::singleShot( 10, this, SLOT( startInitialScan() ) );
}
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()
{
delete appLnkSet;
delete d;
}
void DocumentList::add( const DocLnk& doc )
{
if ( d->serverGui && QFile::exists( doc.file() ) )
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
@@ -69,24 +69,26 @@
struct {
bool enabled;
const char *app;
const char *start;
const char *stop;
const char *desc;
}
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") },
#endif
{ FALSE, "addressbook", "editPersonalAndClose()", "accept()", // No tr
QT_TR_NOOP("Personal Information") },
{ FALSE, 0, 0, 0, 0 }
};
FirstUse::FirstUse(QWidget* parent, const char * name, WFlags wf) :
QDialog( parent, name, TRUE, wf),
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
@@ -73,25 +73,25 @@
#endif
#ifdef Q_WS_QWS
#include <qkeyboard_qws.h>
#include <qpe/lnkproperties.h>
#endif
static bool isVisibleWindow( int );
//===========================================================================
LauncherTabWidget::LauncherTabWidget( Launcher* parent ) :
- QVBox( parent )
+ QVBox( parent ), docview( 0 )
{
docLoadingWidgetEnabled = false;
docLoadingWidget = 0;
docLoadingWidgetProgress = 0;
launcher = parent;
categoryBar = new LauncherTabBar( this );
QPalette pal = categoryBar->palette();
pal.setColor( QColorGroup::Light, pal.color(QPalette::Active,QColorGroup::Shadow) );
pal.setColor( QColorGroup::Background, pal.active().background().light(110) );
categoryBar->setPalette( pal );
stack = new QWidgetStack(this);
connect( categoryBar, SIGNAL(selected(int)), this, SLOT(raiseTabWidget()) );
@@ -122,38 +122,50 @@ void LauncherTabWidget::createDocLoadingWidget()
docLoadingVBox->setSpacing( 20 );
docLoadingVBox->setMargin( 10 );
QWidget *space1 = new QWidget( docLoadingVBox );
docLoadingVBox->setStretchFactor( space1, 1 );
QLabel *waitPixmap = new QLabel( docLoadingVBox );
waitPixmap->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, waitPixmap->sizePolicy().hasHeightForWidth() ) );
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 );
stack->addWidget( docLoadingWidget, 0 );
}
void LauncherTabWidget::initLayout()
{
layout()->activate();
docView()->setFocus();
categoryBar->showTab("Documents");
}
@@ -420,24 +432,27 @@ void LauncherTabWidget::launcherMessage( const QCString &msg, const QByteArray &
}
}
//---------------------------------------------------------------------------
Launcher::Launcher()
: QMainWindow( 0, "PDA User Interface", QWidget::WStyle_Customize | QWidget::WGroupLeader )
{
tabs = 0;
tb = 0;
+ Config cfg( "Launcher" );
+ cfg.setGroup( "DocTab" );
+ docTabEnabled = cfg.readBoolEntry( "Enable", true );
}
void Launcher::createGUI()
{
setCaption( tr("Launcher") );
// we have a pretty good idea how big we'll be
setGeometry( 0, 0, qApp->desktop()->width(), qApp->desktop()->height() );
tb = new TaskBar;
tabs = new LauncherTabWidget( this );
setCentralWidget( tabs );
@@ -463,29 +478,29 @@ void Launcher::createGUI()
#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
QCopChannel* sysChannel = new QCopChannel( "QPE/System", this );
connect( sysChannel, SIGNAL(received(const QCString &, const QByteArray &)),
this, SLOT(systemMessage( const QCString &, const QByteArray &)) );
#endif
// all documents
QImage img( Resource::loadImage( "DocsIcon" ) );
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() ) );
}
Launcher::~Launcher()
{
if ( tb )
destroyGUI();
}
void Launcher::makeVisible()
{
showMaximized();
@@ -725,24 +740,32 @@ void Launcher::applicationScanningProgress( int percent )
tabs->view( (*it) )->setUpdatesEnabled( TRUE );
tabs->view( (*it) )->setSortEnabled( TRUE );
}
break;
}
default:
break;
}
}
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 );
tabs->setLoadingWidgetEnabled( TRUE );
tabs->docView()->setUpdatesEnabled( FALSE );
tabs->docView()->setSortEnabled( FALSE );
break;
}
case 100: {
tabs->docView()->updateTools();
tabs->docView()->setSortEnabled( TRUE );
tabs->docView()->setUpdatesEnabled( TRUE );
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
@@ -141,15 +141,17 @@ private slots:
protected:
bool eventFilter( QObject *o, QEvent *ev );
private:
void updateApps();
void loadDocs();
void updateDocs();
void updateTabs();
LauncherTabWidget *tabs;
QStringList ids;
TaskBar *tb;
+
+ bool docTabEnabled;
};
#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 @@
+/*
+                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
@@ -36,40 +36,39 @@
#include <qcheckbox.h>
#include <qlayout.h>
#include <qlabel.h>
#include <qwhatsthis.h>
InputMethodSettings::InputMethodSettings( QWidget *parent, const char *name ):QWidget( parent, name )
{
QBoxLayout *lay = new QVBoxLayout( this, 4, 4 );
_resize = new QCheckBox( tr( "Resize application on Popup" ), this );
_float = new QCheckBox( tr( "Enable floating and resizing" ), this );
- QHBoxLayout* hbox = new QHBoxLayout( this, 4, 4 );
+ QHBoxLayout* hbox = new QHBoxLayout( lay, 4 );
hbox->addWidget( new QLabel( "Initial Width:", this ) );
_size = new QSpinBox( 10, 100, 10, this );
_size->setSuffix( "%" );
hbox->addWidget( _size );
hbox->addStretch();
Config cfg( "Launcher" );
cfg.setGroup( "InputMethods" );
_resize->setChecked( cfg.readBoolEntry( "Resize", true ) );
_float->setChecked( cfg.readBoolEntry( "Float", false ) );
_size->setValue( cfg.readNumEntry( "Width", 100 ) );
lay->addWidget( _resize );
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 ) );
lay->addStretch();
QWhatsThis::add( _resize, tr( "Check, if you want the application to be automatically resized if the input method pops up." ) );
QWhatsThis::add( _float, tr( "Check, if you want to move and/or resize input methods" ) );
QWhatsThis::add( _size, tr( "Specify the percentage of the screen width for the input method" ) );
}
void InputMethodSettings::appletChanged()
{
}
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 @@
CONFIG += qt warn_on release quick-app
HEADERS = launchersettings.h \
tabssettings.h \
taskbarsettings.h \
menusettings.h \
inputmethodsettings.h \
+ doctabsettings.h \
tabconfig.h \
tabdialog.h
SOURCES = main.cpp \
launchersettings.cpp \
tabssettings.cpp \
taskbarsettings.cpp \
menusettings.cpp \
inputmethodsettings.cpp \
+ doctabsettings.cpp \
tabdialog.cpp
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
LIBS += -lqpe -lopie
TARGET = launchersettings
include ( $(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
@@ -27,51 +27,54 @@
*/
#include <qlayout.h>
#include <qapplication.h>
#include <opie/otabwidget.h>
#include "launchersettings.h"
#include "tabssettings.h"
#include "menusettings.h"
#include "taskbarsettings.h"
#include "inputmethodsettings.h"
+#include "doctabsettings.h"
LauncherSettings::LauncherSettings (QWidget*,const char*, WFlags)
: QDialog ( 0, "LauncherSettings", false, WStyle_ContextHelp )
{
setCaption ( tr( "Launcher Settings" ));
QVBoxLayout *lay = new QVBoxLayout ( this, 4, 4 );
OTabWidget *tw = new OTabWidget ( this, "otab" );
lay-> addWidget ( tw );
m_tabs = new TabsSettings ( tw );
m_taskbar = new TaskbarSettings ( tw );
m_menu = new MenuSettings ( tw );
m_imethods = new InputMethodSettings ( tw );
+ m_doctab = new DocTabSettings ( tw );
tw-> addTab ( m_taskbar, "wait", tr( "Taskbar" ));
tw-> addTab ( m_menu, "go", tr( "O-Menu" ));
tw-> addTab ( m_tabs, "launchersettings/tabstab.png", tr( "Tabs" ));
tw-> addTab ( m_imethods, "launchersettings/inputmethod.png", tr( "InputMethods" ));
-
+ tw-> addTab ( m_doctab, "DocsIcon", tr( "DocTab" ) );
tw-> setCurrentTab ( m_taskbar );
}
void LauncherSettings::accept ( )
{
m_taskbar-> accept ( );
m_menu-> accept ( );
m_tabs-> accept ( );
m_imethods-> accept ( );
+ m_doctab-> accept ( );
QDialog::accept ( );
}
void LauncherSettings::done ( int r )
{
QDialog::done ( r );
close ( );
}
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
@@ -25,31 +25,33 @@
*/
#ifndef __LAUNCHER_SETTINGS_H__
#define __LAUNCHER_SETTINGS_H__
#include <qdialog.h>
class TabsSettings;
class TaskbarSettings;
class MenuSettings;
class InputMethodSettings;
+class DocTabSettings;
class LauncherSettings : public QDialog {
Q_OBJECT
public:
static QString appName() { return QString::fromLatin1("launchersettings"); }
LauncherSettings (QWidget *parent = 0, const char* name = 0, WFlags fl = 0 );
virtual void accept ( );
virtual void done ( int r );
private:
TabsSettings *m_tabs;
TaskbarSettings *m_taskbar;
MenuSettings *m_menu;
InputMethodSettings* m_imethods;
+ DocTabSettings *m_doctab;
};
#endif