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/theme/settings | |
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)
Diffstat (limited to 'noncore/styles/theme/settings') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/styles/theme/settings/main.cpp | 34 | ||||
-rw-r--r-- | noncore/styles/theme/settings/settings.pro | 24 | ||||
-rw-r--r-- | noncore/styles/theme/settings/themeset.cpp | 124 | ||||
-rw-r--r-- | noncore/styles/theme/settings/themeset.h | 20 |
4 files changed, 0 insertions, 202 deletions
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.cpp b/noncore/styles/theme/settings/themeset.cpp deleted file mode 100644 index 046618e..0000000 --- a/noncore/styles/theme/settings/themeset.cpp +++ b/dev/null | |||
@@ -1,124 +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 | |||
22 | |||
23 | #include "themeset.h" | ||
24 | |||
25 | #include <qpe/qpeapplication.h> | ||
26 | #include <qpe/global.h> | ||
27 | |||
28 | #include <qlabel.h> | ||
29 | #include <qlayout.h> | ||
30 | #include <qlistview.h> | ||
31 | #include <qdir.h> | ||
32 | |||
33 | #include <qpe/config.h> | ||
34 | |||
35 | |||
36 | class MyConfig : public Config | ||
37 | { | ||
38 | public: | ||
39 | MyConfig ( const QString &f, Domain d ) : Config ( f, d ) | ||
40 | { } | ||
41 | |||
42 | bool hasGroup ( const QString &gname ) const | ||
43 | { | ||
44 | QMap< QString, ConfigGroup>::ConstIterator it = groups. find ( gname ); | ||
45 | return ( it != groups.end() ); | ||
46 | } | ||
47 | }; | ||
48 | |||
49 | class MyItem : public QListViewItem | ||
50 | { | ||
51 | public: | ||
52 | MyItem ( QListView *lv, const QString &name, const QString &comm, const QString &theme ) : QListViewItem ( lv, name, comm ) | ||
53 | { | ||
54 | m_theme = theme; | ||
55 | } | ||
56 | |||
57 | |||
58 | QString m_theme; | ||
59 | }; | ||
60 | |||
61 | |||
62 | ThemeSet::ThemeSet ( QWidget* parent, const char *name, WFlags fl ) | ||
63 | : QDialog ( parent, name, fl ) | ||
64 | { | ||
65 | setCaption ( tr( "Theme Style" ) ); | ||
66 | |||
67 | Config config ( "qpe" ); | ||
68 | config. setGroup ( "Appearance" ); | ||
69 | |||
70 | QString active = config. readEntry ( "Theme", "default" ); | ||
71 | |||
72 | QVBoxLayout *vbox = new QVBoxLayout ( this ); | ||
73 | vbox-> setSpacing ( 3 ); | ||
74 | vbox-> setMargin ( 6 ); | ||
75 | |||
76 | vbox-> addWidget ( new QLabel ( tr( "Select the theme to be used" ), this )); | ||
77 | |||
78 | m_list = new QListView ( this ); | ||
79 | m_list-> addColumn ( tr( "Name" )); | ||
80 | m_list-> addColumn ( tr( "Description" )); | ||
81 | m_list-> setSelectionMode ( QListView::Single ); | ||
82 | m_list-> setAllColumnsShowFocus ( true ); | ||
83 | vbox-> addWidget ( m_list, 10 ); | ||
84 | |||
85 | QListViewItem *item = new MyItem ( m_list, tr( "[No theme]" ), "", "" ); | ||
86 | m_list-> setSelected ( item, true ); | ||
87 | |||
88 | QString path = QPEApplication::qpeDir() + "/plugins/styles/themes"; | ||
89 | QStringList list = QDir ( path, "*.themerc" ). entryList ( ); | ||
90 | |||
91 | for ( QStringList::Iterator it = list. begin(); it != list. end ( ); ++it ) { | ||
92 | MyConfig cfg ( path + "/" + *it, Config::File ); | ||
93 | |||
94 | if ( cfg. hasGroup ( "Misc" )) { | ||
95 | cfg. setGroup ( "Misc" ); | ||
96 | |||
97 | QString name = cfg. readEntry ( "Name" ); | ||
98 | QString comm = cfg. readEntry ( "Comment" ); | ||
99 | |||
100 | if ( !name. isEmpty ( )) { | ||
101 | QString fname = (*it). left ((*it). length ( ) - 8 ); | ||
102 | |||
103 | item = new MyItem ( m_list, name, comm, fname ); | ||
104 | if ( active == fname ) { | ||
105 | m_list-> setSelected ( item, true ); | ||
106 | } | ||
107 | } | ||
108 | } | ||
109 | } | ||
110 | } | ||
111 | |||
112 | void ThemeSet::accept ( ) | ||
113 | { | ||
114 | Config config ( "qpe" ); | ||
115 | config. setGroup ( "Appearance" ); | ||
116 | |||
117 | MyItem *it = (MyItem *) m_list-> selectedItem ( ); | ||
118 | config. writeEntry ( "Theme", it ? it-> m_theme : QString ( "" )); | ||
119 | |||
120 | Global::applyStyle ( ); | ||
121 | |||
122 | QDialog::accept ( ); | ||
123 | } | ||
124 | |||
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 | ||