author | mickeyl <mickeyl> | 2003-10-02 15:53:52 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-10-02 15:53:52 (UTC) |
commit | 4c9bda8027049b7ea423471a213eca2068490b08 (patch) (unidiff) | |
tree | a2400c2a77847764cd09e4c882caf521e503a423 /core/settings | |
parent | 4dd842eacb6c04303932e4cbebedff14db7cbc87 (diff) | |
download | opie-4c9bda8027049b7ea423471a213eca2068490b08.zip opie-4c9bda8027049b7ea423471a213eca2068490b08.tar.gz opie-4c9bda8027049b7ea423471a213eca2068490b08.tar.bz2 |
Start with some customization bits for inputmethods as part of the
BigScreen initiative. You can now choose to have free floating and
resizable inputmethods.
Two outstanding things: 1.) Hiding the inputmethod via the [x] button
confuses the show/hide toggle button. 2.) The new size and position of
a moved/resized inputmethod should be remembered.
-rw-r--r-- | core/settings/launcher/inputmethodsettings.cpp | 87 | ||||
-rw-r--r-- | core/settings/launcher/inputmethodsettings.h | 57 | ||||
-rw-r--r-- | core/settings/launcher/launcher.pro | 2 | ||||
-rw-r--r-- | core/settings/launcher/launchersettings.cpp | 5 | ||||
-rw-r--r-- | core/settings/launcher/launchersettings.h | 2 |
5 files changed, 152 insertions, 1 deletions
diff --git a/core/settings/launcher/inputmethodsettings.cpp b/core/settings/launcher/inputmethodsettings.cpp new file mode 100644 index 0000000..1aa1ae8 --- a/dev/null +++ b/core/settings/launcher/inputmethodsettings.cpp | |||
@@ -0,0 +1,87 @@ | |||
1 | /* | ||
2 | This file is part of the OPIE Project | ||
3 | =. Copyright (c) 2002 Trolltech AS <info@trolltech.com> | ||
4 | .=l. Copyright (c) 2003 Michael Lauer <mickeyl@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 "inputmethodsettings.h" | ||
30 | |||
31 | #include <qpe/config.h> | ||
32 | #include <qpe/qlibrary.h> | ||
33 | #include <qpe/qpeapplication.h> | ||
34 | |||
35 | #include <qspinbox.h> | ||
36 | #include <qcheckbox.h> | ||
37 | #include <qlayout.h> | ||
38 | #include <qlabel.h> | ||
39 | #include <qwhatsthis.h> | ||
40 | |||
41 | InputMethodSettings::InputMethodSettings( QWidget *parent, const char *name ):QWidget( parent, name ) | ||
42 | { | ||
43 | QBoxLayout *lay = new QVBoxLayout( this, 4, 4 ); | ||
44 | |||
45 | _resize = new QCheckBox( tr( "Resize application on Popup" ), this ); | ||
46 | _float = new QCheckBox( tr( "Enable floating and resizing" ), this ); | ||
47 | |||
48 | QHBoxLayout* hbox = new QHBoxLayout( this, 4, 4 ); | ||
49 | hbox->addWidget( new QLabel( "Initial Width:", this ) ); | ||
50 | _size = new QSpinBox( 10, 100, 10, this ); | ||
51 | _size->setSuffix( "%" ); | ||
52 | hbox->addWidget( _size ); | ||
53 | hbox->addStretch(); | ||
54 | |||
55 | Config cfg( "Launcher" ); | ||
56 | cfg.setGroup( "InputMethods" ); | ||
57 | _resize->setChecked( cfg.readBoolEntry( "Resize", true ) ); | ||
58 | _float->setChecked( cfg.readBoolEntry( "Float", false ) ); | ||
59 | _size->setValue( cfg.readNumEntry( "Width", 100 ) ); | ||
60 | |||
61 | lay->addWidget( _resize ); | ||
62 | lay->addWidget( _float ); | ||
63 | lay->addLayout( hbox ); | ||
64 | lay->addWidget( new QLabel( tr( "<b>Note:</b> Changing these settings may need restarting Opie to become effective." ), this ) ); | ||
65 | |||
66 | lay->addStretch(); | ||
67 | |||
68 | QWhatsThis::add( _resize, tr( "Check, if you want the application to be automatically resized if the input method pops up." ) ); | ||
69 | QWhatsThis::add( _float, tr( "Check, if you want to move and/or resize input methods" ) ); | ||
70 | QWhatsThis::add( _size, tr( "Specify the percentage of the screen width for the input method" ) ); | ||
71 | } | ||
72 | |||
73 | void InputMethodSettings::appletChanged() | ||
74 | { | ||
75 | } | ||
76 | |||
77 | void InputMethodSettings::accept() | ||
78 | { | ||
79 | qDebug( "InputMethodSettings::accept()" ); | ||
80 | Config cfg( "Launcher" ); | ||
81 | cfg.setGroup( "InputMethods" ); | ||
82 | cfg.writeEntry( "Resize", _resize->isChecked() ); | ||
83 | cfg.writeEntry( "Float", _float->isChecked() ); | ||
84 | cfg.writeEntry( "Width", _size->value() ); | ||
85 | cfg.write(); | ||
86 | } | ||
87 | |||
diff --git a/core/settings/launcher/inputmethodsettings.h b/core/settings/launcher/inputmethodsettings.h new file mode 100644 index 0000000..486ee5e --- a/dev/null +++ b/core/settings/launcher/inputmethodsettings.h | |||
@@ -0,0 +1,57 @@ | |||
1 | /* | ||
2 | =. This file is part of the OPIE Project | ||
3 | .=l. Copyright (c) 2003 Michael Lauer <mickeyl@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 __IMETHOD_SETTINGS_H__ | ||
29 | #define __IMETHOD_SETTINGS_H__ | ||
30 | |||
31 | #include <qwidget.h> | ||
32 | |||
33 | class QCheckBox; | ||
34 | class QSpinBox; | ||
35 | |||
36 | class InputMethodSettings : public QWidget | ||
37 | { | ||
38 | Q_OBJECT | ||
39 | |||
40 | public: | ||
41 | InputMethodSettings ( QWidget *parent = 0, const char *name = 0 ); | ||
42 | |||
43 | void accept ( ); | ||
44 | |||
45 | protected slots: | ||
46 | void appletChanged ( ); | ||
47 | |||
48 | protected: | ||
49 | void init ( ); | ||
50 | |||
51 | private: | ||
52 | QCheckBox* _resize; | ||
53 | QCheckBox* _float; | ||
54 | QSpinBox* _size; | ||
55 | }; | ||
56 | |||
57 | #endif | ||
diff --git a/core/settings/launcher/launcher.pro b/core/settings/launcher/launcher.pro index e532852..cea268d 100644 --- a/core/settings/launcher/launcher.pro +++ b/core/settings/launcher/launcher.pro | |||
@@ -2,20 +2,22 @@ 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 | menusettings.h \ | 7 | menusettings.h \ |
8 | inputmethodsettings.h \ | ||
8 | tabconfig.h \ | 9 | tabconfig.h \ |
9 | tabdialog.h | 10 | tabdialog.h |
10 | 11 | ||
11 | SOURCES = main.cpp \ | 12 | SOURCES = main.cpp \ |
12 | launchersettings.cpp \ | 13 | launchersettings.cpp \ |
13 | tabssettings.cpp \ | 14 | tabssettings.cpp \ |
14 | taskbarsettings.cpp \ | 15 | taskbarsettings.cpp \ |
15 | menusettings.cpp \ | 16 | menusettings.cpp \ |
17 | inputmethodsettings.cpp \ | ||
16 | tabdialog.cpp | 18 | tabdialog.cpp |
17 | 19 | ||
18 | INCLUDEPATH += $(OPIEDIR)/include | 20 | INCLUDEPATH += $(OPIEDIR)/include |
19 | DEPENDPATH += $(OPIEDIR)/include | 21 | DEPENDPATH += $(OPIEDIR)/include |
20 | LIBS += -lqpe -lopie | 22 | LIBS += -lqpe -lopie |
21 | TARGET = launchersettings | 23 | TARGET = launchersettings |
diff --git a/core/settings/launcher/launchersettings.cpp b/core/settings/launcher/launchersettings.cpp index cb6e98a..3982194 100644 --- a/core/settings/launcher/launchersettings.cpp +++ b/core/settings/launcher/launchersettings.cpp | |||
@@ -32,13 +32,13 @@ | |||
32 | #include <opie/otabwidget.h> | 32 | #include <opie/otabwidget.h> |
33 | 33 | ||
34 | #include "launchersettings.h" | 34 | #include "launchersettings.h" |
35 | #include "tabssettings.h" | 35 | #include "tabssettings.h" |
36 | #include "menusettings.h" | 36 | #include "menusettings.h" |
37 | #include "taskbarsettings.h" | 37 | #include "taskbarsettings.h" |
38 | 38 | #include "inputmethodsettings.h" | |
39 | 39 | ||
40 | LauncherSettings::LauncherSettings ( ) : QDialog ( 0, "LauncherSettings", false, WStyle_ContextHelp ) | 40 | LauncherSettings::LauncherSettings ( ) : QDialog ( 0, "LauncherSettings", false, WStyle_ContextHelp ) |
41 | { | 41 | { |
42 | setCaption ( tr( "Launcher Settings" )); | 42 | setCaption ( tr( "Launcher Settings" )); |
43 | 43 | ||
44 | QVBoxLayout *lay = new QVBoxLayout ( this, 4, 4 ); | 44 | QVBoxLayout *lay = new QVBoxLayout ( this, 4, 4 ); |
@@ -46,25 +46,28 @@ LauncherSettings::LauncherSettings ( ) : QDialog ( 0, "LauncherSettings", false, | |||
46 | OTabWidget *tw = new OTabWidget ( this, "otab" ); | 46 | OTabWidget *tw = new OTabWidget ( this, "otab" ); |
47 | lay-> addWidget ( tw ); | 47 | lay-> addWidget ( tw ); |
48 | 48 | ||
49 | m_tabs = new TabsSettings ( tw ); | 49 | m_tabs = new TabsSettings ( tw ); |
50 | m_taskbar = new TaskbarSettings ( tw ); | 50 | m_taskbar = new TaskbarSettings ( tw ); |
51 | m_menu = new MenuSettings ( tw ); | 51 | m_menu = new MenuSettings ( tw ); |
52 | m_imethods = new InputMethodSettings ( tw ); | ||
52 | 53 | ||
53 | tw-> addTab ( m_taskbar, "wait", tr( "Taskbar" )); | 54 | tw-> addTab ( m_taskbar, "wait", tr( "Taskbar" )); |
54 | tw-> addTab ( m_menu, "go", tr( "O-Menu" )); | 55 | tw-> addTab ( m_menu, "go", tr( "O-Menu" )); |
55 | tw-> addTab ( m_tabs, "launchersettings/tabstab.png", tr( "Tabs" )); | 56 | tw-> addTab ( m_tabs, "launchersettings/tabstab.png", tr( "Tabs" )); |
57 | tw-> addTab ( m_imethods, "launchersettings/inputmethod.png", tr( "InputMethods" )); | ||
56 | 58 | ||
57 | tw-> setCurrentTab ( m_taskbar ); | 59 | tw-> setCurrentTab ( m_taskbar ); |
58 | } | 60 | } |
59 | 61 | ||
60 | void LauncherSettings::accept ( ) | 62 | void LauncherSettings::accept ( ) |
61 | { | 63 | { |
62 | m_taskbar-> accept ( ); | 64 | m_taskbar-> accept ( ); |
63 | m_menu-> accept ( ); | 65 | m_menu-> accept ( ); |
64 | m_tabs-> accept ( ); | 66 | m_tabs-> accept ( ); |
67 | m_imethods-> accept ( ); | ||
65 | 68 | ||
66 | QDialog::accept ( ); | 69 | QDialog::accept ( ); |
67 | } | 70 | } |
68 | 71 | ||
69 | void LauncherSettings::done ( int r ) | 72 | void LauncherSettings::done ( int r ) |
70 | { | 73 | { |
diff --git a/core/settings/launcher/launchersettings.h b/core/settings/launcher/launchersettings.h index 56c916e..71165a3 100644 --- a/core/settings/launcher/launchersettings.h +++ b/core/settings/launcher/launchersettings.h | |||
@@ -30,12 +30,13 @@ | |||
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 MenuSettings; | 35 | class MenuSettings; |
36 | class InputMethodSettings; | ||
36 | 37 | ||
37 | class LauncherSettings : public QDialog { | 38 | class LauncherSettings : public QDialog { |
38 | Q_OBJECT | 39 | Q_OBJECT |
39 | 40 | ||
40 | public: | 41 | public: |
41 | LauncherSettings ( ); | 42 | LauncherSettings ( ); |
@@ -44,9 +45,10 @@ public: | |||
44 | virtual void done ( int r ); | 45 | virtual void done ( int r ); |
45 | 46 | ||
46 | private: | 47 | private: |
47 | TabsSettings *m_tabs; | 48 | TabsSettings *m_tabs; |
48 | TaskbarSettings *m_taskbar; | 49 | TaskbarSettings *m_taskbar; |
49 | MenuSettings *m_menu; | 50 | MenuSettings *m_menu; |
51 | InputMethodSettings* m_imethods; | ||
50 | }; | 52 | }; |
51 | 53 | ||
52 | #endif | 54 | #endif |