summaryrefslogtreecommitdiff
path: root/noncore/styles/theme/plugin.cpp
authorsandman <sandman>2002-10-04 01:42:57 (UTC)
committer sandman <sandman>2002-10-04 01:42:57 (UTC)
commit4a6ccb87f45065bc37f801adb61c3462f870cb92 (patch) (side-by-side diff)
tree86b6819ee7a13b8df82b14b2bdcf46741b5935a0 /noncore/styles/theme/plugin.cpp
parentb7ec6d0674f0f7835da7f114683dcfa74e6bc546 (diff)
downloadopie-4a6ccb87f45065bc37f801adb61c3462f870cb92.zip
opie-4a6ccb87f45065bc37f801adb61c3462f870cb92.tar.gz
opie-4a6ccb87f45065bc37f801adb61c3462f870cb92.tar.bz2
- ported all OPIE styles to the new Qtopia compatible style interface
- some cleanup in liquid (unused code)
Diffstat (limited to 'noncore/styles/theme/plugin.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/styles/theme/plugin.cpp80
1 files changed, 25 insertions, 55 deletions
diff --git a/noncore/styles/theme/plugin.cpp b/noncore/styles/theme/plugin.cpp
index 4383693..2560720 100644
--- a/noncore/styles/theme/plugin.cpp
+++ b/noncore/styles/theme/plugin.cpp
@@ -1,3 +1,5 @@
+#include <qapplication.h>
+
#include "othemestyle.h"
#include "themeset.h"
#include "plugin.h"
@@ -6,82 +8,41 @@
ThemeInterface::ThemeInterface ( ) : ref ( 0 )
{
+ m_widget = 0;
}
ThemeInterface::~ThemeInterface ( )
{
}
-QStyle *ThemeInterface::create ( )
+QStyle *ThemeInterface::style ( )
{
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 ( )
+QString ThemeInterface::name ( ) const
{
- return 100; // 1.0.0 (\d+.\d.\d)
+ return qApp-> translate ( "Styles", "Themed style" );
}
-QRESULT ThemeInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface )
+QString ThemeInterface::description ( ) const
{
- 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;
+ return qApp-> translate ( "Styles", "KDE2 theme compatible style engine" );
}
-Q_EXPORT_INTERFACE()
+bool ThemeInterface::hasSettings ( ) const
{
- Q_CREATE_INSTANCE( ThemeInterface )
+ return true;
}
-
-ThemeSettingsInterface::ThemeSettingsInterface ( ) : ref ( 0 )
-{
- m_widget = 0;
-}
-
-ThemeSettingsInterface::~ThemeSettingsInterface ( )
-{
-}
-
-QWidget *ThemeSettingsInterface::create ( QWidget *parent, const char *name )
+QWidget *ThemeInterface::create ( QWidget *parent, const char *name )
{
m_widget = new ThemeSettings ( parent, name ? name : "THEME-SETTINGS" );
return m_widget;
}
-bool ThemeSettingsInterface::accept ( )
+bool ThemeInterface::accept ( )
{
if ( !m_widget )
return false;
@@ -89,18 +50,20 @@ bool ThemeSettingsInterface::accept ( )
return m_widget-> writeConfig ( );
}
-void ThemeSettingsInterface::reject ( )
+void ThemeInterface::reject ( )
{
}
-QRESULT ThemeSettingsInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface )
+
+QRESULT ThemeInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface )
{
*iface = 0;
-
if ( uuid == IID_QUnknown )
*iface = this;
- else if ( uuid == IID_StyleSettings )
+ else if ( uuid == IID_Style )
+ *iface = this;
+ else if ( uuid == IID_StyleExtended )
*iface = this;
if ( *iface )
@@ -109,3 +72,10 @@ QRESULT ThemeSettingsInterface::queryInterface ( const QUuid &uuid, QUnknownInte
return QS_OK;
}
+Q_EXPORT_INTERFACE()
+{
+ Q_CREATE_INSTANCE( ThemeInterface )
+}
+
+
+