author | harlekin <harlekin> | 2003-12-10 22:47:24 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2003-12-10 22:47:24 (UTC) |
commit | e29d867078550b6859e3a0253e38febea8880ea1 (patch) (unidiff) | |
tree | 2b3a3c4362edd2bdca0d4ee253e6d5e115c1592b | |
parent | 35e556fc2a9d07e6e2c73cac6f05cfb4c0c3e4f1 (diff) | |
download | opie-e29d867078550b6859e3a0253e38febea8880ea1.zip opie-e29d867078550b6859e3a0253e38febea8880ea1.tar.gz opie-e29d867078550b6859e3a0253e38febea8880ea1.tar.bz2 |
less includes
-rw-r--r-- | core/settings/button/buttonsettings.cpp | 1 | ||||
-rw-r--r-- | core/settings/button/main.cpp | 1 | ||||
-rw-r--r-- | core/settings/button/remapdlg.cpp | 1 |
3 files changed, 0 insertions, 3 deletions
diff --git a/core/settings/button/buttonsettings.cpp b/core/settings/button/buttonsettings.cpp index b6a07a8..523e295 100644 --- a/core/settings/button/buttonsettings.cpp +++ b/core/settings/button/buttonsettings.cpp | |||
@@ -1,96 +1,95 @@ | |||
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 | #include <qpe/qpeapplication.h> | ||
33 | 32 | ||
34 | #include <opie/odevice.h> | 33 | #include <opie/odevice.h> |
35 | 34 | ||
36 | #include "buttonsettings.h" | 35 | #include "buttonsettings.h" |
37 | #include "buttonutils.h" | 36 | #include "buttonutils.h" |
38 | #include "remapdlg.h" | 37 | #include "remapdlg.h" |
39 | 38 | ||
40 | using namespace Opie; | 39 | using namespace Opie; |
41 | 40 | ||
42 | struct buttoninfo { | 41 | struct buttoninfo { |
43 | const ODeviceButton *m_button; | 42 | const ODeviceButton *m_button; |
44 | int m_index; | 43 | int m_index; |
45 | 44 | ||
46 | OQCopMessage m_pmsg; | 45 | OQCopMessage m_pmsg; |
47 | QLabel *m_picon; | 46 | QLabel *m_picon; |
48 | QLabel *m_plabel; | 47 | QLabel *m_plabel; |
49 | 48 | ||
50 | OQCopMessage m_hmsg; | 49 | OQCopMessage m_hmsg; |
51 | QLabel *m_hicon; | 50 | QLabel *m_hicon; |
52 | QLabel *m_hlabel; | 51 | QLabel *m_hlabel; |
53 | 52 | ||
54 | bool m_pdirty : 1; | 53 | bool m_pdirty : 1; |
55 | bool m_hdirty : 1; | 54 | bool m_hdirty : 1; |
56 | }; | 55 | }; |
57 | 56 | ||
58 | 57 | ||
59 | ButtonSettings::ButtonSettings ( QWidget *parent , const char *name, bool modal, WFlags f ) | 58 | ButtonSettings::ButtonSettings ( QWidget *parent , const char *name, bool modal, WFlags f ) |
60 | : QDialog ( 0, "ButtonSettings", false, WStyle_ContextHelp ) | 59 | : QDialog ( 0, "ButtonSettings", false, WStyle_ContextHelp ) |
61 | { | 60 | { |
62 | const QValueList <ODeviceButton> &buttons = ODevice::inst ( )-> buttons ( ); | 61 | const QValueList <ODeviceButton> &buttons = ODevice::inst ( )-> buttons ( ); |
63 | (void) ButtonUtils::inst ( ); // initialise | 62 | (void) ButtonUtils::inst ( ); // initialise |
64 | 63 | ||
65 | setCaption ( tr( "Button Settings" )); | 64 | setCaption ( tr( "Button Settings" )); |
66 | 65 | ||
67 | QVBoxLayout *toplay = new QVBoxLayout ( this, 3, 3 ); | 66 | QVBoxLayout *toplay = new QVBoxLayout ( this, 3, 3 ); |
68 | 67 | ||
69 | 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 ); |
70 | toplay-> addWidget ( l ); | 69 | toplay-> addWidget ( l ); |
71 | 70 | ||
72 | QGridLayout *lay = new QGridLayout ( toplay ); | 71 | QGridLayout *lay = new QGridLayout ( toplay ); |
73 | lay-> setMargin ( 0 ); | 72 | lay-> setMargin ( 0 ); |
74 | lay-> setColStretch ( 0, 0 ); | 73 | lay-> setColStretch ( 0, 0 ); |
75 | lay-> setColStretch ( 1, 0 ); | 74 | lay-> setColStretch ( 1, 0 ); |
76 | lay-> setColStretch ( 2, 0 ); | 75 | lay-> setColStretch ( 2, 0 ); |
77 | lay-> setColStretch ( 3, 10 ); | 76 | lay-> setColStretch ( 3, 10 ); |
78 | 77 | ||
79 | m_infos. setAutoDelete ( true ); | 78 | m_infos. setAutoDelete ( true ); |
80 | 79 | ||
81 | int i = 1; | 80 | int i = 1; |
82 | int index = 0; | 81 | int index = 0; |
83 | for ( QValueList<ODeviceButton>::ConstIterator it = buttons. begin ( ); it != buttons. end ( ); it++ ) { | 82 | for ( QValueList<ODeviceButton>::ConstIterator it = buttons. begin ( ); it != buttons. end ( ); it++ ) { |
84 | if ( it != buttons. begin ( )) { | 83 | if ( it != buttons. begin ( )) { |
85 | QFrame *f = new QFrame ( this ); | 84 | QFrame *f = new QFrame ( this ); |
86 | f-> setFrameStyle ( QFrame::Sunken | QFrame::VLine ); | 85 | f-> setFrameStyle ( QFrame::Sunken | QFrame::VLine ); |
87 | lay-> addMultiCellWidget ( f, i, i, 0, 3 ); | 86 | lay-> addMultiCellWidget ( f, i, i, 0, 3 ); |
88 | i++; | 87 | i++; |
89 | } | 88 | } |
90 | 89 | ||
91 | buttoninfo *bi = new buttoninfo ( ); | 90 | buttoninfo *bi = new buttoninfo ( ); |
92 | bi-> m_button = &(*it); | 91 | bi-> m_button = &(*it); |
93 | bi-> m_index = index++; | 92 | bi-> m_index = index++; |
94 | bi-> m_pmsg = (*it). pressedAction ( ); | 93 | bi-> m_pmsg = (*it). pressedAction ( ); |
95 | bi-> m_hmsg = (*it). heldAction ( ); | 94 | bi-> m_hmsg = (*it). heldAction ( ); |
96 | bi-> m_pdirty = false; | 95 | bi-> m_pdirty = false; |
diff --git a/core/settings/button/main.cpp b/core/settings/button/main.cpp index c063c3c..e7c5bf9 100644 --- a/core/settings/button/main.cpp +++ b/core/settings/button/main.cpp | |||
@@ -1,33 +1,32 @@ | |||
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 <qpe/qpeapplication.h> | ||
31 | #include <opie/oapplicationfactory.h> | 30 | #include <opie/oapplicationfactory.h> |
32 | 31 | ||
33 | OPIE_EXPORT_APP( OApplicationFactory<ButtonSettings> ) | 32 | OPIE_EXPORT_APP( OApplicationFactory<ButtonSettings> ) |
diff --git a/core/settings/button/remapdlg.cpp b/core/settings/button/remapdlg.cpp index 939a6bf..7dabe68 100644 --- a/core/settings/button/remapdlg.cpp +++ b/core/settings/button/remapdlg.cpp | |||
@@ -1,66 +1,65 @@ | |||
1 | #include <qlistview.h> | 1 | #include <qlistview.h> |
2 | #include <qlabel.h> | ||
3 | #include <qcombobox.h> | 2 | #include <qcombobox.h> |
4 | #include <qtimer.h> | 3 | #include <qtimer.h> |
5 | 4 | ||
6 | #include "remapdlg.h" | 5 | #include "remapdlg.h" |
7 | #include "buttonutils.h" | 6 | #include "buttonutils.h" |
8 | 7 | ||
9 | using namespace Opie; | 8 | using namespace Opie; |
10 | 9 | ||
11 | class NoSortItem : public QListViewItem { | 10 | class NoSortItem : public QListViewItem { |
12 | public: | 11 | public: |
13 | 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 ) |
14 | : QListViewItem ( lv, str, s1, s2 ) | 13 | : QListViewItem ( lv, str, s1, s2 ) |
15 | { | 14 | { |
16 | m_key = QString ( QChar ( 'a' + pos )); | 15 | m_key = QString ( QChar ( 'a' + pos )); |
17 | m_def = false; | 16 | m_def = false; |
18 | } | 17 | } |
19 | 18 | ||
20 | void setDefault ( bool b ) | 19 | void setDefault ( bool b ) |
21 | { | 20 | { |
22 | m_def = b; | 21 | m_def = b; |
23 | } | 22 | } |
24 | 23 | ||
25 | virtual QString key ( int /*column*/, bool /*ascending*/ ) const | 24 | virtual QString key ( int /*column*/, bool /*ascending*/ ) const |
26 | { | 25 | { |
27 | return m_key; | 26 | return m_key; |
28 | } | 27 | } |
29 | 28 | ||
30 | 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 ) |
31 | { | 30 | { |
32 | if ( m_def ) { | 31 | if ( m_def ) { |
33 | QFont f ( listView ( )-> font ( )); | 32 | QFont f ( listView ( )-> font ( )); |
34 | f. setBold ( true ); | 33 | f. setBold ( true ); |
35 | p-> setFont ( f ); | 34 | p-> setFont ( f ); |
36 | } | 35 | } |
37 | QListViewItem::paintCell ( p, cg, column, width, align ); | 36 | QListViewItem::paintCell ( p, cg, column, width, align ); |
38 | } | 37 | } |
39 | 38 | ||
40 | private: | 39 | private: |
41 | QString m_key; | 40 | QString m_key; |
42 | bool m_def; | 41 | bool m_def; |
43 | }; | 42 | }; |
44 | 43 | ||
45 | 44 | ||
46 | RemapDlg::RemapDlg ( const Opie::ODeviceButton *b, bool hold, QWidget *parent, const char *name ) | 45 | RemapDlg::RemapDlg ( const Opie::ODeviceButton *b, bool hold, QWidget *parent, const char *name ) |
47 | : RemapDlgBase ( parent, name, true, WStyle_ContextHelp ) | 46 | : RemapDlgBase ( parent, name, true, WStyle_ContextHelp ) |
48 | { | 47 | { |
49 | 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 ( ))); |
50 | 49 | ||
51 | m_current = 0; | 50 | m_current = 0; |
52 | 51 | ||
53 | 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 }; |
54 | w_channel-> insertStrList ((const char **) def_channels ); | 53 | w_channel-> insertStrList ((const char **) def_channels ); |
55 | 54 | ||
56 | m_msg = hold ? b-> heldAction ( ) : b-> pressedAction ( ); | 55 | m_msg = hold ? b-> heldAction ( ) : b-> pressedAction ( ); |
57 | m_msg_preset = hold ? b-> factoryPresetHeldAction ( ) : b-> factoryPresetPressedAction ( ); | 56 | m_msg_preset = hold ? b-> factoryPresetHeldAction ( ) : b-> factoryPresetPressedAction ( ); |
58 | 57 | ||
59 | m_map_none = new NoSortItem ( w_list, 0, tr( "No mapping" )); | 58 | m_map_none = new NoSortItem ( w_list, 0, tr( "No mapping" )); |
60 | 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 ( )); |
61 | ((NoSortItem *) m_map_preset )-> setDefault ( true ); | 60 | ((NoSortItem *) m_map_preset )-> setDefault ( true ); |
62 | 61 | ||
63 | if (m_msg. channel ( ) == "ignore") | 62 | if (m_msg. channel ( ) == "ignore") |
64 | { | 63 | { |
65 | 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 ( )); |
66 | 65 | ||