Changed: #1206 Correct works new settings dialog.

This commit is contained in:
dnk-88 2011-01-16 14:28:22 +02:00
parent 9c74caa529
commit e275b717a4
7 changed files with 12 additions and 10 deletions

View file

@ -8,7 +8,7 @@ SET(OVQT_EXT_SYS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin.
${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin_manager.h ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin_manager.h
${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin_spec.h) ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin_spec.h)
SET(OVQT_CORE_PLUGIN_HDR SET(OVQT_CORE_PLUGIN_HDR
ioptions_page.h ioptions_page.h
core_plugin.h core_plugin.h
core_constants.h core_constants.h

View file

@ -31,12 +31,9 @@ namespace Core
@details You need to subclass this interface and put an instance of your subclass @details You need to subclass this interface and put an instance of your subclass
into the plugin manager object pool. into the plugin manager object pool.
*/ */
class IOptionsPage : public QObject class IOptionsPage
{ {
Q_OBJECT
public: public:
IOptionsPage(QObject *parent = 0) : QObject(parent) {}
virtual ~IOptionsPage() {}
/// id() is a unique identifier for referencing this page /// id() is a unique identifier for referencing this page
virtual QString id() const = 0; virtual QString id() const = 0;
@ -63,4 +60,6 @@ public:
} // namespace Core } // namespace Core
Q_DECLARE_INTERFACE(Core::IOptionsPage, "dev.ryzom.com.IOptionsPage/1.0")
#endif // IOPTIONSPAGE_H #endif // IOPTIONSPAGE_H

View file

@ -28,7 +28,7 @@ namespace Core
{ {
CSearchPathsSettingsPage::CSearchPathsSettingsPage(QObject *parent) CSearchPathsSettingsPage::CSearchPathsSettingsPage(QObject *parent)
: IOptionsPage(parent), : QObject(parent),
_currentPage(NULL) _currentPage(NULL)
{ {
} }

View file

@ -32,9 +32,10 @@ namespace Core
/** /**
@class CSearchPathsSettingsPage @class CSearchPathsSettingsPage
*/ */
class CSearchPathsSettingsPage : public IOptionsPage class CSearchPathsSettingsPage : public QObject, public IOptionsPage
{ {
Q_OBJECT Q_OBJECT
Q_INTERFACES(IOptionsPage)
public: public:
CSearchPathsSettingsPage(QObject *parent = 0); CSearchPathsSettingsPage(QObject *parent = 0);
virtual ~CSearchPathsSettingsPage() {} virtual ~CSearchPathsSettingsPage() {}

View file

@ -18,6 +18,7 @@
#include "settings_dialog.h" #include "settings_dialog.h"
#include "nel/misc/debug.h"
// Qt includes // Qt includes
#include <QtGui/QHeaderView> #include <QtGui/QHeaderView>
#include <QtGui/QPushButton> #include <QtGui/QPushButton>
@ -64,7 +65,7 @@ CSettingsDialog::CSettingsDialog(ExtensionSystem::IPluginManager *pluginManager,
QList<QObject *> all = _plugMan->allObjects(); QList<QObject *> all = _plugMan->allObjects();
Q_FOREACH(QObject *obj, all) Q_FOREACH(QObject *obj, all)
{ {
IOptionsPage *page = dynamic_cast<IOptionsPage *>(obj); IOptionsPage *page = qobject_cast<IOptionsPage *>(obj);
if (page) if (page)
pages.append(page); pages.append(page);
} }

View file

@ -28,7 +28,7 @@ namespace Plugin
{ {
CExampleSettingsPage::CExampleSettingsPage(QObject *parent) CExampleSettingsPage::CExampleSettingsPage(QObject *parent)
: IOptionsPage(parent), : QObject(parent),
_currentPage(NULL) _currentPage(NULL)
{ {
} }

View file

@ -32,9 +32,10 @@ namespace Plugin
/** /**
@class CExampleSettingsPage @class CExampleSettingsPage
*/ */
class CExampleSettingsPage : public Core::IOptionsPage class CExampleSettingsPage : public QObject, public Core::IOptionsPage
{ {
Q_OBJECT Q_OBJECT
Q_INTERFACES(Core::IOptionsPage)
public: public:
CExampleSettingsPage(QObject *parent = 0); CExampleSettingsPage(QObject *parent = 0);
virtual ~CExampleSettingsPage() {} virtual ~CExampleSettingsPage() {}