Changed: Merged in latest API changes to OVQT plugin system.

This commit is contained in:
sfb 2011-05-31 07:34:42 -05:00
parent 4dd8f89943
commit 37dc120e69
5 changed files with 43 additions and 26 deletions

View file

@ -77,7 +77,7 @@ ZonePainterMainWindow::ZonePainterMainWindow(QWidget *parent) :
Core::ICore::instance()->mainWindow()->statusBar()->addPermanentWidget(m_statusInfo); Core::ICore::instance()->mainWindow()->statusBar()->addPermanentWidget(m_statusInfo);
m_undoStack = new QUndoStack(this);
} }
void ZonePainterMainWindow::showEvent(QShowEvent *showEvent) void ZonePainterMainWindow::showEvent(QShowEvent *showEvent)

View file

@ -5,6 +5,7 @@
#include <QTimer> #include <QTimer>
#include <QLabel> #include <QLabel>
#include <QAction> #include <QAction>
#include <QtGui/QUndoStack>
namespace NLQT { namespace NLQT {
class QNLWidget; class QNLWidget;
@ -26,7 +27,7 @@ public:
void loadConfig(); void loadConfig();
void saveConfig(); void saveConfig();
QUndoStack *getUndoStack() { return m_undoStack; }
public Q_SLOTS: public Q_SLOTS:
void setToolMode(int value); void setToolMode(int value);
void setToolMode(); void setToolMode();
@ -49,7 +50,7 @@ private:
QAction *_toolSelectModeAction; QAction *_toolSelectModeAction;
QAction *_toolPickModeAction; QAction *_toolPickModeAction;
QMenu *_toolModeMenu; QMenu *_toolModeMenu;
QUndoStack *m_undoStack;
//QAction *m_setBackColorAction; //QAction *m_setBackColorAction;
}; };

View file

@ -79,28 +79,38 @@ class CZonePainterContext: public Core::IContext
{ {
Q_OBJECT Q_OBJECT
public: public:
CZonePainterContext(QObject *parent = 0): IContext(parent) CZonePainterContext(QObject *parent = 0): IContext(parent)
{ {
m_zonePainterMainWindow = new ZonePainterMainWindow(); m_zonePainterMainWindow = new ZonePainterMainWindow();
} }
virtual ~CZonePainterContext() {} virtual ~CZonePainterContext() {}
virtual QString id() const virtual QString id() const
{ {
return QLatin1String("ZonePainterContext"); return QLatin1String("ZonePainterContext");
} }
virtual QString trName() const virtual QString trName() const
{ {
return tr("Zone Painter"); return tr("Zone Painter");
} }
virtual QIcon icon() const virtual QIcon icon() const
{ {
return QIcon(); return QIcon();
} }
virtual QWidget *widget() virtual QWidget *widget()
{ {
return m_zonePainterMainWindow; return m_zonePainterMainWindow;
} }
virtual QUndoStack *undoStack()
{
return m_zonePainterMainWindow->getUndoStack();
}
virtual void open()
{
}
ZonePainterMainWindow *m_zonePainterMainWindow; ZonePainterMainWindow *m_zonePainterMainWindow;
}; };

View file

@ -53,6 +53,11 @@ QString CZonePainterSettingsPage::trCategory() const
return tr("General"); return tr("General");
} }
QIcon CZonePainterSettingsPage::categoryIcon() const
{
return QIcon();
}
QWidget *CZonePainterSettingsPage::createPage(QWidget *parent) QWidget *CZonePainterSettingsPage::createPage(QWidget *parent)
{ {
_currentPage = new QWidget(parent); _currentPage = new QWidget(parent);
@ -64,4 +69,4 @@ void CZonePainterSettingsPage::apply()
{ {
} }
} /* namespace Plugin */ } /* namespace Plugin */

View file

@ -43,6 +43,7 @@ public:
virtual QString trName() const; virtual QString trName() const;
virtual QString category() const; virtual QString category() const;
virtual QString trCategory() const; virtual QString trCategory() const;
QIcon categoryIcon() const;
virtual QWidget *createPage(QWidget *parent); virtual QWidget *createPage(QWidget *parent);
virtual void apply(); virtual void apply();