author | sandman <sandman> | 2002-07-06 16:42:29 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-07-06 16:42:29 (UTC) |
commit | 3a422983abc7342c9229dccac825d0608fca10f3 (patch) (unidiff) | |
tree | fd0d71eab4df0b286b78efe24184525ae4c819a3 /noncore/styles | |
parent | 8beb5fcdbca8110dc586a7e620bf8eae892087fb (diff) | |
download | opie-3a422983abc7342c9229dccac825d0608fca10f3.zip opie-3a422983abc7342c9229dccac825d0608fca10f3.tar.gz opie-3a422983abc7342c9229dccac825d0608fca10f3.tar.bz2 |
Complete renovation of the external style API:
- created two QCom interfaces in "styleinterface.h"
- moved the liquid/theme settings apps into the plugins
- modified the plugin interface for all three styles
- extended appearance to fully support the new API (replaces the
settings apps)
Additional work:
- made a workaround in appearance for a Qt Bug -- now a QDialog again
(this should really be fixed in Qt, but Z won't work that way)
21 files changed, 412 insertions, 206 deletions
diff --git a/noncore/styles/liquid/liquid.pro b/noncore/styles/liquid/liquid.pro index 23dce09..a07eaf2 100644 --- a/noncore/styles/liquid/liquid.pro +++ b/noncore/styles/liquid/liquid.pro | |||
@@ -1,22 +1,26 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG = qt embedded release warn_on | 2 | CONFIG = qt embedded release warn_on |
3 | SOURCES = liquid.cpp \ | 3 | SOURCES = liquid.cpp \ |
4 | liquiddeco.cpp \ | 4 | liquiddeco.cpp \ |
5 | effects.cpp \ | 5 | effects.cpp \ |
6 | liquidset.cpp \ | ||
6 | plugin.cpp | 7 | plugin.cpp |
7 | 8 | ||
8 | HEADERS = liquid.h \ | 9 | HEADERS = liquid.h \ |
9 | liquiddeco.h \ | 10 | liquiddeco.h \ |
10 | effects.h | 11 | effects.h \ |
12 | liquidset.h \ | ||
13 | plugin.h | ||
14 | |||
11 | LIBS += -lqpe | 15 | LIBS += -lqpe |
12 | INCLUDEPATH += $(OPIEDIR)/include | 16 | INCLUDEPATH += $(OPIEDIR)/include |
13 | DESTDIR = $(OPIEDIR)/plugins/styles | 17 | DESTDIR = $(OPIEDIR)/plugins/styles |
14 | TARGET = liquid | 18 | TARGET = liquid |
15 | VERSION = 1.0.0 | 19 | VERSION = 1.0.0 |
16 | 20 | ||
17 | TRANSLATIONS = ../../../i18n/de/libliquid.ts \ | 21 | TRANSLATIONS = ../../../i18n/de/libliquid.ts \ |
18 | ../../../i18n/en/libliquid.ts \ | 22 | ../../../i18n/en/libliquid.ts \ |
19 | ../../../i18n/es/libliquid.ts \ | 23 | ../../../i18n/es/libliquid.ts \ |
20 | ../../../i18n/fr/libliquid.ts \ | 24 | ../../../i18n/fr/libliquid.ts \ |
21 | ../../../i18n/hu/libliquid.ts \ | 25 | ../../../i18n/hu/libliquid.ts \ |
22 | ../../../i18n/ja/libliquid.ts \ | 26 | ../../../i18n/ja/libliquid.ts \ |
diff --git a/noncore/styles/liquid/settings/liquidset.cpp b/noncore/styles/liquid/liquidset.cpp index 1479ac0..5ae19ba 100644 --- a/noncore/styles/liquid/settings/liquidset.cpp +++ b/noncore/styles/liquid/liquidset.cpp | |||
@@ -12,25 +12,25 @@ | |||
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 | 22 | ||
23 | #include "liquidset.h" | 23 | #include "liquidset.h" |
24 | #include "../liquid.h" | 24 | #include "liquid.h" |
25 | 25 | ||
26 | #include <qpe/qpeapplication.h> | 26 | #include <qpe/qpeapplication.h> |
27 | #include <qpe/global.h> | 27 | #include <qpe/global.h> |
28 | 28 | ||
29 | #include <qslider.h> | 29 | #include <qslider.h> |
30 | #include <qtoolbutton.h> | 30 | #include <qtoolbutton.h> |
31 | #include <qbuttongroup.h> | 31 | #include <qbuttongroup.h> |
32 | #include <qradiobutton.h> | 32 | #include <qradiobutton.h> |
33 | #include <qcheckbox.h> | 33 | #include <qcheckbox.h> |
34 | #include <qlabel.h> | 34 | #include <qlabel.h> |
35 | #include <qlayout.h> | 35 | #include <qlayout.h> |
36 | #include <qpalette.h> | 36 | #include <qpalette.h> |
@@ -48,26 +48,26 @@ static void changeButtonColor ( QWidget *btn, const QColor &col ) | |||
48 | pal. setColor ( QPalette::Active, QColorGroup::Button, col ); | 48 | pal. setColor ( QPalette::Active, QColorGroup::Button, col ); |
49 | pal. setColor ( QPalette::Disabled, QColorGroup::Button, col ); | 49 | pal. setColor ( QPalette::Disabled, QColorGroup::Button, col ); |
50 | pal. setColor ( QPalette::Inactive, QColorGroup::Button, col ); | 50 | pal. setColor ( QPalette::Inactive, QColorGroup::Button, col ); |
51 | pal. setColor ( QPalette::Normal, QColorGroup::Background, col ); | 51 | pal. setColor ( QPalette::Normal, QColorGroup::Background, col ); |
52 | pal. setColor ( QPalette::Active, QColorGroup::Background, col ); | 52 | pal. setColor ( QPalette::Active, QColorGroup::Background, col ); |
53 | pal. setColor ( QPalette::Disabled, QColorGroup::Background, col ); | 53 | pal. setColor ( QPalette::Disabled, QColorGroup::Background, col ); |
54 | pal. setColor ( QPalette::Inactive, QColorGroup::Background, col ); | 54 | pal. setColor ( QPalette::Inactive, QColorGroup::Background, col ); |
55 | 55 | ||
56 | btn-> setPalette ( pal ); | 56 | btn-> setPalette ( pal ); |
57 | } | 57 | } |
58 | 58 | ||
59 | 59 | ||
60 | LiquidSet::LiquidSet ( QWidget* parent, const char *name, WFlags fl ) | 60 | LiquidSettings::LiquidSettings ( QWidget* parent, const char *name, WFlags fl ) |
61 | : QDialog ( parent, name, fl ) | 61 | : QWidget ( parent, name, fl ) |
62 | { | 62 | { |
63 | setCaption ( tr( "Liquid Style" ) ); | 63 | setCaption ( tr( "Liquid Style" ) ); |
64 | 64 | ||
65 | Config config ( "qpe" ); | 65 | Config config ( "qpe" ); |
66 | config. setGroup ( "Liquid-Style" ); | 66 | config. setGroup ( "Liquid-Style" ); |
67 | 67 | ||
68 | m_type = config. readNumEntry ( "Type", TransStippleBg ); | 68 | m_type = config. readNumEntry ( "Type", TransStippleBg ); |
69 | m_menucol = QColor ( config. readEntry ( "Color", QApplication::palette ( ). active ( ). button ( ). name ( ))); | 69 | m_menucol = QColor ( config. readEntry ( "Color", QApplication::palette ( ). active ( ). button ( ). name ( ))); |
70 | m_textcol = QColor ( config. readEntry ( "TextColor", QApplication::palette ( ). active ( ). text ( ). name ( ))); | 70 | m_textcol = QColor ( config. readEntry ( "TextColor", QApplication::palette ( ). active ( ). text ( ). name ( ))); |
71 | int opacity = config. readNumEntry ( "Opacity", 10 ); | 71 | int opacity = config. readNumEntry ( "Opacity", 10 ); |
72 | m_shadow = config. readBoolEntry ( "ShadowText", true ); | 72 | m_shadow = config. readBoolEntry ( "ShadowText", true ); |
73 | m_deco = config. readBoolEntry ( "WinDecoration", true ); | 73 | m_deco = config. readBoolEntry ( "WinDecoration", true ); |
@@ -113,34 +113,34 @@ LiquidSet::LiquidSet ( QWidget* parent, const char *name, WFlags fl ) | |||
113 | grid-> addColSpacing ( 0, 16 ); | 113 | grid-> addColSpacing ( 0, 16 ); |
114 | grid-> addColSpacing ( 3, 8 ); | 114 | grid-> addColSpacing ( 3, 8 ); |
115 | 115 | ||
116 | grid-> addWidget ( m_menulbl = new QLabel ( tr( "Menu color" ), this ), 0, 1 ); | 116 | grid-> addWidget ( m_menulbl = new QLabel ( tr( "Menu color" ), this ), 0, 1 ); |
117 | grid-> addWidget ( m_textlbl = new QLabel ( tr( "Text color" ), this ), 0, 4 ); | 117 | grid-> addWidget ( m_textlbl = new QLabel ( tr( "Text color" ), this ), 0, 4 ); |
118 | grid-> addWidget ( m_opaclbl = new QLabel ( tr( "Opacity" ), this ), 1, 1 ); | 118 | grid-> addWidget ( m_opaclbl = new QLabel ( tr( "Opacity" ), this ), 1, 1 ); |
119 | 119 | ||
120 | m_menubtn = new QToolButton ( this ); | 120 | m_menubtn = new QToolButton ( this ); |
121 | grid-> addWidget ( m_menubtn, 0, 2 ); | 121 | grid-> addWidget ( m_menubtn, 0, 2 ); |
122 | 122 | ||
123 | QPopupMenu *popup; | 123 | QPopupMenu *popup; |
124 | 124 | ||
125 | popup = new ColorPopupMenu ( m_menucol, this ); | 125 | popup = new ColorPopupMenu ( m_menucol, 0 ); |
126 | m_menubtn-> setPopup ( popup ); | 126 | m_menubtn-> setPopup ( popup ); |
127 | m_menubtn-> setPopupDelay ( 0 ); | 127 | m_menubtn-> setPopupDelay ( 0 ); |
128 | connect ( popup, SIGNAL( colorSelected ( const QColor & )), this, SLOT( changeMenuColor ( const QColor & ))); | 128 | connect ( popup, SIGNAL( colorSelected ( const QColor & )), this, SLOT( changeMenuColor ( const QColor & ))); |
129 | changeMenuColor ( m_menucol ); | 129 | changeMenuColor ( m_menucol ); |
130 | 130 | ||
131 | m_textbtn = new QToolButton ( this ); | 131 | m_textbtn = new QToolButton ( this ); |
132 | grid-> addWidget ( m_textbtn, 0, 5 ); | 132 | grid-> addWidget ( m_textbtn, 0, 5 ); |
133 | 133 | ||
134 | popup = new ColorPopupMenu ( m_textcol, this ); | 134 | popup = new ColorPopupMenu ( m_textcol, 0 ); |
135 | m_textbtn-> setPopup ( popup ); | 135 | m_textbtn-> setPopup ( popup ); |
136 | m_textbtn-> setPopupDelay ( 0 ); | 136 | m_textbtn-> setPopupDelay ( 0 ); |
137 | connect ( popup, SIGNAL( colorSelected ( const QColor & )), this, SLOT( changeTextColor ( const QColor & ))); | 137 | connect ( popup, SIGNAL( colorSelected ( const QColor & )), this, SLOT( changeTextColor ( const QColor & ))); |
138 | changeTextColor ( m_textcol ); | 138 | changeTextColor ( m_textcol ); |
139 | 139 | ||
140 | m_opacsld = new QSlider ( Horizontal, this ); | 140 | m_opacsld = new QSlider ( Horizontal, this ); |
141 | m_opacsld-> setRange ( -20, 20 ); | 141 | m_opacsld-> setRange ( -20, 20 ); |
142 | m_opacsld-> setValue ( opacity ); | 142 | m_opacsld-> setValue ( opacity ); |
143 | m_opacsld-> setTickmarks ( QSlider::Below ); | 143 | m_opacsld-> setTickmarks ( QSlider::Below ); |
144 | grid-> addMultiCellWidget ( m_opacsld, 1, 1, 2, 5 ); | 144 | grid-> addMultiCellWidget ( m_opacsld, 1, 1, 2, 5 ); |
145 | 145 | ||
146 | vbox-> addSpacing ( 4 ); | 146 | vbox-> addSpacing ( 4 ); |
@@ -167,68 +167,66 @@ LiquidSet::LiquidSet ( QWidget* parent, const char *name, WFlags fl ) | |||
167 | m_contsld-> setTickmarks ( QSlider::Below ); | 167 | m_contsld-> setTickmarks ( QSlider::Below ); |
168 | hbox-> addWidget ( m_contsld, 10 ); | 168 | hbox-> addWidget ( m_contsld, 10 ); |
169 | 169 | ||
170 | vbox-> addStretch ( 10 ); | 170 | vbox-> addStretch ( 10 ); |
171 | 171 | ||
172 | changeType ( m_type ); | 172 | changeType ( m_type ); |
173 | 173 | ||
174 | connect ( btngrp, SIGNAL( clicked ( int ) ), this, SLOT( changeType ( int ) ) ); | 174 | connect ( btngrp, SIGNAL( clicked ( int ) ), this, SLOT( changeType ( int ) ) ); |
175 | connect ( shadow, SIGNAL( toggled ( bool ) ), this, SLOT( changeShadow ( bool ) ) ); | 175 | connect ( shadow, SIGNAL( toggled ( bool ) ), this, SLOT( changeShadow ( bool ) ) ); |
176 | connect ( windeco, SIGNAL( toggled ( bool ) ), this, SLOT( changeDeco ( bool ) ) ); | 176 | connect ( windeco, SIGNAL( toggled ( bool ) ), this, SLOT( changeDeco ( bool ) ) ); |
177 | } | 177 | } |
178 | 178 | ||
179 | void LiquidSet::changeType ( int t ) | 179 | void LiquidSettings::changeType ( int t ) |
180 | { | 180 | { |
181 | bool custom = ( t == Custom ); | 181 | bool custom = ( t == Custom ); |
182 | 182 | ||
183 | m_menulbl-> setEnabled ( custom ); | 183 | m_menulbl-> setEnabled ( custom ); |
184 | m_textlbl-> setEnabled ( custom ); | 184 | m_textlbl-> setEnabled ( custom ); |
185 | m_opaclbl-> setEnabled ( custom ); | 185 | m_opaclbl-> setEnabled ( custom ); |
186 | m_menubtn-> setEnabled ( custom ); | 186 | m_menubtn-> setEnabled ( custom ); |
187 | m_textbtn-> setEnabled ( custom ); | 187 | m_textbtn-> setEnabled ( custom ); |
188 | m_opacsld-> setEnabled ( custom ); | 188 | m_opacsld-> setEnabled ( custom ); |
189 | 189 | ||
190 | m_type = t; | 190 | m_type = t; |
191 | } | 191 | } |
192 | 192 | ||
193 | void LiquidSet::changeMenuColor ( const QColor &col ) | 193 | void LiquidSettings::changeMenuColor ( const QColor &col ) |
194 | { | 194 | { |
195 | changeButtonColor ( m_menubtn, col ); | 195 | changeButtonColor ( m_menubtn, col ); |
196 | m_menucol = col; | 196 | m_menucol = col; |
197 | } | 197 | } |
198 | 198 | ||
199 | void LiquidSet::changeTextColor ( const QColor &col ) | 199 | void LiquidSettings::changeTextColor ( const QColor &col ) |
200 | { | 200 | { |
201 | changeButtonColor ( m_textbtn, col ); | 201 | changeButtonColor ( m_textbtn, col ); |
202 | m_textcol = col; | 202 | m_textcol = col; |
203 | } | 203 | } |
204 | 204 | ||
205 | void LiquidSet::changeShadow ( bool b ) | 205 | void LiquidSettings::changeShadow ( bool b ) |
206 | { | 206 | { |
207 | m_shadow = b; | 207 | m_shadow = b; |
208 | } | 208 | } |
209 | 209 | ||
210 | void LiquidSet::changeDeco ( bool b ) | 210 | void LiquidSettings::changeDeco ( bool b ) |
211 | { | 211 | { |
212 | m_deco = b; | 212 | m_deco = b; |
213 | } | 213 | } |
214 | 214 | ||
215 | 215 | ||
216 | void LiquidSet::accept ( ) | 216 | bool LiquidSettings::writeConfig ( ) |
217 | { | 217 | { |
218 | Config config ( "qpe" ); | 218 | Config config ( "qpe" ); |
219 | config. setGroup ( "Liquid-Style" ); | 219 | config. setGroup ( "Liquid-Style" ); |
220 | 220 | ||
221 | config. writeEntry ( "Type", m_type ); | 221 | config. writeEntry ( "Type", m_type ); |
222 | config. writeEntry ( "Color", m_menucol. name ( )); | 222 | config. writeEntry ( "Color", m_menucol. name ( )); |
223 | config. writeEntry ( "TextColor", m_textcol. name ( )); | 223 | config. writeEntry ( "TextColor", m_textcol. name ( )); |
224 | config. writeEntry ( "Opacity", m_opacsld-> value ( )); | 224 | config. writeEntry ( "Opacity", m_opacsld-> value ( )); |
225 | config. writeEntry ( "ShadowText", m_shadow ); | 225 | config. writeEntry ( "ShadowText", m_shadow ); |
226 | config. writeEntry ( "WinDecoration", m_deco ); | 226 | config. writeEntry ( "WinDecoration", m_deco ); |
227 | config. writeEntry ( "StippleContrast", m_contsld-> value ( )); | 227 | config. writeEntry ( "StippleContrast", m_contsld-> value ( )); |
228 | config. write ( ); | 228 | config. write ( ); |
229 | 229 | ||
230 | Global::applyStyle ( ); | 230 | return true; |
231 | |||
232 | QDialog::accept ( ); | ||
233 | } | 231 | } |
234 | 232 | ||
diff --git a/noncore/styles/liquid/settings/liquidset.h b/noncore/styles/liquid/liquidset.h index a0f590a..7843513 100644 --- a/noncore/styles/liquid/settings/liquidset.h +++ b/noncore/styles/liquid/liquidset.h | |||
@@ -1,37 +1,36 @@ | |||
1 | #ifndef __OPIE_LIQUID_SET_H__ | 1 | #ifndef __OPIE_LIQUID_SET_H__ |
2 | #define __OPIE_LIQUID_SET_H__ | 2 | #define __OPIE_LIQUID_SET_H__ |
3 | 3 | ||
4 | #include <qdialog.h> | 4 | #include <qdialog.h> |
5 | #include <qcolor.h> | 5 | #include <qcolor.h> |
6 | 6 | ||
7 | class QLabel; | 7 | class QLabel; |
8 | class QToolButton; | 8 | class QToolButton; |
9 | class QSlider; | 9 | class QSlider; |
10 | 10 | ||
11 | class LiquidSet : public QDialog { | 11 | class LiquidSettings : public QWidget { |
12 | Q_OBJECT | 12 | Q_OBJECT |
13 | 13 | ||
14 | public: | 14 | public: |
15 | LiquidSet ( QWidget *parent = 0, const char *name = 0, WFlags fl = 0 ); | 15 | LiquidSettings ( QWidget *parent = 0, const char *name = 0, WFlags fl = 0 ); |
16 | 16 | ||
17 | public slots: | 17 | public slots: |
18 | void changeType ( int t ); | 18 | void changeType ( int t ); |
19 | void changeMenuColor ( const QColor &col ); | 19 | void changeMenuColor ( const QColor &col ); |
20 | void changeTextColor ( const QColor &col ); | 20 | void changeTextColor ( const QColor &col ); |
21 | void changeShadow ( bool b ); | 21 | void changeShadow ( bool b ); |
22 | void changeDeco ( bool b ); | 22 | void changeDeco ( bool b ); |
23 | 23 | ||
24 | protected: | 24 | virtual bool writeConfig ( ); |
25 | virtual void accept ( ); | ||
26 | 25 | ||
27 | private: | 26 | private: |
28 | QColor m_menucol; | 27 | QColor m_menucol; |
29 | QColor m_textcol; | 28 | QColor m_textcol; |
30 | int m_type; | 29 | int m_type; |
31 | bool m_shadow; | 30 | bool m_shadow; |
32 | bool m_deco; | 31 | bool m_deco; |
33 | 32 | ||
34 | QSlider * m_opacsld; | 33 | QSlider * m_opacsld; |
35 | QSlider * m_contsld; | 34 | QSlider * m_contsld; |
36 | QLabel * m_menulbl; | 35 | QLabel * m_menulbl; |
37 | QLabel * m_textlbl; | 36 | QLabel * m_textlbl; |
diff --git a/noncore/styles/liquid/opie-liquid.control b/noncore/styles/liquid/opie-liquid.control index 6311dee..7b6ae71 100644 --- a/noncore/styles/liquid/opie-liquid.control +++ b/noncore/styles/liquid/opie-liquid.control | |||
@@ -1,10 +1,10 @@ | |||
1 | Files: plugins/styles/libliquid.so* bin/liquid-settings apps/Settings/Liquid.desktop pics/liquid/Liquid.png | 1 | Files: plugins/styles/libliquid.so* |
2 | Priority: optional | 2 | Priority: optional |
3 | Section: opie/system | 3 | Section: opie/system |
4 | Maintainer: Robert Griebl <sandman@handhelds.org> | 4 | Maintainer: Robert Griebl <sandman@handhelds.org> |
5 | Architecture: arm | 5 | Architecture: arm |
6 | Version: $QPE_VERSION-$SUB_VERSION.1 | 6 | Version: $QPE_VERSION-$SUB_VERSION.1 |
7 | Depends: opie-base ($QPE_VERSION) | 7 | Depends: opie-base ($QPE_VERSION) |
8 | Description: Liquid style by Mosfet. | 8 | Description: Liquid style by Mosfet. |
9 | Mosfet's well known Liquid GUI style from KDE, | 9 | Mosfet's well known Liquid GUI style from KDE, |
10 | ported to OPIE. | 10 | ported to OPIE. |
diff --git a/noncore/styles/liquid/plugin.cpp b/noncore/styles/liquid/plugin.cpp index d9aa8ef..f149c29 100644 --- a/noncore/styles/liquid/plugin.cpp +++ b/noncore/styles/liquid/plugin.cpp | |||
@@ -1,29 +1,111 @@ | |||
1 | #include "liquid.h" | 1 | #include "liquid.h" |
2 | #include "liquidset.h" | ||
3 | #include "plugin.h" | ||
2 | 4 | ||
3 | 5 | ||
4 | extern "C" { | 6 | |
5 | QStyle* allocate ( ); | 7 | LiquidInterface::LiquidInterface ( ) : ref ( 0 ) |
6 | int minor_version ( ); | 8 | { |
7 | int major_version ( ); | 9 | } |
8 | const char *description ( ); | 10 | |
11 | LiquidInterface::~LiquidInterface ( ) | ||
12 | { | ||
13 | } | ||
14 | |||
15 | QStyle *LiquidInterface::create ( ) | ||
16 | { | ||
17 | return new LiquidStyle ( ); | ||
18 | } | ||
19 | |||
20 | QString LiquidInterface::name ( ) | ||
21 | { | ||
22 | return QObject::tr( "Liquid", "name" ); | ||
23 | } | ||
24 | |||
25 | QString LiquidInterface::description ( ) | ||
26 | { | ||
27 | return QObject::tr( "High Performance Liquid style by Mosfet", "description" ); | ||
28 | } | ||
29 | |||
30 | QCString LiquidInterface::key ( ) | ||
31 | { | ||
32 | return QCString ( "liquid" ); | ||
33 | } | ||
34 | |||
35 | unsigned int LiquidInterface::version ( ) | ||
36 | { | ||
37 | return 100; // 1.0.0 (\d+.\d.\d) | ||
38 | } | ||
39 | |||
40 | QRESULT LiquidInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) | ||
41 | { | ||
42 | static LiquidSettingsInterface *setiface = 0; | ||
43 | |||
44 | *iface = 0; | ||
45 | |||
46 | if ( uuid == IID_QUnknown ) | ||
47 | *iface = this; | ||
48 | else if ( uuid == IID_Style ) | ||
49 | *iface = this; | ||
50 | else if ( uuid == IID_StyleSettings ) { | ||
51 | if ( !setiface ) | ||
52 | setiface = new LiquidSettingsInterface ( ); | ||
53 | *iface = setiface; | ||
54 | } | ||
55 | |||
56 | if ( *iface ) | ||
57 | (*iface)-> addRef ( ); | ||
58 | |||
59 | return QS_OK; | ||
60 | } | ||
61 | |||
62 | Q_EXPORT_INTERFACE() | ||
63 | { | ||
64 | Q_CREATE_INSTANCE( LiquidInterface ) | ||
9 | } | 65 | } |
10 | 66 | ||
11 | QStyle* allocate ( ) | 67 | |
68 | LiquidSettingsInterface::LiquidSettingsInterface ( ) : ref ( 0 ) | ||
69 | { | ||
70 | m_widget = 0; | ||
71 | } | ||
72 | |||
73 | LiquidSettingsInterface::~LiquidSettingsInterface ( ) | ||
12 | { | 74 | { |
13 | return new LiquidStyle ( ); | 75 | } |
76 | |||
77 | QWidget *LiquidSettingsInterface::create ( QWidget *parent, const char *name ) | ||
78 | { | ||
79 | m_widget = new LiquidSettings ( parent, name ? name : "LIQUID-SETTINGS" ); | ||
80 | |||
81 | return m_widget; | ||
14 | } | 82 | } |
15 | 83 | ||
16 | int minor_version ( ) | 84 | bool LiquidSettingsInterface::accept ( ) |
17 | { | 85 | { |
18 | return 0; | 86 | if ( !m_widget ) |
87 | return false; | ||
88 | |||
89 | return m_widget-> writeConfig ( ); | ||
19 | } | 90 | } |
20 | 91 | ||
21 | int major_version ( ) | 92 | void LiquidSettingsInterface::reject ( ) |
22 | { | 93 | { |
23 | return 1; | ||
24 | } | 94 | } |
25 | 95 | ||
26 | const char *description ( ) | 96 | QRESULT LiquidSettingsInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) |
27 | { | 97 | { |
28 | return "High Performance Liquid"; | 98 | *iface = 0; |
99 | |||
100 | |||
101 | if ( uuid == IID_QUnknown ) | ||
102 | *iface = this; | ||
103 | else if ( uuid == IID_StyleSettings ) | ||
104 | *iface = this; | ||
105 | |||
106 | if ( *iface ) | ||
107 | (*iface)-> addRef ( ); | ||
108 | |||
109 | return QS_OK; | ||
29 | } | 110 | } |
111 | |||
diff --git a/noncore/styles/liquid/plugin.h b/noncore/styles/liquid/plugin.h new file mode 100644 index 0000000..759577f --- a/dev/null +++ b/noncore/styles/liquid/plugin.h | |||
@@ -0,0 +1,46 @@ | |||
1 | #ifndef __OPIE_LIQUID_PLUGIN_H__ | ||
2 | #define __OPIE_LIQUID_PLUGIN_H__ | ||
3 | |||
4 | #include <qpe/styleinterface.h> | ||
5 | |||
6 | class LiquidSettings; | ||
7 | |||
8 | class LiquidInterface : public StyleInterface { | ||
9 | public: | ||
10 | LiquidInterface ( ); | ||
11 | virtual ~LiquidInterface ( ); | ||
12 | |||
13 | QRESULT queryInterface ( const QUuid &, QUnknownInterface ** ); | ||
14 | Q_REFCOUNT | ||
15 | |||
16 | virtual QStyle *create ( ); | ||
17 | |||
18 | virtual QString description ( ); | ||
19 | virtual QString name ( ); | ||
20 | virtual QCString key ( ); | ||
21 | |||
22 | virtual unsigned int version ( ); | ||
23 | |||
24 | private: | ||
25 | ulong ref; | ||
26 | }; | ||
27 | |||
28 | class LiquidSettingsInterface : public StyleSettingsInterface { | ||
29 | public: | ||
30 | LiquidSettingsInterface ( ); | ||
31 | virtual ~LiquidSettingsInterface ( ); | ||
32 | |||
33 | QRESULT queryInterface ( const QUuid &, QUnknownInterface ** ); | ||
34 | Q_REFCOUNT | ||
35 | |||
36 | virtual QWidget *create ( QWidget *parent, const char *name = 0 ); | ||
37 | |||
38 | virtual bool accept ( ); | ||
39 | virtual void reject ( ); | ||
40 | |||
41 | private: | ||
42 | LiquidSettings *m_widget; | ||
43 | ulong ref; | ||
44 | }; | ||
45 | |||
46 | #endif | ||
diff --git a/noncore/styles/liquid/settings/.cvsignore b/noncore/styles/liquid/settings/.cvsignore deleted file mode 100644 index c13418b..0000000 --- a/noncore/styles/liquid/settings/.cvsignore +++ b/dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | Makefile* | ||
2 | moc_* | ||
diff --git a/noncore/styles/liquid/settings/main.cpp b/noncore/styles/liquid/settings/main.cpp deleted file mode 100644 index fd69007..0000000 --- a/noncore/styles/liquid/settings/main.cpp +++ b/dev/null | |||
@@ -1,34 +0,0 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Qtopia Environment. | ||
5 | ** | ||
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 | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
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. | ||
13 | ** | ||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
15 | ** | ||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
17 | ** not clear to you. | ||
18 | ** | ||
19 | **********************************************************************/ | ||
20 | |||
21 | #include "liquidset.h" | ||
22 | |||
23 | #include <qpe/qpeapplication.h> | ||
24 | |||
25 | |||
26 | int main ( int argc, char** argv ) | ||
27 | { | ||
28 | QPEApplication a ( argc, argv ); | ||
29 | |||
30 | LiquidSet dlg; | ||
31 | a. showMainWidget ( &dlg ); | ||
32 | |||
33 | return a. exec ( ); | ||
34 | } | ||
diff --git a/noncore/styles/liquid/settings/settings.pro b/noncore/styles/liquid/settings/settings.pro deleted file mode 100644 index bfda7a4..0000000 --- a/noncore/styles/liquid/settings/settings.pro +++ b/dev/null | |||
@@ -1,24 +0,0 @@ | |||
1 | TEMPLATE= app | ||
2 | CONFIG += qt warn_on release | ||
3 | DESTDIR = $(OPIEDIR)/bin | ||
4 | HEADERS = liquidset.h | ||
5 | SOURCES = liquidset.cpp main.cpp | ||
6 | INCLUDEPATH += $(OPIEDIR)/include | ||
7 | DEPENDPATH+= ../$(OPIEDIR)/include | ||
8 | LIBS += -lqpe -lopie | ||
9 | TARGET = liquid-settings | ||
10 | |||
11 | TRANSLATIONS = ../../../../i18n/de/liquid-settings.ts \ | ||
12 | ../../../../i18n/en/liquid-settings.ts \ | ||
13 | ../../../../i18n/es/liquid-settings.ts \ | ||
14 | ../../../../i18n/fr/liquid-settings.ts \ | ||
15 | ../../../../i18n/hu/liquid-settings.ts \ | ||
16 | ../../../../i18n/ja/liquid-settings.ts \ | ||
17 | ../../../../i18n/ko/liquid-settings.ts \ | ||
18 | ../../../../i18n/no/liquid-settings.ts \ | ||
19 | ../../../../i18n/pl/liquid-settings.ts \ | ||
20 | ../../../../i18n/pt/liquid-settings.ts \ | ||
21 | ../../../../i18n/pt_BR/liquid-settings.ts \ | ||
22 | ../../../../i18n/sl/liquid-settings.ts \ | ||
23 | ../../../../i18n/zh_CN/liquid-settings.ts \ | ||
24 | ../../../../i18n/zh_TW/liquid-settings.ts | ||
diff --git a/noncore/styles/metal/metal.pro b/noncore/styles/metal/metal.pro index 6e99389..cf15f33 100644 --- a/noncore/styles/metal/metal.pro +++ b/noncore/styles/metal/metal.pro | |||
@@ -1,17 +1,17 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG = qt embedded release warn_on | 2 | CONFIG = qt embedded release warn_on |
3 | SOURCES = metal.cpp plugin.cpp | 3 | SOURCES = metal.cpp plugin.cpp |
4 | 4 | ||
5 | HEADERS = metal.h | 5 | HEADERS = metal.h plugin.h |
6 | LIBS += -lqpe | 6 | LIBS += -lqpe |
7 | INCLUDEPATH += $(OPIEDIR)/include | 7 | INCLUDEPATH += $(OPIEDIR)/include |
8 | DESTDIR = $(OPIEDIR)/plugins/styles | 8 | DESTDIR = $(OPIEDIR)/plugins/styles |
9 | TARGET = metal | 9 | TARGET = metal |
10 | VERSION = 1.0.0 | 10 | VERSION = 1.0.0 |
11 | 11 | ||
12 | TRANSLATIONS = ../../../i18n/de/libmetal.ts \ | 12 | TRANSLATIONS = ../../../i18n/de/libmetal.ts \ |
13 | ../../../i18n/en/libmetal.ts \ | 13 | ../../../i18n/en/libmetal.ts \ |
14 | ../../../i18n/es/libmetal.ts \ | 14 | ../../../i18n/es/libmetal.ts \ |
15 | ../../../i18n/fr/libmetal.ts \ | 15 | ../../../i18n/fr/libmetal.ts \ |
16 | ../../../i18n/hu/libmetal.ts \ | 16 | ../../../i18n/hu/libmetal.ts \ |
17 | ../../../i18n/ja/libmetal.ts \ | 17 | ../../../i18n/ja/libmetal.ts \ |
diff --git a/noncore/styles/metal/plugin.cpp b/noncore/styles/metal/plugin.cpp index e5bee10..1db4aac 100644 --- a/noncore/styles/metal/plugin.cpp +++ b/noncore/styles/metal/plugin.cpp | |||
@@ -1,29 +1,57 @@ | |||
1 | #include "metal.h" | 1 | #include "metal.h" |
2 | #include "plugin.h" | ||
2 | 3 | ||
3 | 4 | ||
4 | extern "C" { | 5 | MetalInterface::MetalInterface ( ) : ref ( 0 ) |
5 | QStyle* allocate ( ); | 6 | { |
6 | int minor_version ( ); | 7 | } |
7 | int major_version ( ); | 8 | |
8 | const char *description ( ); | 9 | MetalInterface::~MetalInterface ( ) |
10 | { | ||
11 | } | ||
12 | |||
13 | QStyle *MetalInterface::create ( ) | ||
14 | { | ||
15 | return new MetalStyle ( ); | ||
16 | } | ||
17 | |||
18 | QString MetalInterface::name ( ) | ||
19 | { | ||
20 | return QObject::tr( "Metal", "name" ); | ||
21 | } | ||
22 | |||
23 | QString MetalInterface::description ( ) | ||
24 | { | ||
25 | return QObject::tr( "Metal style", "description" ); | ||
9 | } | 26 | } |
10 | 27 | ||
11 | QStyle* allocate ( ) | 28 | QCString MetalInterface::key ( ) |
12 | { | 29 | { |
13 | return new MetalStyle ( ); | 30 | return QCString ( "metal" ); |
14 | } | 31 | } |
15 | 32 | ||
16 | int minor_version ( ) | 33 | unsigned int MetalInterface::version ( ) |
17 | { | 34 | { |
18 | return 0; | 35 | return 100; // 1.0.0 (\d+.\d.\d) |
19 | } | 36 | } |
20 | 37 | ||
21 | int major_version ( ) | 38 | QRESULT MetalInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) |
22 | { | 39 | { |
23 | return 1; | 40 | *iface = 0; |
41 | |||
42 | if ( uuid == IID_QUnknown ) | ||
43 | *iface = this; | ||
44 | else if ( uuid == IID_Style ) | ||
45 | *iface = this; | ||
46 | |||
47 | if ( *iface ) | ||
48 | (*iface)-> addRef ( ); | ||
49 | |||
50 | return QS_OK; | ||
24 | } | 51 | } |
25 | 52 | ||
26 | const char *description ( ) | 53 | Q_EXPORT_INTERFACE() |
27 | { | 54 | { |
28 | return "Metal style plugin"; | 55 | Q_CREATE_INSTANCE( MetalInterface ) |
29 | } | 56 | } |
57 | |||
diff --git a/noncore/styles/metal/plugin.h b/noncore/styles/metal/plugin.h new file mode 100644 index 0000000..f61c833 --- a/dev/null +++ b/noncore/styles/metal/plugin.h | |||
@@ -0,0 +1,27 @@ | |||
1 | #ifndef __OPIE_METAL_PLUGIN_H__ | ||
2 | #define __OPIE_METAL_PLUGIN_H__ | ||
3 | |||
4 | #include <qpe/styleinterface.h> | ||
5 | |||
6 | |||
7 | class MetalInterface : public StyleInterface { | ||
8 | public: | ||
9 | MetalInterface ( ); | ||
10 | virtual ~MetalInterface ( ); | ||
11 | |||
12 | QRESULT queryInterface ( const QUuid &, QUnknownInterface ** ); | ||
13 | Q_REFCOUNT | ||
14 | |||
15 | virtual QStyle *create ( ); | ||
16 | |||
17 | virtual QString description ( ); | ||
18 | virtual QString name ( ); | ||
19 | virtual QCString key ( ); | ||
20 | |||
21 | virtual unsigned int version ( ); | ||
22 | |||
23 | private: | ||
24 | ulong ref; | ||
25 | }; | ||
26 | |||
27 | #endif | ||
diff --git a/noncore/styles/theme/opie-theme.control b/noncore/styles/theme/opie-theme.control index 02739fb..adb4f4b 100644 --- a/noncore/styles/theme/opie-theme.control +++ b/noncore/styles/theme/opie-theme.control | |||
@@ -1,11 +1,11 @@ | |||
1 | Files: plugins/styles/libtheme.so* bin/theme-settings apps/Settings/Theme.desktop pics/theme/Theme.png | 1 | Files: plugins/styles/libtheme.so* |
2 | Priority: optional | 2 | Priority: optional |
3 | Section: opie/system | 3 | Section: opie/system |
4 | Maintainer: Robert Griebl <sandman@handhelds.org> | 4 | Maintainer: Robert Griebl <sandman@handhelds.org> |
5 | Architecture: arm | 5 | Architecture: arm |
6 | Version: $QPE_VERSION-$SUB_VERSION.1 | 6 | Version: $QPE_VERSION-$SUB_VERSION.1 |
7 | Depends: opie-base ($QPE_VERSION) | 7 | Depends: opie-base ($QPE_VERSION) |
8 | Description: Themed style. | 8 | Description: Themed style. |
9 | This style accepts all themes written | 9 | This style accepts all themes written |
10 | for KDE 2.2 | 10 | for KDE 2.2 |
11 | 11 | ||
diff --git a/noncore/styles/theme/plugin.cpp b/noncore/styles/theme/plugin.cpp index b334357..4383693 100644 --- a/noncore/styles/theme/plugin.cpp +++ b/noncore/styles/theme/plugin.cpp | |||
@@ -1,19 +1,111 @@ | |||
1 | //#include <klocale.h> | ||
2 | #include "othemestyle.h" | 1 | #include "othemestyle.h" |
2 | #include "themeset.h" | ||
3 | #include "plugin.h" | ||
3 | 4 | ||
4 | extern "C" | 5 | |
6 | |||
7 | ThemeInterface::ThemeInterface ( ) : ref ( 0 ) | ||
5 | { | 8 | { |
6 | QStyle * allocate() { | 9 | } |
7 | return new OThemeStyle ( "" ); | 10 | |
8 | } | 11 | ThemeInterface::~ThemeInterface ( ) |
9 | int minor_version() { | 12 | { |
10 | return 0; | 13 | } |
11 | } | 14 | |
12 | int major_version() { | 15 | QStyle *ThemeInterface::create ( ) |
13 | return 1; | 16 | { |
14 | } | 17 | return new OThemeStyle ( "" ); |
15 | const char * description() { | 18 | } |
16 | return ( "Theme Style" ); | 19 | |
20 | QString ThemeInterface::name ( ) | ||
21 | { | ||
22 | return QObject::tr( "Themed style", "name" ); | ||
23 | } | ||
24 | |||
25 | QString ThemeInterface::description ( ) | ||
26 | { | ||
27 | return QObject::tr( "KDE2 theme compatible style engine", "description" ); | ||
28 | } | ||
29 | |||
30 | QCString ThemeInterface::key ( ) | ||
31 | { | ||
32 | return QCString ( "theme" ); | ||
33 | } | ||
34 | |||
35 | unsigned int ThemeInterface::version ( ) | ||
36 | { | ||
37 | return 100; // 1.0.0 (\d+.\d.\d) | ||
38 | } | ||
39 | |||
40 | QRESULT ThemeInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) | ||
41 | { | ||
42 | static ThemeSettingsInterface *setiface = 0; | ||
43 | |||
44 | *iface = 0; | ||
45 | |||
46 | if ( uuid == IID_QUnknown ) | ||
47 | *iface = this; | ||
48 | else if ( uuid == IID_Style ) | ||
49 | *iface = this; | ||
50 | else if ( uuid == IID_StyleSettings ) { | ||
51 | if ( !setiface ) | ||
52 | setiface = new ThemeSettingsInterface ( ); | ||
53 | *iface = setiface; | ||
17 | } | 54 | } |
55 | |||
56 | if ( *iface ) | ||
57 | (*iface)-> addRef ( ); | ||
58 | |||
59 | return QS_OK; | ||
60 | } | ||
61 | |||
62 | Q_EXPORT_INTERFACE() | ||
63 | { | ||
64 | Q_CREATE_INSTANCE( ThemeInterface ) | ||
65 | } | ||
66 | |||
67 | |||
68 | ThemeSettingsInterface::ThemeSettingsInterface ( ) : ref ( 0 ) | ||
69 | { | ||
70 | m_widget = 0; | ||
71 | } | ||
72 | |||
73 | ThemeSettingsInterface::~ThemeSettingsInterface ( ) | ||
74 | { | ||
75 | } | ||
76 | |||
77 | QWidget *ThemeSettingsInterface::create ( QWidget *parent, const char *name ) | ||
78 | { | ||
79 | m_widget = new ThemeSettings ( parent, name ? name : "THEME-SETTINGS" ); | ||
80 | |||
81 | return m_widget; | ||
82 | } | ||
83 | |||
84 | bool ThemeSettingsInterface::accept ( ) | ||
85 | { | ||
86 | if ( !m_widget ) | ||
87 | return false; | ||
88 | |||
89 | return m_widget-> writeConfig ( ); | ||
90 | } | ||
91 | |||
92 | void ThemeSettingsInterface::reject ( ) | ||
93 | { | ||
94 | } | ||
95 | |||
96 | QRESULT ThemeSettingsInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) | ||
97 | { | ||
98 | *iface = 0; | ||
99 | |||
100 | |||
101 | if ( uuid == IID_QUnknown ) | ||
102 | *iface = this; | ||
103 | else if ( uuid == IID_StyleSettings ) | ||
104 | *iface = this; | ||
105 | |||
106 | if ( *iface ) | ||
107 | (*iface)-> addRef ( ); | ||
108 | |||
109 | return QS_OK; | ||
18 | } | 110 | } |
19 | 111 | ||
diff --git a/noncore/styles/theme/plugin.h b/noncore/styles/theme/plugin.h new file mode 100644 index 0000000..d13fc5d --- a/dev/null +++ b/noncore/styles/theme/plugin.h | |||
@@ -0,0 +1,46 @@ | |||
1 | #ifndef __OPIE_THEME_PLUGIN_H__ | ||
2 | #define __OPIE_THEME_PLUGIN_H__ | ||
3 | |||
4 | #include <qpe/styleinterface.h> | ||
5 | |||
6 | class ThemeSettings; | ||
7 | |||
8 | class ThemeInterface : public StyleInterface { | ||
9 | public: | ||
10 | ThemeInterface ( ); | ||
11 | virtual ~ThemeInterface ( ); | ||
12 | |||
13 | QRESULT queryInterface ( const QUuid &, QUnknownInterface ** ); | ||
14 | Q_REFCOUNT | ||
15 | |||
16 | virtual QStyle *create ( ); | ||
17 | |||
18 | virtual QString description ( ); | ||
19 | virtual QString name ( ); | ||
20 | virtual QCString key ( ); | ||
21 | |||
22 | virtual unsigned int version ( ); | ||
23 | |||
24 | private: | ||
25 | ulong ref; | ||
26 | }; | ||
27 | |||
28 | class ThemeSettingsInterface : public StyleSettingsInterface { | ||
29 | public: | ||
30 | ThemeSettingsInterface ( ); | ||
31 | virtual ~ThemeSettingsInterface ( ); | ||
32 | |||
33 | QRESULT queryInterface ( const QUuid &, QUnknownInterface ** ); | ||
34 | Q_REFCOUNT | ||
35 | |||
36 | virtual QWidget *create ( QWidget *parent, const char *name = 0 ); | ||
37 | |||
38 | virtual bool accept ( ); | ||
39 | virtual void reject ( ); | ||
40 | |||
41 | private: | ||
42 | ThemeSettings *m_widget; | ||
43 | ulong ref; | ||
44 | }; | ||
45 | |||
46 | #endif | ||
diff --git a/noncore/styles/theme/settings/main.cpp b/noncore/styles/theme/settings/main.cpp deleted file mode 100644 index 94d40f3..0000000 --- a/noncore/styles/theme/settings/main.cpp +++ b/dev/null | |||
@@ -1,34 +0,0 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Qtopia Environment. | ||
5 | ** | ||
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 | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
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. | ||
13 | ** | ||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | ||
15 | ** | ||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | ||
17 | ** not clear to you. | ||
18 | ** | ||
19 | **********************************************************************/ | ||
20 | |||
21 | #include "themeset.h" | ||
22 | |||
23 | #include <qpe/qpeapplication.h> | ||
24 | |||
25 | |||
26 | int main ( int argc, char** argv ) | ||
27 | { | ||
28 | QPEApplication a ( argc, argv ); | ||
29 | |||
30 | ThemeSet dlg; | ||
31 | a. showMainWidget ( &dlg ); | ||
32 | |||
33 | return a. exec ( ); | ||
34 | } | ||
diff --git a/noncore/styles/theme/settings/settings.pro b/noncore/styles/theme/settings/settings.pro deleted file mode 100644 index 85d1f7a..0000000 --- a/noncore/styles/theme/settings/settings.pro +++ b/dev/null | |||
@@ -1,24 +0,0 @@ | |||
1 | TEMPLATE= app | ||
2 | CONFIG += qt warn_on release | ||
3 | DESTDIR = $(OPIEDIR)/bin | ||
4 | HEADERS = themeset.h | ||
5 | SOURCES = themeset.cpp main.cpp | ||
6 | INCLUDEPATH += $(OPIEDIR)/include | ||
7 | DEPENDPATH+= ../$(OPIEDIR)/include | ||
8 | LIBS += -lqpe | ||
9 | TARGET = theme-settings | ||
10 | |||
11 | TRANSLATIONS = ../../../../i18n/de/theme-settings.ts \ | ||
12 | ../../../../i18n/en/theme-settings.ts \ | ||
13 | ../../../../i18n/es/theme-settings.ts \ | ||
14 | ../../../../i18n/fr/theme-settings.ts \ | ||
15 | ../../../../i18n/hu/theme-settings.ts \ | ||
16 | ../../../../i18n/ja/theme-settings.ts \ | ||
17 | ../../../../i18n/ko/theme-settings.ts \ | ||
18 | ../../../../i18n/no/theme-settings.ts \ | ||
19 | ../../../../i18n/pl/theme-settings.ts \ | ||
20 | ../../../../i18n/pt/theme-settings.ts \ | ||
21 | ../../../../i18n/pt_BR/theme-settings.ts \ | ||
22 | ../../../../i18n/sl/theme-settings.ts \ | ||
23 | ../../../../i18n/zh_CN/theme-settings.ts \ | ||
24 | ../../../../i18n/zh_TW/theme-settings.ts | ||
diff --git a/noncore/styles/theme/settings/themeset.h b/noncore/styles/theme/settings/themeset.h deleted file mode 100644 index 24804ce..0000000 --- a/noncore/styles/theme/settings/themeset.h +++ b/dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | #ifndef __OPIE_THEME_SET_H__ | ||
2 | #define __OPIE_THEME_SET_H__ | ||
3 | |||
4 | #include <qdialog.h> | ||
5 | |||
6 | class QListView; | ||
7 | |||
8 | class ThemeSet : public QDialog { | ||
9 | Q_OBJECT | ||
10 | |||
11 | public: | ||
12 | ThemeSet ( QWidget *parent = 0, const char *name = 0, WFlags fl = 0 ); | ||
13 | |||
14 | protected: | ||
15 | virtual void accept ( ); | ||
16 | |||
17 | private: | ||
18 | QListView *m_list; | ||
19 | }; | ||
20 | #endif | ||
diff --git a/noncore/styles/theme/theme.pro b/noncore/styles/theme/theme.pro index fdcd20e..49c4103 100644 --- a/noncore/styles/theme/theme.pro +++ b/noncore/styles/theme/theme.pro | |||
@@ -1,22 +1,25 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG = qt embedded debug warn_on | 2 | CONFIG = qt embedded debug warn_on |
3 | SOURCES = ogfxeffect.cpp \ | 3 | SOURCES = ogfxeffect.cpp \ |
4 | othemestyle.cpp \ | 4 | othemestyle.cpp \ |
5 | othemebase.cpp \ | 5 | othemebase.cpp \ |
6 | themeset.cpp \ | ||
6 | plugin.cpp | 7 | plugin.cpp |
7 | 8 | ||
8 | HEADERS = ogfxeffect.h \ | 9 | HEADERS = ogfxeffect.h \ |
9 | othemebase.h \ | 10 | othemebase.h \ |
10 | othemestyle.h | 11 | othemestyle.h \ |
12 | themeset.h \ | ||
13 | plugin.h | ||
11 | 14 | ||
12 | 15 | ||
13 | LIBS += -lqpe | 16 | LIBS += -lqpe |
14 | INCLUDEPATH += $(OPIEDIR)/include | 17 | INCLUDEPATH += $(OPIEDIR)/include |
15 | DESTDIR = $(OPIEDIR)/plugins/styles | 18 | DESTDIR = $(OPIEDIR)/plugins/styles |
16 | TARGET = theme | 19 | TARGET = theme |
17 | VERSION = 1.0.0 | 20 | VERSION = 1.0.0 |
18 | 21 | ||
19 | TRANSLATIONS = ../../../i18n/de/libtheme.ts \ | 22 | TRANSLATIONS = ../../../i18n/de/libtheme.ts \ |
20 | ../../../i18n/en/libtheme.ts \ | 23 | ../../../i18n/en/libtheme.ts \ |
21 | ../../../i18n/es/libtheme.ts \ | 24 | ../../../i18n/es/libtheme.ts \ |
22 | ../../../i18n/fr/libtheme.ts \ | 25 | ../../../i18n/fr/libtheme.ts \ |
diff --git a/noncore/styles/theme/settings/themeset.cpp b/noncore/styles/theme/themeset.cpp index 046618e..4a4efcb 100644 --- a/noncore/styles/theme/settings/themeset.cpp +++ b/noncore/styles/theme/themeset.cpp | |||
@@ -50,26 +50,26 @@ class MyItem : public QListViewItem | |||
50 | { | 50 | { |
51 | public: | 51 | public: |
52 | MyItem ( QListView *lv, const QString &name, const QString &comm, const QString &theme ) : QListViewItem ( lv, name, comm ) | 52 | MyItem ( QListView *lv, const QString &name, const QString &comm, const QString &theme ) : QListViewItem ( lv, name, comm ) |
53 | { | 53 | { |
54 | m_theme = theme; | 54 | m_theme = theme; |
55 | } | 55 | } |
56 | 56 | ||
57 | 57 | ||
58 | QString m_theme; | 58 | QString m_theme; |
59 | }; | 59 | }; |
60 | 60 | ||
61 | 61 | ||
62 | ThemeSet::ThemeSet ( QWidget* parent, const char *name, WFlags fl ) | 62 | ThemeSettings::ThemeSettings ( QWidget* parent, const char *name, WFlags fl ) |
63 | : QDialog ( parent, name, fl ) | 63 | : QWidget ( parent, name, fl ) |
64 | { | 64 | { |
65 | setCaption ( tr( "Theme Style" ) ); | 65 | setCaption ( tr( "Theme Style" ) ); |
66 | 66 | ||
67 | Config config ( "qpe" ); | 67 | Config config ( "qpe" ); |
68 | config. setGroup ( "Appearance" ); | 68 | config. setGroup ( "Appearance" ); |
69 | 69 | ||
70 | QString active = config. readEntry ( "Theme", "default" ); | 70 | QString active = config. readEntry ( "Theme", "default" ); |
71 | 71 | ||
72 | QVBoxLayout *vbox = new QVBoxLayout ( this ); | 72 | QVBoxLayout *vbox = new QVBoxLayout ( this ); |
73 | vbox-> setSpacing ( 3 ); | 73 | vbox-> setSpacing ( 3 ); |
74 | vbox-> setMargin ( 6 ); | 74 | vbox-> setMargin ( 6 ); |
75 | 75 | ||
@@ -100,25 +100,24 @@ ThemeSet::ThemeSet ( QWidget* parent, const char *name, WFlags fl ) | |||
100 | if ( !name. isEmpty ( )) { | 100 | if ( !name. isEmpty ( )) { |
101 | QString fname = (*it). left ((*it). length ( ) - 8 ); | 101 | QString fname = (*it). left ((*it). length ( ) - 8 ); |
102 | 102 | ||
103 | item = new MyItem ( m_list, name, comm, fname ); | 103 | item = new MyItem ( m_list, name, comm, fname ); |
104 | if ( active == fname ) { | 104 | if ( active == fname ) { |
105 | m_list-> setSelected ( item, true ); | 105 | m_list-> setSelected ( item, true ); |
106 | } | 106 | } |
107 | } | 107 | } |
108 | } | 108 | } |
109 | } | 109 | } |
110 | } | 110 | } |
111 | 111 | ||
112 | void ThemeSet::accept ( ) | 112 | bool ThemeSettings::writeConfig ( ) |
113 | { | 113 | { |
114 | Config config ( "qpe" ); | 114 | Config config ( "qpe" ); |
115 | config. setGroup ( "Appearance" ); | 115 | config. setGroup ( "Appearance" ); |
116 | 116 | ||
117 | MyItem *it = (MyItem *) m_list-> selectedItem ( ); | 117 | MyItem *it = (MyItem *) m_list-> selectedItem ( ); |
118 | config. writeEntry ( "Theme", it ? it-> m_theme : QString ( "" )); | 118 | config. writeEntry ( "Theme", it ? it-> m_theme : QString ( "" )); |
119 | config. write ( ); | ||
119 | 120 | ||
120 | Global::applyStyle ( ); | 121 | return true; |
121 | |||
122 | QDialog::accept ( ); | ||
123 | } | 122 | } |
124 | 123 | ||
diff --git a/noncore/styles/theme/themeset.h b/noncore/styles/theme/themeset.h new file mode 100644 index 0000000..c337cfa --- a/dev/null +++ b/noncore/styles/theme/themeset.h | |||
@@ -0,0 +1,20 @@ | |||
1 | #ifndef __OPIE_THEME_SETTINGS_H__ | ||
2 | #define __OPIE_THEME_SETTINGS_H__ | ||
3 | |||
4 | #include <qdialog.h> | ||
5 | |||
6 | class QListView; | ||
7 | |||
8 | class ThemeSettings : public QWidget { | ||
9 | Q_OBJECT | ||
10 | |||
11 | public: | ||
12 | ThemeSettings ( QWidget *parent = 0, const char *name = 0, WFlags fl = 0 ); | ||
13 | |||
14 | public: | ||
15 | virtual bool writeConfig ( ); | ||
16 | |||
17 | private: | ||
18 | QListView *m_list; | ||
19 | }; | ||
20 | #endif | ||