author | mickeyl <mickeyl> | 2003-11-17 15:16:13 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-11-17 15:16:13 (UTC) |
commit | c4a6e9c529ea6bcb1c9a42fee33a70300f116c98 (patch) (side-by-side diff) | |
tree | 1ee68a2035b0218ba99662db1dff4c4067064cde /noncore/settings | |
parent | 725e2723291fe1d71ca68cb59cec83428d40b8af (diff) | |
download | opie-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"
-rw-r--r-- | noncore/settings/doctab/.cvsignore | 4 | ||||
-rw-r--r-- | noncore/settings/doctab/config.in | 4 | ||||
-rw-r--r-- | noncore/settings/doctab/doctab.cpp | 94 | ||||
-rw-r--r-- | noncore/settings/doctab/doctab.h | 57 | ||||
-rw-r--r-- | noncore/settings/doctab/doctab.pro | 10 | ||||
-rw-r--r-- | noncore/settings/doctab/doctabsettingsbase.ui | 115 | ||||
-rw-r--r-- | noncore/settings/doctab/main.cpp | 25 | ||||
-rw-r--r-- | noncore/settings/doctab/opie-doctab.control | 10 | ||||
-rw-r--r-- | noncore/settings/language/config.in | 2 | ||||
-rw-r--r-- | noncore/settings/language/main.cpp | 2 |
10 files changed, 320 insertions, 3 deletions
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 @@ +Makefile* +languagesettingsbase.cpp +languagesettingsbase.h +moc_* 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 @@ + config DOCTAB + boolean "opie-doctab (select doctab for Opie)" + default "y" + 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 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** +** This file is part of Qtopia Environment. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** 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 "doctab.h" + +#include <qpe/global.h> +#include <qpe/fontmanager.h> +#include <qpe/config.h> +#include <qpe/applnk.h> +#include <qpe/qpedialog.h> +#include <qpe/qpeapplication.h> +#if defined(Q_WS_QWS) && !defined(QT_NO_COP) +#include <qpe/qcopenvelope_qws.h> +#endif + +#include <qlabel.h> +#include <qcheckbox.h> +#include <qradiobutton.h> +#include <qtabwidget.h> +#include <qslider.h> +#include <qfile.h> +#include <qtextstream.h> +#include <qdatastream.h> +#include <qmessagebox.h> +#include <qcombobox.h> +#include <qspinbox.h> +#include <qlistbox.h> +#include <qdir.h> +#if QT_VERSION >= 300 +#include <qstylefactory.h> +#endif + +#include <stdlib.h> + + +DocTabSettings::DocTabSettings( QWidget* parent, const char* name, WFlags fl ) + : DocTabSettingsBase( parent, name, TRUE, fl ) +{ + dl = new QPEDialogListener(this); + reset(); +} + +DocTabSettings::~DocTabSettings() +{} + +void DocTabSettings::accept() +{ + applyDocTab(); + QDialog::accept(); +} + +void DocTabSettings::applyDocTab() +{ + Config cfg( "Launcher" ); + cfg.setGroup( "DocTab" ); + cfg.writeEntry( "Enable", yes->isChecked() ); + cfg.write(); +} + + +void DocTabSettings::reject() +{ + reset(); + QDialog::reject(); +} + +void DocTabSettings::reset() +{ +} + +QString DocTabSettings::actualDocTab; + +void DocTabSettings::done(int r) +{ + QDialog::done(r); + close(); +} 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 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** +** This file is part of Qtopia Environment. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** 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. +** +**********************************************************************/ +#ifndef DOCTAB_H +#define DOCTAB_H + + +#include <qstrlist.h> +#include <qasciidict.h> +#include "doctabsettingsbase.h" + +class QPEDialogListener; + +class DocTabSettings : public DocTabSettingsBase +{ + Q_OBJECT + +public: + DocTabSettings( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~DocTabSettings(); + + static QString appName() { return QString::fromLatin1("doctab"); } + +protected: + void accept(); + void reject(); + void done(int); + +private slots: + void applyDocTab(); + void reset(); + +private: + static QString actualDocTab; + + QPEDialogListener *dl; +}; + + +#endif // SETTINGS_H + 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 @@ +CONFIG += qt warn_on release quick-app +HEADERS = doctab.h +SOURCES = doctab.cpp main.cpp +INTERFACES = doctabsettingsbase.ui +INCLUDEPATH += $(OPIEDIR)/include +DEPENDPATH += ../$(OPIEDIR)/include +LIBS += -lqpe +TARGET = doctab + +include ( $(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 @@ +<!DOCTYPE UI><UI> +<class>DocTabSettingsBase</class> +<widget> + <class>QDialog</class> + <property stdset="1"> + <name>name</name> + <cstring>DocTabSettingsBase</cstring> + </property> + <property stdset="1"> + <name>geometry</name> + <rect> + <x>0</x> + <y>0</y> + <width>273</width> + <height>293</height> + </rect> + </property> + <property stdset="1"> + <name>caption</name> + <string>DocTab Settings</string> + </property> + <vbox> + <property stdset="1"> + <name>margin</name> + <number>11</number> + </property> + <property stdset="1"> + <name>spacing</name> + <number>6</number> + </property> + <widget> + <class>QLabel</class> + <property stdset="1"> + <name>name</name> + <cstring>TextLabel1</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string><b>Do you want a Documents Tab?</b><p> +(Note that such a tab scans <i>all</i> documents +on <i>all</i> external media, which can be quite +slow and annyoing...)</string> + </property> + </widget> + <widget> + <class>QButtonGroup</class> + <property stdset="1"> + <name>name</name> + <cstring>ButtonGroup1</cstring> + </property> + <property stdset="1"> + <name>title</name> + <string>Enable the DocTab</string> + </property> + <vbox> + <property stdset="1"> + <name>margin</name> + <number>11</number> + </property> + <property stdset="1"> + <name>spacing</name> + <number>6</number> + </property> + <widget> + <class>QRadioButton</class> + <property stdset="1"> + <name>name</name> + <cstring>yes</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>Yes, please!</string> + </property> + <property stdset="1"> + <name>checked</name> + <bool>true</bool> + </property> + </widget> + <widget> + <class>QRadioButton</class> + <property stdset="1"> + <name>name</name> + <cstring>no</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>No, thanks.</string> + </property> + </widget> + </vbox> + </widget> + <spacer> + <property> + <name>name</name> + <cstring>Spacer1</cstring> + </property> + <property stdset="1"> + <name>orientation</name> + <enum>Vertical</enum> + </property> + <property stdset="1"> + <name>sizeType</name> + <enum>Expanding</enum> + </property> + <property> + <name>sizeHint</name> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </vbox> +</widget> +</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 @@ +/********************************************************************** +** Copyright (C) 2000 Trolltech AS. All rights reserved. +** +** This file is part of Qtopia Environment. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** 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 "settings.h" + +#include <opie/oapplicationfactory.h> + +OPIE_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 @@ +Package: opie-doctab +Files: plugins/application/libdoctab.so* bin/doctab apps/Settings/DocTab.desktop +Priority: optional +Section: opie/settings +Maintainer: The Opie Team <opie-devel@handhelds.org> +Architecture: arm +Depends: task-opie-minimal +Description: DocTab settings dialog + For the Opie environment. +Version: $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 @@ config LANGUAGE boolean "opie-language (select language for Opie)" default "y" - depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE + 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 @@ -11,17 +11,15 @@ ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** 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 "settings.h" -#include <qpe/qpeapplication.h> #include <opie/oapplicationfactory.h> - OPIE_EXPORT_APP( OApplicationFactory<LanguageSettings> ) |