From c4a6e9c529ea6bcb1c9a42fee33a70300f116c98 Mon Sep 17 00:00:00 2001 From: mickeyl Date: Mon, 17 Nov 2003 15:16:13 +0000 Subject: 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" --- (limited to 'noncore/settings') 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 +#include +#include +#include +#include +#include +#if defined(Q_WS_QWS) && !defined(QT_NO_COP) +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#if QT_VERSION >= 300 +#include +#endif + +#include + + +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 +#include +#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 @@ + +DocTabSettingsBase + + QDialog + + name + DocTabSettingsBase + + + geometry + + 0 + 0 + 273 + 293 + + + + caption + DocTab Settings + + + + margin + 11 + + + spacing + 6 + + + QLabel + + name + TextLabel1 + + + text + <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...) + + + + QButtonGroup + + name + ButtonGroup1 + + + title + Enable the DocTab + + + + margin + 11 + + + spacing + 6 + + + QRadioButton + + name + yes + + + text + Yes, please! + + + checked + true + + + + QRadioButton + + name + no + + + text + No, thanks. + + + + + + + name + Spacer1 + + + orientation + Vertical + + + sizeType + Expanding + + + sizeHint + + 20 + 20 + + + + + + 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_EXPORT_APP( OApplicationFactory ) 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 +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 @@ -20,8 +20,6 @@ #include "settings.h" -#include #include - OPIE_EXPORT_APP( OApplicationFactory ) -- cgit v0.9.0.2