author | sandman <sandman> | 2002-09-26 01:14:30 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-09-26 01:14:30 (UTC) |
commit | 056f01ffc3b32de4dbf4fca79917198951e59d60 (patch) (unidiff) | |
tree | 7c3331a038a85480c120b92dddb6277d97fe81da | |
parent | 8c831e3a8cc9cf7ee120a3a227b6698aa797f740 (diff) | |
download | opie-056f01ffc3b32de4dbf4fca79917198951e59d60.zip opie-056f01ffc3b32de4dbf4fca79917198951e59d60.tar.gz opie-056f01ffc3b32de4dbf4fca79917198951e59d60.tar.bz2 |
Corrected the copyright headers (LGPL -> GPL)
-rw-r--r-- | noncore/settings/appearance2/appearance.cpp | 31 | ||||
-rw-r--r-- | noncore/settings/appearance2/appearance.h | 30 | ||||
-rw-r--r-- | noncore/settings/appearance2/colorlistitem.h | 27 | ||||
-rw-r--r-- | noncore/settings/appearance2/decolistitem.h | 28 | ||||
-rw-r--r-- | noncore/settings/appearance2/editScheme.cpp | 30 | ||||
-rw-r--r-- | noncore/settings/appearance2/editScheme.h | 30 | ||||
-rw-r--r-- | noncore/settings/appearance2/main.cpp | 27 | ||||
-rw-r--r-- | noncore/settings/appearance2/sample.cpp | 27 | ||||
-rw-r--r-- | noncore/settings/appearance2/sample.h | 27 | ||||
-rw-r--r-- | noncore/settings/appearance2/stylelistitem.h | 27 |
10 files changed, 140 insertions, 144 deletions
diff --git a/noncore/settings/appearance2/appearance.cpp b/noncore/settings/appearance2/appearance.cpp index 66cf2c3..a5d216c 100644 --- a/noncore/settings/appearance2/appearance.cpp +++ b/noncore/settings/appearance2/appearance.cpp | |||
@@ -1,88 +1,89 @@ | |||
1 | /* | 1 | /* |
2 | =. This file is part of the OPIE Project | 2 | This file is part of the OPIE Project |
3 | Copyright (c) 2002 Trolltech AS <info@trolltech.com> | ||
4 | =. Copyright (c) 2002 Dan Williams <williamsdr@acm.org> | ||
3 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> | 5 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> |
4 | .>+-= | 6 | .>+-= |
5 | _;:, .> :=|. This library is free software; you can | 7 | _;:, .> :=|. This file is free software; you can |
6 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
7 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
8 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
9 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
10 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
11 | .%`+i> _;_. | 13 | .%`+i> _;_. |
12 | .i_,=:_. -<s. This library is distributed in the hope that | 14 | .i_,=:_. -<s. This file is distributed in the hope that |
13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
14 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General |
17 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Public License for more details. |
18 | ++= -. .` .: details. | 20 | ++= -. .` .: |
19 | : = ...= . :.=- | 21 | : = ...= . :.=- You should have received a copy of the GNU |
20 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; General Public License along with this file; |
21 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = see the file COPYING. If not, write to the |
22 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` Free Software Foundation, Inc., |
23 | If not, write to the Free Software Foundation, | 25 | 59 Temple Place - Suite 330, |
24 | Inc., 59 Temple Place - Suite 330, | ||
25 | Boston, MA 02111-1307, USA. | 26 | Boston, MA 02111-1307, USA. |
26 | 27 | ||
27 | */ | 28 | */ |
28 | 29 | ||
29 | #include "appearance.h" | 30 | #include "appearance.h" |
30 | #include "editScheme.h" | 31 | #include "editScheme.h" |
31 | 32 | ||
32 | #include <opie/ofiledialog.h> | 33 | #include <opie/ofiledialog.h> |
33 | #include <opie/otabwidget.h> | 34 | #include <opie/otabwidget.h> |
34 | 35 | ||
35 | #include <qpe/applnk.h> | 36 | #include <qpe/applnk.h> |
36 | #include <qpe/config.h> | 37 | #include <qpe/config.h> |
37 | #include <qpe/global.h> | 38 | #include <qpe/global.h> |
38 | #include <qpe/resource.h> | 39 | #include <qpe/resource.h> |
39 | #include <qpe/qpeapplication.h> | 40 | #include <qpe/qpeapplication.h> |
40 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 41 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
41 | #include <qpe/qcopenvelope_qws.h> | 42 | #include <qpe/qcopenvelope_qws.h> |
42 | #endif | 43 | #endif |
43 | 44 | ||
44 | #include <qaction.h> | 45 | #include <qaction.h> |
45 | #include <qbuttongroup.h> | 46 | #include <qbuttongroup.h> |
46 | #include <qcheckbox.h> | 47 | #include <qcheckbox.h> |
47 | #include <qcombobox.h> | 48 | #include <qcombobox.h> |
48 | #include <qdialog.h> | 49 | #include <qdialog.h> |
49 | #include <qdir.h> | 50 | #include <qdir.h> |
50 | #include <qlabel.h> | 51 | #include <qlabel.h> |
51 | #include <qlayout.h> | 52 | #include <qlayout.h> |
52 | #include <qlineedit.h> | 53 | #include <qlineedit.h> |
53 | #include <qlistbox.h> | 54 | #include <qlistbox.h> |
54 | #include <qmessagebox.h> | 55 | #include <qmessagebox.h> |
55 | #include <qmultilineedit.h> | 56 | #include <qmultilineedit.h> |
56 | #include <qpopupmenu.h> | 57 | #include <qpopupmenu.h> |
57 | #include <qpushbutton.h> | 58 | #include <qpushbutton.h> |
58 | #include <qradiobutton.h> | 59 | #include <qradiobutton.h> |
59 | #if QT_VERSION >= 300 | 60 | #if QT_VERSION >= 300 |
60 | #include <qstylefactory.h> | 61 | #include <qstylefactory.h> |
61 | #else | 62 | #else |
62 | #include <qwindowsstyle.h> | 63 | #include <qwindowsstyle.h> |
63 | #include <qpe/qpestyle.h> | 64 | #include <qpe/qpestyle.h> |
64 | #include <qpe/lightstyle.h> | 65 | #include <qpe/lightstyle.h> |
65 | #include <qpe/qlibrary.h> | 66 | #include <qpe/qlibrary.h> |
66 | #include <qpe/styleinterface.h> | 67 | #include <qpe/styleinterface.h> |
67 | #endif | 68 | #endif |
68 | #include <qtabwidget.h> | 69 | #include <qtabwidget.h> |
69 | #include <qtoolbutton.h> | 70 | #include <qtoolbutton.h> |
70 | #include <qvgroupbox.h> | 71 | #include <qvgroupbox.h> |
71 | #include <qwidget.h> | 72 | #include <qwidget.h> |
72 | 73 | ||
73 | #include "stylelistitem.h" | 74 | #include "stylelistitem.h" |
74 | #include "decolistitem.h" | 75 | #include "decolistitem.h" |
75 | #include "colorlistitem.h" | 76 | #include "colorlistitem.h" |
76 | 77 | ||
77 | #include "sample.h" | 78 | #include "sample.h" |
78 | 79 | ||
79 | #include <opie/ofontselector.h> | 80 | #include <opie/ofontselector.h> |
80 | 81 | ||
81 | 82 | ||
82 | class DefaultWindowDecoration : public WindowDecorationInterface | 83 | class DefaultWindowDecoration : public WindowDecorationInterface |
83 | { | 84 | { |
84 | public: | 85 | public: |
85 | DefaultWindowDecoration() : ref(0) {} | 86 | DefaultWindowDecoration() : ref(0) {} |
86 | QString name() const { | 87 | QString name() const { |
87 | return "Default"; | 88 | return "Default"; |
88 | } | 89 | } |
diff --git a/noncore/settings/appearance2/appearance.h b/noncore/settings/appearance2/appearance.h index ddf94f2..a392aa7 100644 --- a/noncore/settings/appearance2/appearance.h +++ b/noncore/settings/appearance2/appearance.h | |||
@@ -1,88 +1,88 @@ | |||
1 | /* | 1 | /* |
2 | =. This file is part of the OPIE Project | 2 | This file is part of the OPIE Project |
3 | =. Copyright (c) 2002 Dan Williams <williamsdr@acm.org> | ||
3 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> | 4 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> |
4 | .>+-= | 5 | .>+-= |
5 | _;:, .> :=|. This library is free software; you can | 6 | _;:, .> :=|. This file is free software; you can |
6 | .> <`_, > . <= redistribute it and/or modify it under | 7 | .> <`_, > . <= redistribute it and/or modify it under |
7 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 8 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
8 | .="- .-=="i, .._ License as published by the Free Software | 9 | .="- .-=="i, .._ License as published by the Free Software |
9 | - . .-<_> .<> Foundation; either version 2 of the License, | 10 | - . .-<_> .<> Foundation; either version 2 of the License, |
10 | ._= =} : or (at your option) any later version. | 11 | ._= =} : or (at your option) any later version. |
11 | .%`+i> _;_. | 12 | .%`+i> _;_. |
12 | .i_,=:_. -<s. This library is distributed in the hope that | 13 | .i_,=:_. -<s. This file is distributed in the hope that |
13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 14 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
14 | : .. .:, . . . without even the implied warranty of | 15 | : .. .:, . . . without even the implied warranty of |
15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 16 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General |
17 | ..}^=.= = ; Library General Public License for more | 18 | ..}^=.= = ; Public License for more details. |
18 | ++= -. .` .: 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 | -_. . . )=. = Library General Public License along with | 22 | -_. . . )=. = see the file COPYING. If not, write to the |
22 | -- :-=` this library; see the file COPYING.LIB. | 23 | -- :-=` Free Software Foundation, Inc., |
23 | If not, write to the Free Software Foundation, | 24 | 59 Temple Place - Suite 330, |
24 | Inc., 59 Temple Place - Suite 330, | ||
25 | Boston, MA 02111-1307, USA. | 25 | Boston, MA 02111-1307, USA. |
26 | 26 | ||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #ifndef APPEARANCESETTINGS_H | 29 | #ifndef APPEARANCESETTINGS_H |
30 | #define APPEARANCESETTINGS_H | 30 | #define APPEARANCESETTINGS_H |
31 | 31 | ||
32 | #include <qpe/fontdatabase.h> | 32 | #include <qpe/fontdatabase.h> |
33 | 33 | ||
34 | #include <qmainwindow.h> | 34 | #include <qmainwindow.h> |
35 | #include <qdialog.h> | 35 | #include <qdialog.h> |
36 | 36 | ||
37 | class QCheckBox; | 37 | class QCheckBox; |
38 | class QComboBox; | 38 | class QComboBox; |
39 | class QLabel; | 39 | class QLabel; |
40 | class QLineEdit; | 40 | class QLineEdit; |
41 | class QListBox; | 41 | class QListBox; |
42 | class QMultiLineEdit; | 42 | class QMultiLineEdit; |
43 | class QPushButton; | 43 | class QPushButton; |
44 | class QRadioButton; | 44 | class QRadioButton; |
45 | class QToolButton; | 45 | class QToolButton; |
46 | class SampleWindow; | 46 | class SampleWindow; |
47 | class OFontSelector; | 47 | class OFontSelector; |
48 | 48 | ||
49 | class Appearance : public QDialog | 49 | class Appearance : public QDialog |
50 | { | 50 | { |
51 | Q_OBJECT | 51 | Q_OBJECT |
52 | 52 | ||
53 | public: | 53 | public: |
54 | Appearance( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); | 54 | Appearance( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); |
55 | ~Appearance(); | 55 | ~Appearance(); |
56 | 56 | ||
57 | protected: | 57 | protected: |
58 | virtual void accept ( ); | 58 | virtual void accept ( ); |
59 | virtual void done ( int r ); | 59 | virtual void done ( int r ); |
60 | 60 | ||
61 | protected slots: | 61 | protected slots: |
62 | void styleClicked ( int ); | 62 | void styleClicked ( int ); |
63 | void styleSettingsClicked ( ); | 63 | void styleSettingsClicked ( ); |
64 | void decoClicked ( int ); | 64 | void decoClicked ( int ); |
65 | void fontClicked ( const QFont & ); | 65 | void fontClicked ( const QFont & ); |
66 | void colorClicked ( int ); | 66 | void colorClicked ( int ); |
67 | 67 | ||
68 | void editSchemeClicked(); | 68 | void editSchemeClicked(); |
69 | void saveSchemeClicked(); | 69 | void saveSchemeClicked(); |
70 | void deleteSchemeClicked(); | 70 | void deleteSchemeClicked(); |
71 | 71 | ||
72 | private: | 72 | private: |
73 | void loadStyles ( QListBox * ); | 73 | void loadStyles ( QListBox * ); |
74 | void loadDecos ( QListBox * ); | 74 | void loadDecos ( QListBox * ); |
75 | void loadColors ( QListBox * ); | 75 | void loadColors ( QListBox * ); |
76 | 76 | ||
77 | void changeText(); | 77 | void changeText(); |
78 | 78 | ||
79 | QWidget *createStyleTab ( QWidget *parent ); | 79 | QWidget *createStyleTab ( QWidget *parent ); |
80 | QWidget *createDecoTab ( QWidget *parent ); | 80 | QWidget *createDecoTab ( QWidget *parent ); |
81 | QWidget *createFontTab ( QWidget *parent ); | 81 | QWidget *createFontTab ( QWidget *parent ); |
82 | QWidget *createColorTab ( QWidget *parent ); | 82 | QWidget *createColorTab ( QWidget *parent ); |
83 | QWidget *createGuiTab ( QWidget *parent ); | 83 | QWidget *createGuiTab ( QWidget *parent ); |
84 | 84 | ||
85 | private: | 85 | private: |
86 | bool m_style_changed; | 86 | bool m_style_changed; |
87 | bool m_font_changed; | 87 | bool m_font_changed; |
88 | bool m_scheme_changed; | 88 | bool m_scheme_changed; |
diff --git a/noncore/settings/appearance2/colorlistitem.h b/noncore/settings/appearance2/colorlistitem.h index 1df541b..10e4468 100644 --- a/noncore/settings/appearance2/colorlistitem.h +++ b/noncore/settings/appearance2/colorlistitem.h | |||
@@ -1,88 +1,87 @@ | |||
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 library 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 Library 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 library 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 | 16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General |
17 | ..}^=.= = ; Library General Public License for more | 17 | ..}^=.= = ; Public License for more details. |
18 | ++= -. .` .: details. | 18 | ++= -. .` .: |
19 | : = ...= . :.=- | 19 | : = ...= . :.=- You should have received a copy of the GNU |
20 | -. .:....=;==+<; You should have received a copy of the GNU | 20 | -. .:....=;==+<; General Public License along with this file; |
21 | -_. . . )=. = Library General Public License along with | 21 | -_. . . )=. = see the file COPYING. If not, write to the |
22 | -- :-=` this library; see the file COPYING.LIB. | 22 | -- :-=` Free Software Foundation, Inc., |
23 | If not, write to the Free Software Foundation, | 23 | 59 Temple Place - Suite 330, |
24 | Inc., 59 Temple Place - Suite 330, | ||
25 | Boston, MA 02111-1307, USA. | 24 | Boston, MA 02111-1307, USA. |
26 | 25 | ||
27 | */ | 26 | */ |
28 | 27 | ||
29 | #ifndef COLORLISTITEM_H | 28 | #ifndef COLORLISTITEM_H |
30 | #define COLORLISTITEM_H | 29 | #define COLORLISTITEM_H |
31 | 30 | ||
32 | #include <qlistbox.h> | 31 | #include <qlistbox.h> |
33 | #include <qpalette.h> | 32 | #include <qpalette.h> |
34 | #include <qapplication.h> | 33 | #include <qapplication.h> |
35 | 34 | ||
36 | #include <qpe/config.h> | 35 | #include <qpe/config.h> |
37 | 36 | ||
38 | class Appearance; | 37 | class Appearance; |
39 | 38 | ||
40 | class ColorListItem : public QListBoxText { | 39 | class ColorListItem : public QListBoxText { |
41 | public: | 40 | public: |
42 | ColorListItem ( const QString &t, Config &cfg ) : QListBoxText ( t ) | 41 | ColorListItem ( const QString &t, Config &cfg ) : QListBoxText ( t ) |
43 | { | 42 | { |
44 | m_colors = new QColor [s_colorcount]; | 43 | m_colors = new QColor [s_colorcount]; |
45 | load ( cfg ); | 44 | load ( cfg ); |
46 | } | 45 | } |
47 | 46 | ||
48 | virtual ~ColorListItem ( ) | 47 | virtual ~ColorListItem ( ) |
49 | { | 48 | { |
50 | delete [] m_colors; | 49 | delete [] m_colors; |
51 | } | 50 | } |
52 | 51 | ||
53 | QPalette palette ( ) | 52 | QPalette palette ( ) |
54 | { | 53 | { |
55 | return m_palette; | 54 | return m_palette; |
56 | } | 55 | } |
57 | 56 | ||
58 | bool load ( Config &cfg ) | 57 | bool load ( Config &cfg ) |
59 | { | 58 | { |
60 | for ( int i = 0; i < s_colorcount; i++ ) | 59 | for ( int i = 0; i < s_colorcount; i++ ) |
61 | m_colors [i] = QColor ( cfg. readEntry ( s_colorlut [i]. m_key, s_colorlut [i]. m_def )); | 60 | m_colors [i] = QColor ( cfg. readEntry ( s_colorlut [i]. m_key, s_colorlut [i]. m_def )); |
62 | 61 | ||
63 | buildPalette ( ); | 62 | buildPalette ( ); |
64 | return true; | 63 | return true; |
65 | } | 64 | } |
66 | 65 | ||
67 | void buildPalette ( ) | 66 | void buildPalette ( ) |
68 | { | 67 | { |
69 | m_palette = QPalette ( m_colors [r2i(QColorGroup::Button)], m_colors [r2i(QColorGroup::Background)] ); | 68 | m_palette = QPalette ( m_colors [r2i(QColorGroup::Button)], m_colors [r2i(QColorGroup::Background)] ); |
70 | m_palette. setColor ( QColorGroup::Highlight, m_colors [r2i(QColorGroup::Highlight)] ); | 69 | m_palette. setColor ( QColorGroup::Highlight, m_colors [r2i(QColorGroup::Highlight)] ); |
71 | m_palette. setColor ( QColorGroup::HighlightedText, m_colors [r2i(QColorGroup::HighlightedText)] ); | 70 | m_palette. setColor ( QColorGroup::HighlightedText, m_colors [r2i(QColorGroup::HighlightedText)] ); |
72 | m_palette. setColor ( QColorGroup::Text, m_colors [r2i(QColorGroup::Text)] ); | 71 | m_palette. setColor ( QColorGroup::Text, m_colors [r2i(QColorGroup::Text)] ); |
73 | m_palette. setColor ( QPalette::Active, QColorGroup::ButtonText, m_colors [r2i(QColorGroup::ButtonText)] ); | 72 | m_palette. setColor ( QPalette::Active, QColorGroup::ButtonText, m_colors [r2i(QColorGroup::ButtonText)] ); |
74 | m_palette. setColor ( QColorGroup::Base, m_colors [r2i(QColorGroup::Base)] ); | 73 | m_palette. setColor ( QColorGroup::Base, m_colors [r2i(QColorGroup::Base)] ); |
75 | m_palette. setColor ( QPalette::Disabled, QColorGroup::Text, m_palette. color ( QPalette::Active, QColorGroup::Background ). dark ( )); | 74 | m_palette. setColor ( QPalette::Disabled, QColorGroup::Text, m_palette. color ( QPalette::Active, QColorGroup::Background ). dark ( )); |
76 | } | 75 | } |
77 | 76 | ||
78 | bool save ( Config &cfg ) | 77 | bool save ( Config &cfg ) |
79 | { | 78 | { |
80 | for ( int i = 0; i < s_colorcount; i++ ) | 79 | for ( int i = 0; i < s_colorcount; i++ ) |
81 | cfg. writeEntry ( s_colorlut [i]. m_key, m_colors [i]. name ( )); | 80 | cfg. writeEntry ( s_colorlut [i]. m_key, m_colors [i]. name ( )); |
82 | return true; | 81 | return true; |
83 | } | 82 | } |
84 | 83 | ||
85 | QColor color ( QColorGroup::ColorRole role ) | 84 | QColor color ( QColorGroup::ColorRole role ) |
86 | { | 85 | { |
87 | int i = r2i ( role ); | 86 | int i = r2i ( role ); |
88 | return i >= 0 ? m_colors [i] : QColor ( ); | 87 | return i >= 0 ? m_colors [i] : QColor ( ); |
diff --git a/noncore/settings/appearance2/decolistitem.h b/noncore/settings/appearance2/decolistitem.h index 953a939..23261b1 100644 --- a/noncore/settings/appearance2/decolistitem.h +++ b/noncore/settings/appearance2/decolistitem.h | |||
@@ -1,91 +1,91 @@ | |||
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 library 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 Library 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 library 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 | 16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General |
17 | ..}^=.= = ; Library General Public License for more | 17 | ..}^=.= = ; Public License for more details. |
18 | ++= -. .` .: details. | 18 | ++= -. .` .: |
19 | : = ...= . :.=- | 19 | : = ...= . :.=- You should have received a copy of the GNU |
20 | -. .:....=;==+<; You should have received a copy of the GNU | 20 | -. .:....=;==+<; General Public License along with this file; |
21 | -_. . . )=. = Library General Public License along with | 21 | -_. . . )=. = see the file COPYING. If not, write to the |
22 | -- :-=` this library; see the file COPYING.LIB. | 22 | -- :-=` Free Software Foundation, Inc., |
23 | If not, write to the Free Software Foundation, | 23 | 59 Temple Place - Suite 330, |
24 | Inc., 59 Temple Place - Suite 330, | ||
25 | Boston, MA 02111-1307, USA. | 24 | Boston, MA 02111-1307, USA. |
26 | 25 | ||
27 | */ | 26 | */ |
27 | |||
28 | #ifndef DECOLISTITEM_H | 28 | #ifndef DECOLISTITEM_H |
29 | #define DECOLISTITEM_H | 29 | #define DECOLISTITEM_H |
30 | 30 | ||
31 | #include <qpe/windowdecorationinterface.h> | 31 | #include <qpe/windowdecorationinterface.h> |
32 | #include <qlistbox.h> | 32 | #include <qlistbox.h> |
33 | 33 | ||
34 | class DecoListItem : public QListBoxText { | 34 | class DecoListItem : public QListBoxText { |
35 | public: | 35 | public: |
36 | DecoListItem ( const QString &t ) : QListBoxText ( t ) | 36 | DecoListItem ( const QString &t ) : QListBoxText ( t ) |
37 | { | 37 | { |
38 | m_lib = 0; | 38 | m_lib = 0; |
39 | m_window_if = 0; | 39 | m_window_if = 0; |
40 | // m_settings_if = 0; | 40 | // m_settings_if = 0; |
41 | } | 41 | } |
42 | 42 | ||
43 | DecoListItem ( QLibrary *lib, WindowDecorationInterface *iface ) : QListBoxText ( iface-> name ( )) | 43 | DecoListItem ( QLibrary *lib, WindowDecorationInterface *iface ) : QListBoxText ( iface-> name ( )) |
44 | { | 44 | { |
45 | m_lib = lib; | 45 | m_lib = lib; |
46 | m_window_if = iface; | 46 | m_window_if = iface; |
47 | 47 | ||
48 | // iface-> queryInterface ( IID_WindowDecoration, (QUnknownInterface **) &m_settings_if ); | 48 | // iface-> queryInterface ( IID_WindowDecoration, (QUnknownInterface **) &m_settings_if ); |
49 | } | 49 | } |
50 | 50 | ||
51 | virtual ~DecoListItem ( ) | 51 | virtual ~DecoListItem ( ) |
52 | { | 52 | { |
53 | // if ( m_settings_if ) | 53 | // if ( m_settings_if ) |
54 | // m_settings_if-> release ( ); | 54 | // m_settings_if-> release ( ); |
55 | if ( m_window_if ) | 55 | if ( m_window_if ) |
56 | m_window_if-> release ( ); | 56 | m_window_if-> release ( ); |
57 | delete m_lib; | 57 | delete m_lib; |
58 | } | 58 | } |
59 | 59 | ||
60 | bool hasSettings ( ) const | 60 | bool hasSettings ( ) const |
61 | { | 61 | { |
62 | // return ( m_settings_if ); | 62 | // return ( m_settings_if ); |
63 | return false; | 63 | return false; |
64 | } | 64 | } |
65 | 65 | ||
66 | QWidget *settings ( QWidget * /*parent*/ ) | 66 | QWidget *settings ( QWidget * /*parent*/ ) |
67 | { | 67 | { |
68 | // return m_settings_if ? m_settings_if-> create ( parent ) : 0; | 68 | // return m_settings_if ? m_settings_if-> create ( parent ) : 0; |
69 | return 0; | 69 | return 0; |
70 | } | 70 | } |
71 | 71 | ||
72 | bool setSettings ( bool /*accepted*/ ) | 72 | bool setSettings ( bool /*accepted*/ ) |
73 | { | 73 | { |
74 | // if ( !m_settings_if ) | 74 | // if ( !m_settings_if ) |
75 | // return false; | 75 | // return false; |
76 | 76 | ||
77 | // if ( accepted ) | 77 | // if ( accepted ) |
78 | // return m_settings_if-> accept ( ); | 78 | // return m_settings_if-> accept ( ); |
79 | // else { | 79 | // else { |
80 | // m_settings_if-> reject ( ); | 80 | // m_settings_if-> reject ( ); |
81 | // return false; | 81 | // return false; |
82 | // } | 82 | // } |
83 | return false; | 83 | return false; |
84 | } | 84 | } |
85 | 85 | ||
86 | QString key ( ) | 86 | QString key ( ) |
87 | { | 87 | { |
88 | if ( m_window_if ) | 88 | if ( m_window_if ) |
89 | return QString ( m_window_if-> name ( )); | 89 | return QString ( m_window_if-> name ( )); |
90 | else | 90 | else |
91 | return text ( ); | 91 | return text ( ); |
diff --git a/noncore/settings/appearance2/editScheme.cpp b/noncore/settings/appearance2/editScheme.cpp index 8cb0f1c..c2e5355 100644 --- a/noncore/settings/appearance2/editScheme.cpp +++ b/noncore/settings/appearance2/editScheme.cpp | |||
@@ -1,73 +1,73 @@ | |||
1 | /* | 1 | /* |
2 | =. This file is part of the OPIE Project | 2 | This file is part of the OPIE Project |
3 | =. Copyright (c) 2002 Dan Williams <williamsdr@acm.org> | ||
3 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> | 4 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> |
4 | .>+-= | 5 | .>+-= |
5 | _;:, .> :=|. This library is free software; you can | 6 | _;:, .> :=|. This file is free software; you can |
6 | .> <`_, > . <= redistribute it and/or modify it under | 7 | .> <`_, > . <= redistribute it and/or modify it under |
7 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 8 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
8 | .="- .-=="i, .._ License as published by the Free Software | 9 | .="- .-=="i, .._ License as published by the Free Software |
9 | - . .-<_> .<> Foundation; either version 2 of the License, | 10 | - . .-<_> .<> Foundation; either version 2 of the License, |
10 | ._= =} : or (at your option) any later version. | 11 | ._= =} : or (at your option) any later version. |
11 | .%`+i> _;_. | 12 | .%`+i> _;_. |
12 | .i_,=:_. -<s. This library is distributed in the hope that | 13 | .i_,=:_. -<s. This file is distributed in the hope that |
13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 14 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
14 | : .. .:, . . . without even the implied warranty of | 15 | : .. .:, . . . without even the implied warranty of |
15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 16 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General |
17 | ..}^=.= = ; Library General Public License for more | 18 | ..}^=.= = ; Public License for more details. |
18 | ++= -. .` .: 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 | -_. . . )=. = Library General Public License along with | 22 | -_. . . )=. = see the file COPYING. If not, write to the |
22 | -- :-=` this library; see the file COPYING.LIB. | 23 | -- :-=` Free Software Foundation, Inc., |
23 | If not, write to the Free Software Foundation, | 24 | 59 Temple Place - Suite 330, |
24 | Inc., 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 "editScheme.h" | 29 | #include "editScheme.h" |
30 | 30 | ||
31 | #include <opie/ocolorbutton.h> | 31 | #include <opie/ocolorbutton.h> |
32 | 32 | ||
33 | #include <qaction.h> | 33 | #include <qaction.h> |
34 | #include <qlabel.h> | 34 | #include <qlabel.h> |
35 | #include <qlayout.h> | 35 | #include <qlayout.h> |
36 | #include <qpopupmenu.h> | 36 | #include <qpopupmenu.h> |
37 | #include <qscrollview.h> | 37 | #include <qscrollview.h> |
38 | #include <qtoolbutton.h> | 38 | #include <qtoolbutton.h> |
39 | 39 | ||
40 | EditScheme::EditScheme ( int cnt, const QString *labels, QColor *colors, QWidget* parent, const char* name, bool modal, WFlags fl ) | 40 | EditScheme::EditScheme ( int cnt, const QString *labels, QColor *colors, QWidget* parent, const char* name, bool modal, WFlags fl ) |
41 | : QDialog ( parent, name, modal, fl ) | 41 | : QDialog ( parent, name, modal, fl ) |
42 | { | 42 | { |
43 | setCaption ( tr( "Edit scheme" ) ); | 43 | setCaption ( tr( "Edit scheme" ) ); |
44 | QGridLayout *layout = new QGridLayout ( this, 0, 0, 4, 4 ); | 44 | QGridLayout *layout = new QGridLayout ( this, 0, 0, 4, 4 ); |
45 | 45 | ||
46 | m_count = cnt; | 46 | m_count = cnt; |
47 | m_buttons = new OColorButton * [cnt]; | 47 | m_buttons = new OColorButton * [cnt]; |
48 | m_colors = colors; | 48 | m_colors = colors; |
49 | 49 | ||
50 | for ( int i = 0; i < cnt; i++ ) | 50 | for ( int i = 0; i < cnt; i++ ) |
51 | { | 51 | { |
52 | QLabel *l = new QLabel ( labels [i], this ); | 52 | QLabel *l = new QLabel ( labels [i], this ); |
53 | layout-> addWidget ( l, i, 0 ); | 53 | layout-> addWidget ( l, i, 0 ); |
54 | 54 | ||
55 | m_buttons [i] = new OColorButton ( this ); | 55 | m_buttons [i] = new OColorButton ( this ); |
56 | m_buttons [i]-> setColor ( colors [i] ); | 56 | m_buttons [i]-> setColor ( colors [i] ); |
57 | layout-> addWidget ( m_buttons [i], i, 1 ); | 57 | layout-> addWidget ( m_buttons [i], i, 1 ); |
58 | } | 58 | } |
59 | } | 59 | } |
60 | 60 | ||
61 | EditScheme::~EditScheme ( ) | 61 | EditScheme::~EditScheme ( ) |
62 | { | 62 | { |
63 | delete [] m_buttons; | 63 | delete [] m_buttons; |
64 | } | 64 | } |
65 | 65 | ||
66 | void EditScheme::accept ( ) | 66 | void EditScheme::accept ( ) |
67 | { | 67 | { |
68 | for ( int i = 0; i < m_count; i++ ) | 68 | for ( int i = 0; i < m_count; i++ ) |
69 | m_colors [i] = m_buttons [i]-> color ( ); | 69 | m_colors [i] = m_buttons [i]-> color ( ); |
70 | 70 | ||
71 | QDialog::accept ( ); | 71 | QDialog::accept ( ); |
72 | } | 72 | } |
73 | 73 | ||
diff --git a/noncore/settings/appearance2/editScheme.h b/noncore/settings/appearance2/editScheme.h index 0a025bd..93dc50d 100644 --- a/noncore/settings/appearance2/editScheme.h +++ b/noncore/settings/appearance2/editScheme.h | |||
@@ -1,53 +1,53 @@ | |||
1 | /* | 1 | /* |
2 | =. This file is part of the OPIE Project | 2 | This file is part of the OPIE Project |
3 | =. Copyright (c) 2002 Dan Williams <williamsdr@acm.org> | ||
3 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> | 4 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> |
4 | .>+-= | 5 | .>+-= |
5 | _;:, .> :=|. This library is free software; you can | 6 | _;:, .> :=|. This file is free software; you can |
6 | .> <`_, > . <= redistribute it and/or modify it under | 7 | .> <`_, > . <= redistribute it and/or modify it under |
7 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 8 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
8 | .="- .-=="i, .._ License as published by the Free Software | 9 | .="- .-=="i, .._ License as published by the Free Software |
9 | - . .-<_> .<> Foundation; either version 2 of the License, | 10 | - . .-<_> .<> Foundation; either version 2 of the License, |
10 | ._= =} : or (at your option) any later version. | 11 | ._= =} : or (at your option) any later version. |
11 | .%`+i> _;_. | 12 | .%`+i> _;_. |
12 | .i_,=:_. -<s. This library is distributed in the hope that | 13 | .i_,=:_. -<s. This file is distributed in the hope that |
13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 14 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
14 | : .. .:, . . . without even the implied warranty of | 15 | : .. .:, . . . without even the implied warranty of |
15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 16 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General |
17 | ..}^=.= = ; Library General Public License for more | 18 | ..}^=.= = ; Public License for more details. |
18 | ++= -. .` .: 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 | -_. . . )=. = Library General Public License along with | 22 | -_. . . )=. = see the file COPYING. If not, write to the |
22 | -- :-=` this library; see the file COPYING.LIB. | 23 | -- :-=` Free Software Foundation, Inc., |
23 | If not, write to the Free Software Foundation, | 24 | 59 Temple Place - Suite 330, |
24 | Inc., 59 Temple Place - Suite 330, | ||
25 | Boston, MA 02111-1307, USA. | 25 | Boston, MA 02111-1307, USA. |
26 | 26 | ||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #ifndef EDITSCHEME_H | 29 | #ifndef EDITSCHEME_H |
30 | #define EDITSCHEME_H | 30 | #define EDITSCHEME_H |
31 | 31 | ||
32 | #include <qdialog.h> | 32 | #include <qdialog.h> |
33 | 33 | ||
34 | class QColor; | 34 | class QColor; |
35 | class OColorButton; | 35 | class OColorButton; |
36 | 36 | ||
37 | class EditScheme : public QDialog { | 37 | class EditScheme : public QDialog { |
38 | Q_OBJECT | 38 | Q_OBJECT |
39 | 39 | ||
40 | public: | 40 | public: |
41 | EditScheme ( int cnt, const QString *labels, QColor *colors, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); | 41 | EditScheme ( int cnt, const QString *labels, QColor *colors, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); |
42 | virtual ~EditScheme ( ); | 42 | virtual ~EditScheme ( ); |
43 | 43 | ||
44 | protected slots: | 44 | protected slots: |
45 | virtual void accept ( ); | 45 | virtual void accept ( ); |
46 | 46 | ||
47 | private: | 47 | private: |
48 | int m_count; | 48 | int m_count; |
49 | QColor *m_colors; | 49 | QColor *m_colors; |
50 | OColorButton **m_buttons; | 50 | OColorButton **m_buttons; |
51 | }; | 51 | }; |
52 | 52 | ||
53 | #endif | 53 | #endif |
diff --git a/noncore/settings/appearance2/main.cpp b/noncore/settings/appearance2/main.cpp index 3afec46..ad24cf3 100644 --- a/noncore/settings/appearance2/main.cpp +++ b/noncore/settings/appearance2/main.cpp | |||
@@ -1,43 +1,42 @@ | |||
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 library 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 Library 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 library 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 | 16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General |
17 | ..}^=.= = ; Library General Public License for more | 17 | ..}^=.= = ; Public License for more details. |
18 | ++= -. .` .: details. | 18 | ++= -. .` .: |
19 | : = ...= . :.=- | 19 | : = ...= . :.=- You should have received a copy of the GNU |
20 | -. .:....=;==+<; You should have received a copy of the GNU | 20 | -. .:....=;==+<; General Public License along with this file; |
21 | -_. . . )=. = Library General Public License along with | 21 | -_. . . )=. = see the file COPYING. If not, write to the |
22 | -- :-=` this library; see the file COPYING.LIB. | 22 | -- :-=` Free Software Foundation, Inc., |
23 | If not, write to the Free Software Foundation, | 23 | 59 Temple Place - Suite 330, |
24 | Inc., 59 Temple Place - Suite 330, | ||
25 | Boston, MA 02111-1307, USA. | 24 | Boston, MA 02111-1307, USA. |
26 | 25 | ||
27 | */ | 26 | */ |
28 | 27 | ||
29 | #include "appearance.h" | 28 | #include "appearance.h" |
30 | 29 | ||
31 | #include <qpe/qpeapplication.h> | 30 | #include <qpe/qpeapplication.h> |
32 | 31 | ||
33 | 32 | ||
34 | int main ( int argc, char **argv ) | 33 | int main ( int argc, char **argv ) |
35 | { | 34 | { |
36 | QPEApplication app ( argc, argv ); | 35 | QPEApplication app ( argc, argv ); |
37 | 36 | ||
38 | Appearance m; | 37 | Appearance m; |
39 | app. showMainDocumentWidget ( &m ); | 38 | app. showMainDocumentWidget ( &m ); |
40 | 39 | ||
41 | return app. exec ( ); | 40 | return app. exec ( ); |
42 | } | 41 | } |
43 | 42 | ||
diff --git a/noncore/settings/appearance2/sample.cpp b/noncore/settings/appearance2/sample.cpp index 0d8b003..6bbed4b 100644 --- a/noncore/settings/appearance2/sample.cpp +++ b/noncore/settings/appearance2/sample.cpp | |||
@@ -1,89 +1,88 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the OPIE Project | 2 | This file is part of the OPIE Project |
3 | =. Copyright (c) 2002 Trolltech AS <info@trolltech.com> | 3 | =. Copyright (c) 2002 Trolltech AS <info@trolltech.com> |
4 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> | 4 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> |
5 | .>+-= | 5 | .>+-= |
6 | _;:, .> :=|. This library 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 Library 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 library 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 | 17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General |
18 | ..}^=.= = ; Library General Public License for more | 18 | ..}^=.= = ; Public License for more details. |
19 | ++= -. .` .: details. | 19 | ++= -. .` .: |
20 | : = ...= . :.=- | 20 | : = ...= . :.=- You should have received a copy of the GNU |
21 | -. .:....=;==+<; You should have received a copy of the GNU | 21 | -. .:....=;==+<; General Public License along with this file; |
22 | -_. . . )=. = Library General Public License along with | 22 | -_. . . )=. = see the file COPYING. If not, write to the |
23 | -- :-=` this library; see the file COPYING.LIB. | 23 | -- :-=` Free Software Foundation, Inc., |
24 | If not, write to the Free Software Foundation, | 24 | 59 Temple Place - Suite 330, |
25 | Inc., 59 Temple Place - Suite 330, | ||
26 | Boston, MA 02111-1307, USA. | 25 | Boston, MA 02111-1307, USA. |
27 | 26 | ||
28 | */ | 27 | */ |
29 | 28 | ||
30 | #include <qvbox.h> | 29 | #include <qvbox.h> |
31 | #include <qpopupmenu.h> | 30 | #include <qpopupmenu.h> |
32 | #include <qpainter.h> | 31 | #include <qpainter.h> |
33 | #include <qmenubar.h> | 32 | #include <qmenubar.h> |
34 | #include <qcheckbox.h> | 33 | #include <qcheckbox.h> |
35 | #include <qpushbutton.h> | 34 | #include <qpushbutton.h> |
36 | #include <qscrollbar.h> | 35 | #include <qscrollbar.h> |
37 | #include <qlayout.h> | 36 | #include <qlayout.h> |
38 | #include <qwhatsthis.h> | 37 | #include <qwhatsthis.h> |
39 | #include <qpixmapcache.h> | 38 | #include <qpixmapcache.h> |
40 | #include <qtimer.h> | 39 | #include <qtimer.h> |
41 | #include <qobjectlist.h> | 40 | #include <qobjectlist.h> |
42 | #include <qcommonstyle.h> | 41 | #include <qcommonstyle.h> |
43 | 42 | ||
44 | #include "sample.h" | 43 | #include "sample.h" |
45 | 44 | ||
46 | 45 | ||
47 | class SampleText : public QWidget | 46 | class SampleText : public QWidget |
48 | { | 47 | { |
49 | public: | 48 | public: |
50 | SampleText( const QString &t, bool h, QWidget *parent ) | 49 | SampleText( const QString &t, bool h, QWidget *parent ) |
51 | : QWidget( parent ), hl(h), text(t) | 50 | : QWidget( parent ), hl(h), text(t) |
52 | { | 51 | { |
53 | if ( hl ) | 52 | if ( hl ) |
54 | setBackgroundMode( PaletteHighlight ); | 53 | setBackgroundMode( PaletteHighlight ); |
55 | else | 54 | else |
56 | setBackgroundMode( PaletteBase ); | 55 | setBackgroundMode( PaletteBase ); |
57 | } | 56 | } |
58 | 57 | ||
59 | QSize sizeHint() const | 58 | QSize sizeHint() const |
60 | { | 59 | { |
61 | QFontMetrics fm(font()); | 60 | QFontMetrics fm(font()); |
62 | return QSize( fm.width(text)+10, fm.height()+4 ); | 61 | return QSize( fm.width(text)+10, fm.height()+4 ); |
63 | } | 62 | } |
64 | 63 | ||
65 | void paintEvent( QPaintEvent * ) | 64 | void paintEvent( QPaintEvent * ) |
66 | { | 65 | { |
67 | QPainter p(this); | 66 | QPainter p(this); |
68 | if ( hl ) | 67 | if ( hl ) |
69 | p.setPen( colorGroup().highlightedText() ); | 68 | p.setPen( colorGroup().highlightedText() ); |
70 | else | 69 | else |
71 | p.setPen( colorGroup().text() ); | 70 | p.setPen( colorGroup().text() ); |
72 | p.drawText( rect(), AlignCenter, text ); | 71 | p.drawText( rect(), AlignCenter, text ); |
73 | } | 72 | } |
74 | 73 | ||
75 | private: | 74 | private: |
76 | bool hl; | 75 | bool hl; |
77 | QString text; | 76 | QString text; |
78 | }; | 77 | }; |
79 | 78 | ||
80 | 79 | ||
81 | SampleWindow::SampleWindow( QWidget *parent ) : QWidget(parent), iface(0) | 80 | SampleWindow::SampleWindow( QWidget *parent ) : QWidget(parent), iface(0) |
82 | { | 81 | { |
83 | init(); | 82 | init(); |
84 | } | 83 | } |
85 | 84 | ||
86 | QSize SampleWindow::sizeHint() const | 85 | QSize SampleWindow::sizeHint() const |
87 | { | 86 | { |
88 | return container->sizeHint() + QSize( 10, 35 ); | 87 | return container->sizeHint() + QSize( 10, 35 ); |
89 | } | 88 | } |
diff --git a/noncore/settings/appearance2/sample.h b/noncore/settings/appearance2/sample.h index a189f69..c861228 100644 --- a/noncore/settings/appearance2/sample.h +++ b/noncore/settings/appearance2/sample.h | |||
@@ -1,78 +1,77 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the OPIE Project | 2 | This file is part of the OPIE Project |
3 | =. Copyright (c) 2002 Trolltech AS <info@trolltech.com> | 3 | =. Copyright (c) 2002 Trolltech AS <info@trolltech.com> |
4 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> | 4 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> |
5 | .>+-= | 5 | .>+-= |
6 | _;:, .> :=|. This library 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 Library 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 library 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 | 17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General |
18 | ..}^=.= = ; Library General Public License for more | 18 | ..}^=.= = ; Public License for more details. |
19 | ++= -. .` .: details. | 19 | ++= -. .` .: |
20 | : = ...= . :.=- | 20 | : = ...= . :.=- You should have received a copy of the GNU |
21 | -. .:....=;==+<; You should have received a copy of the GNU | 21 | -. .:....=;==+<; General Public License along with this file; |
22 | -_. . . )=. = Library General Public License along with | 22 | -_. . . )=. = see the file COPYING. If not, write to the |
23 | -- :-=` this library; see the file COPYING.LIB. | 23 | -- :-=` Free Software Foundation, Inc., |
24 | If not, write to the Free Software Foundation, | 24 | 59 Temple Place - Suite 330, |
25 | Inc., 59 Temple Place - Suite 330, | ||
26 | Boston, MA 02111-1307, USA. | 25 | Boston, MA 02111-1307, USA. |
27 | 26 | ||
28 | */ | 27 | */ |
29 | 28 | ||
30 | #ifndef __PREVIEW_H__ | 29 | #ifndef __PREVIEW_H__ |
31 | #define __PREVIEW_H__ | 30 | #define __PREVIEW_H__ |
32 | 31 | ||
33 | #include <qwidget.h> | 32 | #include <qwidget.h> |
34 | 33 | ||
35 | #include <qpe/windowdecorationinterface.h> | 34 | #include <qpe/windowdecorationinterface.h> |
36 | 35 | ||
37 | class QVBox; | 36 | class QVBox; |
38 | class QPopupMenu; | 37 | class QPopupMenu; |
39 | class SampleText; | 38 | class SampleText; |
40 | 39 | ||
41 | class SampleWindow : public QWidget | 40 | class SampleWindow : public QWidget |
42 | { | 41 | { |
43 | Q_OBJECT | 42 | Q_OBJECT |
44 | public: | 43 | public: |
45 | SampleWindow( QWidget *parent ); | 44 | SampleWindow( QWidget *parent ); |
46 | 45 | ||
47 | QSize sizeHint() const; | 46 | QSize sizeHint() const; |
48 | 47 | ||
49 | virtual void setFont( const QFont &f ); | 48 | virtual void setFont( const QFont &f ); |
50 | 49 | ||
51 | void setStyle2 ( QStyle *sty ); | 50 | void setStyle2 ( QStyle *sty ); |
52 | void setDecoration( WindowDecorationInterface *i ); | 51 | void setDecoration( WindowDecorationInterface *i ); |
53 | void setPalette ( const QPalette & ); | 52 | void setPalette ( const QPalette & ); |
54 | 53 | ||
55 | virtual void paintEvent( QPaintEvent * ); | 54 | virtual void paintEvent( QPaintEvent * ); |
56 | 55 | ||
57 | void init(); | 56 | void init(); |
58 | 57 | ||
59 | virtual bool eventFilter( QObject *, QEvent *e ); | 58 | virtual bool eventFilter( QObject *, QEvent *e ); |
60 | virtual void paletteChange( const QPalette &old ); | 59 | virtual void paletteChange( const QPalette &old ); |
61 | virtual void resizeEvent( QResizeEvent *re ); | 60 | virtual void resizeEvent( QResizeEvent *re ); |
62 | 61 | ||
63 | public slots: | 62 | public slots: |
64 | void fixGeometry(); | 63 | void fixGeometry(); |
65 | 64 | ||
66 | protected: | 65 | protected: |
67 | WindowDecorationInterface *iface; | 66 | WindowDecorationInterface *iface; |
68 | WindowDecorationInterface::WindowData wd; | 67 | WindowDecorationInterface::WindowData wd; |
69 | QVBox *container; | 68 | QVBox *container; |
70 | QPopupMenu *popup; | 69 | QPopupMenu *popup; |
71 | int th; | 70 | int th; |
72 | int tb; | 71 | int tb; |
73 | int lb; | 72 | int lb; |
74 | int rb; | 73 | int rb; |
75 | int bb; | 74 | int bb; |
76 | }; | 75 | }; |
77 | 76 | ||
78 | #endif | 77 | #endif |
diff --git a/noncore/settings/appearance2/stylelistitem.h b/noncore/settings/appearance2/stylelistitem.h index bbfbd41..c0258e0 100644 --- a/noncore/settings/appearance2/stylelistitem.h +++ b/noncore/settings/appearance2/stylelistitem.h | |||
@@ -1,88 +1,87 @@ | |||
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 library 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 Library 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 library 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 | 16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General |
17 | ..}^=.= = ; Library General Public License for more | 17 | ..}^=.= = ; Public License for more details. |
18 | ++= -. .` .: details. | 18 | ++= -. .` .: |
19 | : = ...= . :.=- | 19 | : = ...= . :.=- You should have received a copy of the GNU |
20 | -. .:....=;==+<; You should have received a copy of the GNU | 20 | -. .:....=;==+<; General Public License along with this file; |
21 | -_. . . )=. = Library General Public License along with | 21 | -_. . . )=. = see the file COPYING. If not, write to the |
22 | -- :-=` this library; see the file COPYING.LIB. | 22 | -- :-=` Free Software Foundation, Inc., |
23 | If not, write to the Free Software Foundation, | 23 | 59 Temple Place - Suite 330, |
24 | Inc., 59 Temple Place - Suite 330, | ||
25 | Boston, MA 02111-1307, USA. | 24 | Boston, MA 02111-1307, USA. |
26 | 25 | ||
27 | */ | 26 | */ |
28 | 27 | ||
29 | #ifndef STYLELISTITEM_H | 28 | #ifndef STYLELISTITEM_H |
30 | #define STYLELISTITEM_H | 29 | #define STYLELISTITEM_H |
31 | 30 | ||
32 | #include <qlistbox.h> | 31 | #include <qlistbox.h> |
33 | #include <qpe/styleinterface.h> | 32 | #include <qpe/styleinterface.h> |
34 | 33 | ||
35 | #include <stdio.h> | 34 | #include <stdio.h> |
36 | 35 | ||
37 | class StyleListItem : public QListBoxText { | 36 | class StyleListItem : public QListBoxText { |
38 | public: | 37 | public: |
39 | StyleListItem ( const QString &t, QStyle *sty ) : QListBoxText ( t ) | 38 | StyleListItem ( const QString &t, QStyle *sty ) : QListBoxText ( t ) |
40 | { | 39 | { |
41 | m_lib = 0; | 40 | m_lib = 0; |
42 | m_style_if = 0; | 41 | m_style_if = 0; |
43 | m_settings_if = 0; | 42 | m_settings_if = 0; |
44 | m_style = sty; | 43 | m_style = sty; |
45 | } | 44 | } |
46 | 45 | ||
47 | StyleListItem ( QLibrary *lib, StyleInterface *iface ) : QListBoxText ( iface-> name ( )) | 46 | StyleListItem ( QLibrary *lib, StyleInterface *iface ) : QListBoxText ( iface-> name ( )) |
48 | { | 47 | { |
49 | m_lib = lib; | 48 | m_lib = lib; |
50 | m_style_if = iface; | 49 | m_style_if = iface; |
51 | m_settings_if = 0; | 50 | m_settings_if = 0; |
52 | m_style = iface-> create ( ); | 51 | m_style = iface-> create ( ); |
53 | 52 | ||
54 | iface-> queryInterface ( IID_StyleSettings, (QUnknownInterface **) &m_settings_if ); | 53 | iface-> queryInterface ( IID_StyleSettings, (QUnknownInterface **) &m_settings_if ); |
55 | } | 54 | } |
56 | 55 | ||
57 | virtual ~StyleListItem ( ) | 56 | virtual ~StyleListItem ( ) |
58 | { | 57 | { |
59 | delete m_style; | 58 | delete m_style; |
60 | 59 | ||
61 | if ( m_settings_if ) | 60 | if ( m_settings_if ) |
62 | m_settings_if-> release ( ); | 61 | m_settings_if-> release ( ); |
63 | if ( m_style_if ) | 62 | if ( m_style_if ) |
64 | m_style_if-> release ( ); | 63 | m_style_if-> release ( ); |
65 | delete m_lib; | 64 | delete m_lib; |
66 | } | 65 | } |
67 | 66 | ||
68 | bool hasSettings ( ) const | 67 | bool hasSettings ( ) const |
69 | { | 68 | { |
70 | return ( m_settings_if ); | 69 | return ( m_settings_if ); |
71 | } | 70 | } |
72 | 71 | ||
73 | QWidget *settings ( QWidget *parent ) | 72 | QWidget *settings ( QWidget *parent ) |
74 | { | 73 | { |
75 | return m_settings_if ? m_settings_if-> create ( parent ) : 0; | 74 | return m_settings_if ? m_settings_if-> create ( parent ) : 0; |
76 | } | 75 | } |
77 | 76 | ||
78 | bool setSettings ( bool accepted ) | 77 | bool setSettings ( bool accepted ) |
79 | { | 78 | { |
80 | if ( !m_settings_if ) | 79 | if ( !m_settings_if ) |
81 | return false; | 80 | return false; |
82 | 81 | ||
83 | if ( accepted ) | 82 | if ( accepted ) |
84 | return m_settings_if-> accept ( ); | 83 | return m_settings_if-> accept ( ); |
85 | else { | 84 | else { |
86 | m_settings_if-> reject ( ); | 85 | m_settings_if-> reject ( ); |
87 | return false; | 86 | return false; |
88 | } | 87 | } |