author | zecke <zecke> | 2004-03-14 18:42:05 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-03-14 18:42:05 (UTC) |
commit | 617e15d4cdbe7bc962388f9710bce834182bee24 (patch) (unidiff) | |
tree | 2c714b53d47c7421abc424b68c692dbe005bf598 | |
parent | a3726e8ae25805d215d0fd5c249345aad9952ef3 (diff) | |
download | opie-617e15d4cdbe7bc962388f9710bce834182bee24.zip opie-617e15d4cdbe7bc962388f9710bce834182bee24.tar.gz opie-617e15d4cdbe7bc962388f9710bce834182bee24.tar.bz2 |
ODP change
23 files changed, 45 insertions, 38 deletions
diff --git a/core/settings/button/button.pro b/core/settings/button/button.pro index 817eac4..aa47f54 100644 --- a/core/settings/button/button.pro +++ b/core/settings/button/button.pro | |||
@@ -1,19 +1,19 @@ | |||
1 | CONFIG += qt warn_on release quick-app | 1 | CONFIG += qt warn_on release quick-app |
2 | 2 | ||
3 | HEADERS = buttonsettings.h \ | 3 | HEADERS = buttonsettings.h \ |
4 | buttonutils.h \ | 4 | buttonutils.h \ |
5 | remapdlg.h | 5 | remapdlg.h |
6 | 6 | ||
7 | SOURCES = main.cpp \ | 7 | SOURCES = main.cpp \ |
8 | buttonsettings.cpp \ | 8 | buttonsettings.cpp \ |
9 | buttonutils.cpp \ | 9 | buttonutils.cpp \ |
10 | remapdlg.cpp | 10 | remapdlg.cpp |
11 | 11 | ||
12 | INTERFACES = remapdlgbase.ui | 12 | INTERFACES = remapdlgbase.ui |
13 | 13 | ||
14 | INCLUDEPATH += $(OPIEDIR)/include | 14 | INCLUDEPATH += $(OPIEDIR)/include |
15 | DEPENDPATH += $(OPIEDIR)/include | 15 | DEPENDPATH += $(OPIEDIR)/include |
16 | LIBS += -lqpe -lopie | 16 | LIBS += -lqpe -lopiecore2 |
17 | TARGET = buttonsettings | 17 | TARGET = buttonsettings |
18 | 18 | ||
19 | include ( $(OPIEDIR)/include.pro ) | 19 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/core/settings/button/buttonsettings.cpp b/core/settings/button/buttonsettings.cpp index d80e496..326554b 100644 --- a/core/settings/button/buttonsettings.cpp +++ b/core/settings/button/buttonsettings.cpp | |||
@@ -1,103 +1,103 @@ | |||
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 | #include <qlabel.h> | 29 | #include <qlabel.h> |
30 | #include <qtimer.h> | 30 | #include <qtimer.h> |
31 | 31 | ||
32 | 32 | ||
33 | #include <opie/odevice.h> | 33 | #include <opie2/odevice.h> |
34 | 34 | ||
35 | #include "buttonsettings.h" | 35 | #include "buttonsettings.h" |
36 | #include "buttonutils.h" | 36 | #include "buttonutils.h" |
37 | #include "remapdlg.h" | 37 | #include "remapdlg.h" |
38 | 38 | ||
39 | using namespace Opie; | 39 | using namespace Opie::Core; |
40 | 40 | ||
41 | struct buttoninfo { | 41 | struct buttoninfo { |
42 | const ODeviceButton *m_button; | 42 | const ODeviceButton *m_button; |
43 | int m_index; | 43 | int m_index; |
44 | 44 | ||
45 | OQCopMessage m_pmsg; | 45 | OQCopMessage m_pmsg; |
46 | QLabel *m_picon; | 46 | QLabel *m_picon; |
47 | QLabel *m_plabel; | 47 | QLabel *m_plabel; |
48 | 48 | ||
49 | OQCopMessage m_hmsg; | 49 | OQCopMessage m_hmsg; |
50 | QLabel *m_hicon; | 50 | QLabel *m_hicon; |
51 | QLabel *m_hlabel; | 51 | QLabel *m_hlabel; |
52 | 52 | ||
53 | bool m_pdirty : 1; | 53 | bool m_pdirty : 1; |
54 | bool m_hdirty : 1; | 54 | bool m_hdirty : 1; |
55 | }; | 55 | }; |
56 | 56 | ||
57 | 57 | ||
58 | ButtonSettings::ButtonSettings ( QWidget *parent , const char *name, bool modal, WFlags f ) | 58 | ButtonSettings::ButtonSettings ( QWidget *parent , const char *name, bool modal, WFlags f ) |
59 | : QDialog ( 0, "ButtonSettings", false, WStyle_ContextHelp ) | 59 | : QDialog ( 0, "ButtonSettings", false, WStyle_ContextHelp ) |
60 | { | 60 | { |
61 | const QValueList <ODeviceButton> &buttons = ODevice::inst ( )-> buttons ( ); | 61 | const QValueList <ODeviceButton> &buttons = ODevice::inst ( )-> buttons ( ); |
62 | (void) ButtonUtils::inst ( ); // initialise | 62 | (void) ButtonUtils::inst ( ); // initialise |
63 | 63 | ||
64 | setCaption ( tr( "Button Settings" )); | 64 | setCaption ( tr( "Button Settings" )); |
65 | 65 | ||
66 | QVBoxLayout *toplay = new QVBoxLayout ( this, 3, 3 ); | 66 | QVBoxLayout *toplay = new QVBoxLayout ( this, 3, 3 ); |
67 | 67 | ||
68 | QLabel *l = new QLabel ( tr( "<center>Press or hold the button you want to remap.</center>" ), this ); | 68 | QLabel *l = new QLabel ( tr( "<center>Press or hold the button you want to remap.</center>" ), this ); |
69 | toplay-> addWidget ( l ); | 69 | toplay-> addWidget ( l ); |
70 | 70 | ||
71 | QGridLayout *lay = new QGridLayout ( toplay ); | 71 | QGridLayout *lay = new QGridLayout ( toplay ); |
72 | lay-> setMargin ( 0 ); | 72 | lay-> setMargin ( 0 ); |
73 | lay-> setColStretch ( 0, 0 ); | 73 | lay-> setColStretch ( 0, 0 ); |
74 | lay-> setColStretch ( 1, 0 ); | 74 | lay-> setColStretch ( 1, 0 ); |
75 | lay-> setColStretch ( 2, 0 ); | 75 | lay-> setColStretch ( 2, 0 ); |
76 | lay-> setColStretch ( 3, 10 ); | 76 | lay-> setColStretch ( 3, 10 ); |
77 | 77 | ||
78 | m_infos. setAutoDelete ( true ); | 78 | m_infos. setAutoDelete ( true ); |
79 | 79 | ||
80 | int i = 1; | 80 | int i = 1; |
81 | int index = 0; | 81 | int index = 0; |
82 | for ( QValueList<ODeviceButton>::ConstIterator it = buttons. begin ( ); it != buttons. end ( ); it++ ) { | 82 | for ( QValueList<ODeviceButton>::ConstIterator it = buttons. begin ( ); it != buttons. end ( ); it++ ) { |
83 | if ( it != buttons. begin ( )) { | 83 | if ( it != buttons. begin ( )) { |
84 | QFrame *f = new QFrame ( this ); | 84 | QFrame *f = new QFrame ( this ); |
85 | f-> setFrameStyle ( QFrame::Sunken | QFrame::VLine ); | 85 | f-> setFrameStyle ( QFrame::Sunken | QFrame::VLine ); |
86 | lay-> addMultiCellWidget ( f, i, i, 0, 3 ); | 86 | lay-> addMultiCellWidget ( f, i, i, 0, 3 ); |
87 | i++; | 87 | i++; |
88 | } | 88 | } |
89 | 89 | ||
90 | buttoninfo *bi = new buttoninfo ( ); | 90 | buttoninfo *bi = new buttoninfo ( ); |
91 | bi-> m_button = &(*it); | 91 | bi-> m_button = &(*it); |
92 | bi-> m_index = index++; | 92 | bi-> m_index = index++; |
93 | bi-> m_pmsg = (*it). pressedAction ( ); | 93 | bi-> m_pmsg = (*it). pressedAction ( ); |
94 | bi-> m_hmsg = (*it). heldAction ( ); | 94 | bi-> m_hmsg = (*it). heldAction ( ); |
95 | bi-> m_pdirty = false; | 95 | bi-> m_pdirty = false; |
96 | bi-> m_hdirty = false; | 96 | bi-> m_hdirty = false; |
97 | 97 | ||
98 | l = new QLabel ( this ); | 98 | l = new QLabel ( this ); |
99 | l-> setPixmap (( *it ). pixmap ( )); | 99 | l-> setPixmap (( *it ). pixmap ( )); |
100 | 100 | ||
101 | lay-> addMultiCellWidget ( l, i, i + 1, 0, 0 ); | 101 | lay-> addMultiCellWidget ( l, i, i + 1, 0, 0 ); |
102 | 102 | ||
103 | l = new QLabel ( tr( "Press:" ), this ); | 103 | l = new QLabel ( tr( "Press:" ), this ); |
diff --git a/core/settings/button/buttonsettings.h b/core/settings/button/buttonsettings.h index 67694d3..1127e7c 100644 --- a/core/settings/button/buttonsettings.h +++ b/core/settings/button/buttonsettings.h | |||
@@ -1,76 +1,75 @@ | |||
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 __BUTTON_SETTINGS_H__ | 28 | #ifndef __BUTTON_SETTINGS_H__ |
29 | #define __BUTTON_SETTINGS_H__ | 29 | #define __BUTTON_SETTINGS_H__ |
30 | 30 | ||
31 | #include <qdialog.h> | 31 | #include <qdialog.h> |
32 | #include <qlist.h> | 32 | #include <qlist.h> |
33 | #include <opie/odevice.h> | 33 | #include <opie2/odevice.h> |
34 | 34 | ||
35 | class QTimer; | 35 | class QTimer; |
36 | 36 | ||
37 | using namespace Opie; | ||
38 | 37 | ||
39 | class buttoninfo; | 38 | class buttoninfo; |
40 | 39 | ||
41 | class ButtonSettings : public QDialog { | 40 | class ButtonSettings : public QDialog { |
42 | Q_OBJECT | 41 | Q_OBJECT |
43 | 42 | ||
44 | public: | 43 | public: |
45 | ButtonSettings ( QWidget *parent = 0, const char *name = 0, bool modal = FALSE,WFlags f = 0 ); | 44 | ButtonSettings ( QWidget *parent = 0, const char *name = 0, bool modal = FALSE,WFlags f = 0 ); |
46 | ~ButtonSettings ( ); | 45 | ~ButtonSettings ( ); |
47 | 46 | ||
48 | static QString appName() { return QString::fromLatin1("buttonsettings"); } | 47 | static QString appName() { return QString::fromLatin1("buttonsettings"); } |
49 | virtual void accept ( ); | 48 | virtual void accept ( ); |
50 | virtual void done ( int r ); | 49 | virtual void done ( int r ); |
51 | 50 | ||
52 | private slots: | 51 | private slots: |
53 | void keyTimeout ( ); | 52 | void keyTimeout ( ); |
54 | void updateLabels ( ); | 53 | void updateLabels ( ); |
55 | 54 | ||
56 | protected: | 55 | protected: |
57 | virtual void keyPressEvent ( QKeyEvent *e ); | 56 | virtual void keyPressEvent ( QKeyEvent *e ); |
58 | virtual void keyReleaseEvent ( QKeyEvent *e ); | 57 | virtual void keyReleaseEvent ( QKeyEvent *e ); |
59 | 58 | ||
60 | private: | 59 | private: |
61 | buttoninfo *buttonInfoForKeycode ( ushort key ); | 60 | buttoninfo *buttonInfoForKeycode ( ushort key ); |
62 | 61 | ||
63 | void edit ( buttoninfo *bi, bool hold ); | 62 | void edit ( buttoninfo *bi, bool hold ); |
64 | QString qcopToString ( const OQCopMessage &c ); | 63 | QString qcopToString ( const Opie::Core::OQCopMessage &c ); |
65 | 64 | ||
66 | private: | 65 | private: |
67 | QTimer *m_timer; | 66 | QTimer *m_timer; |
68 | buttoninfo *m_last_button; | 67 | buttoninfo *m_last_button; |
69 | 68 | ||
70 | QList <buttoninfo> m_infos; | 69 | QList <buttoninfo> m_infos; |
71 | bool m_lock; | 70 | bool m_lock; |
72 | }; | 71 | }; |
73 | 72 | ||
74 | #endif | 73 | #endif |
75 | 74 | ||
76 | 75 | ||
diff --git a/core/settings/button/buttonutils.cpp b/core/settings/button/buttonutils.cpp index 27a2f38..9bf4b53 100644 --- a/core/settings/button/buttonutils.cpp +++ b/core/settings/button/buttonutils.cpp | |||
@@ -1,76 +1,77 @@ | |||
1 | #include <stdlib.h> | 1 | #include <stdlib.h> |
2 | 2 | ||
3 | #include <qapplication.h> | 3 | #include <qapplication.h> |
4 | #include <qlistview.h> | 4 | #include <qlistview.h> |
5 | #include <qpe/applnk.h> | 5 | #include <qpe/applnk.h> |
6 | #include <qpe/mimetype.h> | 6 | #include <qpe/mimetype.h> |
7 | #include <qpe/resource.h> | 7 | #include <qpe/resource.h> |
8 | 8 | ||
9 | #include "buttonutils.h" | 9 | #include "buttonutils.h" |
10 | 10 | ||
11 | using namespace Opie; | 11 | using namespace Opie; |
12 | 12 | ||
13 | using namespace Opie::Core; | ||
13 | struct predef_qcop { | 14 | struct predef_qcop { |
14 | const char *m_text; | 15 | const char *m_text; |
15 | const char *m_pixmap; | 16 | const char *m_pixmap; |
16 | const char *m_channel; | 17 | const char *m_channel; |
17 | const char *m_function; | 18 | const char *m_function; |
18 | }; | 19 | }; |
19 | 20 | ||
20 | static const predef_qcop predef [] = { | 21 | static const predef_qcop predef [] = { |
21 | 22 | ||
22 | { QT_TRANSLATE_NOOP( "ButtonSettings", "Beam VCard" ), "beam", "QPE/Application/addressbook", "beamBusinessCard()" }, | 23 | { QT_TRANSLATE_NOOP( "ButtonSettings", "Beam VCard" ), "beam", "QPE/Application/addressbook", "beamBusinessCard()" }, |
23 | { QT_TRANSLATE_NOOP( "ButtonSettings", "Send eMail" ), "buttonsettings/mail", "QPE/Application/mail", "newMail()" }, | 24 | { QT_TRANSLATE_NOOP( "ButtonSettings", "Send eMail" ), "buttonsettings/mail", "QPE/Application/mail", "newMail()" }, |
24 | 25 | ||
25 | 26 | ||
26 | { QT_TRANSLATE_NOOP( "ButtonSettings", "Toggle Menu" ), "buttonsettings/menu", "QPE/TaskBar", "toggleMenu()" }, | 27 | { QT_TRANSLATE_NOOP( "ButtonSettings", "Toggle Menu" ), "buttonsettings/menu", "QPE/TaskBar", "toggleMenu()" }, |
27 | { QT_TRANSLATE_NOOP( "ButtonSettings", "Toggle O-Menu" ), "buttonsettings/omenu", "QPE/TaskBar", "toggleStartMenu()" }, | 28 | { QT_TRANSLATE_NOOP( "ButtonSettings", "Toggle O-Menu" ), "buttonsettings/omenu", "QPE/TaskBar", "toggleStartMenu()" }, |
28 | { QT_TRANSLATE_NOOP( "ButtonSettings", "Show Desktop" ), "home", "QPE/Launcher", "home()" }, | 29 | { QT_TRANSLATE_NOOP( "ButtonSettings", "Show Desktop" ), "home", "QPE/Launcher", "home()" }, |
29 | { QT_TRANSLATE_NOOP( "ButtonSettings", "Toggle Recording" ), "buttonsettings/record", "QPE/VMemo", "toggleRecord()" }, | 30 | { QT_TRANSLATE_NOOP( "ButtonSettings", "Toggle Recording" ), "buttonsettings/record", "QPE/VMemo", "toggleRecord()" }, |
30 | 31 | ||
31 | { 0, 0, 0, 0 } | 32 | { 0, 0, 0, 0 } |
32 | }; | 33 | }; |
33 | 34 | ||
34 | 35 | ||
35 | 36 | ||
36 | 37 | ||
37 | ButtonUtils *ButtonUtils::ButtonUtils::inst ( ) | 38 | ButtonUtils *ButtonUtils::ButtonUtils::inst ( ) |
38 | { | 39 | { |
39 | static ButtonUtils *p = 0; | 40 | static ButtonUtils *p = 0; |
40 | 41 | ||
41 | if ( !p ) { | 42 | if ( !p ) { |
42 | p = new ButtonUtils ( ); | 43 | p = new ButtonUtils ( ); |
43 | ::atexit ( cleanup ); | 44 | ::atexit ( cleanup ); |
44 | } | 45 | } |
45 | return p; | 46 | return p; |
46 | } | 47 | } |
47 | 48 | ||
48 | void ButtonUtils::cleanup ( ) | 49 | void ButtonUtils::cleanup ( ) |
49 | { | 50 | { |
50 | delete inst ( ); | 51 | delete inst ( ); |
51 | } | 52 | } |
52 | 53 | ||
53 | ButtonUtils::ButtonUtils ( ) | 54 | ButtonUtils::ButtonUtils ( ) |
54 | { | 55 | { |
55 | m_apps = new AppLnkSet( MimeType::appsFolderName ( )); | 56 | m_apps = new AppLnkSet( MimeType::appsFolderName ( )); |
56 | } | 57 | } |
57 | 58 | ||
58 | ButtonUtils::~ButtonUtils ( ) | 59 | ButtonUtils::~ButtonUtils ( ) |
59 | { | 60 | { |
60 | delete m_apps; | 61 | delete m_apps; |
61 | } | 62 | } |
62 | 63 | ||
63 | qCopInfo ButtonUtils::messageToInfo ( const OQCopMessage &c ) | 64 | qCopInfo ButtonUtils::messageToInfo ( const OQCopMessage &c ) |
64 | { | 65 | { |
65 | QCString ch = c. channel ( ); | 66 | QCString ch = c. channel ( ); |
66 | QCString f = c. message ( ); | 67 | QCString f = c. message ( ); |
67 | 68 | ||
68 | 69 | ||
69 | if ( ch == "ignore" ) | 70 | if ( ch == "ignore" ) |
70 | return qCopInfo ( qApp-> translate ( "ButtonSettings", "<nobr>Ignored</nobr>" )); | 71 | return qCopInfo ( qApp-> translate ( "ButtonSettings", "<nobr>Ignored</nobr>" )); |
71 | 72 | ||
72 | for ( const predef_qcop *p = predef; p-> m_text; p++ ) { | 73 | for ( const predef_qcop *p = predef; p-> m_text; p++ ) { |
73 | if (( ch == p-> m_channel ) && ( f == p-> m_function )) | 74 | if (( ch == p-> m_channel ) && ( f == p-> m_function )) |
74 | return qCopInfo ( qApp-> translate ( "ButtonSettings", p-> m_text ), Resource::loadPixmap ( p-> m_pixmap )); | 75 | return qCopInfo ( qApp-> translate ( "ButtonSettings", p-> m_text ), Resource::loadPixmap ( p-> m_pixmap )); |
75 | } | 76 | } |
76 | 77 | ||
diff --git a/core/settings/button/buttonutils.h b/core/settings/button/buttonutils.h index 5ea59bb..79eb8e3 100644 --- a/core/settings/button/buttonutils.h +++ b/core/settings/button/buttonutils.h | |||
@@ -1,67 +1,67 @@ | |||
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 __BUTTON_UTILS_H__ | 28 | #ifndef __BUTTON_UTILS_H__ |
29 | #define __BUTTON_UTILS_H__ | 29 | #define __BUTTON_UTILS_H__ |
30 | 30 | ||
31 | #include <opie/odevicebutton.h> | 31 | #include <opie2/odevicebutton.h> |
32 | 32 | ||
33 | class AppLnkSet; | 33 | class AppLnkSet; |
34 | class QListViewItem; | 34 | class QListViewItem; |
35 | 35 | ||
36 | 36 | ||
37 | class qCopInfo { | 37 | class qCopInfo { |
38 | public: | 38 | public: |
39 | qCopInfo ( const QString &str, const QPixmap &pix = QPixmap ( )) | 39 | qCopInfo ( const QString &str, const QPixmap &pix = QPixmap ( )) |
40 | : m_name ( str ), m_icon ( pix ) | 40 | : m_name ( str ), m_icon ( pix ) |
41 | { } | 41 | { } |
42 | 42 | ||
43 | QString m_name; | 43 | QString m_name; |
44 | QPixmap m_icon; | 44 | QPixmap m_icon; |
45 | }; | 45 | }; |
46 | 46 | ||
47 | 47 | ||
48 | class ButtonUtils { | 48 | class ButtonUtils { |
49 | public: | 49 | public: |
50 | ~ButtonUtils ( ); | 50 | ~ButtonUtils ( ); |
51 | 51 | ||
52 | static ButtonUtils *inst ( ); | 52 | static ButtonUtils *inst ( ); |
53 | 53 | ||
54 | qCopInfo messageToInfo ( const Opie::OQCopMessage & ); | 54 | qCopInfo messageToInfo ( const Opie::Core::OQCopMessage & ); |
55 | 55 | ||
56 | void insertActions ( QListViewItem *here ); | 56 | void insertActions ( QListViewItem *here ); |
57 | void insertAppLnks ( QListViewItem *here ); | 57 | void insertAppLnks ( QListViewItem *here ); |
58 | 58 | ||
59 | private: | 59 | private: |
60 | ButtonUtils ( ); | 60 | ButtonUtils ( ); |
61 | static void cleanup ( ); | 61 | static void cleanup ( ); |
62 | 62 | ||
63 | private: | 63 | private: |
64 | AppLnkSet *m_apps; | 64 | AppLnkSet *m_apps; |
65 | }; | 65 | }; |
66 | 66 | ||
67 | #endif | 67 | #endif |
diff --git a/core/settings/button/config.in b/core/settings/button/config.in index 3eb9155..834c375 100644 --- a/core/settings/button/config.in +++ b/core/settings/button/config.in | |||
@@ -1,4 +1,4 @@ | |||
1 | config BUTTON-SETTINGS | 1 | config BUTTON-SETTINGS |
2 | boolean "opie-button-settings (application buttons settings)" | 2 | boolean "opie-button-settings (application buttons settings)" |
3 | default "y" | 3 | default "y" |
4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE && !TARGET_RAMSES | 4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIECORE2 && !TARGET_RAMSES |
diff --git a/core/settings/button/main.cpp b/core/settings/button/main.cpp index e7c5bf9..6c2539f 100644 --- a/core/settings/button/main.cpp +++ b/core/settings/button/main.cpp | |||
@@ -1,32 +1,33 @@ | |||
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 "buttonsettings.h" | 28 | #include "buttonsettings.h" |
29 | 29 | ||
30 | #include <opie/oapplicationfactory.h> | 30 | #include <opie2/oapplicationfactory.h> |
31 | 31 | ||
32 | using namespace Opie::Core; | ||
32 | OPIE_EXPORT_APP( OApplicationFactory<ButtonSettings> ) | 33 | OPIE_EXPORT_APP( OApplicationFactory<ButtonSettings> ) |
diff --git a/core/settings/button/remapdlg.cpp b/core/settings/button/remapdlg.cpp index 121173a..4effebc 100644 --- a/core/settings/button/remapdlg.cpp +++ b/core/settings/button/remapdlg.cpp | |||
@@ -1,109 +1,109 @@ | |||
1 | #include <qlistview.h> | 1 | #include <qlistview.h> |
2 | #include <qcombobox.h> | 2 | #include <qcombobox.h> |
3 | #include <qtimer.h> | 3 | #include <qtimer.h> |
4 | 4 | ||
5 | #include "remapdlg.h" | 5 | #include "remapdlg.h" |
6 | #include "buttonutils.h" | 6 | #include "buttonutils.h" |
7 | 7 | ||
8 | using namespace Opie; | ||
9 | 8 | ||
9 | using namespace Opie::Core; | ||
10 | class NoSortItem : public QListViewItem { | 10 | class NoSortItem : public QListViewItem { |
11 | public: | 11 | public: |
12 | NoSortItem ( QListView *lv, uint pos, const QString &str, const QCString &s1 = 0, const QCString &s2 = 0 ) | 12 | NoSortItem ( QListView *lv, uint pos, const QString &str, const QCString &s1 = 0, const QCString &s2 = 0 ) |
13 | : QListViewItem ( lv, str, s1, s2 ) | 13 | : QListViewItem ( lv, str, s1, s2 ) |
14 | { | 14 | { |
15 | m_key = QString ( QChar ( 'a' + pos )); | 15 | m_key = QString ( QChar ( 'a' + pos )); |
16 | m_def = false; | 16 | m_def = false; |
17 | } | 17 | } |
18 | 18 | ||
19 | void setDefault ( bool b ) | 19 | void setDefault ( bool b ) |
20 | { | 20 | { |
21 | m_def = b; | 21 | m_def = b; |
22 | } | 22 | } |
23 | 23 | ||
24 | virtual QString key ( int /*column*/, bool /*ascending*/ ) const | 24 | virtual QString key ( int /*column*/, bool /*ascending*/ ) const |
25 | { | 25 | { |
26 | return m_key; | 26 | return m_key; |
27 | } | 27 | } |
28 | 28 | ||
29 | virtual void paintCell ( QPainter * p, const QColorGroup & cg, int column, int width, int align ) | 29 | virtual void paintCell ( QPainter * p, const QColorGroup & cg, int column, int width, int align ) |
30 | { | 30 | { |
31 | if ( m_def ) { | 31 | if ( m_def ) { |
32 | QFont f ( listView ( )-> font ( )); | 32 | QFont f ( listView ( )-> font ( )); |
33 | f. setBold ( true ); | 33 | f. setBold ( true ); |
34 | p-> setFont ( f ); | 34 | p-> setFont ( f ); |
35 | } | 35 | } |
36 | QListViewItem::paintCell ( p, cg, column, width, align ); | 36 | QListViewItem::paintCell ( p, cg, column, width, align ); |
37 | } | 37 | } |
38 | 38 | ||
39 | private: | 39 | private: |
40 | QString m_key; | 40 | QString m_key; |
41 | bool m_def; | 41 | bool m_def; |
42 | }; | 42 | }; |
43 | 43 | ||
44 | 44 | ||
45 | RemapDlg::RemapDlg ( const Opie::ODeviceButton *b, bool hold, QWidget *parent, const char *name ) | 45 | RemapDlg::RemapDlg ( const Opie::Core::ODeviceButton *b, bool hold, QWidget *parent, const char *name ) |
46 | : RemapDlgBase ( parent, name, true, WStyle_ContextHelp ) | 46 | : RemapDlgBase ( parent, name, true, WStyle_ContextHelp ) |
47 | { | 47 | { |
48 | setCaption ( tr( "%1 %2", "(hold|press) buttoname" ). arg( hold ? tr( "Held" ) : tr( "Pressed" )). arg ( b-> userText ( ))); | 48 | setCaption ( tr( "%1 %2", "(hold|press) buttoname" ). arg( hold ? tr( "Held" ) : tr( "Pressed" )). arg ( b-> userText ( ))); |
49 | 49 | ||
50 | m_current = 0; | 50 | m_current = 0; |
51 | 51 | ||
52 | static const char * const def_channels [] = { "QPE/Application/", "QPE/Launcher", "QPE/System", "QPE/TaskBar", "QPE/", 0 }; | 52 | static const char * const def_channels [] = { "QPE/Application/", "QPE/Launcher", "QPE/System", "QPE/TaskBar", "QPE/", 0 }; |
53 | w_channel-> insertStrList ((const char **) def_channels ); | 53 | w_channel-> insertStrList ((const char **) def_channels ); |
54 | 54 | ||
55 | m_msg = hold ? b-> heldAction ( ) : b-> pressedAction ( ); | 55 | m_msg = hold ? b-> heldAction ( ) : b-> pressedAction ( ); |
56 | m_msg_preset = hold ? b-> factoryPresetHeldAction ( ) : b-> factoryPresetPressedAction ( ); | 56 | m_msg_preset = hold ? b-> factoryPresetHeldAction ( ) : b-> factoryPresetPressedAction ( ); |
57 | 57 | ||
58 | m_map_none = new NoSortItem ( w_list, 0, tr( "No mapping" )); | 58 | m_map_none = new NoSortItem ( w_list, 0, tr( "No mapping" )); |
59 | m_map_preset = new NoSortItem ( w_list, 1, tr( "Default" ), m_msg_preset. channel ( ), m_msg_preset. message ( )); | 59 | m_map_preset = new NoSortItem ( w_list, 1, tr( "Default" ), m_msg_preset. channel ( ), m_msg_preset. message ( )); |
60 | ((NoSortItem *) m_map_preset )-> setDefault ( true ); | 60 | ((NoSortItem *) m_map_preset )-> setDefault ( true ); |
61 | 61 | ||
62 | if (m_msg. channel ( ) == "ignore") | 62 | if (m_msg. channel ( ) == "ignore") |
63 | { | 63 | { |
64 | m_map_custom = new NoSortItem ( w_list, 2, tr( "Custom" ), m_msg_preset. channel ( ), m_msg_preset. message ( )); | 64 | m_map_custom = new NoSortItem ( w_list, 2, tr( "Custom" ), m_msg_preset. channel ( ), m_msg_preset. message ( )); |
65 | 65 | ||
66 | m_current = m_map_none; | 66 | m_current = m_map_none; |
67 | } | 67 | } |
68 | else | 68 | else |
69 | { | 69 | { |
70 | m_map_custom = new NoSortItem ( w_list, 2, tr( "Custom" ), m_msg. channel ( ), m_msg. message ( )); | 70 | m_map_custom = new NoSortItem ( w_list, 2, tr( "Custom" ), m_msg. channel ( ), m_msg. message ( )); |
71 | m_current = m_map_custom; | 71 | m_current = m_map_custom; |
72 | } | 72 | } |
73 | 73 | ||
74 | QListViewItem *it = new NoSortItem ( w_list, 3, tr( "Actions" )); | 74 | QListViewItem *it = new NoSortItem ( w_list, 3, tr( "Actions" )); |
75 | ButtonUtils::inst ( )-> insertActions ( it ); | 75 | ButtonUtils::inst ( )-> insertActions ( it ); |
76 | it-> setOpen ( true ); | 76 | it-> setOpen ( true ); |
77 | 77 | ||
78 | m_map_show = new NoSortItem ( w_list, 4, tr( "Show" )); | 78 | m_map_show = new NoSortItem ( w_list, 4, tr( "Show" )); |
79 | 79 | ||
80 | w_list-> setCurrentItem ( m_current ); | 80 | w_list-> setCurrentItem ( m_current ); |
81 | 81 | ||
82 | QTimer::singleShot ( 0, this, SLOT( delayedInit())); | 82 | QTimer::singleShot ( 0, this, SLOT( delayedInit())); |
83 | } | 83 | } |
84 | 84 | ||
85 | RemapDlg::~RemapDlg ( ) | 85 | RemapDlg::~RemapDlg ( ) |
86 | { | 86 | { |
87 | } | 87 | } |
88 | 88 | ||
89 | void RemapDlg::delayedInit ( ) | 89 | void RemapDlg::delayedInit ( ) |
90 | { | 90 | { |
91 | bool b = w_list-> viewport ( )-> isUpdatesEnabled ( ); | 91 | bool b = w_list-> viewport ( )-> isUpdatesEnabled ( ); |
92 | w_list-> viewport ( )-> setUpdatesEnabled ( false ); | 92 | w_list-> viewport ( )-> setUpdatesEnabled ( false ); |
93 | 93 | ||
94 | ButtonUtils::inst ( )-> insertAppLnks ( m_map_show ); | 94 | ButtonUtils::inst ( )-> insertAppLnks ( m_map_show ); |
95 | 95 | ||
96 | w_list-> viewport ( )-> setUpdatesEnabled ( b ); | 96 | w_list-> viewport ( )-> setUpdatesEnabled ( b ); |
97 | 97 | ||
98 | m_map_show-> repaint ( ); | 98 | m_map_show-> repaint ( ); |
99 | } | 99 | } |
100 | 100 | ||
101 | void RemapDlg::itemChanged ( QListViewItem *it ) | 101 | void RemapDlg::itemChanged ( QListViewItem *it ) |
102 | { | 102 | { |
103 | bool enabled = false; | 103 | bool enabled = false; |
104 | OQCopMessage m; | 104 | OQCopMessage m; |
105 | 105 | ||
106 | m_current = it; | 106 | m_current = it; |
107 | 107 | ||
108 | if ( it == m_map_none ) | 108 | if ( it == m_map_none ) |
109 | { | 109 | { |
diff --git a/core/settings/button/remapdlg.h b/core/settings/button/remapdlg.h index 046a22f..6cdd678 100644 --- a/core/settings/button/remapdlg.h +++ b/core/settings/button/remapdlg.h | |||
@@ -1,39 +1,39 @@ | |||
1 | #ifndef __REMAPDLG_H__ | 1 | #ifndef __REMAPDLG_H__ |
2 | #define __REMAPDLG_H__ | 2 | #define __REMAPDLG_H__ |
3 | 3 | ||
4 | #include <opie/odevicebutton.h> | 4 | #include <opie2/odevicebutton.h> |
5 | 5 | ||
6 | #include "remapdlgbase.h" | 6 | #include "remapdlgbase.h" |
7 | 7 | ||
8 | class QListViewItem; | 8 | class QListViewItem; |
9 | 9 | ||
10 | 10 | ||
11 | class RemapDlg : public RemapDlgBase { | 11 | class RemapDlg : public RemapDlgBase { |
12 | Q_OBJECT | 12 | Q_OBJECT |
13 | 13 | ||
14 | public: | 14 | public: |
15 | RemapDlg ( const Opie::ODeviceButton *b, bool hold, QWidget* parent = 0, const char* name = 0 ); | 15 | RemapDlg ( const Opie::Core::ODeviceButton *b, bool hold, QWidget* parent = 0, const char* name = 0 ); |
16 | ~RemapDlg ( ); | 16 | ~RemapDlg ( ); |
17 | 17 | ||
18 | Opie::OQCopMessage message ( ); | 18 | Opie::Core::OQCopMessage message ( ); |
19 | 19 | ||
20 | public slots: | 20 | public slots: |
21 | virtual void itemChanged ( QListViewItem * ); | 21 | virtual void itemChanged ( QListViewItem * ); |
22 | virtual void textChanged ( const QString & ); | 22 | virtual void textChanged ( const QString & ); |
23 | 23 | ||
24 | private slots: | 24 | private slots: |
25 | void delayedInit ( ); | 25 | void delayedInit ( ); |
26 | 26 | ||
27 | private: | 27 | private: |
28 | Opie::OQCopMessage m_msg; | 28 | Opie::Core::OQCopMessage m_msg; |
29 | Opie::OQCopMessage m_msg_preset; | 29 | Opie::Core::OQCopMessage m_msg_preset; |
30 | 30 | ||
31 | QListViewItem *m_current; | 31 | QListViewItem *m_current; |
32 | 32 | ||
33 | QListViewItem *m_map_none; | 33 | QListViewItem *m_map_none; |
34 | QListViewItem *m_map_preset; | 34 | QListViewItem *m_map_preset; |
35 | QListViewItem *m_map_custom; | 35 | QListViewItem *m_map_custom; |
36 | QListViewItem *m_map_show; | 36 | QListViewItem *m_map_show; |
37 | }; | 37 | }; |
38 | 38 | ||
39 | #endif | 39 | #endif |
diff --git a/core/settings/citytime/config.in b/core/settings/citytime/config.in index 295b8b8..be1bb71 100644 --- a/core/settings/citytime/config.in +++ b/core/settings/citytime/config.in | |||
@@ -1,4 +1,4 @@ | |||
1 | config CITYTIME | 1 | config CITYTIME |
2 | boolean "opie-citytime (Time-zone / world clock settings)" | 2 | boolean "opie-citytime (Time-zone / world clock settings)" |
3 | default "y" | 3 | default "y" |
4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE | 4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIECORE2 |
diff --git a/core/settings/citytime/main.cpp b/core/settings/citytime/main.cpp index 7fb76ec..3f22621 100644 --- a/core/settings/citytime/main.cpp +++ b/core/settings/citytime/main.cpp | |||
@@ -1,24 +1,25 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include "citytime.h" | 21 | #include "citytime.h" |
22 | #include <opie2/oapplicationfactory.h> | 22 | #include <opie2/oapplicationfactory.h> |
23 | 23 | ||
24 | using namespace Opie::Core; | ||
24 | OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<CityTime> ) | 25 | OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<CityTime> ) |
diff --git a/core/settings/launcher/config.in b/core/settings/launcher/config.in index e167313..226da3c 100644 --- a/core/settings/launcher/config.in +++ b/core/settings/launcher/config.in | |||
@@ -1,4 +1,4 @@ | |||
1 | config LAUNCHER-SETTINGS | 1 | config LAUNCHER-SETTINGS |
2 | boolean "opie-launcher-settings (Opie taskbar settings)" | 2 | boolean "opie-launcher-settings (Opie taskbar settings)" |
3 | default "y" | 3 | default "y" |
4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE | 4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIEUI2 && LIBQTAUX |
diff --git a/core/settings/launcher/launcher.pro b/core/settings/launcher/launcher.pro index 3261ee8..e3f1060 100644 --- a/core/settings/launcher/launcher.pro +++ b/core/settings/launcher/launcher.pro | |||
@@ -1,28 +1,28 @@ | |||
1 | CONFIG += qt warn_on release quick-app | 1 | CONFIG += qt warn_on release quick-app |
2 | HEADERS = launchersettings.h \ | 2 | HEADERS = launchersettings.h \ |
3 | tabssettings.h \ | 3 | tabssettings.h \ |
4 | taskbarsettings.h \ | 4 | taskbarsettings.h \ |
5 | menusettings.h \ | 5 | menusettings.h \ |
6 | inputmethodsettings.h \ | 6 | inputmethodsettings.h \ |
7 | doctabsettings.h \ | 7 | doctabsettings.h \ |
8 | tabconfig.h \ | 8 | tabconfig.h \ |
9 | tabdialog.h | 9 | tabdialog.h |
10 | 10 | ||
11 | SOURCES = main.cpp \ | 11 | SOURCES = main.cpp \ |
12 | launchersettings.cpp \ | 12 | launchersettings.cpp \ |
13 | tabssettings.cpp \ | 13 | tabssettings.cpp \ |
14 | taskbarsettings.cpp \ | 14 | taskbarsettings.cpp \ |
15 | menusettings.cpp \ | 15 | menusettings.cpp \ |
16 | inputmethodsettings.cpp \ | 16 | inputmethodsettings.cpp \ |
17 | doctabsettings.cpp \ | 17 | doctabsettings.cpp \ |
18 | tabdialog.cpp | 18 | tabdialog.cpp |
19 | 19 | ||
20 | INCLUDEPATH += $(OPIEDIR)/include | 20 | INCLUDEPATH += $(OPIEDIR)/include |
21 | DEPENDPATH += $(OPIEDIR)/include | 21 | DEPENDPATH += $(OPIEDIR)/include |
22 | LIBS += -lqpe -lopie | 22 | LIBS += -lqpe -lopiecore2 -lopieui2 -lqtaux2 |
23 | TARGET = launchersettings | 23 | TARGET = launchersettings |
24 | 24 | ||
25 | 25 | ||
26 | 26 | ||
27 | 27 | ||
28 | include ( $(OPIEDIR)/include.pro ) | 28 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/core/settings/launcher/launchersettings.cpp b/core/settings/launcher/launchersettings.cpp index 5c11cc8..5efd297 100644 --- a/core/settings/launcher/launchersettings.cpp +++ b/core/settings/launcher/launchersettings.cpp | |||
@@ -1,79 +1,80 @@ | |||
1 | 1 | ||
2 | /* | 2 | /* |
3 | =. This file is part of the OPIE Project | 3 | =. This file is part of the OPIE Project |
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 <qlayout.h> | 29 | #include <qlayout.h> |
30 | 30 | ||
31 | #include <opie/otabwidget.h> | 31 | #include <opie2/otabwidget.h> |
32 | 32 | ||
33 | #include "launchersettings.h" | 33 | #include "launchersettings.h" |
34 | #include "tabssettings.h" | 34 | #include "tabssettings.h" |
35 | #include "menusettings.h" | 35 | #include "menusettings.h" |
36 | #include "taskbarsettings.h" | 36 | #include "taskbarsettings.h" |
37 | #include "inputmethodsettings.h" | 37 | #include "inputmethodsettings.h" |
38 | #include "doctabsettings.h" | 38 | #include "doctabsettings.h" |
39 | 39 | ||
40 | using namespace Opie::Ui; | ||
40 | LauncherSettings::LauncherSettings (QWidget*,const char*, WFlags) | 41 | LauncherSettings::LauncherSettings (QWidget*,const char*, WFlags) |
41 | : QDialog ( 0, "LauncherSettings", false, WStyle_ContextHelp ) | 42 | : QDialog ( 0, "LauncherSettings", false, WStyle_ContextHelp ) |
42 | { | 43 | { |
43 | setCaption ( tr( "Launcher Settings" )); | 44 | setCaption ( tr( "Launcher Settings" )); |
44 | 45 | ||
45 | QVBoxLayout *lay = new QVBoxLayout ( this, 4, 4 ); | 46 | QVBoxLayout *lay = new QVBoxLayout ( this, 4, 4 ); |
46 | 47 | ||
47 | OTabWidget *tw = new OTabWidget ( this, "otab" ); | 48 | OTabWidget *tw = new OTabWidget ( this, "otab" ); |
48 | lay-> addWidget ( tw ); | 49 | lay-> addWidget ( tw ); |
49 | 50 | ||
50 | m_tabs = new TabsSettings ( tw ); | 51 | m_tabs = new TabsSettings ( tw ); |
51 | m_taskbar = new TaskbarSettings ( tw ); | 52 | m_taskbar = new TaskbarSettings ( tw ); |
52 | m_menu = new MenuSettings ( tw ); | 53 | m_menu = new MenuSettings ( tw ); |
53 | m_imethods = new InputMethodSettings ( tw ); | 54 | m_imethods = new InputMethodSettings ( tw ); |
54 | m_doctab = new DocTabSettings ( tw ); | 55 | m_doctab = new DocTabSettings ( tw ); |
55 | 56 | ||
56 | tw-> addTab ( m_taskbar, "wait", tr( "Taskbar" )); | 57 | tw-> addTab ( m_taskbar, "wait", tr( "Taskbar" )); |
57 | tw-> addTab ( m_menu, "go", tr( "O-Menu" )); | 58 | tw-> addTab ( m_menu, "go", tr( "O-Menu" )); |
58 | tw-> addTab ( m_tabs, "launchersettings/tabstab.png", tr( "Tabs" )); | 59 | tw-> addTab ( m_tabs, "launchersettings/tabstab.png", tr( "Tabs" )); |
59 | tw-> addTab ( m_imethods, "launchersettings/inputmethod.png", tr( "InputMethods" )); | 60 | tw-> addTab ( m_imethods, "launchersettings/inputmethod.png", tr( "InputMethods" )); |
60 | tw-> addTab ( m_doctab, "DocsIcon", tr( "DocTab" ) ); | 61 | tw-> addTab ( m_doctab, "DocsIcon", tr( "DocTab" ) ); |
61 | tw-> setCurrentTab ( m_taskbar ); | 62 | tw-> setCurrentTab ( m_taskbar ); |
62 | } | 63 | } |
63 | 64 | ||
64 | void LauncherSettings::accept ( ) | 65 | void LauncherSettings::accept ( ) |
65 | { | 66 | { |
66 | m_taskbar-> accept ( ); | 67 | m_taskbar-> accept ( ); |
67 | m_menu-> accept ( ); | 68 | m_menu-> accept ( ); |
68 | m_tabs-> accept ( ); | 69 | m_tabs-> accept ( ); |
69 | m_imethods-> accept ( ); | 70 | m_imethods-> accept ( ); |
70 | m_doctab-> accept ( ); | 71 | m_doctab-> accept ( ); |
71 | 72 | ||
72 | QDialog::accept ( ); | 73 | QDialog::accept ( ); |
73 | } | 74 | } |
74 | 75 | ||
75 | void LauncherSettings::done ( int r ) | 76 | void LauncherSettings::done ( int r ) |
76 | { | 77 | { |
77 | QDialog::done ( r ); | 78 | QDialog::done ( r ); |
78 | close ( ); | 79 | close ( ); |
79 | } | 80 | } |
diff --git a/core/settings/launcher/main.cpp b/core/settings/launcher/main.cpp index bcfdcf6..b27381a 100644 --- a/core/settings/launcher/main.cpp +++ b/core/settings/launcher/main.cpp | |||
@@ -1,34 +1,35 @@ | |||
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 "launchersettings.h" | 28 | #include "launchersettings.h" |
29 | 29 | ||
30 | #include <opie/oapplicationfactory.h> | 30 | #include <opie2/oapplicationfactory.h> |
31 | 31 | ||
32 | using namespace Opie::Core; | ||
32 | OPIE_EXPORT_APP( OApplicationFactory<LauncherSettings> ) | 33 | OPIE_EXPORT_APP( OApplicationFactory<LauncherSettings> ) |
33 | 34 | ||
34 | 35 | ||
diff --git a/core/settings/launcher/tabdialog.cpp b/core/settings/launcher/tabdialog.cpp index c0d1cf2..763b360 100644 --- a/core/settings/launcher/tabdialog.cpp +++ b/core/settings/launcher/tabdialog.cpp | |||
@@ -1,112 +1,113 @@ | |||
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 <qpe/resource.h> | 28 | #include <qpe/resource.h> |
29 | 29 | ||
30 | #include <qlayout.h> | 30 | #include <qlayout.h> |
31 | #include <qvbox.h> | 31 | #include <qvbox.h> |
32 | #include <qtabbar.h> | 32 | #include <qtabbar.h> |
33 | #include <qiconview.h> | 33 | #include <qiconview.h> |
34 | #include <qapplication.h> | 34 | #include <qapplication.h> |
35 | #include <qlabel.h> | 35 | #include <qlabel.h> |
36 | #include <qradiobutton.h> | 36 | #include <qradiobutton.h> |
37 | #include <qbuttongroup.h> | 37 | #include <qbuttongroup.h> |
38 | #include <qwhatsthis.h> | 38 | #include <qwhatsthis.h> |
39 | #include <qcheckbox.h> | 39 | #include <qcheckbox.h> |
40 | 40 | ||
41 | #include <opie/ofontselector.h> | 41 | #include <opie2/ofontselector.h> |
42 | #include <opie/otabwidget.h> | 42 | #include <opie2/otabwidget.h> |
43 | #include <opie/ocolorbutton.h> | 43 | #include <opie2/ocolorbutton.h> |
44 | #include <opie/ofiledialog.h> | 44 | #include <opie2/ofiledialog.h> |
45 | 45 | ||
46 | #include "tabdialog.h" | 46 | #include "tabdialog.h" |
47 | 47 | ||
48 | 48 | ||
49 | using namespace Opie::Ui; | ||
49 | class SampleItem : public QIconViewItem { | 50 | class SampleItem : public QIconViewItem { |
50 | public: | 51 | public: |
51 | SampleItem ( QIconView *v, const QString &text, const QPixmap &pix ) : QIconViewItem ( v, text ) | 52 | SampleItem ( QIconView *v, const QString &text, const QPixmap &pix ) : QIconViewItem ( v, text ) |
52 | { | 53 | { |
53 | m_large = pix; | 54 | m_large = pix; |
54 | m_small. convertFromImage ( pix. convertToImage ( ). smoothScale ( pix. width ( ) / 2, pix. height ( ) / 2 )); | 55 | m_small. convertFromImage ( pix. convertToImage ( ). smoothScale ( pix. width ( ) / 2, pix. height ( ) / 2 )); |
55 | } | 56 | } |
56 | 57 | ||
57 | void sizeChange ( ) | 58 | void sizeChange ( ) |
58 | { | 59 | { |
59 | calcRect ( ); | 60 | calcRect ( ); |
60 | repaint ( ); | 61 | repaint ( ); |
61 | } | 62 | } |
62 | 63 | ||
63 | QPixmap *pixmap ( ) const | 64 | QPixmap *pixmap ( ) const |
64 | { | 65 | { |
65 | if ( iconView ( )-> itemTextPos ( ) == QIconView::Right ) | 66 | if ( iconView ( )-> itemTextPos ( ) == QIconView::Right ) |
66 | return (QPixmap *) &m_small; | 67 | return (QPixmap *) &m_small; |
67 | else | 68 | else |
68 | return (QPixmap *) &m_large; | 69 | return (QPixmap *) &m_large; |
69 | } | 70 | } |
70 | 71 | ||
71 | private: | 72 | private: |
72 | QPixmap m_large, m_small; | 73 | QPixmap m_large, m_small; |
73 | }; | 74 | }; |
74 | 75 | ||
75 | class SampleView : public QIconView { | 76 | class SampleView : public QIconView { |
76 | public: | 77 | public: |
77 | SampleView ( QWidget *parent = 0, const char *name = 0 ) : QIconView ( parent, name ) | 78 | SampleView ( QWidget *parent = 0, const char *name = 0 ) : QIconView ( parent, name ) |
78 | { | 79 | { |
79 | setItemsMovable ( false ); | 80 | setItemsMovable ( false ); |
80 | setAutoArrange ( true ); | 81 | setAutoArrange ( true ); |
81 | setSorting ( true ); | 82 | setSorting ( true ); |
82 | setFrameStyle ( QFrame::NoFrame ); | 83 | setFrameStyle ( QFrame::NoFrame ); |
83 | setSpacing ( 4 ); | 84 | setSpacing ( 4 ); |
84 | setMargin ( 0 ); | 85 | setMargin ( 0 ); |
85 | setSelectionMode ( QIconView::NoSelection ); | 86 | setSelectionMode ( QIconView::NoSelection ); |
86 | setBackgroundMode ( PaletteBase ); | 87 | setBackgroundMode ( PaletteBase ); |
87 | setViewMode ( TabConfig::Icon ); | 88 | setViewMode ( TabConfig::Icon ); |
88 | calculateGrid ( Bottom ); | 89 | calculateGrid ( Bottom ); |
89 | 90 | ||
90 | 91 | ||
91 | new SampleItem ( this, QObject::tr( "Sample 1" ), Resource::loadPixmap ( "datebook/DateBook" )); | 92 | new SampleItem ( this, QObject::tr( "Sample 1" ), Resource::loadPixmap ( "datebook/DateBook" )); |
92 | new SampleItem ( this, QObject::tr( "Sample 2" ), Resource::loadPixmap ( "Calibrate" )); | 93 | new SampleItem ( this, QObject::tr( "Sample 2" ), Resource::loadPixmap ( "Calibrate" )); |
93 | new SampleItem ( this, QObject::tr( "Sample 3" ), Resource::loadPixmap ( "UnknownDocument" )); | 94 | new SampleItem ( this, QObject::tr( "Sample 3" ), Resource::loadPixmap ( "UnknownDocument" )); |
94 | 95 | ||
95 | setBackgroundType ( TabConfig::Ruled, QString::null ); | 96 | setBackgroundType ( TabConfig::Ruled, QString::null ); |
96 | 97 | ||
97 | setMaximumHeight ( firstItem ( )-> height ( ) + 16 ); | 98 | setMaximumHeight ( firstItem ( )-> height ( ) + 16 ); |
98 | } | 99 | } |
99 | 100 | ||
100 | void setViewMode ( TabConfig::ViewMode m ) | 101 | void setViewMode ( TabConfig::ViewMode m ) |
101 | { | 102 | { |
102 | viewport ( )-> setUpdatesEnabled ( false ); | 103 | viewport ( )-> setUpdatesEnabled ( false ); |
103 | 104 | ||
104 | switch ( m ) { | 105 | switch ( m ) { |
105 | case TabConfig::List: | 106 | case TabConfig::List: |
106 | setItemTextPos( QIconView::Right ); | 107 | setItemTextPos( QIconView::Right ); |
107 | break; | 108 | break; |
108 | case TabConfig::Icon: | 109 | case TabConfig::Icon: |
109 | setItemTextPos( QIconView::Bottom ); | 110 | setItemTextPos( QIconView::Bottom ); |
110 | break; | 111 | break; |
111 | } | 112 | } |
112 | // hideOrShowItems ( false ); | 113 | // hideOrShowItems ( false ); |
@@ -292,195 +293,195 @@ TabDialog::TabDialog ( const QPixmap *tabicon, const QString &tabname, TabConfig | |||
292 | //m_iconcolor-> setColor ( QColor ( m_tc. m_text_color )); | 293 | //m_iconcolor-> setColor ( QColor ( m_tc. m_text_color )); |
293 | iconColorClicked ( m_iconcolor-> color ( )); | 294 | iconColorClicked ( m_iconcolor-> color ( )); |
294 | m_bgtype-> setButton ( tc. m_bg_type ); | 295 | m_bgtype-> setButton ( tc. m_bg_type ); |
295 | //m_solidcolor-> setColor ( QColor ( tc. m_bg_color )); | 296 | //m_solidcolor-> setColor ( QColor ( tc. m_bg_color )); |
296 | m_bgimage = tc. m_bg_image; | 297 | m_bgimage = tc. m_bg_image; |
297 | bgTypeClicked ( tc. m_bg_type ); | 298 | bgTypeClicked ( tc. m_bg_type ); |
298 | m_fontuse-> setChecked ( tc. m_font_use ); | 299 | m_fontuse-> setChecked ( tc. m_font_use ); |
299 | m_fontselect-> setSelectedFont ( QFont ( tc. m_font_family, tc. m_font_size, tc. m_font_weight, tc. m_font_italic )); | 300 | m_fontselect-> setSelectedFont ( QFont ( tc. m_font_family, tc. m_font_size, tc. m_font_weight, tc. m_font_italic )); |
300 | m_fontselect-> setEnabled ( m_fontuse-> isChecked ( )); | 301 | m_fontselect-> setEnabled ( m_fontuse-> isChecked ( )); |
301 | fontClicked ( m_fontselect-> selectedFont ( )); | 302 | fontClicked ( m_fontselect-> selectedFont ( )); |
302 | 303 | ||
303 | QWhatsThis::add ( sample, tr( "This is a rough preview of what the currently selected Tab will look like." )); | 304 | QWhatsThis::add ( sample, tr( "This is a rough preview of what the currently selected Tab will look like." )); |
304 | } | 305 | } |
305 | 306 | ||
306 | 307 | ||
307 | TabDialog::~TabDialog ( ) | 308 | TabDialog::~TabDialog ( ) |
308 | { | 309 | { |
309 | } | 310 | } |
310 | 311 | ||
311 | QWidget *TabDialog::createFontTab ( QWidget *parent ) | 312 | QWidget *TabDialog::createFontTab ( QWidget *parent ) |
312 | { | 313 | { |
313 | QWidget *tab = new QWidget ( parent, "FontTab" ); | 314 | QWidget *tab = new QWidget ( parent, "FontTab" ); |
314 | QVBoxLayout *vertLayout = new QVBoxLayout ( tab, 3, 3 ); | 315 | QVBoxLayout *vertLayout = new QVBoxLayout ( tab, 3, 3 ); |
315 | 316 | ||
316 | m_fontuse = new QCheckBox ( tr( "Use a custom font" ), tab ); | 317 | m_fontuse = new QCheckBox ( tr( "Use a custom font" ), tab ); |
317 | vertLayout-> addWidget ( m_fontuse ); | 318 | vertLayout-> addWidget ( m_fontuse ); |
318 | 319 | ||
319 | m_fontselect = new OFontSelector ( false, tab, "fontsel" ); | 320 | m_fontselect = new OFontSelector ( false, tab, "fontsel" ); |
320 | vertLayout-> addWidget ( m_fontselect ); | 321 | vertLayout-> addWidget ( m_fontselect ); |
321 | 322 | ||
322 | connect ( m_fontuse, SIGNAL( toggled(bool)), m_fontselect, SLOT( setEnabled(bool))); | 323 | connect ( m_fontuse, SIGNAL( toggled(bool)), m_fontselect, SLOT( setEnabled(bool))); |
323 | connect( m_fontselect, SIGNAL( fontSelected(const QFont&)), | 324 | connect( m_fontselect, SIGNAL( fontSelected(const QFont&)), |
324 | this, SLOT( fontClicked(const QFont&))); | 325 | this, SLOT( fontClicked(const QFont&))); |
325 | 326 | ||
326 | return tab; | 327 | return tab; |
327 | } | 328 | } |
328 | 329 | ||
329 | QWidget *TabDialog::createBgTab ( QWidget *parent ) | 330 | QWidget *TabDialog::createBgTab ( QWidget *parent ) |
330 | { | 331 | { |
331 | QWidget *tab = new QWidget( parent, "BgTab" ); | 332 | QWidget *tab = new QWidget( parent, "BgTab" ); |
332 | QVBoxLayout *vertLayout = new QVBoxLayout( tab, 3, 3 ); | 333 | QVBoxLayout *vertLayout = new QVBoxLayout( tab, 3, 3 ); |
333 | 334 | ||
334 | QGridLayout* gridLayout = new QGridLayout ( vertLayout ); | 335 | QGridLayout* gridLayout = new QGridLayout ( vertLayout ); |
335 | gridLayout-> setColStretch ( 1, 10 ); | 336 | gridLayout-> setColStretch ( 1, 10 ); |
336 | 337 | ||
337 | QLabel* label = new QLabel( tr( "Type:" ), tab ); | 338 | QLabel* label = new QLabel( tr( "Type:" ), tab ); |
338 | gridLayout-> addWidget ( label, 0, 0 ); | 339 | gridLayout-> addWidget ( label, 0, 0 ); |
339 | m_bgtype = new QButtonGroup( tab, "buttongroup" ); | 340 | m_bgtype = new QButtonGroup( tab, "buttongroup" ); |
340 | m_bgtype-> hide ( ); | 341 | m_bgtype-> hide ( ); |
341 | m_bgtype-> setExclusive ( true ); | 342 | m_bgtype-> setExclusive ( true ); |
342 | 343 | ||
343 | QRadioButton *rb; | 344 | QRadioButton *rb; |
344 | rb = new QRadioButton( tr( "Ruled" ), tab, "ruled" ); | 345 | rb = new QRadioButton( tr( "Ruled" ), tab, "ruled" ); |
345 | m_bgtype-> insert ( rb, TabConfig::Ruled ); | 346 | m_bgtype-> insert ( rb, TabConfig::Ruled ); |
346 | gridLayout-> addWidget( rb, 0, 1 ); | 347 | gridLayout-> addWidget( rb, 0, 1 ); |
347 | 348 | ||
348 | QHBoxLayout *hb = new QHBoxLayout ( ); | 349 | QHBoxLayout *hb = new QHBoxLayout ( ); |
349 | hb-> setSpacing ( 3 ); | 350 | hb-> setSpacing ( 3 ); |
350 | 351 | ||
351 | rb = new QRadioButton( tr( "Solid color" ), tab, "solid" ); | 352 | rb = new QRadioButton( tr( "Solid color" ), tab, "solid" ); |
352 | m_bgtype-> insert ( rb, TabConfig::SolidColor ); | 353 | m_bgtype-> insert ( rb, TabConfig::SolidColor ); |
353 | hb-> addWidget ( rb ); | 354 | hb-> addWidget ( rb ); |
354 | hb-> addSpacing ( 10 ); | 355 | hb-> addSpacing ( 10 ); |
355 | 356 | ||
356 | m_solidcolor = new OColorButton ( tab, QColor ( m_tc. m_bg_color ) ); | 357 | m_solidcolor = new Opie::OColorButton ( tab, QColor ( m_tc. m_bg_color ) ); |
357 | connect ( m_solidcolor, SIGNAL( colorSelected(const QColor&)), this, SLOT( bgColorClicked(const QColor&))); | 358 | connect ( m_solidcolor, SIGNAL( colorSelected(const QColor&)), this, SLOT( bgColorClicked(const QColor&))); |
358 | hb-> addWidget ( m_solidcolor ); | 359 | hb-> addWidget ( m_solidcolor ); |
359 | hb-> addStretch ( 10 ); | 360 | hb-> addStretch ( 10 ); |
360 | 361 | ||
361 | gridLayout-> addLayout ( hb, 1, 1 ); | 362 | gridLayout-> addLayout ( hb, 1, 1 ); |
362 | 363 | ||
363 | hb = new QHBoxLayout ( ); | 364 | hb = new QHBoxLayout ( ); |
364 | hb-> setSpacing ( 3 ); | 365 | hb-> setSpacing ( 3 ); |
365 | 366 | ||
366 | rb = new QRadioButton( tr( "Image" ), tab, "image" ); | 367 | rb = new QRadioButton( tr( "Image" ), tab, "image" ); |
367 | m_bgtype-> insert ( rb, TabConfig::Image ); | 368 | m_bgtype-> insert ( rb, TabConfig::Image ); |
368 | hb-> addWidget( rb ); | 369 | hb-> addWidget( rb ); |
369 | hb-> addSpacing ( 10 ); | 370 | hb-> addSpacing ( 10 ); |
370 | 371 | ||
371 | m_imagebrowse = new QPushButton ( tr( "Select..." ), tab ); | 372 | m_imagebrowse = new QPushButton ( tr( "Select..." ), tab ); |
372 | connect ( m_imagebrowse, SIGNAL( clicked()), this, SLOT( bgImageClicked())); | 373 | connect ( m_imagebrowse, SIGNAL( clicked()), this, SLOT( bgImageClicked())); |
373 | hb-> addWidget ( m_imagebrowse ); | 374 | hb-> addWidget ( m_imagebrowse ); |
374 | hb-> addStretch ( 10 ); | 375 | hb-> addStretch ( 10 ); |
375 | 376 | ||
376 | gridLayout-> addLayout ( hb, 2, 1 ); | 377 | gridLayout-> addLayout ( hb, 2, 1 ); |
377 | 378 | ||
378 | QPushButton *p = new QPushButton ( tr( "Default" ), tab ); | 379 | QPushButton *p = new QPushButton ( tr( "Default" ), tab ); |
379 | connect ( p, SIGNAL( clicked()), this, SLOT( bgDefaultClicked())); | 380 | connect ( p, SIGNAL( clicked()), this, SLOT( bgDefaultClicked())); |
380 | gridLayout-> addWidget ( p, 3, 1 ); | 381 | gridLayout-> addWidget ( p, 3, 1 ); |
381 | 382 | ||
382 | connect ( m_bgtype, SIGNAL( clicked(int)), this, SLOT( bgTypeClicked(int))); | 383 | connect ( m_bgtype, SIGNAL( clicked(int)), this, SLOT( bgTypeClicked(int))); |
383 | 384 | ||
384 | vertLayout-> addStretch ( 10 ); | 385 | vertLayout-> addStretch ( 10 ); |
385 | 386 | ||
386 | return tab; | 387 | return tab; |
387 | } | 388 | } |
388 | 389 | ||
389 | QWidget *TabDialog::createIconTab ( QWidget *parent ) | 390 | QWidget *TabDialog::createIconTab ( QWidget *parent ) |
390 | { | 391 | { |
391 | QWidget *tab = new QWidget( parent, "IconTab" ); | 392 | QWidget *tab = new QWidget( parent, "IconTab" ); |
392 | QVBoxLayout *vertLayout = new QVBoxLayout( tab, 3, 3 ); | 393 | QVBoxLayout *vertLayout = new QVBoxLayout( tab, 3, 3 ); |
393 | 394 | ||
394 | QGridLayout* gridLayout = new QGridLayout ( vertLayout ); | 395 | QGridLayout* gridLayout = new QGridLayout ( vertLayout ); |
395 | gridLayout-> setColStretch ( 1, 10 ); | 396 | gridLayout-> setColStretch ( 1, 10 ); |
396 | 397 | ||
397 | QLabel* label = new QLabel( tr( "Size:" ), tab ); | 398 | QLabel* label = new QLabel( tr( "Size:" ), tab ); |
398 | gridLayout-> addWidget ( label, 0, 0 ); | 399 | gridLayout-> addWidget ( label, 0, 0 ); |
399 | m_iconsize = new QButtonGroup( tab, "buttongroup" ); | 400 | m_iconsize = new QButtonGroup( tab, "buttongroup" ); |
400 | m_iconsize-> hide ( ); | 401 | m_iconsize-> hide ( ); |
401 | m_iconsize-> setExclusive ( true ); | 402 | m_iconsize-> setExclusive ( true ); |
402 | 403 | ||
403 | QRadioButton *rb; | 404 | QRadioButton *rb; |
404 | rb = new QRadioButton( tr( "Small" ), tab, "iconsmall" ); | 405 | rb = new QRadioButton( tr( "Small" ), tab, "iconsmall" ); |
405 | m_iconsize-> insert ( rb, TabConfig::List ); | 406 | m_iconsize-> insert ( rb, TabConfig::List ); |
406 | gridLayout-> addWidget( rb, 0, 1 ); | 407 | gridLayout-> addWidget( rb, 0, 1 ); |
407 | 408 | ||
408 | rb = new QRadioButton( tr( "Large" ), tab, "iconlarge" ); | 409 | rb = new QRadioButton( tr( "Large" ), tab, "iconlarge" ); |
409 | m_iconsize-> insert ( rb, TabConfig::Icon ); | 410 | m_iconsize-> insert ( rb, TabConfig::Icon ); |
410 | gridLayout-> addWidget( rb, 1, 1 ); | 411 | gridLayout-> addWidget( rb, 1, 1 ); |
411 | 412 | ||
412 | connect ( m_iconsize, SIGNAL( clicked(int)), this, SLOT( iconSizeClicked(int))); | 413 | connect ( m_iconsize, SIGNAL( clicked(int)), this, SLOT( iconSizeClicked(int))); |
413 | 414 | ||
414 | //vertLayout-> addSpacing ( 8 ); | 415 | //vertLayout-> addSpacing ( 8 ); |
415 | 416 | ||
416 | //gridLayout = new QGridLayout ( vertLayout ); | 417 | //gridLayout = new QGridLayout ( vertLayout ); |
417 | gridLayout-> addRowSpacing ( 2, 8 ); | 418 | gridLayout-> addRowSpacing ( 2, 8 ); |
418 | 419 | ||
419 | label = new QLabel ( tr( "Color:" ), tab ); | 420 | label = new QLabel ( tr( "Color:" ), tab ); |
420 | gridLayout-> addWidget ( label, 3, 0 ); | 421 | gridLayout-> addWidget ( label, 3, 0 ); |
421 | 422 | ||
422 | m_iconcolor = new OColorButton ( tab, QColor ( m_tc. m_text_color ) ); | 423 | m_iconcolor = new Opie::OColorButton ( tab, QColor ( m_tc. m_text_color ) ); |
423 | connect ( m_iconcolor, SIGNAL( colorSelected(const QColor&)), this, SLOT( iconColorClicked(const QColor&))); | 424 | connect ( m_iconcolor, SIGNAL( colorSelected(const QColor&)), this, SLOT( iconColorClicked(const QColor&))); |
424 | gridLayout-> addWidget ( m_iconcolor, 3, 1, AlignLeft ); | 425 | gridLayout-> addWidget ( m_iconcolor, 3, 1, AlignLeft ); |
425 | 426 | ||
426 | vertLayout-> addStretch ( 10 ); | 427 | vertLayout-> addStretch ( 10 ); |
427 | 428 | ||
428 | return tab; | 429 | return tab; |
429 | } | 430 | } |
430 | 431 | ||
431 | 432 | ||
432 | void TabDialog::iconSizeClicked ( int s ) | 433 | void TabDialog::iconSizeClicked ( int s ) |
433 | { | 434 | { |
434 | m_sample-> setViewMode ((TabConfig::ViewMode) s ); | 435 | m_sample-> setViewMode ((TabConfig::ViewMode) s ); |
435 | } | 436 | } |
436 | 437 | ||
437 | void TabDialog::fontClicked ( const QFont &f ) | 438 | void TabDialog::fontClicked ( const QFont &f ) |
438 | { | 439 | { |
439 | m_sample-> setViewFont ( f ); | 440 | m_sample-> setViewFont ( f ); |
440 | } | 441 | } |
441 | 442 | ||
442 | void TabDialog::bgTypeClicked ( int t ) | 443 | void TabDialog::bgTypeClicked ( int t ) |
443 | { | 444 | { |
444 | QString s; | 445 | QString s; |
445 | 446 | ||
446 | if ( m_bgtype-> id ( m_bgtype-> selected ( )) != t ) | 447 | if ( m_bgtype-> id ( m_bgtype-> selected ( )) != t ) |
447 | m_bgtype-> setButton ( t ); | 448 | m_bgtype-> setButton ( t ); |
448 | 449 | ||
449 | m_solidcolor-> setEnabled ( t == TabConfig::SolidColor ); | 450 | m_solidcolor-> setEnabled ( t == TabConfig::SolidColor ); |
450 | m_imagebrowse-> setEnabled ( t == TabConfig::Image ); | 451 | m_imagebrowse-> setEnabled ( t == TabConfig::Image ); |
451 | 452 | ||
452 | if ( t == TabConfig::SolidColor ) | 453 | if ( t == TabConfig::SolidColor ) |
453 | s = m_solidcolor-> color ( ). name ( ); | 454 | s = m_solidcolor-> color ( ). name ( ); |
454 | else if ( t == TabConfig::Image ) | 455 | else if ( t == TabConfig::Image ) |
455 | s = Resource::findPixmap ( m_bgimage ); | 456 | s = Resource::findPixmap ( m_bgimage ); |
456 | 457 | ||
457 | m_sample-> setBackgroundType ((TabConfig::BackgroundType) t, s ); | 458 | m_sample-> setBackgroundType ((TabConfig::BackgroundType) t, s ); |
458 | } | 459 | } |
459 | 460 | ||
460 | void TabDialog::bgColorClicked ( const QColor & ) | 461 | void TabDialog::bgColorClicked ( const QColor & ) |
461 | { | 462 | { |
462 | bgTypeClicked ( TabConfig::SolidColor ); | 463 | bgTypeClicked ( TabConfig::SolidColor ); |
463 | } | 464 | } |
464 | 465 | ||
465 | void TabDialog::iconColorClicked ( const QColor &col ) | 466 | void TabDialog::iconColorClicked ( const QColor &col ) |
466 | { | 467 | { |
467 | m_sample-> setTextColor ( col ); | 468 | m_sample-> setTextColor ( col ); |
468 | } | 469 | } |
469 | 470 | ||
470 | void TabDialog::bgImageClicked ( ) | 471 | void TabDialog::bgImageClicked ( ) |
471 | { | 472 | { |
472 | // ### use OFileSelector here ### | 473 | // ### use OFileSelector here ### |
473 | // this is just a quick c&p from the old appearance app | 474 | // this is just a quick c&p from the old appearance app |
474 | 475 | ||
475 | MimeTypes types; | 476 | MimeTypes types; |
476 | QStringList list; | 477 | QStringList list; |
477 | list << "image/*"; | 478 | list << "image/*"; |
478 | types. insert ( "Images", list ); | 479 | types. insert ( "Images", list ); |
479 | 480 | ||
480 | QString file = OFileDialog::getOpenFileName ( 1, "/", QString::null, types ); | 481 | QString file = OFileDialog::getOpenFileName ( 1, "/", QString::null, types ); |
481 | if ( !file. isEmpty ( )) { | 482 | if ( !file. isEmpty ( )) { |
482 | m_bgimage = DocLnk ( file ). file ( ); | 483 | m_bgimage = DocLnk ( file ). file ( ); |
483 | bgTypeClicked ( TabConfig::Image ); | 484 | bgTypeClicked ( TabConfig::Image ); |
484 | } | 485 | } |
485 | } | 486 | } |
486 | 487 | ||
diff --git a/core/settings/launcher/tabdialog.h b/core/settings/launcher/tabdialog.h index 4f99d5d..46b7ae9 100644 --- a/core/settings/launcher/tabdialog.h +++ b/core/settings/launcher/tabdialog.h | |||
@@ -1,81 +1,81 @@ | |||
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 __TABDIALOG_H__ | 28 | #ifndef __TABDIALOG_H__ |
29 | #define __TABDIALOG_H__ | 29 | #define __TABDIALOG_H__ |
30 | 30 | ||
31 | #include <qdialog.h> | 31 | #include <qdialog.h> |
32 | #include "tabconfig.h" | 32 | #include "tabconfig.h" |
33 | 33 | ||
34 | class QButtonGroup; | 34 | class QButtonGroup; |
35 | class OFontSelector; | 35 | namespace Opie {namespace Ui {class OFontSelector;}} |
36 | class SampleView; | 36 | class SampleView; |
37 | class OColorButton; | 37 | namespace Opie {class OColorButton;} |
38 | class QPushButton; | 38 | class QPushButton; |
39 | class QCheckBox; | 39 | class QCheckBox; |
40 | 40 | ||
41 | 41 | ||
42 | class TabDialog : public QDialog { | 42 | class TabDialog : public QDialog { |
43 | Q_OBJECT | 43 | Q_OBJECT |
44 | public: | 44 | public: |
45 | TabDialog ( const QPixmap *tabicon, const QString &tabname, TabConfig &cfg, QWidget *parent = 0, const char *dname = 0, bool modal = false, WFlags = 0 ); | 45 | TabDialog ( const QPixmap *tabicon, const QString &tabname, TabConfig &cfg, QWidget *parent = 0, const char *dname = 0, bool modal = false, WFlags = 0 ); |
46 | virtual ~TabDialog ( ); | 46 | virtual ~TabDialog ( ); |
47 | 47 | ||
48 | public slots: | 48 | public slots: |
49 | virtual void accept ( ); | 49 | virtual void accept ( ); |
50 | 50 | ||
51 | protected slots: | 51 | protected slots: |
52 | void iconSizeClicked ( int ); | 52 | void iconSizeClicked ( int ); |
53 | void fontClicked ( const QFont & ); | 53 | void fontClicked ( const QFont & ); |
54 | void bgTypeClicked ( int ); | 54 | void bgTypeClicked ( int ); |
55 | void bgColorClicked ( const QColor & ); | 55 | void bgColorClicked ( const QColor & ); |
56 | void iconColorClicked ( const QColor & ); | 56 | void iconColorClicked ( const QColor & ); |
57 | void bgImageClicked ( ); | 57 | void bgImageClicked ( ); |
58 | void bgDefaultClicked ( ); | 58 | void bgDefaultClicked ( ); |
59 | 59 | ||
60 | private: | 60 | private: |
61 | QWidget *createBgTab ( QWidget *parent ); | 61 | QWidget *createBgTab ( QWidget *parent ); |
62 | QWidget *createFontTab ( QWidget *parent ); | 62 | QWidget *createFontTab ( QWidget *parent ); |
63 | QWidget *createIconTab ( QWidget *parent ); | 63 | QWidget *createIconTab ( QWidget *parent ); |
64 | 64 | ||
65 | 65 | ||
66 | private: | 66 | private: |
67 | SampleView *m_sample; | 67 | SampleView *m_sample; |
68 | QButtonGroup *m_iconsize; | 68 | QButtonGroup *m_iconsize; |
69 | OFontSelector *m_fontselect; | 69 | Opie::Ui::OFontSelector *m_fontselect; |
70 | OColorButton *m_solidcolor; | 70 | Opie::OColorButton *m_solidcolor; |
71 | OColorButton *m_iconcolor; | 71 | Opie::OColorButton *m_iconcolor; |
72 | QPushButton *m_imagebrowse; | 72 | QPushButton *m_imagebrowse; |
73 | QString m_bgimage; | 73 | QString m_bgimage; |
74 | QButtonGroup *m_bgtype; | 74 | QButtonGroup *m_bgtype; |
75 | QCheckBox *m_fontuse; | 75 | QCheckBox *m_fontuse; |
76 | 76 | ||
77 | TabConfig &m_tc; | 77 | TabConfig &m_tc; |
78 | }; | 78 | }; |
79 | 79 | ||
80 | 80 | ||
81 | #endif | 81 | #endif |
diff --git a/core/settings/light-and-power/config.in b/core/settings/light-and-power/config.in index 96346bb..ef2a42f 100644 --- a/core/settings/light-and-power/config.in +++ b/core/settings/light-and-power/config.in | |||
@@ -1,4 +1,4 @@ | |||
1 | config LIGHT-AND-POWER | 1 | config LIGHT-AND-POWER |
2 | boolean "opie-light-and-power (apm and energy saving settings)" | 2 | boolean "opie-light-and-power (apm and energy saving settings)" |
3 | default "y" | 3 | default "y" |
4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE | 4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIECORE2 |
diff --git a/core/settings/light-and-power/light.cpp b/core/settings/light-and-power/light.cpp index 09fb767..ebcc25c 100644 --- a/core/settings/light-and-power/light.cpp +++ b/core/settings/light-and-power/light.cpp | |||
@@ -1,115 +1,115 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the OPIE Project | 2 | This file is part of the OPIE Project |
3 | =. Copyright (c) 2002 Maximilian Reiss <harlekin@handhelds.org> | 3 | =. Copyright (c) 2002 Maximilian Reiss <harlekin@handhelds.org> |
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 "light.h" | 29 | #include "light.h" |
30 | #include "sensor.h" | 30 | #include "sensor.h" |
31 | 31 | ||
32 | #include <opie2/odevice.h> | 32 | #include <opie2/odevice.h> |
33 | 33 | ||
34 | #include <qpe/config.h> | 34 | #include <qpe/config.h> |
35 | #include <qpe/power.h> | 35 | #include <qpe/power.h> |
36 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 36 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
37 | #include <qpe/qcopenvelope_qws.h> | 37 | #include <qpe/qcopenvelope_qws.h> |
38 | #endif | 38 | #endif |
39 | 39 | ||
40 | #include <qlabel.h> | 40 | #include <qlabel.h> |
41 | #include <qcheckbox.h> | 41 | #include <qcheckbox.h> |
42 | #include <qtabwidget.h> | 42 | #include <qtabwidget.h> |
43 | #include <qslider.h> | 43 | #include <qslider.h> |
44 | #include <qspinbox.h> | 44 | #include <qspinbox.h> |
45 | #include <qpushbutton.h> | 45 | #include <qpushbutton.h> |
46 | #include <qgroupbox.h> | 46 | #include <qgroupbox.h> |
47 | #include <qcombobox.h> | 47 | #include <qcombobox.h> |
48 | 48 | ||
49 | 49 | ||
50 | 50 | ||
51 | using namespace Opie; | 51 | using namespace Opie::Core; |
52 | 52 | ||
53 | LightSettings::LightSettings( QWidget* parent, const char* name, WFlags ) | 53 | LightSettings::LightSettings( QWidget* parent, const char* name, WFlags ) |
54 | : LightSettingsBase( parent, name, false, WStyle_ContextHelp ) | 54 | : LightSettingsBase( parent, name, false, WStyle_ContextHelp ) |
55 | { | 55 | { |
56 | m_bres = ODevice::inst ( )-> displayBrightnessResolution ( ); | 56 | m_bres = ODevice::inst ( )-> displayBrightnessResolution ( ); |
57 | m_cres = ODevice::inst ( )-> displayContrastResolution ( ); | 57 | m_cres = ODevice::inst ( )-> displayContrastResolution ( ); |
58 | 58 | ||
59 | // check whether to show the light sensor stuff | 59 | // check whether to show the light sensor stuff |
60 | 60 | ||
61 | if ( !ODevice::inst ( )-> hasLightSensor ( )) { | 61 | if ( !ODevice::inst ( )-> hasLightSensor ( )) { |
62 | auto_brightness-> hide ( ); | 62 | auto_brightness-> hide ( ); |
63 | CalibrateLightSensor-> hide ( ); | 63 | CalibrateLightSensor-> hide ( ); |
64 | auto_brightness_ac-> hide ( ); | 64 | auto_brightness_ac-> hide ( ); |
65 | CalibrateLightSensor_ac-> hide ( ); | 65 | CalibrateLightSensor_ac-> hide ( ); |
66 | } | 66 | } |
67 | 67 | ||
68 | // check whether to show the contrast stuff | 68 | // check whether to show the contrast stuff |
69 | 69 | ||
70 | if (m_cres) { | 70 | if (m_cres) { |
71 | GroupLight->setTitle(tr("Backlight && Contrast")); | 71 | GroupLight->setTitle(tr("Backlight && Contrast")); |
72 | GroupLight_ac->setTitle(GroupLight->title()); | 72 | GroupLight_ac->setTitle(GroupLight->title()); |
73 | } else { | 73 | } else { |
74 | contrast->hide(); | 74 | contrast->hide(); |
75 | contrast_ac->hide(); | 75 | contrast_ac->hide(); |
76 | } | 76 | } |
77 | 77 | ||
78 | // check whether to show the cpu frequency stuff | 78 | // check whether to show the cpu frequency stuff |
79 | 79 | ||
80 | QStrList freq = ODevice::inst()->allowedCpuFrequencies(); | 80 | QStrList freq = ODevice::inst()->allowedCpuFrequencies(); |
81 | if ( freq.count() ) { | 81 | if ( freq.count() ) { |
82 | frequency->insertStrList( freq ); | 82 | frequency->insertStrList( freq ); |
83 | frequency_ac->insertStrList( freq ); | 83 | frequency_ac->insertStrList( freq ); |
84 | } else { | 84 | } else { |
85 | frequencyLabel->hide(); | 85 | frequencyLabel->hide(); |
86 | frequency->hide(); | 86 | frequency->hide(); |
87 | frequencyLabel_ac->hide(); | 87 | frequencyLabel_ac->hide(); |
88 | frequency_ac->hide(); | 88 | frequency_ac->hide(); |
89 | } | 89 | } |
90 | 90 | ||
91 | // check whether to show the hinge action stuff | 91 | // check whether to show the hinge action stuff |
92 | 92 | ||
93 | if ( !ODevice::inst()->hasHingeSensor() ) { | 93 | if ( !ODevice::inst()->hasHingeSensor() ) { |
94 | closeHingeLabel->hide(); | 94 | closeHingeLabel->hide(); |
95 | closeHingeAction->hide(); | 95 | closeHingeAction->hide(); |
96 | closeHingeLabel_ac->hide(); | 96 | closeHingeLabel_ac->hide(); |
97 | closeHingeAction_ac->hide(); | 97 | closeHingeAction_ac->hide(); |
98 | } | 98 | } |
99 | 99 | ||
100 | Config config ( "apm" ); | 100 | Config config ( "apm" ); |
101 | config. setGroup ( "Battery" ); | 101 | config. setGroup ( "Battery" ); |
102 | 102 | ||
103 | // battery spinboxes | 103 | // battery spinboxes |
104 | interval_dim-> setValue ( config. readNumEntry ( "Dim", 30 )); | 104 | interval_dim-> setValue ( config. readNumEntry ( "Dim", 30 )); |
105 | interval_lightoff-> setValue ( config. readNumEntry ( "LightOff", 20 )); | 105 | interval_lightoff-> setValue ( config. readNumEntry ( "LightOff", 20 )); |
106 | interval_suspend-> setValue ( config. readNumEntry ( "Suspend", 60 )); | 106 | interval_suspend-> setValue ( config. readNumEntry ( "Suspend", 60 )); |
107 | 107 | ||
108 | // battery check and slider | 108 | // battery check and slider |
109 | LcdOffOnly->setChecked ( config. readBoolEntry ( "LcdOffOnly", false )); | 109 | LcdOffOnly->setChecked ( config. readBoolEntry ( "LcdOffOnly", false )); |
110 | 110 | ||
111 | // CPU frequency | 111 | // CPU frequency |
112 | frequency->setCurrentItem( config.readNumEntry("Freq", 0) ); | 112 | frequency->setCurrentItem( config.readNumEntry("Freq", 0) ); |
113 | 113 | ||
114 | // hinge action | 114 | // hinge action |
115 | closeHingeAction->setCurrentItem( config.readNumEntry("CloseHingeAction", 0) ); | 115 | closeHingeAction->setCurrentItem( config.readNumEntry("CloseHingeAction", 0) ); |
diff --git a/core/settings/light-and-power/main.cpp b/core/settings/light-and-power/main.cpp index 7a47b0b..1fc167d 100644 --- a/core/settings/light-and-power/main.cpp +++ b/core/settings/light-and-power/main.cpp | |||
@@ -1,26 +1,27 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include "light.h" | 21 | #include "light.h" |
22 | 22 | ||
23 | #include <opie2/oapplicationfactory.h> | 23 | #include <opie2/oapplicationfactory.h> |
24 | 24 | ||
25 | 25 | ||
26 | using namespace Opie::Core; | ||
26 | OPIE_EXPORT_APP( OApplicationFactory<LightSettings> ) | 27 | OPIE_EXPORT_APP( OApplicationFactory<LightSettings> ) |
diff --git a/core/settings/light-and-power/sensor.cpp b/core/settings/light-and-power/sensor.cpp index 53c3aed..a700a64 100644 --- a/core/settings/light-and-power/sensor.cpp +++ b/core/settings/light-and-power/sensor.cpp | |||
@@ -1,102 +1,102 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the OPIE Project | 2 | This file is part of the OPIE Project |
3 | =. Copyright (c) 2002 Maximilian Reiss <harlekin@handhelds.org> | 3 | =. Copyright (c) 2002 Maximilian Reiss <harlekin@handhelds.org> |
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 "calibration.h" | 29 | #include "calibration.h" |
30 | #include "sensor.h" | 30 | #include "sensor.h" |
31 | 31 | ||
32 | #include <opie2/odevice.h> | 32 | #include <opie2/odevice.h> |
33 | 33 | ||
34 | #include <qlayout.h> | 34 | #include <qlayout.h> |
35 | #include <qslider.h> | 35 | #include <qslider.h> |
36 | #include <qspinbox.h> | 36 | #include <qspinbox.h> |
37 | 37 | ||
38 | using namespace Opie; | 38 | using namespace Opie::Core; |
39 | 39 | ||
40 | Sensor::Sensor ( QStringList ¶ms, QWidget *parent, const char *name ) | 40 | Sensor::Sensor ( QStringList ¶ms, QWidget *parent, const char *name ) |
41 | : SensorBase ( parent, name, true, WStyle_ContextHelp ), m_params ( params ) | 41 | : SensorBase ( parent, name, true, WStyle_ContextHelp ), m_params ( params ) |
42 | { | 42 | { |
43 | int steps = 12; | 43 | int steps = 12; |
44 | int inter = 2; | 44 | int inter = 2; |
45 | 45 | ||
46 | int smin = 40; | 46 | int smin = 40; |
47 | int smax = 215; | 47 | int smax = 215; |
48 | int lmin = 1; | 48 | int lmin = 1; |
49 | int lmax = 255; | 49 | int lmax = 255; |
50 | 50 | ||
51 | switch ( params. count ( )) { | 51 | switch ( params. count ( )) { |
52 | case 6: lmax = params [5]. toInt ( ); | 52 | case 6: lmax = params [5]. toInt ( ); |
53 | case 5: lmin = params [4]. toInt ( ); | 53 | case 5: lmin = params [4]. toInt ( ); |
54 | case 4: smax = params [3]. toInt ( ); | 54 | case 4: smax = params [3]. toInt ( ); |
55 | case 3: smin = params [2]. toInt ( ); | 55 | case 3: smin = params [2]. toInt ( ); |
56 | case 2: steps = params [1]. toInt ( ); | 56 | case 2: steps = params [1]. toInt ( ); |
57 | case 1: inter = params [0]. toInt ( ) / 1000; | 57 | case 1: inter = params [0]. toInt ( ) / 1000; |
58 | } | 58 | } |
59 | 59 | ||
60 | int xscale = ODevice::inst ( )-> lightSensorResolution ( ); | 60 | int xscale = ODevice::inst ( )-> lightSensorResolution ( ); |
61 | int yscale = ODevice::inst ( )-> displayBrightnessResolution ( ); | 61 | int yscale = ODevice::inst ( )-> displayBrightnessResolution ( ); |
62 | 62 | ||
63 | QVBoxLayout *lay = new QVBoxLayout ( frame ); | 63 | QVBoxLayout *lay = new QVBoxLayout ( frame ); |
64 | lay-> setMargin ( 2 ); | 64 | lay-> setMargin ( 2 ); |
65 | m_calib = new Calibration ( frame ); | 65 | m_calib = new Calibration ( frame ); |
66 | lay-> add ( m_calib ); | 66 | lay-> add ( m_calib ); |
67 | 67 | ||
68 | m_calib-> setScale ( QSize ( xscale, yscale )); | 68 | m_calib-> setScale ( QSize ( xscale, yscale )); |
69 | m_calib-> setLineSteps ( steps ); | 69 | m_calib-> setLineSteps ( steps ); |
70 | m_calib-> setInterval ( inter ); | 70 | m_calib-> setInterval ( inter ); |
71 | m_calib-> setStartPoint ( QPoint ( smin * xscale / 256, lmax * yscale / 256 )); | 71 | m_calib-> setStartPoint ( QPoint ( smin * xscale / 256, lmax * yscale / 256 )); |
72 | m_calib-> setEndPoint ( QPoint ( smax * xscale / 256, lmin * yscale / 256 )); | 72 | m_calib-> setEndPoint ( QPoint ( smax * xscale / 256, lmin * yscale / 256 )); |
73 | 73 | ||
74 | interval-> setValue ( inter ); | 74 | interval-> setValue ( inter ); |
75 | linesteps-> setValue ( steps ); | 75 | linesteps-> setValue ( steps ); |
76 | 76 | ||
77 | connect ( interval, SIGNAL( valueChanged(int)), m_calib, SLOT( setInterval(int))); | 77 | connect ( interval, SIGNAL( valueChanged(int)), m_calib, SLOT( setInterval(int))); |
78 | connect ( linesteps, SIGNAL( valueChanged(int)), m_calib, SLOT( setLineSteps(int))); | 78 | connect ( linesteps, SIGNAL( valueChanged(int)), m_calib, SLOT( setLineSteps(int))); |
79 | 79 | ||
80 | connect ( m_calib, SIGNAL( startPointChanged(const QPoint&)), this, SLOT( pointDrag(const QPoint&))); | 80 | connect ( m_calib, SIGNAL( startPointChanged(const QPoint&)), this, SLOT( pointDrag(const QPoint&))); |
81 | connect ( m_calib, SIGNAL( endPointChanged(const QPoint&)), this, SLOT( pointDrag(const QPoint&))); | 81 | connect ( m_calib, SIGNAL( endPointChanged(const QPoint&)), this, SLOT( pointDrag(const QPoint&))); |
82 | } | 82 | } |
83 | 83 | ||
84 | void Sensor::accept ( ) | 84 | void Sensor::accept ( ) |
85 | { | 85 | { |
86 | int xscale = ODevice::inst ( )-> lightSensorResolution ( ); | 86 | int xscale = ODevice::inst ( )-> lightSensorResolution ( ); |
87 | int yscale = ODevice::inst ( )-> displayBrightnessResolution ( ); | 87 | int yscale = ODevice::inst ( )-> displayBrightnessResolution ( ); |
88 | 88 | ||
89 | m_params. clear ( ); | 89 | m_params. clear ( ); |
90 | m_params << QString::number ( m_calib-> interval ( ) * 1000 ) | 90 | m_params << QString::number ( m_calib-> interval ( ) * 1000 ) |
91 | << QString::number ( m_calib-> lineSteps ( )) | 91 | << QString::number ( m_calib-> lineSteps ( )) |
92 | << QString::number ( m_calib-> startPoint ( ). x ( ) * 256 / xscale ) | 92 | << QString::number ( m_calib-> startPoint ( ). x ( ) * 256 / xscale ) |
93 | << QString::number ( m_calib-> endPoint ( ). x ( ) * 256 / xscale ) | 93 | << QString::number ( m_calib-> endPoint ( ). x ( ) * 256 / xscale ) |
94 | << QString::number ( m_calib-> endPoint ( ). y ( ) * 256 / yscale ) | 94 | << QString::number ( m_calib-> endPoint ( ). y ( ) * 256 / yscale ) |
95 | << QString::number ( m_calib-> startPoint ( ). y ( ) * 256 / yscale ); | 95 | << QString::number ( m_calib-> startPoint ( ). y ( ) * 256 / yscale ); |
96 | 96 | ||
97 | QDialog::accept ( ); | 97 | QDialog::accept ( ); |
98 | } | 98 | } |
99 | 99 | ||
100 | void Sensor::pointDrag ( const QPoint &p ) | 100 | void Sensor::pointDrag ( const QPoint &p ) |
101 | { | 101 | { |
102 | emit viewBacklight ( p. y ( )); | 102 | emit viewBacklight ( p. y ( )); |
diff --git a/core/settings/security/config.in b/core/settings/security/config.in index 0973349..14876da 100644 --- a/core/settings/security/config.in +++ b/core/settings/security/config.in | |||
@@ -1,4 +1,4 @@ | |||
1 | config SECURITY | 1 | config SECURITY |
2 | boolean "opie-security (to set a pin for PDA usage protection)" | 2 | boolean "opie-security (to set a pin for PDA usage protection)" |
3 | default "y" | 3 | default "y" |
4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE | 4 | depends ( LIBQPE || LIBQPE-X11 ) |
diff --git a/core/settings/security/main.cpp b/core/settings/security/main.cpp index aed8ab2..200a541 100644 --- a/core/settings/security/main.cpp +++ b/core/settings/security/main.cpp | |||
@@ -1,29 +1,30 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | 21 | ||
22 | #include "security.h" | 22 | #include "security.h" |
23 | 23 | ||
24 | #include <opie/oapplicationfactory.h> | 24 | #include <opie2/oapplicationfactory.h> |
25 | 25 | ||
26 | using namespace Opie::Core; | ||
26 | OPIE_EXPORT_APP( OApplicationFactory<Security> ) | 27 | OPIE_EXPORT_APP( OApplicationFactory<Security> ) |
27 | 28 | ||
28 | 29 | ||
29 | 30 | ||