-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 @@ | |||
1 | /* | ||
2 | This file is part of the OPIE Project | ||
3 | =. Copyright (c) 2002 Trolltech AS <info@trolltech.com> | ||
4 | .=l. Copyright (c) 2002 Robert Griebl <sandman@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 "guisettings.h" | ||
30 | |||
31 | #include <qpe/config.h> | ||
32 | #include <qpe/qpeapplication.h> | ||
33 | #include <qpe/qcopenvelope_qws.h> | ||
34 | |||
35 | #include <qlistview.h> | ||
36 | #include <qcheckbox.h> | ||
37 | #include <qheader.h> | ||
38 | #include <qlayout.h> | ||
39 | #include <qlabel.h> | ||
40 | #include <qwhatsthis.h> | ||
41 | |||
42 | #include <stdlib.h> | ||
43 | |||
44 | |||
45 | GuiSettings::GuiSettings ( QWidget *parent, const char *name ) | ||
46 | : QWidget ( parent, name ) | ||
47 | { | ||
48 | m_menu_changed = false; | ||
49 | m_busy_changed = false; | ||
50 | |||
51 | QGridLayout *lay = new QGridLayout ( this, 0, 0, 4, 4 ); | ||
52 | lay-> addColSpacing ( 0, 16 ); | ||
53 | |||
54 | m_omenu = new QCheckBox ( tr( "Show O-Menu" ), this ); | ||
55 | lay-> addMultiCellWidget ( m_omenu, 0, 0, 0, 1 ); | ||
56 | |||
57 | m_omenu_tabs = new QCheckBox ( tr( "Add Launcher tabs to O-Menu" ), this ); | ||
58 | lay-> addWidget ( m_omenu_tabs, 1, 1 ); | ||
59 | |||
60 | m_omenu_home = new QCheckBox ( tr( "Add 'Home' shortcut to O-Menu" ), this ); | ||
61 | lay-> addWidget ( m_omenu_home, 2, 1 ); | ||
62 | |||
63 | m_omenu_suspend = new QCheckBox ( tr( "Add 'Suspend' shortcut to O-Menu" ), this ); | ||
64 | lay-> addWidget ( m_omenu_suspend, 3, 1 ); | ||
65 | |||
66 | QWhatsThis::add( m_omenu_tabs, tr( "Adds the contents of the Launcher as menus in the O-Menu." )); | ||
67 | QWhatsThis::add( m_omenu, tr( "Check if you want the O-Menu in the taskbar." )); | ||
68 | |||
69 | connect ( m_omenu, SIGNAL( toggled ( bool )), m_omenu_tabs, SLOT( setEnabled ( bool ))); | ||
70 | connect ( m_omenu, SIGNAL( toggled ( bool )), m_omenu_home, SLOT( setEnabled ( bool ))); | ||
71 | connect ( m_omenu, SIGNAL( toggled ( bool )), m_omenu_suspend, SLOT( setEnabled ( bool ))); | ||
72 | |||
73 | connect ( m_omenu, SIGNAL( toggled ( bool )), this, SLOT( menuChanged ( ))); | ||
74 | connect ( m_omenu_tabs, SIGNAL( toggled ( bool )), this, SLOT( menuChanged ( ))); | ||
75 | connect ( m_omenu_home, SIGNAL( toggled ( bool )), this, SLOT( menuChanged ( ))); | ||
76 | connect ( m_omenu_suspend, SIGNAL( toggled ( bool )), this, SLOT( menuChanged ( ))); | ||
77 | |||
78 | lay-> addRowSpacing ( 4, 8 ); | ||
79 | |||
80 | m_busy = new QCheckBox ( tr( "Enable blinking busy indicator" ), this ); | ||
81 | lay-> addMultiCellWidget ( m_busy, 5, 5, 0, 1 ); | ||
82 | |||
83 | connect ( m_busy, SIGNAL( toggled( bool )), this, SLOT( busyChanged ( ))); | ||
84 | |||
85 | lay-> setRowStretch ( 6, 10 ); | ||
86 | |||
87 | init ( ); | ||
88 | } | ||
89 | |||
90 | void GuiSettings::init ( ) | ||
91 | { | ||
92 | Config cfg ( "Taskbar" ); | ||
93 | cfg. setGroup ( "Menu" ); | ||
94 | |||
95 | m_omenu-> setChecked ( cfg. readBoolEntry ( "ShowMenu", true )); | ||
96 | m_omenu_tabs-> setChecked ( cfg. readBoolEntry ( "LauncherTabs", true )); | ||
97 | m_omenu_home-> setChecked ( cfg. readBoolEntry ( "Home", true )); | ||
98 | m_omenu_suspend-> setChecked ( cfg. readBoolEntry ( "Suspend", true )); | ||
99 | |||
100 | m_omenu_tabs-> setEnabled ( m_omenu-> isChecked ( )); | ||
101 | m_omenu_home-> setEnabled ( m_omenu-> isChecked ( )); | ||
102 | m_omenu_suspend-> setEnabled ( m_omenu-> isChecked ( )); | ||
103 | |||
104 | Config cfg2 ( "Launcher" ); | ||
105 | cfg2. setGroup ( "GUI" ); | ||
106 | |||
107 | m_busy-> setChecked ( cfg2. readEntry ( "BusyType" ). lower ( ) == "blink" ); | ||
108 | } | ||
109 | |||
110 | void GuiSettings::menuChanged() | ||
111 | { | ||
112 | m_menu_changed = true; | ||
113 | } | ||
114 | |||
115 | void GuiSettings::busyChanged() | ||
116 | { | ||
117 | m_busy_changed = true; | ||
118 | } | ||
119 | |||
120 | void GuiSettings::accept ( ) | ||
121 | { | ||
122 | Config cfg ( "Taskbar" ); | ||
123 | cfg. setGroup ( "Menu" ); | ||
124 | |||
125 | if ( m_menu_changed ) { | ||
126 | cfg. writeEntry ( "ShowMenu", m_omenu-> isChecked ( )); | ||
127 | cfg. writeEntry ( "LauncherTabs", m_omenu_tabs-> isChecked ( )); | ||
128 | cfg. writeEntry ( "Home", m_omenu_home-> isChecked ( )); | ||
129 | cfg. writeEntry ( "Suspend", m_omenu_suspend-> isChecked ( )); | ||
130 | } | ||
131 | cfg. write ( ); | ||
132 | |||
133 | if ( m_menu_changed ) | ||
134 | QCopEnvelope ( "QPE/TaskBar", "reloadApplets()" ); | ||
135 | |||
136 | Config cfg2 ( "Launcher" ); | ||
137 | cfg2. setGroup ( "GUI" ); | ||
138 | |||
139 | QString busytype = QString ( m_busy-> isChecked ( ) ? "blink" : "" ); | ||
140 | |||
141 | if ( m_busy_changed ) { | ||
142 | |||
143 | cfg2. writeEntry ( "BusyType", busytype ); | ||
144 | } | ||
145 | |||
146 | cfg2. write ( ); | ||
147 | |||
148 | if ( m_busy_changed ) { | ||
149 | QCopEnvelope e ( "QPE/Launcher", "setBusyIndicatorType(QString)" ); | ||
150 | e << busytype; | ||
151 | } | ||
152 | } | ||
153 | |||
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 @@ | |||
1 | /* | ||
2 | =. This file is part of the OPIE Project | ||
3 | .=l. Copyright (c) 2002 Robert Griebl <sandman@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 __GUI_SETTINGS_H__ | ||
29 | #define __GUI_SETTINGS_H__ | ||
30 | |||
31 | #include <qwidget.h> | ||
32 | #include <qmap.h> | ||
33 | |||
34 | class QListView; | ||
35 | class QCheckListItem; | ||
36 | class QCheckBox; | ||
37 | |||
38 | |||
39 | class GuiSettings : public QWidget { | ||
40 | Q_OBJECT | ||
41 | |||
42 | public: | ||
43 | GuiSettings ( QWidget *parent = 0, const char *name = 0 ); | ||
44 | |||
45 | void accept ( ); | ||
46 | |||
47 | protected slots: | ||
48 | void menuChanged ( ); | ||
49 | void busyChanged ( ); | ||
50 | |||
51 | protected: | ||
52 | void init ( ); | ||
53 | |||
54 | private: | ||
55 | QCheckBox *m_omenu; | ||
56 | QCheckBox *m_omenu_tabs; | ||
57 | QCheckBox *m_omenu_home; | ||
58 | QCheckBox *m_omenu_suspend; | ||
59 | QCheckBox *m_busy; | ||
60 | |||
61 | bool m_menu_changed; | ||
62 | bool m_busy_changed; | ||
63 | }; | ||
64 | |||
65 | #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 | |||
@@ -1,20 +1,22 @@ | |||
1 | TEMPLATE = app | 1 | TEMPLATE = app |
2 | CONFIG += qt warn_on release | 2 | CONFIG += qt warn_on release |
3 | DESTDIR = $(OPIEDIR)/bin | 3 | DESTDIR = $(OPIEDIR)/bin |
4 | HEADERS = launchersettings.h \ | 4 | HEADERS = launchersettings.h \ |
5 | tabssettings.h \ | 5 | tabssettings.h \ |
6 | taskbarsettings.h \ | 6 | taskbarsettings.h \ |
7 | guisettings.h \ | ||
7 | tabconfig.h \ | 8 | tabconfig.h \ |
8 | tabdialog.h | 9 | tabdialog.h |
9 | 10 | ||
10 | SOURCES = main.cpp \ | 11 | SOURCES = main.cpp \ |
11 | launchersettings.cpp \ | 12 | launchersettings.cpp \ |
12 | tabssettings.cpp \ | 13 | tabssettings.cpp \ |
13 | taskbarsettings.cpp \ | 14 | taskbarsettings.cpp \ |
15 | guisettings.cpp \ | ||
14 | tabdialog.cpp | 16 | tabdialog.cpp |
15 | 17 | ||
16 | INCLUDEPATH += $(OPIEDIR)/include | 18 | INCLUDEPATH += $(OPIEDIR)/include |
17 | DEPENDPATH += $(OPIEDIR)/include | 19 | DEPENDPATH += $(OPIEDIR)/include |
18 | LIBS += -lqpe -lopie | 20 | LIBS += -lqpe -lopie |
19 | TARGET = launchersettings | 21 | TARGET = launchersettings |
20 | 22 | ||
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 | |||
@@ -1,67 +1,71 @@ | |||
1 | /* | 1 | /* |
2 | =. This file is part of the OPIE Project | 2 | =. This file is part of the OPIE Project |
3 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> | 3 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> |
4 | .>+-= | 4 | .>+-= |
5 | _;:, .> :=|. This file is free software; you can | 5 | _;:, .> :=|. This file is free software; you can |
6 | .> <`_, > . <= redistribute it and/or modify it under | 6 | .> <`_, > . <= redistribute it and/or modify it under |
7 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 7 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
8 | .="- .-=="i, .._ License as published by the Free Software | 8 | .="- .-=="i, .._ License as published by the Free Software |
9 | - . .-<_> .<> Foundation; either version 2 of the License, | 9 | - . .-<_> .<> Foundation; either version 2 of the License, |
10 | ._= =} : or (at your option) any later version. | 10 | ._= =} : or (at your option) any later version. |
11 | .%`+i> _;_. | 11 | .%`+i> _;_. |
12 | .i_,=:_. -<s. This file is distributed in the hope that | 12 | .i_,=:_. -<s. This file is distributed in the hope that |
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 | #include <qlayout.h> | 28 | #include <qlayout.h> |
29 | 29 | ||
30 | #include <opie/otabwidget.h> | 30 | #include <opie/otabwidget.h> |
31 | 31 | ||
32 | #include "launchersettings.h" | 32 | #include "launchersettings.h" |
33 | #include "tabssettings.h" | 33 | #include "tabssettings.h" |
34 | #include "taskbarsettings.h" | 34 | #include "taskbarsettings.h" |
35 | #include "guisettings.h" | ||
35 | 36 | ||
36 | 37 | ||
37 | LauncherSettings::LauncherSettings ( ) : QDialog ( 0, "LauncherSettings", false ) | 38 | LauncherSettings::LauncherSettings ( ) : QDialog ( 0, "LauncherSettings", false ) |
38 | { | 39 | { |
39 | setCaption ( tr( "Launcher Settings" )); | 40 | setCaption ( tr( "Launcher Settings" )); |
40 | 41 | ||
41 | QVBoxLayout *lay = new QVBoxLayout ( this, 4, 4 ); | 42 | QVBoxLayout *lay = new QVBoxLayout ( this, 4, 4 ); |
42 | 43 | ||
43 | OTabWidget *tw = new OTabWidget ( this, "otab" ); | 44 | OTabWidget *tw = new OTabWidget ( this, "otab" ); |
44 | lay-> addWidget ( tw ); | 45 | lay-> addWidget ( tw ); |
45 | 46 | ||
46 | m_tabs = new TabsSettings ( tw ); | 47 | m_tabs = new TabsSettings ( tw ); |
47 | m_taskbar = new TaskbarSettings ( tw ); | 48 | m_taskbar = new TaskbarSettings ( tw ); |
49 | m_gui = new GuiSettings ( tw ); | ||
48 | 50 | ||
49 | tw-> addTab ( m_taskbar, "appearance/styletabicon.png", tr( "Taskbar" )); | 51 | tw-> addTab ( m_taskbar, "launchersettings/taskbartab.png", tr( "Taskbar" )); |
50 | tw-> addTab ( m_tabs, "appearance/styletabicon.png", tr( "Tabs" )); | 52 | tw-> addTab ( m_tabs, "launchersettings/tabstab.png", tr( "Tabs" )); |
53 | tw-> addTab ( m_gui, "launchersettings/guitab.png", tr( "GUI" )); | ||
51 | 54 | ||
52 | tw-> setCurrentTab ( m_taskbar ); | 55 | tw-> setCurrentTab ( m_taskbar ); |
53 | } | 56 | } |
54 | 57 | ||
55 | void LauncherSettings::accept ( ) | 58 | void LauncherSettings::accept ( ) |
56 | { | 59 | { |
57 | m_taskbar-> accept ( ); | 60 | m_taskbar-> accept ( ); |
58 | m_tabs-> accept ( ); | 61 | m_tabs-> accept ( ); |
62 | m_gui-> accept ( ); | ||
59 | 63 | ||
60 | QDialog::accept ( ); | 64 | QDialog::accept ( ); |
61 | } | 65 | } |
62 | 66 | ||
63 | void LauncherSettings::done ( int r ) | 67 | void LauncherSettings::done ( int r ) |
64 | { | 68 | { |
65 | QDialog::done ( r ); | 69 | QDialog::done ( r ); |
66 | close ( ); | 70 | close ( ); |
67 | } | 71 | } |
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 | |||
@@ -1,50 +1,52 @@ | |||
1 | /* | 1 | /* |
2 | =. This file is part of the OPIE Project | 2 | =. This file is part of the OPIE Project |
3 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> | 3 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> |
4 | .>+-= | 4 | .>+-= |
5 | _;:, .> :=|. This file is free software; you can | 5 | _;:, .> :=|. This file is free software; you can |
6 | .> <`_, > . <= redistribute it and/or modify it under | 6 | .> <`_, > . <= redistribute it and/or modify it under |
7 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 7 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
8 | .="- .-=="i, .._ License as published by the Free Software | 8 | .="- .-=="i, .._ License as published by the Free Software |
9 | - . .-<_> .<> Foundation; either version 2 of the License, | 9 | - . .-<_> .<> Foundation; either version 2 of the License, |
10 | ._= =} : or (at your option) any later version. | 10 | ._= =} : or (at your option) any later version. |
11 | .%`+i> _;_. | 11 | .%`+i> _;_. |
12 | .i_,=:_. -<s. This file is distributed in the hope that | 12 | .i_,=:_. -<s. This file is distributed in the hope that |
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 | ||
33 | class TabsSettings; | 33 | class TabsSettings; |
34 | class TaskbarSettings; | 34 | class TaskbarSettings; |
35 | class GuiSettings; | ||
35 | 36 | ||
36 | class LauncherSettings : public QDialog { | 37 | class LauncherSettings : public QDialog { |
37 | Q_OBJECT | 38 | Q_OBJECT |
38 | 39 | ||
39 | public: | 40 | public: |
40 | LauncherSettings ( ); | 41 | LauncherSettings ( ); |
41 | 42 | ||
42 | virtual void accept ( ); | 43 | virtual void accept ( ); |
43 | virtual void done ( int r ); | 44 | virtual void done ( int r ); |
44 | 45 | ||
45 | private: | 46 | private: |
46 | TabsSettings *m_tabs; | 47 | TabsSettings *m_tabs; |
47 | TaskbarSettings *m_taskbar; | 48 | TaskbarSettings *m_taskbar; |
49 | GuiSettings *m_gui; | ||
48 | }; | 50 | }; |
49 | 51 | ||
50 | #endif | 52 | #endif |
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 | |||
@@ -1,178 +1,147 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the OPIE Project | 2 | This file is part of the OPIE Project |
3 | =. Copyright (c) 2002 Trolltech AS <info@trolltech.com> | 3 | =. Copyright (c) 2002 Trolltech AS <info@trolltech.com> |
4 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> | 4 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> |
5 | .>+-= | 5 | .>+-= |
6 | _;:, .> :=|. This file is free software; you can | 6 | _;:, .> :=|. This file is free software; you can |
7 | .> <`_, > . <= redistribute it and/or modify it under | 7 | .> <`_, > . <= redistribute it and/or modify it under |
8 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 8 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
9 | .="- .-=="i, .._ License as published by the Free Software | 9 | .="- .-=="i, .._ License as published by the Free Software |
10 | - . .-<_> .<> Foundation; either version 2 of the License, | 10 | - . .-<_> .<> Foundation; either version 2 of the License, |
11 | ._= =} : or (at your option) any later version. | 11 | ._= =} : or (at your option) any later version. |
12 | .%`+i> _;_. | 12 | .%`+i> _;_. |
13 | .i_,=:_. -<s. This file is distributed in the hope that | 13 | .i_,=:_. -<s. This file is distributed in the hope that |
14 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 14 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
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 "taskbarsettings.h" | 29 | #include "taskbarsettings.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 | #include <qpe/taskbarappletinterface.h> | 34 | #include <qpe/taskbarappletinterface.h> |
35 | #include <qpe/qcopenvelope_qws.h> | 35 | #include <qpe/qcopenvelope_qws.h> |
36 | 36 | ||
37 | #include <qdir.h> | 37 | #include <qdir.h> |
38 | #include <qlistview.h> | 38 | #include <qlistview.h> |
39 | #include <qcheckbox.h> | 39 | #include <qcheckbox.h> |
40 | #include <qheader.h> | 40 | #include <qheader.h> |
41 | #include <qlayout.h> | 41 | #include <qlayout.h> |
42 | #include <qlabel.h> | 42 | #include <qlabel.h> |
43 | #include <qwhatsthis.h> | 43 | #include <qwhatsthis.h> |
44 | 44 | ||
45 | #include <stdlib.h> | 45 | #include <stdlib.h> |
46 | 46 | ||
47 | 47 | ||
48 | TaskbarSettings::TaskbarSettings ( QWidget *parent, const char *name ) | 48 | TaskbarSettings::TaskbarSettings ( QWidget *parent, const char *name ) |
49 | : QWidget ( parent, name ) | 49 | : QWidget ( parent, name ) |
50 | { | 50 | { |
51 | m_applets_changed = false; | 51 | m_applets_changed = false; |
52 | 52 | ||
53 | QBoxLayout *lay = new QVBoxLayout ( this, 4, 4 ); | 53 | QBoxLayout *lay = new QVBoxLayout ( this, 4, 4 ); |
54 | 54 | ||
55 | QLabel *l = new QLabel ( tr( "Load applets:" ), this ); | 55 | QLabel *l = new QLabel ( tr( "Load applets:" ), this ); |
56 | lay-> addWidget ( l ); | 56 | lay-> addWidget ( l ); |
57 | 57 | ||
58 | m_list = new QListView ( this ); | 58 | m_list = new QListView ( this ); |
59 | m_list-> addColumn ( "foobar" ); | 59 | m_list-> addColumn ( "foobar" ); |
60 | m_list-> header ( )-> hide ( ); | 60 | m_list-> header ( )-> hide ( ); |
61 | 61 | ||
62 | lay-> addWidget ( m_list ); | 62 | lay-> addWidget ( m_list ); |
63 | 63 | ||
64 | m_omenu = new QCheckBox ( tr( "Show O-Menu" ), this ); | ||
65 | lay-> addWidget ( m_omenu ); | ||
66 | |||
67 | m_omenu_tabs = new QCheckBox ( tr( "Show Launcher tabs in O-Menu" ), this ); | ||
68 | lay-> addWidget ( m_omenu_tabs ); | ||
69 | |||
70 | QWhatsThis::add ( m_list, tr( "Check the applets that you want displayed in the Taskbar." )); | 64 | QWhatsThis::add ( m_list, tr( "Check the applets that you want displayed in the Taskbar." )); |
71 | QWhatsThis::add( m_omenu_tabs, tr( "Adds the contents of the Launcher as menus in the O-Menu." )); | ||
72 | QWhatsThis::add( m_omenu, tr( "Check if you want the O-Menu in the taskbar." )); | ||
73 | 65 | ||
74 | connect ( m_list, SIGNAL( clicked ( QListViewItem * )), this, SLOT( appletChanged ( ))); | 66 | connect ( m_list, SIGNAL( clicked ( QListViewItem * )), this, SLOT( appletChanged ( ))); |
75 | connect ( m_omenu, SIGNAL( toggled ( bool )), m_omenu_tabs, SLOT( setEnabled ( bool ))); | ||
76 | |||
77 | // This option does not make sense ! (sandman) | ||
78 | m_omenu_tabs-> hide ( ); | ||
79 | 67 | ||
80 | init ( ); | 68 | init ( ); |
81 | } | 69 | } |
82 | 70 | ||
83 | void TaskbarSettings::init ( ) | 71 | void TaskbarSettings::init ( ) |
84 | { | 72 | { |
85 | Config cfg ( "Taskbar" ); | 73 | Config cfg ( "Taskbar" ); |
86 | cfg. setGroup ( "Applets" ); | 74 | cfg. setGroup ( "Applets" ); |
87 | QStringList exclude = cfg. readListEntry ( "ExcludeApplets", ',' ); | 75 | QStringList exclude = cfg. readListEntry ( "ExcludeApplets", ',' ); |
88 | 76 | ||
89 | QString path = QPEApplication::qpeDir ( ) + "/plugins/applets"; | 77 | QString path = QPEApplication::qpeDir ( ) + "/plugins/applets"; |
90 | QStringList list = QDir ( path, "lib*.so" ). entryList ( ); | 78 | QStringList list = QDir ( path, "lib*.so" ). entryList ( ); |
91 | 79 | ||
92 | for ( QStringList::Iterator it = list. begin ( ); it != list. end ( ); ++it ) { | 80 | for ( QStringList::Iterator it = list. begin ( ); it != list. end ( ); ++it ) { |
93 | QString name; | 81 | QString name; |
94 | QPixmap icon; | 82 | QPixmap icon; |
95 | TaskbarNamedAppletInterface *iface = 0; | 83 | TaskbarNamedAppletInterface *iface = 0; |
96 | 84 | ||
97 | QLibrary *lib = new QLibrary ( path + "/" + *it ); | 85 | QLibrary *lib = new QLibrary ( path + "/" + *it ); |
98 | lib-> queryInterface ( IID_TaskbarNamedApplet, (QUnknownInterface**) &iface ); | 86 | lib-> queryInterface ( IID_TaskbarNamedApplet, (QUnknownInterface**) &iface ); |
99 | if ( iface ) { | 87 | if ( iface ) { |
100 | 88 | ||
101 | QString lang = getenv( "LANG" ); | 89 | QString lang = getenv( "LANG" ); |
102 | QTranslator *trans = new QTranslator ( qApp ); | 90 | QTranslator *trans = new QTranslator ( qApp ); |
103 | QString type = (*it). left ((*it). find (".")); | 91 | QString type = (*it). left ((*it). find (".")); |
104 | QString tfn = QPEApplication::qpeDir ( ) + "/i18n/" + lang + "/" + type + ".qm"; | 92 | QString tfn = QPEApplication::qpeDir ( ) + "/i18n/" + lang + "/" + type + ".qm"; |
105 | if ( trans-> load ( tfn )) | 93 | if ( trans-> load ( tfn )) |
106 | qApp-> installTranslator ( trans ); | 94 | qApp-> installTranslator ( trans ); |
107 | else | 95 | else |
108 | delete trans; | 96 | delete trans; |
109 | name = iface-> name ( ); | 97 | name = iface-> name ( ); |
110 | icon = iface-> icon ( ); | 98 | icon = iface-> icon ( ); |
111 | iface-> release ( ); | 99 | iface-> release ( ); |
112 | lib-> unload ( ); | 100 | lib-> unload ( ); |
113 | } else { | 101 | } else { |
114 | delete lib; | 102 | delete lib; |
115 | name = (*it). mid ( 3 ); | 103 | name = (*it). mid ( 3 ); |
116 | int sep = name. find( ".so" ); | 104 | int sep = name. find( ".so" ); |
117 | if ( sep > 0 ) | 105 | if ( sep > 0 ) |
118 | name. truncate ( sep ); | 106 | name. truncate ( sep ); |
119 | sep = name. find ( "applet" ); | 107 | sep = name. find ( "applet" ); |
120 | if ( sep == (int) name.length ( ) - 6 ) | 108 | if ( sep == (int) name.length ( ) - 6 ) |
121 | name. truncate ( sep ); | 109 | name. truncate ( sep ); |
122 | name[0] = name[0]. upper ( ); | 110 | name[0] = name[0]. upper ( ); |
123 | } | 111 | } |
124 | QCheckListItem *item; | 112 | QCheckListItem *item; |
125 | item = new QCheckListItem ( m_list, name, QCheckListItem::CheckBox ); | 113 | item = new QCheckListItem ( m_list, name, QCheckListItem::CheckBox ); |
126 | if ( !icon. isNull ( )) | 114 | if ( !icon. isNull ( )) |
127 | item-> setPixmap ( 0, icon ); | 115 | item-> setPixmap ( 0, icon ); |
128 | item-> setOn ( exclude. find ( *it ) == exclude. end ( )); | 116 | item-> setOn ( exclude. find ( *it ) == exclude. end ( )); |
129 | m_applets [*it] = item; | 117 | m_applets [*it] = item; |
130 | } | 118 | } |
131 | |||
132 | cfg. setGroup ( "Menu" ); | ||
133 | |||
134 | m_omenu_tabs-> setChecked ( cfg. readBoolEntry ( "LauncherTabs", true )); | ||
135 | m_omenu-> setChecked ( cfg. readBoolEntry ( "ShowMenu", true )); | ||
136 | |||
137 | m_omenu_tabs-> setEnabled ( m_omenu-> isChecked ( )); | ||
138 | } | 119 | } |
139 | 120 | ||
140 | void TaskbarSettings::appletChanged() | 121 | void TaskbarSettings::appletChanged() |
141 | { | 122 | { |
142 | m_applets_changed = true; | 123 | m_applets_changed = true; |
143 | } | 124 | } |
144 | 125 | ||
145 | void TaskbarSettings::accept ( ) | 126 | void TaskbarSettings::accept ( ) |
146 | { | 127 | { |
147 | Config cfg ( "Taskbar" ); | 128 | Config cfg ( "Taskbar" ); |
148 | cfg. setGroup ( "Applets" ); | 129 | cfg. setGroup ( "Applets" ); |
149 | if ( m_applets_changed ) { | 130 | if ( m_applets_changed ) { |
150 | QStringList exclude; | 131 | QStringList exclude; |
151 | QMap <QString, QCheckListItem *>::Iterator it; | 132 | QMap <QString, QCheckListItem *>::Iterator it; |
152 | for ( it = m_applets. begin ( ); it != m_applets. end ( ); ++it ) { | 133 | for ( it = m_applets. begin ( ); it != m_applets. end ( ); ++it ) { |
153 | if ( !(*it)-> isOn ( )) | 134 | if ( !(*it)-> isOn ( )) |
154 | exclude << it. key ( ); | 135 | exclude << it. key ( ); |
155 | } | 136 | } |
156 | cfg. writeEntry ( "ExcludeApplets", exclude, ',' ); | 137 | cfg. writeEntry ( "ExcludeApplets", exclude, ',' ); |
157 | } | 138 | } |
158 | cfg. writeEntry ( "SafeMode", false ); | 139 | cfg. writeEntry ( "SafeMode", false ); |
159 | |||
160 | cfg. setGroup ( "Menu" ); | ||
161 | |||
162 | if ( m_omenu_tabs-> isChecked ( ) != cfg. readBoolEntry ( "LauncherTabs", true )) { | ||
163 | m_applets_changed = true; | ||
164 | cfg. writeEntry ( "LauncherTabs", m_omenu_tabs-> isChecked ( )); | ||
165 | } | ||
166 | |||
167 | if ( m_omenu-> isChecked ( ) != cfg. readBoolEntry ( "ShowMenu", true )) { | ||
168 | m_applets_changed = true; | ||
169 | cfg. writeEntry ( "ShowMenu", m_omenu-> isChecked ( )); | ||
170 | } | ||
171 | cfg. write ( ); | 140 | cfg. write ( ); |
172 | 141 | ||
173 | if ( m_applets_changed ) { | 142 | if ( m_applets_changed ) { |
174 | QCopEnvelope ( "QPE/TaskBar", "reloadApplets()" ); | 143 | QCopEnvelope ( "QPE/TaskBar", "reloadApplets()" ); |
175 | m_applets_changed = false; | 144 | m_applets_changed = false; |
176 | } | 145 | } |
177 | } | 146 | } |
178 | 147 | ||
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 | |||
@@ -1,62 +1,59 @@ | |||
1 | /* | 1 | /* |
2 | =. This file is part of the OPIE Project | 2 | =. This file is part of the OPIE Project |
3 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> | 3 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> |
4 | .>+-= | 4 | .>+-= |
5 | _;:, .> :=|. This file is free software; you can | 5 | _;:, .> :=|. This file is free software; you can |
6 | .> <`_, > . <= redistribute it and/or modify it under | 6 | .> <`_, > . <= redistribute it and/or modify it under |
7 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 7 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
8 | .="- .-=="i, .._ License as published by the Free Software | 8 | .="- .-=="i, .._ License as published by the Free Software |
9 | - . .-<_> .<> Foundation; either version 2 of the License, | 9 | - . .-<_> .<> Foundation; either version 2 of the License, |
10 | ._= =} : or (at your option) any later version. | 10 | ._= =} : or (at your option) any later version. |
11 | .%`+i> _;_. | 11 | .%`+i> _;_. |
12 | .i_,=:_. -<s. This file is distributed in the hope that | 12 | .i_,=:_. -<s. This file is distributed in the hope that |
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 __TASKBAR_SETTINGS_H__ | 28 | #ifndef __TASKBAR_SETTINGS_H__ |
29 | #define __TASKBAR_SETTINGS_H__ | 29 | #define __TASKBAR_SETTINGS_H__ |
30 | 30 | ||
31 | #include <qwidget.h> | 31 | #include <qwidget.h> |
32 | #include <qmap.h> | 32 | #include <qmap.h> |
33 | 33 | ||
34 | class QListView; | 34 | class QListView; |
35 | class QCheckListItem; | 35 | class QCheckListItem; |
36 | class QCheckBox; | 36 | class QCheckBox; |
37 | 37 | ||
38 | 38 | ||
39 | class TaskbarSettings : public QWidget { | 39 | class TaskbarSettings : public QWidget { |
40 | Q_OBJECT | 40 | Q_OBJECT |
41 | 41 | ||
42 | public: | 42 | public: |
43 | TaskbarSettings ( QWidget *parent = 0, const char *name = 0 ); | 43 | TaskbarSettings ( QWidget *parent = 0, const char *name = 0 ); |
44 | 44 | ||
45 | void accept ( ); | 45 | void accept ( ); |
46 | 46 | ||
47 | protected slots: | 47 | protected slots: |
48 | void appletChanged ( ); | 48 | void appletChanged ( ); |
49 | 49 | ||
50 | protected: | 50 | protected: |
51 | void init ( ); | 51 | void init ( ); |
52 | 52 | ||
53 | private: | 53 | private: |
54 | QListView *m_list; | 54 | QListView *m_list; |
55 | QCheckBox *m_omenu; | ||
56 | QCheckBox *m_omenu_tabs; | ||
57 | |||
58 | QMap <QString, QCheckListItem *> m_applets; | 55 | QMap <QString, QCheckListItem *> m_applets; |
59 | bool m_applets_changed; | 56 | bool m_applets_changed; |
60 | }; | 57 | }; |
61 | 58 | ||
62 | #endif | 59 | #endif |