summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/appearance2/appearance.cpp3
-rw-r--r--noncore/settings/appearance2/appearance.h6
-rw-r--r--noncore/settings/appearance2/editScheme.cpp5
-rw-r--r--noncore/settings/appearance2/editScheme.h6
-rw-r--r--noncore/settings/appearance2/main.cpp1
5 files changed, 11 insertions, 10 deletions
diff --git a/noncore/settings/appearance2/appearance.cpp b/noncore/settings/appearance2/appearance.cpp
index 8ae87fe..6b9fe4d 100644
--- a/noncore/settings/appearance2/appearance.cpp
+++ b/noncore/settings/appearance2/appearance.cpp
@@ -1,172 +1,173 @@
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 =. Copyright (c) 2002 Dan Williams <williamsdr@acm.org> 4 =. Copyright (c) 2002 Dan Williams <williamsdr@acm.org>
5             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> 5             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org>
6           .>+-= 6           .>+-=
7 _;:,     .>    :=|. This file is free software; you can 7 _;:,     .>    :=|. This file is free software; you can
8.> <`_,   >  .   <= redistribute it and/or modify it under 8.> <`_,   >  .   <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU General Public 9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10.="- .-=="i,     .._ License as published by the Free Software 10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License, 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version. 12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_. 13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This file is distributed in the hope that 14    .i_,=:_.      -<s. This file is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details. 19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .: 20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU 21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file; 22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the 23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc., 24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330, 25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. 26 Boston, MA 02111-1307, USA.
27 27
28*/ 28*/
29 29
30#include "appearance.h" 30#include "appearance.h"
31#include "editScheme.h" 31#include "editScheme.h"
32#include "stylelistitem.h" 32#include "stylelistitem.h"
33#include "decolistitem.h" 33#include "decolistitem.h"
34#include "colorlistitem.h" 34#include "colorlistitem.h"
35#include "exceptlistitem.h" 35#include "exceptlistitem.h"
36#include "sample.h" 36#include "sample.h"
37 37
38/* OPIE */ 38/* OPIE */
39#include <opie2/odevice.h> 39#include <opie2/odevice.h>
40#include <opie2/ofiledialog.h> 40#include <opie2/ofiledialog.h>
41#include <opie2/otabwidget.h> 41#include <opie2/otabwidget.h>
42 42
43#include <qpe/config.h> 43#include <qpe/config.h>
44#include <qpe/global.h> 44#include <qpe/global.h>
45#include <qpe/qpeapplication.h> 45#include <qpe/qpeapplication.h>
46#include <qpe/qpemessagebox.h> 46#include <qpe/qpemessagebox.h>
47#include <qpe/qcopenvelope_qws.h> 47#include <qpe/qcopenvelope_qws.h>
48#include <qpe/qpestyle.h> 48#include <qpe/qpestyle.h>
49#include <qpe/lightstyle.h> 49#include <qpe/lightstyle.h>
50#include <qpe/styleinterface.h> 50#include <qpe/styleinterface.h>
51 51
52/* QT */ 52/* QT */
53#include <qbuttongroup.h> 53#include <qbuttongroup.h>
54#include <qcheckbox.h> 54#include <qcheckbox.h>
55#include <qcombobox.h> 55#include <qcombobox.h>
56#include <qdialog.h> 56#include <qdialog.h>
57#include <qdir.h> 57#include <qdir.h>
58#include <qlabel.h> 58#include <qlabel.h>
59#include <qlayout.h> 59#include <qlayout.h>
60#include <qlineedit.h> 60#include <qlineedit.h>
61#include <qlistbox.h> 61#include <qlistbox.h>
62#include <qmessagebox.h> 62#include <qmessagebox.h>
63#include <qpushbutton.h> 63#include <qpushbutton.h>
64#include <qradiobutton.h> 64#include <qradiobutton.h>
65#if QT_VERSION >= 300 65#if QT_VERSION >= 300
66#include <qstylefactory.h> 66#include <qstylefactory.h>
67#endif 67#endif
68#include <qtoolbutton.h> 68#include <qtoolbutton.h>
69#include <qwindowsstyle.h> 69#include <qwindowsstyle.h>
70#include <qlistview.h> 70#include <qlistview.h>
71#include <qheader.h> 71#include <qheader.h>
72#include <qvbox.h> 72#include <qvbox.h>
73#include <qwhatsthis.h> 73#include <qwhatsthis.h>
74 74
75using namespace Opie; 75using namespace Opie;
76 76using namespace Opie::Ui;
77using namespace Opie::Core;
77 78
78class DefaultWindowDecoration : public WindowDecorationInterface 79class DefaultWindowDecoration : public WindowDecorationInterface
79{ 80{
80public: 81public:
81 DefaultWindowDecoration() : ref(0) {} 82 DefaultWindowDecoration() : ref(0) {}
82 QString name() const 83 QString name() const
83 { 84 {
84 return "Default"; 85 return "Default";
85 } 86 }
86 QPixmap icon() const 87 QPixmap icon() const
87 { 88 {
88 return QPixmap(); 89 return QPixmap();
89 } 90 }
90 QRESULT queryInterface( const QUuid &uuid, QUnknownInterface **iface ) 91 QRESULT queryInterface( const QUuid &uuid, QUnknownInterface **iface )
91 { 92 {
92 *iface = 0; 93 *iface = 0;
93 if ( uuid == IID_QUnknown ) 94 if ( uuid == IID_QUnknown )
94 *iface = this; 95 *iface = this;
95 else if ( uuid == IID_WindowDecoration ) 96 else if ( uuid == IID_WindowDecoration )
96 *iface = this; 97 *iface = this;
97 98
98 if ( *iface ) 99 if ( *iface )
99 (*iface)->addRef(); 100 (*iface)->addRef();
100 return QS_OK; 101 return QS_OK;
101 } 102 }
102 Q_REFCOUNT 103 Q_REFCOUNT
103 104
104private: 105private:
105 ulong ref; 106 ulong ref;
106}; 107};
107 108
108 109
109 110
110 111
111 112
112 113
113 114
114QWidget *Appearance::createStyleTab ( QWidget *parent, Config &cfg ) 115QWidget *Appearance::createStyleTab ( QWidget *parent, Config &cfg )
115{ 116{
116 QWidget* tab = new QWidget( parent, "StyleTab" ); 117 QWidget* tab = new QWidget( parent, "StyleTab" );
117 QVBoxLayout* vertLayout = new QVBoxLayout( tab, 3, 3 ); 118 QVBoxLayout* vertLayout = new QVBoxLayout( tab, 3, 3 );
118 119
119 m_style_list = new QListBox( tab, "m_style_list" ); 120 m_style_list = new QListBox( tab, "m_style_list" );
120 vertLayout->addWidget( m_style_list ); 121 vertLayout->addWidget( m_style_list );
121 QWhatsThis::add( m_style_list, tr( "Styles control the way items such as buttons and scroll bars appear in all applications.\n\nClick here to select an available style." ) ); 122 QWhatsThis::add( m_style_list, tr( "Styles control the way items such as buttons and scroll bars appear in all applications.\n\nClick here to select an available style." ) );
122 123
123 m_style_settings = new QPushButton ( tr( "Settings..." ), tab ); 124 m_style_settings = new QPushButton ( tr( "Settings..." ), tab );
124 connect ( m_style_settings, SIGNAL( clicked()), this, SLOT( styleSettingsClicked())); 125 connect ( m_style_settings, SIGNAL( clicked()), this, SLOT( styleSettingsClicked()));
125 vertLayout-> addWidget ( m_style_settings ); 126 vertLayout-> addWidget ( m_style_settings );
126 QWhatsThis::add( m_style_settings, tr( "Click here to configure the currently selected style.\n\nNote: This option is not available for all styles." ) ); 127 QWhatsThis::add( m_style_settings, tr( "Click here to configure the currently selected style.\n\nNote: This option is not available for all styles." ) );
127 128
128 QString s = cfg. readEntry ( "Style", "Light" ); 129 QString s = cfg. readEntry ( "Style", "Light" );
129 130
130 131
131#if QT_VERSION >= 300 132#if QT_VERSION >= 300
132 m_style_list->insertStringList(QStyleFactory::styles()); 133 m_style_list->insertStringList(QStyleFactory::styles());
133#else 134#else
134 m_style_list-> insertItem ( new StyleListItem ( "Windows", new QWindowsStyle ( ))); 135 m_style_list-> insertItem ( new StyleListItem ( "Windows", new QWindowsStyle ( )));
135 m_style_list-> insertItem ( new StyleListItem ( "Light", new LightStyle ( ))); 136 m_style_list-> insertItem ( new StyleListItem ( "Light", new LightStyle ( )));
136 m_style_list-> insertItem ( new StyleListItem ( "QPE", new QPEStyle ( ))); 137 m_style_list-> insertItem ( new StyleListItem ( "QPE", new QPEStyle ( )));
137#endif 138#endif
138 139
139 { 140 {
140 QString path = QPEApplication::qpeDir ( ); 141 QString path = QPEApplication::qpeDir ( );
141 path.append( "/plugins/styles/" ); 142 path.append( "/plugins/styles/" );
142 QStringList sl = QDir ( path, "lib*.so" ). entryList ( ); 143 QStringList sl = QDir ( path, "lib*.so" ). entryList ( );
143 144
144 for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) 145 for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it )
145 { 146 {
146 QString libstr = path; 147 QString libstr = path;
147 libstr.append( "/" ); 148 libstr.append( "/" );
148 libstr.append( *it ); 149 libstr.append( *it );
149 QLibrary *lib = new QLibrary ( libstr ); 150 QLibrary *lib = new QLibrary ( libstr );
150 StyleInterface *iface; 151 StyleInterface *iface;
151 152
152 if (( lib-> queryInterface ( IID_Style, (QUnknownInterface **) &iface ) == QS_OK ) && iface ) 153 if (( lib-> queryInterface ( IID_Style, (QUnknownInterface **) &iface ) == QS_OK ) && iface )
153 { 154 {
154 StyleListItem *slit = new StyleListItem ( lib, iface ); 155 StyleListItem *slit = new StyleListItem ( lib, iface );
155 m_style_list-> insertItem ( slit ); 156 m_style_list-> insertItem ( slit );
156 157
157 if ( slit-> key ( ) == s ) 158 if ( slit-> key ( ) == s )
158 m_style_list-> setCurrentItem ( slit ); 159 m_style_list-> setCurrentItem ( slit );
159 } 160 }
160 else 161 else
161 delete lib; 162 delete lib;
162 } 163 }
163 } 164 }
164 165
165 m_original_style = m_style_list-> currentItem ( ); 166 m_original_style = m_style_list-> currentItem ( );
166 styleClicked ( m_original_style ); 167 styleClicked ( m_original_style );
167 168
168 connect( m_style_list, SIGNAL( highlighted(int) ), this, SLOT( styleClicked(int) ) ); 169 connect( m_style_list, SIGNAL( highlighted(int) ), this, SLOT( styleClicked(int) ) );
169 170
170 return tab; 171 return tab;
171} 172}
172 173
diff --git a/noncore/settings/appearance2/appearance.h b/noncore/settings/appearance2/appearance.h
index f45f549..134a918 100644
--- a/noncore/settings/appearance2/appearance.h
+++ b/noncore/settings/appearance2/appearance.h
@@ -1,132 +1,132 @@
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 =. Copyright (c) 2002 Dan Williams <williamsdr@acm.org>
4             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> 4             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org>
5           .>+-= 5           .>+-=
6 _;:,     .>    :=|. This file is free software; you can 6 _;:,     .>    :=|. This file is free software; you can
7.> <`_,   >  .   <= redistribute it and/or modify it under 7.> <`_,   >  .   <= redistribute it and/or modify it under
8:`=1 )Y*s>-.--   : the terms of the GNU General Public 8:`=1 )Y*s>-.--   : the terms of the GNU General Public
9.="- .-=="i,     .._ License as published by the Free Software 9.="- .-=="i,     .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; either version 2 of the License, 10 - .   .-<_>     .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version. 11     ._= =}       : or (at your option) any later version.
12    .%`+i>       _;_. 12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that 13    .i_,=:_.      -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of 15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details. 18..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .: 19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU 20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file; 21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the 22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc., 23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330, 24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#ifndef APPEARANCESETTINGS_H 29#ifndef APPEARANCESETTINGS_H
30#define APPEARANCESETTINGS_H 30#define APPEARANCESETTINGS_H
31 31
32#include <opie2/ofontselector.h> 32#include <opie2/ofontselector.h>
33 33
34#include <qpe/fontdatabase.h> 34#include <qpe/fontdatabase.h>
35 35
36#include <qdialog.h> 36#include <qdialog.h>
37 37
38using Opie::OFontSelector; 38using Opie::Ui::OFontSelector;
39 39
40class QCheckBox; 40class QCheckBox;
41class QComboBox; 41class QComboBox;
42class QLabel; 42class QLabel;
43class QLineEdit; 43class QLineEdit;
44class QListBox; 44class QListBox;
45class QMultiLineEdit; 45class QMultiLineEdit;
46class QPushButton; 46class QPushButton;
47class QRadioButton; 47class QRadioButton;
48class QToolButton; 48class QToolButton;
49class SampleWindow; 49class SampleWindow;
50class OFontSelector; 50namespace Opie {namespace Ui {class OFontSelector;}}
51class QListView; 51class QListView;
52class QListViewItem; 52class QListViewItem;
53class Config; 53class Config;
54 54
55class Appearance : public QDialog 55class Appearance : public QDialog
56{ 56{
57 Q_OBJECT 57 Q_OBJECT
58 58
59public: 59public:
60 Appearance( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); 60 Appearance( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
61 ~Appearance(); 61 ~Appearance();
62 static QString appName() { return QString::fromLatin1("appearance"); } 62 static QString appName() { return QString::fromLatin1("appearance"); }
63 63
64protected: 64protected:
65 virtual void accept ( ); 65 virtual void accept ( );
66 virtual void done ( int r ); 66 virtual void done ( int r );
67 67
68protected slots: 68protected slots:
69 void styleClicked ( int ); 69 void styleClicked ( int );
70 void styleSettingsClicked ( ); 70 void styleSettingsClicked ( );
71 void decoClicked ( int ); 71 void decoClicked ( int );
72 void fontClicked ( const QFont & ); 72 void fontClicked ( const QFont & );
73 void colorClicked ( int ); 73 void colorClicked ( int );
74 74
75 void editSchemeClicked(); 75 void editSchemeClicked();
76 void saveSchemeClicked(); 76 void saveSchemeClicked();
77 void deleteSchemeClicked(); 77 void deleteSchemeClicked();
78 78
79 void tabChanged ( QWidget * ); 79 void tabChanged ( QWidget * );
80 80
81 void addExcept ( ); 81 void addExcept ( );
82 void delExcept ( ); 82 void delExcept ( );
83 void upExcept ( ); 83 void upExcept ( );
84 void downExcept ( ); 84 void downExcept ( );
85 void clickedExcept ( QListViewItem *, const QPoint &, int ); 85 void clickedExcept ( QListViewItem *, const QPoint &, int );
86 86
87private: 87private:
88 void changeText(); 88 void changeText();
89 89
90 QWidget *createStyleTab ( QWidget *parent, Config &cfg ); 90 QWidget *createStyleTab ( QWidget *parent, Config &cfg );
91 QWidget *createDecoTab ( QWidget *parent, Config &cfg ); 91 QWidget *createDecoTab ( QWidget *parent, Config &cfg );
92 QWidget *createFontTab ( QWidget *parent, Config &cfg ); 92 QWidget *createFontTab ( QWidget *parent, Config &cfg );
93 QWidget *createColorTab ( QWidget *parent, Config &cfg ); 93 QWidget *createColorTab ( QWidget *parent, Config &cfg );
94 QWidget *createAdvancedTab ( QWidget *parent, Config &cfg ); 94 QWidget *createAdvancedTab ( QWidget *parent, Config &cfg );
95 95
96private: 96private:
97 bool m_style_changed; 97 bool m_style_changed;
98 bool m_font_changed; 98 bool m_font_changed;
99 bool m_scheme_changed; 99 bool m_scheme_changed;
100 bool m_deco_changed; 100 bool m_deco_changed;
101 bool m_color_changed; 101 bool m_color_changed;
102 102
103 int m_original_style; 103 int m_original_style;
104 int m_original_deco; 104 int m_original_deco;
105 int m_original_tabstyle; 105 int m_original_tabstyle;
106 bool m_original_tabpos; 106 bool m_original_tabpos;
107 107
108 QListBox * m_style_list; 108 QListBox * m_style_list;
109 QPushButton * m_style_settings; 109 QPushButton * m_style_settings;
110 110
111 QListBox * m_deco_list; 111 QListBox * m_deco_list;
112 112
113 QListBox * m_color_list; 113 QListBox * m_color_list;
114 114
115 OFontSelector *m_fontselect; 115 Opie::Ui::OFontSelector *m_fontselect;
116 116
117 SampleWindow *m_sample; 117 SampleWindow *m_sample;
118 118
119 QComboBox * m_tabstyle_list; 119 QComboBox * m_tabstyle_list;
120 QRadioButton *m_tabstyle_top; 120 QRadioButton *m_tabstyle_top;
121 QRadioButton *m_tabstyle_bottom; 121 QRadioButton *m_tabstyle_bottom;
122 122
123 QRadioButton *m_rotdir_cw; 123 QRadioButton *m_rotdir_cw;
124 QRadioButton *m_rotdir_ccw; 124 QRadioButton *m_rotdir_ccw;
125 QRadioButton *m_rotdir_flip; 125 QRadioButton *m_rotdir_flip;
126 126
127 QWidget * m_advtab; 127 QWidget * m_advtab;
128 QListView * m_except; 128 QListView * m_except;
129 QCheckBox * m_force; 129 QCheckBox * m_force;
130}; 130};
131 131
132#endif 132#endif
diff --git a/noncore/settings/appearance2/editScheme.cpp b/noncore/settings/appearance2/editScheme.cpp
index 0f3702f..18c69a5 100644
--- a/noncore/settings/appearance2/editScheme.cpp
+++ b/noncore/settings/appearance2/editScheme.cpp
@@ -1,73 +1,74 @@
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 =. Copyright (c) 2002 Dan Williams <williamsdr@acm.org>
4             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> 4             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org>
5           .>+-= 5           .>+-=
6 _;:,     .>    :=|. This file is free software; you can 6 _;:,     .>    :=|. This file is free software; you can
7.> <`_,   >  .   <= redistribute it and/or modify it under 7.> <`_,   >  .   <= redistribute it and/or modify it under
8:`=1 )Y*s>-.--   : the terms of the GNU General Public 8:`=1 )Y*s>-.--   : the terms of the GNU General Public
9.="- .-=="i,     .._ License as published by the Free Software 9.="- .-=="i,     .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; either version 2 of the License, 10 - .   .-<_>     .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version. 11     ._= =}       : or (at your option) any later version.
12    .%`+i>       _;_. 12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that 13    .i_,=:_.      -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of 15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details. 18..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .: 19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU 20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file; 21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the 22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc., 23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330, 24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#include "editScheme.h" 29#include "editScheme.h"
30 30
31#include <qaction.h> 31#include <qaction.h>
32#include <qlabel.h> 32#include <qlabel.h>
33#include <qlayout.h> 33#include <qlayout.h>
34#include <qpopupmenu.h> 34#include <qpopupmenu.h>
35#include <qscrollview.h> 35#include <qscrollview.h>
36#include <qtoolbutton.h> 36#include <qtoolbutton.h>
37#include <qwhatsthis.h> 37#include <qwhatsthis.h>
38 38
39using namespace Opie::Ui;
39EditScheme::EditScheme ( int cnt, const QString *labels, QColor *colors, QWidget* parent, const char* name, bool modal, WFlags ) 40EditScheme::EditScheme ( int cnt, const QString *labels, QColor *colors, QWidget* parent, const char* name, bool modal, WFlags )
40 : QDialog ( parent, name, modal, WStyle_ContextHelp ) 41 : QDialog ( parent, name, modal, WStyle_ContextHelp )
41{ 42{
42 setCaption ( tr( "Edit scheme" ) ); 43 setCaption ( tr( "Edit scheme" ) );
43 QGridLayout *layout = new QGridLayout ( this, 0, 0, 4, 4 ); 44 QGridLayout *layout = new QGridLayout ( this, 0, 0, 4, 4 );
44 45
45 m_count = cnt; 46 m_count = cnt;
46 m_buttons = new OColorButton * [cnt]; 47 m_buttons = new Opie::OColorButton * [cnt];
47 m_colors = colors; 48 m_colors = colors;
48 49
49 for ( int i = 0; i < cnt; i++ ) 50 for ( int i = 0; i < cnt; i++ )
50 { 51 {
51 QLabel *l = new QLabel ( labels [i], this ); 52 QLabel *l = new QLabel ( labels [i], this );
52 layout-> addWidget ( l, i, 0 ); 53 layout-> addWidget ( l, i, 0 );
53 QWhatsThis::add( l, tr( "Click here to select a color for: " ).arg( labels [i] ) ); 54 QWhatsThis::add( l, tr( "Click here to select a color for: " ).arg( labels [i] ) );
54 55
55 m_buttons [i] = new OColorButton ( this, colors [i] ); 56 m_buttons [i] = new Opie::OColorButton ( this, colors [i] );
56 layout-> addWidget ( m_buttons [i], i, 1 ); 57 layout-> addWidget ( m_buttons [i], i, 1 );
57 QWhatsThis::add( m_buttons [i], tr( "Click here to select a color for: " ).arg( labels [i] ) ); 58 QWhatsThis::add( m_buttons [i], tr( "Click here to select a color for: " ).arg( labels [i] ) );
58 } 59 }
59} 60}
60 61
61EditScheme::~EditScheme ( ) 62EditScheme::~EditScheme ( )
62{ 63{
63 delete [] m_buttons; 64 delete [] m_buttons;
64} 65}
65 66
66void EditScheme::accept ( ) 67void EditScheme::accept ( )
67{ 68{
68 for ( int i = 0; i < m_count; i++ ) 69 for ( int i = 0; i < m_count; i++ )
69 m_colors [i] = m_buttons [i]-> color ( ); 70 m_colors [i] = m_buttons [i]-> color ( );
70 71
71 QDialog::accept ( ); 72 QDialog::accept ( );
72} 73}
73 74
diff --git a/noncore/settings/appearance2/editScheme.h b/noncore/settings/appearance2/editScheme.h
index c7539cb..302652c 100644
--- a/noncore/settings/appearance2/editScheme.h
+++ b/noncore/settings/appearance2/editScheme.h
@@ -1,57 +1,55 @@
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 =. Copyright (c) 2002 Dan Williams <williamsdr@acm.org>
4             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> 4             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org>
5           .>+-= 5           .>+-=
6 _;:,     .>    :=|. This file is free software; you can 6 _;:,     .>    :=|. This file is free software; you can
7.> <`_,   >  .   <= redistribute it and/or modify it under 7.> <`_,   >  .   <= redistribute it and/or modify it under
8:`=1 )Y*s>-.--   : the terms of the GNU General Public 8:`=1 )Y*s>-.--   : the terms of the GNU General Public
9.="- .-=="i,     .._ License as published by the Free Software 9.="- .-=="i,     .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; either version 2 of the License, 10 - .   .-<_>     .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version. 11     ._= =}       : or (at your option) any later version.
12    .%`+i>       _;_. 12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that 13    .i_,=:_.      -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of 15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details. 18..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .: 19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU 20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file; 21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the 22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc., 23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330, 24 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#ifndef EDITSCHEME_H 29#ifndef EDITSCHEME_H
30#define EDITSCHEME_H 30#define EDITSCHEME_H
31 31
32#include <opie2/ocolorbutton.h> 32#include <opie2/ocolorbutton.h>
33 33
34#include <qdialog.h> 34#include <qdialog.h>
35 35
36using Opie::OColorButton;
37
38class QColor; 36class QColor;
39class OColorButton; 37namespace Opie {namespace Ui {class OColor;}}
40 38
41class EditScheme : public QDialog { 39class EditScheme : public QDialog {
42 Q_OBJECT 40 Q_OBJECT
43 41
44public: 42public:
45 EditScheme ( int cnt, const QString *labels, QColor *colors, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); 43 EditScheme ( int cnt, const QString *labels, QColor *colors, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
46 virtual ~EditScheme ( ); 44 virtual ~EditScheme ( );
47 45
48protected slots: 46protected slots:
49 virtual void accept ( ); 47 virtual void accept ( );
50 48
51private: 49private:
52 int m_count; 50 int m_count;
53 QColor *m_colors; 51 QColor *m_colors;
54 OColorButton **m_buttons; 52 Opie::OColorButton **m_buttons;
55}; 53};
56 54
57#endif 55#endif
diff --git a/noncore/settings/appearance2/main.cpp b/noncore/settings/appearance2/main.cpp
index 8ac45d8..87061e3 100644
--- a/noncore/settings/appearance2/main.cpp
+++ b/noncore/settings/appearance2/main.cpp
@@ -1,33 +1,34 @@
1/* 1/*
2               =. This file is part of the OPIE Project 2               =. This file is part of the OPIE Project
3             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> 3             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org>
4           .>+-= 4           .>+-=
5 _;:,     .>    :=|. This file is free software; you can 5 _;:,     .>    :=|. This file is free software; you can
6.> <`_,   >  .   <= redistribute it and/or modify it under 6.> <`_,   >  .   <= redistribute it and/or modify it under
7:`=1 )Y*s>-.--   : the terms of the GNU General Public 7:`=1 )Y*s>-.--   : the terms of the GNU General Public
8.="- .-=="i,     .._ License as published by the Free Software 8.="- .-=="i,     .._ License as published by the Free Software
9 - .   .-<_>     .<> Foundation; either version 2 of the License, 9 - .   .-<_>     .<> Foundation; either version 2 of the License,
10     ._= =}       : or (at your option) any later version. 10     ._= =}       : or (at your option) any later version.
11    .%`+i>       _;_. 11    .%`+i>       _;_.
12    .i_,=:_.      -<s. This file is distributed in the hope that 12    .i_,=:_.      -<s. This file is distributed in the hope that
13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
14    : ..    .:,     . . . without even the implied warranty of 14    : ..    .:,     . . . without even the implied warranty of
15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
17..}^=.=       =       ; Public License for more details. 17..}^=.=       =       ; Public License for more details.
18++=   -.     .`     .: 18++=   -.     .`     .:
19 :     =  ...= . :.=- You should have received a copy of the GNU 19 :     =  ...= . :.=- You should have received a copy of the GNU
20 -.   .:....=;==+<; General Public License along with this file; 20 -.   .:....=;==+<; General Public License along with this file;
21  -_. . .   )=.  = see the file COPYING. If not, write to the 21  -_. . .   )=.  = see the file COPYING. If not, write to the
22    --        :-=` Free Software Foundation, Inc., 22    --        :-=` Free Software Foundation, Inc.,
23 59 Temple Place - Suite 330, 23 59 Temple Place - Suite 330,
24 Boston, MA 02111-1307, USA. 24 Boston, MA 02111-1307, USA.
25 25
26*/ 26*/
27 27
28#include "appearance.h" 28#include "appearance.h"
29 29
30#include <opie2/oapplicationfactory.h> 30#include <opie2/oapplicationfactory.h>
31 31
32 32
33using namespace Opie::Core;
33OPIE_EXPORT_APP( OApplicationFactory<Appearance> ) 34OPIE_EXPORT_APP( OApplicationFactory<Appearance> )