author | sandman <sandman> | 2002-10-01 22:43:23 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-10-01 22:43:23 (UTC) |
commit | 895280b5ff189fff2e77d6f5f27668e7dad0d88d (patch) (side-by-side diff) | |
tree | d097848e85b307d94445fb247e8e1a11204bc58b | |
parent | 430b2838137a953a39939a992fc6f08a79954752 (diff) | |
download | opie-895280b5ff189fff2e77d6f5f27668e7dad0d88d.zip opie-895280b5ff189fff2e77d6f5f27668e7dad0d88d.tar.gz opie-895280b5ff189fff2e77d6f5f27668e7dad0d88d.tar.bz2 |
- added a config item for the new busyindicator
- added configs for O Menu (launcher part missing at the moment)
-rw-r--r-- | core/settings/launcher/guisettings.cpp | 153 | ||||
-rw-r--r-- | core/settings/launcher/guisettings.h | 65 | ||||
-rw-r--r-- | core/settings/launcher/launcher.pro | 2 | ||||
-rw-r--r-- | core/settings/launcher/launchersettings.cpp | 8 | ||||
-rw-r--r-- | core/settings/launcher/launchersettings.h | 2 | ||||
-rw-r--r-- | core/settings/launcher/taskbarsettings.cpp | 31 | ||||
-rw-r--r-- | core/settings/launcher/taskbarsettings.h | 3 |
7 files changed, 228 insertions, 36 deletions
diff --git a/core/settings/launcher/guisettings.cpp b/core/settings/launcher/guisettings.cpp new file mode 100644 index 0000000..a292663 --- a/dev/null +++ b/core/settings/launcher/guisettings.cpp @@ -0,0 +1,153 @@ +/* + This file is part of the OPIE Project + =. Copyright (c) 2002 Trolltech AS <info@trolltech.com> + .=l. Copyright (c) 2002 Robert Griebl <sandman@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 "guisettings.h" + +#include <qpe/config.h> +#include <qpe/qpeapplication.h> +#include <qpe/qcopenvelope_qws.h> + +#include <qlistview.h> +#include <qcheckbox.h> +#include <qheader.h> +#include <qlayout.h> +#include <qlabel.h> +#include <qwhatsthis.h> + +#include <stdlib.h> + + +GuiSettings::GuiSettings ( QWidget *parent, const char *name ) + : QWidget ( parent, name ) +{ + m_menu_changed = false; + m_busy_changed = false; + + QGridLayout *lay = new QGridLayout ( this, 0, 0, 4, 4 ); + lay-> addColSpacing ( 0, 16 ); + + m_omenu = new QCheckBox ( tr( "Show O-Menu" ), this ); + lay-> addMultiCellWidget ( m_omenu, 0, 0, 0, 1 ); + + m_omenu_tabs = new QCheckBox ( tr( "Add Launcher tabs to O-Menu" ), this ); + lay-> addWidget ( m_omenu_tabs, 1, 1 ); + + m_omenu_home = new QCheckBox ( tr( "Add 'Home' shortcut to O-Menu" ), this ); + lay-> addWidget ( m_omenu_home, 2, 1 ); + + m_omenu_suspend = new QCheckBox ( tr( "Add 'Suspend' shortcut to O-Menu" ), this ); + lay-> addWidget ( m_omenu_suspend, 3, 1 ); + + QWhatsThis::add( m_omenu_tabs, tr( "Adds the contents of the Launcher as menus in the O-Menu." )); + QWhatsThis::add( m_omenu, tr( "Check if you want the O-Menu in the taskbar." )); + + connect ( m_omenu, SIGNAL( toggled ( bool )), m_omenu_tabs, SLOT( setEnabled ( bool ))); + connect ( m_omenu, SIGNAL( toggled ( bool )), m_omenu_home, SLOT( setEnabled ( bool ))); + connect ( m_omenu, SIGNAL( toggled ( bool )), m_omenu_suspend, SLOT( setEnabled ( bool ))); + + connect ( m_omenu, SIGNAL( toggled ( bool )), this, SLOT( menuChanged ( ))); + connect ( m_omenu_tabs, SIGNAL( toggled ( bool )), this, SLOT( menuChanged ( ))); + connect ( m_omenu_home, SIGNAL( toggled ( bool )), this, SLOT( menuChanged ( ))); + connect ( m_omenu_suspend, SIGNAL( toggled ( bool )), this, SLOT( menuChanged ( ))); + + lay-> addRowSpacing ( 4, 8 ); + + m_busy = new QCheckBox ( tr( "Enable blinking busy indicator" ), this ); + lay-> addMultiCellWidget ( m_busy, 5, 5, 0, 1 ); + + connect ( m_busy, SIGNAL( toggled( bool )), this, SLOT( busyChanged ( ))); + + lay-> setRowStretch ( 6, 10 ); + + init ( ); +} + +void GuiSettings::init ( ) +{ + Config cfg ( "Taskbar" ); + cfg. setGroup ( "Menu" ); + + m_omenu-> setChecked ( cfg. readBoolEntry ( "ShowMenu", true )); + m_omenu_tabs-> setChecked ( cfg. readBoolEntry ( "LauncherTabs", true )); + m_omenu_home-> setChecked ( cfg. readBoolEntry ( "Home", true )); + m_omenu_suspend-> setChecked ( cfg. readBoolEntry ( "Suspend", true )); + + m_omenu_tabs-> setEnabled ( m_omenu-> isChecked ( )); + m_omenu_home-> setEnabled ( m_omenu-> isChecked ( )); + m_omenu_suspend-> setEnabled ( m_omenu-> isChecked ( )); + + Config cfg2 ( "Launcher" ); + cfg2. setGroup ( "GUI" ); + + m_busy-> setChecked ( cfg2. readEntry ( "BusyType" ). lower ( ) == "blink" ); +} + +void GuiSettings::menuChanged() +{ + m_menu_changed = true; +} + +void GuiSettings::busyChanged() +{ + m_busy_changed = true; +} + +void GuiSettings::accept ( ) +{ + Config cfg ( "Taskbar" ); + cfg. setGroup ( "Menu" ); + + if ( m_menu_changed ) { + cfg. writeEntry ( "ShowMenu", m_omenu-> isChecked ( )); + cfg. writeEntry ( "LauncherTabs", m_omenu_tabs-> isChecked ( )); + cfg. writeEntry ( "Home", m_omenu_home-> isChecked ( )); + cfg. writeEntry ( "Suspend", m_omenu_suspend-> isChecked ( )); + } + cfg. write ( ); + + if ( m_menu_changed ) + QCopEnvelope ( "QPE/TaskBar", "reloadApplets()" ); + + Config cfg2 ( "Launcher" ); + cfg2. setGroup ( "GUI" ); + + QString busytype = QString ( m_busy-> isChecked ( ) ? "blink" : "" ); + + if ( m_busy_changed ) { + + cfg2. writeEntry ( "BusyType", busytype ); + } + + cfg2. write ( ); + + if ( m_busy_changed ) { + QCopEnvelope e ( "QPE/Launcher", "setBusyIndicatorType(QString)" ); + e << busytype; + } +} + diff --git a/core/settings/launcher/guisettings.h b/core/settings/launcher/guisettings.h new file mode 100644 index 0000000..2673981 --- a/dev/null +++ b/core/settings/launcher/guisettings.h @@ -0,0 +1,65 @@ +/* + =. This file is part of the OPIE Project + .=l. Copyright (c) 2002 Robert Griebl <sandman@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 __GUI_SETTINGS_H__ +#define __GUI_SETTINGS_H__ + +#include <qwidget.h> +#include <qmap.h> + +class QListView; +class QCheckListItem; +class QCheckBox; + + +class GuiSettings : public QWidget { + Q_OBJECT + +public: + GuiSettings ( QWidget *parent = 0, const char *name = 0 ); + + void accept ( ); + +protected slots: + void menuChanged ( ); + void busyChanged ( ); + +protected: + void init ( ); + +private: + QCheckBox *m_omenu; + QCheckBox *m_omenu_tabs; + QCheckBox *m_omenu_home; + QCheckBox *m_omenu_suspend; + QCheckBox *m_busy; + + bool m_menu_changed; + bool m_busy_changed; +}; + +#endif diff --git a/core/settings/launcher/launcher.pro b/core/settings/launcher/launcher.pro index 484b159..0554d0a 100644 --- a/core/settings/launcher/launcher.pro +++ b/core/settings/launcher/launcher.pro @@ -5,4 +5,5 @@ HEADERS = launchersettings.h \ tabssettings.h \ taskbarsettings.h \ + guisettings.h \ tabconfig.h \ tabdialog.h @@ -12,4 +13,5 @@ SOURCES = main.cpp \ tabssettings.cpp \ taskbarsettings.cpp \ + guisettings.cpp \ tabdialog.cpp diff --git a/core/settings/launcher/launchersettings.cpp b/core/settings/launcher/launchersettings.cpp index 7a020a0..22bf1d1 100644 --- a/core/settings/launcher/launchersettings.cpp +++ b/core/settings/launcher/launchersettings.cpp @@ -33,4 +33,5 @@ #include "tabssettings.h" #include "taskbarsettings.h" +#include "guisettings.h" @@ -46,7 +47,9 @@ LauncherSettings::LauncherSettings ( ) : QDialog ( 0, "LauncherSettings", false m_tabs = new TabsSettings ( tw ); m_taskbar = new TaskbarSettings ( tw ); + m_gui = new GuiSettings ( tw ); - tw-> addTab ( m_taskbar, "appearance/styletabicon.png", tr( "Taskbar" )); - tw-> addTab ( m_tabs, "appearance/styletabicon.png", tr( "Tabs" )); + tw-> addTab ( m_taskbar, "launchersettings/taskbartab.png", tr( "Taskbar" )); + tw-> addTab ( m_tabs, "launchersettings/tabstab.png", tr( "Tabs" )); + tw-> addTab ( m_gui, "launchersettings/guitab.png", tr( "GUI" )); tw-> setCurrentTab ( m_taskbar ); @@ -57,4 +60,5 @@ void LauncherSettings::accept ( ) m_taskbar-> accept ( ); m_tabs-> accept ( ); + m_gui-> accept ( ); QDialog::accept ( ); diff --git a/core/settings/launcher/launchersettings.h b/core/settings/launcher/launchersettings.h index 09ea933..fa9977e 100644 --- a/core/settings/launcher/launchersettings.h +++ b/core/settings/launcher/launchersettings.h @@ -33,4 +33,5 @@ class TabsSettings; class TaskbarSettings; +class GuiSettings; class LauncherSettings : public QDialog { @@ -46,4 +47,5 @@ private: TabsSettings *m_tabs; TaskbarSettings *m_taskbar; + GuiSettings *m_gui; }; diff --git a/core/settings/launcher/taskbarsettings.cpp b/core/settings/launcher/taskbarsettings.cpp index 6921ee8..b5c03c8 100644 --- a/core/settings/launcher/taskbarsettings.cpp +++ b/core/settings/launcher/taskbarsettings.cpp @@ -62,19 +62,7 @@ TaskbarSettings::TaskbarSettings ( QWidget *parent, const char *name ) lay-> addWidget ( m_list ); - m_omenu = new QCheckBox ( tr( "Show O-Menu" ), this ); - lay-> addWidget ( m_omenu ); - - m_omenu_tabs = new QCheckBox ( tr( "Show Launcher tabs in O-Menu" ), this ); - lay-> addWidget ( m_omenu_tabs ); - QWhatsThis::add ( m_list, tr( "Check the applets that you want displayed in the Taskbar." )); - QWhatsThis::add( m_omenu_tabs, tr( "Adds the contents of the Launcher as menus in the O-Menu." )); - QWhatsThis::add( m_omenu, tr( "Check if you want the O-Menu in the taskbar." )); connect ( m_list, SIGNAL( clicked ( QListViewItem * )), this, SLOT( appletChanged ( ))); - connect ( m_omenu, SIGNAL( toggled ( bool )), m_omenu_tabs, SLOT( setEnabled ( bool ))); - - // This option does not make sense ! (sandman) - m_omenu_tabs-> hide ( ); init ( ); @@ -129,11 +117,4 @@ void TaskbarSettings::init ( ) m_applets [*it] = item; } - - cfg. setGroup ( "Menu" ); - - m_omenu_tabs-> setChecked ( cfg. readBoolEntry ( "LauncherTabs", true )); - m_omenu-> setChecked ( cfg. readBoolEntry ( "ShowMenu", true )); - - m_omenu_tabs-> setEnabled ( m_omenu-> isChecked ( )); } @@ -157,16 +138,4 @@ void TaskbarSettings::accept ( ) } cfg. writeEntry ( "SafeMode", false ); - - cfg. setGroup ( "Menu" ); - - if ( m_omenu_tabs-> isChecked ( ) != cfg. readBoolEntry ( "LauncherTabs", true )) { - m_applets_changed = true; - cfg. writeEntry ( "LauncherTabs", m_omenu_tabs-> isChecked ( )); - } - - if ( m_omenu-> isChecked ( ) != cfg. readBoolEntry ( "ShowMenu", true )) { - m_applets_changed = true; - cfg. writeEntry ( "ShowMenu", m_omenu-> isChecked ( )); - } cfg. write ( ); diff --git a/core/settings/launcher/taskbarsettings.h b/core/settings/launcher/taskbarsettings.h index 2f5242f..b99720d 100644 --- a/core/settings/launcher/taskbarsettings.h +++ b/core/settings/launcher/taskbarsettings.h @@ -53,7 +53,4 @@ protected: private: QListView *m_list; - QCheckBox *m_omenu; - QCheckBox *m_omenu_tabs; - QMap <QString, QCheckListItem *> m_applets; bool m_applets_changed; |