From 3a422983abc7342c9229dccac825d0608fca10f3 Mon Sep 17 00:00:00 2001 From: sandman Date: Sat, 06 Jul 2002 16:42:29 +0000 Subject: 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) --- (limited to 'noncore') 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 @@ -3,11 +3,15 @@ CONFIG = qt embedded release warn_on SOURCES = liquid.cpp \ liquiddeco.cpp \ effects.cpp \ + liquidset.cpp \ plugin.cpp HEADERS = liquid.h \ liquiddeco.h \ - effects.h + effects.h \ + liquidset.h \ + plugin.h + LIBS += -lqpe INCLUDEPATH += $(OPIEDIR)/include DESTDIR = $(OPIEDIR)/plugins/styles 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 @@ -21,7 +21,7 @@ #include "liquidset.h" -#include "../liquid.h" +#include "liquid.h" #include #include @@ -57,8 +57,8 @@ static void changeButtonColor ( QWidget *btn, const QColor &col ) } -LiquidSet::LiquidSet ( QWidget* parent, const char *name, WFlags fl ) - : QDialog ( parent, name, fl ) +LiquidSettings::LiquidSettings ( QWidget* parent, const char *name, WFlags fl ) + : QWidget ( parent, name, fl ) { setCaption ( tr( "Liquid Style" ) ); @@ -122,7 +122,7 @@ LiquidSet::LiquidSet ( QWidget* parent, const char *name, WFlags fl ) QPopupMenu *popup; - popup = new ColorPopupMenu ( m_menucol, this ); + popup = new ColorPopupMenu ( m_menucol, 0 ); m_menubtn-> setPopup ( popup ); m_menubtn-> setPopupDelay ( 0 ); connect ( popup, SIGNAL( colorSelected ( const QColor & )), this, SLOT( changeMenuColor ( const QColor & ))); @@ -131,7 +131,7 @@ LiquidSet::LiquidSet ( QWidget* parent, const char *name, WFlags fl ) m_textbtn = new QToolButton ( this ); grid-> addWidget ( m_textbtn, 0, 5 ); - popup = new ColorPopupMenu ( m_textcol, this ); + popup = new ColorPopupMenu ( m_textcol, 0 ); m_textbtn-> setPopup ( popup ); m_textbtn-> setPopupDelay ( 0 ); connect ( popup, SIGNAL( colorSelected ( const QColor & )), this, SLOT( changeTextColor ( const QColor & ))); @@ -176,7 +176,7 @@ LiquidSet::LiquidSet ( QWidget* parent, const char *name, WFlags fl ) connect ( windeco, SIGNAL( toggled ( bool ) ), this, SLOT( changeDeco ( bool ) ) ); } -void LiquidSet::changeType ( int t ) +void LiquidSettings::changeType ( int t ) { bool custom = ( t == Custom ); @@ -190,30 +190,30 @@ void LiquidSet::changeType ( int t ) m_type = t; } -void LiquidSet::changeMenuColor ( const QColor &col ) +void LiquidSettings::changeMenuColor ( const QColor &col ) { changeButtonColor ( m_menubtn, col ); m_menucol = col; } -void LiquidSet::changeTextColor ( const QColor &col ) +void LiquidSettings::changeTextColor ( const QColor &col ) { changeButtonColor ( m_textbtn, col ); m_textcol = col; } -void LiquidSet::changeShadow ( bool b ) +void LiquidSettings::changeShadow ( bool b ) { m_shadow = b; } -void LiquidSet::changeDeco ( bool b ) +void LiquidSettings::changeDeco ( bool b ) { m_deco = b; } -void LiquidSet::accept ( ) +bool LiquidSettings::writeConfig ( ) { Config config ( "qpe" ); config. setGroup ( "Liquid-Style" ); @@ -227,8 +227,6 @@ void LiquidSet::accept ( ) config. writeEntry ( "StippleContrast", m_contsld-> value ( )); config. write ( ); - Global::applyStyle ( ); - - QDialog::accept ( ); + return true; } 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 @@ -8,11 +8,11 @@ class QLabel; class QToolButton; class QSlider; -class LiquidSet : public QDialog { +class LiquidSettings : public QWidget { Q_OBJECT public: - LiquidSet ( QWidget *parent = 0, const char *name = 0, WFlags fl = 0 ); + LiquidSettings ( QWidget *parent = 0, const char *name = 0, WFlags fl = 0 ); public slots: void changeType ( int t ); @@ -21,8 +21,7 @@ public slots: void changeShadow ( bool b ); void changeDeco ( bool b ); -protected: - virtual void accept ( ); + virtual bool writeConfig ( ); private: QColor m_menucol; 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,4 +1,4 @@ -Files: plugins/styles/libliquid.so* bin/liquid-settings apps/Settings/Liquid.desktop pics/liquid/Liquid.png +Files: plugins/styles/libliquid.so* Priority: optional Section: opie/system Maintainer: Robert Griebl 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 @@ #include "liquid.h" +#include "liquidset.h" +#include "plugin.h" -extern "C" { - QStyle* allocate ( ); - int minor_version ( ); - int major_version ( ); - const char *description ( ); + +LiquidInterface::LiquidInterface ( ) : ref ( 0 ) +{ +} + +LiquidInterface::~LiquidInterface ( ) +{ +} + +QStyle *LiquidInterface::create ( ) +{ + return new LiquidStyle ( ); +} + +QString LiquidInterface::name ( ) +{ + return QObject::tr( "Liquid", "name" ); +} + +QString LiquidInterface::description ( ) +{ + return QObject::tr( "High Performance Liquid style by Mosfet", "description" ); +} + +QCString LiquidInterface::key ( ) +{ + return QCString ( "liquid" ); +} + +unsigned int LiquidInterface::version ( ) +{ + return 100; // 1.0.0 (\d+.\d.\d) +} + +QRESULT LiquidInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) +{ + static LiquidSettingsInterface *setiface = 0; + + *iface = 0; + + if ( uuid == IID_QUnknown ) + *iface = this; + else if ( uuid == IID_Style ) + *iface = this; + else if ( uuid == IID_StyleSettings ) { + if ( !setiface ) + setiface = new LiquidSettingsInterface ( ); + *iface = setiface; + } + + if ( *iface ) + (*iface)-> addRef ( ); + + return QS_OK; +} + +Q_EXPORT_INTERFACE() +{ + Q_CREATE_INSTANCE( LiquidInterface ) } -QStyle* allocate ( ) + +LiquidSettingsInterface::LiquidSettingsInterface ( ) : ref ( 0 ) +{ + m_widget = 0; +} + +LiquidSettingsInterface::~LiquidSettingsInterface ( ) { - return new LiquidStyle ( ); +} + +QWidget *LiquidSettingsInterface::create ( QWidget *parent, const char *name ) +{ + m_widget = new LiquidSettings ( parent, name ? name : "LIQUID-SETTINGS" ); + + return m_widget; } -int minor_version ( ) +bool LiquidSettingsInterface::accept ( ) { - return 0; + if ( !m_widget ) + return false; + + return m_widget-> writeConfig ( ); } -int major_version ( ) +void LiquidSettingsInterface::reject ( ) { - return 1; } -const char *description ( ) +QRESULT LiquidSettingsInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) { - return "High Performance Liquid"; + *iface = 0; + + + if ( uuid == IID_QUnknown ) + *iface = this; + else if ( uuid == IID_StyleSettings ) + *iface = this; + + if ( *iface ) + (*iface)-> addRef ( ); + + return QS_OK; } + 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 @@ +#ifndef __OPIE_LIQUID_PLUGIN_H__ +#define __OPIE_LIQUID_PLUGIN_H__ + +#include + +class LiquidSettings; + +class LiquidInterface : public StyleInterface { +public: + LiquidInterface ( ); + virtual ~LiquidInterface ( ); + + QRESULT queryInterface ( const QUuid &, QUnknownInterface ** ); + Q_REFCOUNT + + virtual QStyle *create ( ); + + virtual QString description ( ); + virtual QString name ( ); + virtual QCString key ( ); + + virtual unsigned int version ( ); + +private: + ulong ref; +}; + +class LiquidSettingsInterface : public StyleSettingsInterface { +public: + LiquidSettingsInterface ( ); + virtual ~LiquidSettingsInterface ( ); + + QRESULT queryInterface ( const QUuid &, QUnknownInterface ** ); + Q_REFCOUNT + + virtual QWidget *create ( QWidget *parent, const char *name = 0 ); + + virtual bool accept ( ); + virtual void reject ( ); + +private: + LiquidSettings *m_widget; + ulong ref; +}; + +#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 @@ -Makefile* -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 @@ -/********************************************************************** -** Copyright (C) 2000 Trolltech AS. All rights reserved. -** -** This file is part of Qtopia Environment. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -** See http://www.trolltech.com/gpl/ for GPL licensing information. -** -** Contact info@trolltech.com if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -#include "liquidset.h" - -#include - - -int main ( int argc, char** argv ) -{ - QPEApplication a ( argc, argv ); - - LiquidSet dlg; - a. showMainWidget ( &dlg ); - - return a. exec ( ); -} 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 @@ -TEMPLATE = app -CONFIG += qt warn_on release -DESTDIR = $(OPIEDIR)/bin -HEADERS = liquidset.h -SOURCES = liquidset.cpp main.cpp -INCLUDEPATH += $(OPIEDIR)/include -DEPENDPATH += ../$(OPIEDIR)/include -LIBS += -lqpe -lopie -TARGET = liquid-settings - -TRANSLATIONS = ../../../../i18n/de/liquid-settings.ts \ - ../../../../i18n/en/liquid-settings.ts \ - ../../../../i18n/es/liquid-settings.ts \ - ../../../../i18n/fr/liquid-settings.ts \ - ../../../../i18n/hu/liquid-settings.ts \ - ../../../../i18n/ja/liquid-settings.ts \ - ../../../../i18n/ko/liquid-settings.ts \ - ../../../../i18n/no/liquid-settings.ts \ - ../../../../i18n/pl/liquid-settings.ts \ - ../../../../i18n/pt/liquid-settings.ts \ - ../../../../i18n/pt_BR/liquid-settings.ts \ - ../../../../i18n/sl/liquid-settings.ts \ - ../../../../i18n/zh_CN/liquid-settings.ts \ - ../../../../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 @@ -2,7 +2,7 @@ TEMPLATE = lib CONFIG = qt embedded release warn_on SOURCES = metal.cpp plugin.cpp -HEADERS = metal.h +HEADERS = metal.h plugin.h LIBS += -lqpe INCLUDEPATH += $(OPIEDIR)/include DESTDIR = $(OPIEDIR)/plugins/styles 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 @@ #include "metal.h" +#include "plugin.h" -extern "C" { - QStyle* allocate ( ); - int minor_version ( ); - int major_version ( ); - const char *description ( ); +MetalInterface::MetalInterface ( ) : ref ( 0 ) +{ +} + +MetalInterface::~MetalInterface ( ) +{ +} + +QStyle *MetalInterface::create ( ) +{ + return new MetalStyle ( ); +} + +QString MetalInterface::name ( ) +{ + return QObject::tr( "Metal", "name" ); +} + +QString MetalInterface::description ( ) +{ + return QObject::tr( "Metal style", "description" ); } -QStyle* allocate ( ) +QCString MetalInterface::key ( ) { - return new MetalStyle ( ); + return QCString ( "metal" ); } -int minor_version ( ) +unsigned int MetalInterface::version ( ) { - return 0; + return 100; // 1.0.0 (\d+.\d.\d) } -int major_version ( ) +QRESULT MetalInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) { - return 1; + *iface = 0; + + if ( uuid == IID_QUnknown ) + *iface = this; + else if ( uuid == IID_Style ) + *iface = this; + + if ( *iface ) + (*iface)-> addRef ( ); + + return QS_OK; } -const char *description ( ) +Q_EXPORT_INTERFACE() { - return "Metal style plugin"; + Q_CREATE_INSTANCE( MetalInterface ) } + 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 @@ +#ifndef __OPIE_METAL_PLUGIN_H__ +#define __OPIE_METAL_PLUGIN_H__ + +#include + + +class MetalInterface : public StyleInterface { +public: + MetalInterface ( ); + virtual ~MetalInterface ( ); + + QRESULT queryInterface ( const QUuid &, QUnknownInterface ** ); + Q_REFCOUNT + + virtual QStyle *create ( ); + + virtual QString description ( ); + virtual QString name ( ); + virtual QCString key ( ); + + virtual unsigned int version ( ); + +private: + ulong ref; +}; + +#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,4 +1,4 @@ -Files: plugins/styles/libtheme.so* bin/theme-settings apps/Settings/Theme.desktop pics/theme/Theme.png +Files: plugins/styles/libtheme.so* Priority: optional Section: opie/system Maintainer: Robert Griebl 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 @@ -//#include #include "othemestyle.h" +#include "themeset.h" +#include "plugin.h" -extern "C" + + +ThemeInterface::ThemeInterface ( ) : ref ( 0 ) { - QStyle * allocate() { - return new OThemeStyle ( "" ); - } - int minor_version() { - return 0; - } - int major_version() { - return 1; - } - const char * description() { - return ( "Theme Style" ); +} + +ThemeInterface::~ThemeInterface ( ) +{ +} + +QStyle *ThemeInterface::create ( ) +{ + return new OThemeStyle ( "" ); +} + +QString ThemeInterface::name ( ) +{ + return QObject::tr( "Themed style", "name" ); +} + +QString ThemeInterface::description ( ) +{ + return QObject::tr( "KDE2 theme compatible style engine", "description" ); +} + +QCString ThemeInterface::key ( ) +{ + return QCString ( "theme" ); +} + +unsigned int ThemeInterface::version ( ) +{ + return 100; // 1.0.0 (\d+.\d.\d) +} + +QRESULT ThemeInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) +{ + static ThemeSettingsInterface *setiface = 0; + + *iface = 0; + + if ( uuid == IID_QUnknown ) + *iface = this; + else if ( uuid == IID_Style ) + *iface = this; + else if ( uuid == IID_StyleSettings ) { + if ( !setiface ) + setiface = new ThemeSettingsInterface ( ); + *iface = setiface; } + + if ( *iface ) + (*iface)-> addRef ( ); + + return QS_OK; +} + +Q_EXPORT_INTERFACE() +{ + Q_CREATE_INSTANCE( ThemeInterface ) +} + + +ThemeSettingsInterface::ThemeSettingsInterface ( ) : ref ( 0 ) +{ + m_widget = 0; +} + +ThemeSettingsInterface::~ThemeSettingsInterface ( ) +{ +} + +QWidget *ThemeSettingsInterface::create ( QWidget *parent, const char *name ) +{ + m_widget = new ThemeSettings ( parent, name ? name : "THEME-SETTINGS" ); + + return m_widget; +} + +bool ThemeSettingsInterface::accept ( ) +{ + if ( !m_widget ) + return false; + + return m_widget-> writeConfig ( ); +} + +void ThemeSettingsInterface::reject ( ) +{ +} + +QRESULT ThemeSettingsInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) +{ + *iface = 0; + + + if ( uuid == IID_QUnknown ) + *iface = this; + else if ( uuid == IID_StyleSettings ) + *iface = this; + + if ( *iface ) + (*iface)-> addRef ( ); + + return QS_OK; } 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 @@ +#ifndef __OPIE_THEME_PLUGIN_H__ +#define __OPIE_THEME_PLUGIN_H__ + +#include + +class ThemeSettings; + +class ThemeInterface : public StyleInterface { +public: + ThemeInterface ( ); + virtual ~ThemeInterface ( ); + + QRESULT queryInterface ( const QUuid &, QUnknownInterface ** ); + Q_REFCOUNT + + virtual QStyle *create ( ); + + virtual QString description ( ); + virtual QString name ( ); + virtual QCString key ( ); + + virtual unsigned int version ( ); + +private: + ulong ref; +}; + +class ThemeSettingsInterface : public StyleSettingsInterface { +public: + ThemeSettingsInterface ( ); + virtual ~ThemeSettingsInterface ( ); + + QRESULT queryInterface ( const QUuid &, QUnknownInterface ** ); + Q_REFCOUNT + + virtual QWidget *create ( QWidget *parent, const char *name = 0 ); + + virtual bool accept ( ); + virtual void reject ( ); + +private: + ThemeSettings *m_widget; + ulong ref; +}; + +#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 @@ -/********************************************************************** -** Copyright (C) 2000 Trolltech AS. All rights reserved. -** -** This file is part of Qtopia Environment. -** -** This file may be distributed and/or modified under the terms of the -** GNU General Public License version 2 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -** See http://www.trolltech.com/gpl/ for GPL licensing information. -** -** Contact info@trolltech.com if any conditions of this licensing are -** not clear to you. -** -**********************************************************************/ - -#include "themeset.h" - -#include - - -int main ( int argc, char** argv ) -{ - QPEApplication a ( argc, argv ); - - ThemeSet dlg; - a. showMainWidget ( &dlg ); - - return a. exec ( ); -} 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 @@ -TEMPLATE = app -CONFIG += qt warn_on release -DESTDIR = $(OPIEDIR)/bin -HEADERS = themeset.h -SOURCES = themeset.cpp main.cpp -INCLUDEPATH += $(OPIEDIR)/include -DEPENDPATH += ../$(OPIEDIR)/include -LIBS += -lqpe -TARGET = theme-settings - -TRANSLATIONS = ../../../../i18n/de/theme-settings.ts \ - ../../../../i18n/en/theme-settings.ts \ - ../../../../i18n/es/theme-settings.ts \ - ../../../../i18n/fr/theme-settings.ts \ - ../../../../i18n/hu/theme-settings.ts \ - ../../../../i18n/ja/theme-settings.ts \ - ../../../../i18n/ko/theme-settings.ts \ - ../../../../i18n/no/theme-settings.ts \ - ../../../../i18n/pl/theme-settings.ts \ - ../../../../i18n/pt/theme-settings.ts \ - ../../../../i18n/pt_BR/theme-settings.ts \ - ../../../../i18n/sl/theme-settings.ts \ - ../../../../i18n/zh_CN/theme-settings.ts \ - ../../../../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 @@ -#ifndef __OPIE_THEME_SET_H__ -#define __OPIE_THEME_SET_H__ - -#include - -class QListView; - -class ThemeSet : public QDialog { - Q_OBJECT - -public: - ThemeSet ( QWidget *parent = 0, const char *name = 0, WFlags fl = 0 ); - -protected: - virtual void accept ( ); - -private: - QListView *m_list; -}; -#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 @@ -3,11 +3,14 @@ CONFIG = qt embedded debug warn_on SOURCES = ogfxeffect.cpp \ othemestyle.cpp \ othemebase.cpp \ + themeset.cpp \ plugin.cpp HEADERS = ogfxeffect.h \ othemebase.h \ - othemestyle.h + othemestyle.h \ + themeset.h \ + plugin.h LIBS += -lqpe 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 @@ -59,8 +59,8 @@ public: }; -ThemeSet::ThemeSet ( QWidget* parent, const char *name, WFlags fl ) - : QDialog ( parent, name, fl ) +ThemeSettings::ThemeSettings ( QWidget* parent, const char *name, WFlags fl ) + : QWidget ( parent, name, fl ) { setCaption ( tr( "Theme Style" ) ); @@ -109,16 +109,15 @@ ThemeSet::ThemeSet ( QWidget* parent, const char *name, WFlags fl ) } } -void ThemeSet::accept ( ) +bool ThemeSettings::writeConfig ( ) { Config config ( "qpe" ); config. setGroup ( "Appearance" ); MyItem *it = (MyItem *) m_list-> selectedItem ( ); config. writeEntry ( "Theme", it ? it-> m_theme : QString ( "" )); + config. write ( ); - Global::applyStyle ( ); - - QDialog::accept ( ); + return true; } 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 @@ +#ifndef __OPIE_THEME_SETTINGS_H__ +#define __OPIE_THEME_SETTINGS_H__ + +#include + +class QListView; + +class ThemeSettings : public QWidget { + Q_OBJECT + +public: + ThemeSettings ( QWidget *parent = 0, const char *name = 0, WFlags fl = 0 ); + +public: + virtual bool writeConfig ( ); + +private: + QListView *m_list; +}; +#endif -- cgit v0.9.0.2