mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-26 17:16:20 +00:00
Fixed: EOL
This commit is contained in:
parent
687927ba10
commit
3625818283
5 changed files with 226 additions and 226 deletions
|
@ -1,48 +1,48 @@
|
|||
// Object Viewer Qt - Georges Editor Plugin - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
|
||||
// Copyright (C) 2011 Adrian Jaekel <aj at elane2k dot com>
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#ifndef ACTIONS_H
|
||||
#define ACTIONS_H
|
||||
|
||||
#include <QtGui/QUndoCommand>
|
||||
#include <QModelIndex>
|
||||
|
||||
namespace GeorgesQt
|
||||
{
|
||||
class CFormItem;
|
||||
class CGeorgesFormModel;
|
||||
|
||||
class CUndoFormArrayRenameCommand : public QUndoCommand
|
||||
{
|
||||
public:
|
||||
CUndoFormArrayRenameCommand(CGeorgesFormModel *model, CFormItem *item, const QVariant &value, QUndoCommand *parent = 0);
|
||||
~CUndoFormArrayRenameCommand() {}
|
||||
|
||||
void redo();
|
||||
void undo();
|
||||
|
||||
void update(bool redo);
|
||||
|
||||
protected:
|
||||
CFormItem *m_item;
|
||||
CGeorgesFormModel *m_model;
|
||||
|
||||
QString m_newValue;
|
||||
QString m_oldValue;
|
||||
};
|
||||
}
|
||||
|
||||
// Object Viewer Qt - Georges Editor Plugin - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
|
||||
// Copyright (C) 2011 Adrian Jaekel <aj at elane2k dot com>
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Affero General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU Affero General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Affero General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#ifndef ACTIONS_H
|
||||
#define ACTIONS_H
|
||||
|
||||
#include <QtGui/QUndoCommand>
|
||||
#include <QModelIndex>
|
||||
|
||||
namespace GeorgesQt
|
||||
{
|
||||
class CFormItem;
|
||||
class CGeorgesFormModel;
|
||||
|
||||
class CUndoFormArrayRenameCommand : public QUndoCommand
|
||||
{
|
||||
public:
|
||||
CUndoFormArrayRenameCommand(CGeorgesFormModel *model, CFormItem *item, const QVariant &value, QUndoCommand *parent = 0);
|
||||
~CUndoFormArrayRenameCommand() {}
|
||||
|
||||
void redo();
|
||||
void undo();
|
||||
|
||||
void update(bool redo);
|
||||
|
||||
protected:
|
||||
CFormItem *m_item;
|
||||
CGeorgesFormModel *m_model;
|
||||
|
||||
QString m_newValue;
|
||||
QString m_oldValue;
|
||||
};
|
||||
}
|
||||
|
||||
#endif // ACTIONS_H
|
|
@ -1,47 +1,47 @@
|
|||
#ifndef BROWSER_CTRL_H
|
||||
#define BROWSER_CTRL_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
namespace NLGEORGES
|
||||
{
|
||||
class UForm;
|
||||
}
|
||||
|
||||
class QtTreePropertyBrowser;
|
||||
class QModelIndex;
|
||||
class QVariant;
|
||||
class QtProperty;
|
||||
|
||||
class BrowserCtrlPvt;
|
||||
|
||||
class BrowserCtrl : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
BrowserCtrl( QtTreePropertyBrowser *browser );
|
||||
~BrowserCtrl();
|
||||
void setForm( NLGEORGES::UForm *form ){ m_form = form; }
|
||||
|
||||
public Q_SLOTS:
|
||||
void clicked( const QModelIndex &idx );
|
||||
|
||||
Q_SIGNALS:
|
||||
void arrayResized( const QString &name, int size );
|
||||
void modified();
|
||||
|
||||
private Q_SLOTS:
|
||||
void onValueChanged( QtProperty *p, const QVariant &value );
|
||||
void onArrayResized( const QString &name, int size );
|
||||
void onModified();
|
||||
|
||||
private:
|
||||
void enableMgrConnections();
|
||||
void disableMgrConnections();
|
||||
|
||||
|
||||
BrowserCtrlPvt *m_pvt;
|
||||
NLGEORGES::UForm *m_form;
|
||||
};
|
||||
|
||||
#endif
|
||||
#ifndef BROWSER_CTRL_H
|
||||
#define BROWSER_CTRL_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
namespace NLGEORGES
|
||||
{
|
||||
class UForm;
|
||||
}
|
||||
|
||||
class QtTreePropertyBrowser;
|
||||
class QModelIndex;
|
||||
class QVariant;
|
||||
class QtProperty;
|
||||
|
||||
class BrowserCtrlPvt;
|
||||
|
||||
class BrowserCtrl : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
BrowserCtrl( QtTreePropertyBrowser *browser );
|
||||
~BrowserCtrl();
|
||||
void setForm( NLGEORGES::UForm *form ){ m_form = form; }
|
||||
|
||||
public Q_SLOTS:
|
||||
void clicked( const QModelIndex &idx );
|
||||
|
||||
Q_SIGNALS:
|
||||
void arrayResized( const QString &name, int size );
|
||||
void modified();
|
||||
|
||||
private Q_SLOTS:
|
||||
void onValueChanged( QtProperty *p, const QVariant &value );
|
||||
void onArrayResized( const QString &name, int size );
|
||||
void onModified();
|
||||
|
||||
private:
|
||||
void enableMgrConnections();
|
||||
void disableMgrConnections();
|
||||
|
||||
|
||||
BrowserCtrlPvt *m_pvt;
|
||||
NLGEORGES::UForm *m_form;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,54 +1,54 @@
|
|||
#ifndef BROWSER_CTRL_PVT_H
|
||||
#define BROWSER_CTRL_PVT_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
namespace NLGEORGES
|
||||
{
|
||||
class CFormElm;
|
||||
class UFormElm;
|
||||
class CFormElmStruct;
|
||||
}
|
||||
|
||||
class QtVariantPropertyManager;
|
||||
class QtVariantEditorFactory;
|
||||
class QtTreePropertyBrowser;
|
||||
class QVariant;
|
||||
class QtProperty;
|
||||
|
||||
class BrowserCtrlPvt : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
BrowserCtrlPvt( QObject *parent = NULL );
|
||||
~BrowserCtrlPvt();
|
||||
|
||||
void clear();
|
||||
void setupNode( NLGEORGES::UFormElm *node );
|
||||
void onValueChanged( QtProperty *p, const QVariant &value );
|
||||
|
||||
QtVariantPropertyManager* manager() const{ return mgr; }
|
||||
void setRootNode( NLGEORGES::CFormElm *root ){ m_rootNode = root; }
|
||||
void setBrowser( QtTreePropertyBrowser *browser ){ m_browser = browser; }
|
||||
|
||||
Q_SIGNALS:
|
||||
void arrayResized( const QString &name, int size );
|
||||
void modified();
|
||||
|
||||
private:
|
||||
void setupStruct( NLGEORGES::UFormElm *node );
|
||||
void setupArray( NLGEORGES::UFormElm *node );
|
||||
void setupAtom( NLGEORGES::CFormElmStruct::CFormElmStructElm &elm );
|
||||
|
||||
void onStructValueChanged( QtProperty *p, const QVariant &value );
|
||||
void onArrayValueChanged( QtProperty *p, const QVariant &value );
|
||||
|
||||
QtVariantPropertyManager *mgr;
|
||||
QtVariantEditorFactory *factory;
|
||||
QtTreePropertyBrowser *m_browser;
|
||||
|
||||
NLGEORGES::UFormElm *m_currentNode;
|
||||
NLGEORGES::CFormElm *m_rootNode;
|
||||
};
|
||||
|
||||
#endif
|
||||
#ifndef BROWSER_CTRL_PVT_H
|
||||
#define BROWSER_CTRL_PVT_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
namespace NLGEORGES
|
||||
{
|
||||
class CFormElm;
|
||||
class UFormElm;
|
||||
class CFormElmStruct;
|
||||
}
|
||||
|
||||
class QtVariantPropertyManager;
|
||||
class QtVariantEditorFactory;
|
||||
class QtTreePropertyBrowser;
|
||||
class QVariant;
|
||||
class QtProperty;
|
||||
|
||||
class BrowserCtrlPvt : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
BrowserCtrlPvt( QObject *parent = NULL );
|
||||
~BrowserCtrlPvt();
|
||||
|
||||
void clear();
|
||||
void setupNode( NLGEORGES::UFormElm *node );
|
||||
void onValueChanged( QtProperty *p, const QVariant &value );
|
||||
|
||||
QtVariantPropertyManager* manager() const{ return mgr; }
|
||||
void setRootNode( NLGEORGES::CFormElm *root ){ m_rootNode = root; }
|
||||
void setBrowser( QtTreePropertyBrowser *browser ){ m_browser = browser; }
|
||||
|
||||
Q_SIGNALS:
|
||||
void arrayResized( const QString &name, int size );
|
||||
void modified();
|
||||
|
||||
private:
|
||||
void setupStruct( NLGEORGES::UFormElm *node );
|
||||
void setupArray( NLGEORGES::UFormElm *node );
|
||||
void setupAtom( NLGEORGES::CFormElmStruct::CFormElmStructElm &elm );
|
||||
|
||||
void onStructValueChanged( QtProperty *p, const QVariant &value );
|
||||
void onArrayValueChanged( QtProperty *p, const QVariant &value );
|
||||
|
||||
QtVariantPropertyManager *mgr;
|
||||
QtVariantEditorFactory *factory;
|
||||
QtTreePropertyBrowser *m_browser;
|
||||
|
||||
NLGEORGES::UFormElm *m_currentNode;
|
||||
NLGEORGES::CFormElm *m_rootNode;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,49 +1,49 @@
|
|||
#include "action_list.h"
|
||||
#include "nel/gui/action_handler.h"
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
ActionList::ActionList( QDialog *parent ) :
|
||||
QDialog( parent )
|
||||
{
|
||||
setupUi( this );
|
||||
}
|
||||
|
||||
ActionList::~ActionList()
|
||||
{
|
||||
}
|
||||
|
||||
void ActionList::load()
|
||||
{
|
||||
actionList->clear();
|
||||
|
||||
NLGUI::CAHManager *am = NLGUI::CAHManager::getInstance();
|
||||
std::vector< std::string > handlers;
|
||||
am->getActionHandlers( handlers );
|
||||
|
||||
std::vector< std::string >::const_iterator itr = handlers.begin();
|
||||
while( itr != handlers.end() )
|
||||
{
|
||||
actionList->addItem( itr->c_str() );
|
||||
++itr;
|
||||
}
|
||||
}
|
||||
|
||||
void ActionList::accept()
|
||||
{
|
||||
QListWidgetItem *item = actionList->currentItem();
|
||||
if( item == NULL )
|
||||
return;
|
||||
|
||||
selectedAction = item->text();
|
||||
|
||||
QDialog::accept();
|
||||
}
|
||||
|
||||
void ActionList::reject()
|
||||
{
|
||||
selectedAction = "";
|
||||
|
||||
QDialog::reject();
|
||||
}
|
||||
|
||||
#include "action_list.h"
|
||||
#include "nel/gui/action_handler.h"
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
ActionList::ActionList( QDialog *parent ) :
|
||||
QDialog( parent )
|
||||
{
|
||||
setupUi( this );
|
||||
}
|
||||
|
||||
ActionList::~ActionList()
|
||||
{
|
||||
}
|
||||
|
||||
void ActionList::load()
|
||||
{
|
||||
actionList->clear();
|
||||
|
||||
NLGUI::CAHManager *am = NLGUI::CAHManager::getInstance();
|
||||
std::vector< std::string > handlers;
|
||||
am->getActionHandlers( handlers );
|
||||
|
||||
std::vector< std::string >::const_iterator itr = handlers.begin();
|
||||
while( itr != handlers.end() )
|
||||
{
|
||||
actionList->addItem( itr->c_str() );
|
||||
++itr;
|
||||
}
|
||||
}
|
||||
|
||||
void ActionList::accept()
|
||||
{
|
||||
QListWidgetItem *item = actionList->currentItem();
|
||||
if( item == NULL )
|
||||
return;
|
||||
|
||||
selectedAction = item->text();
|
||||
|
||||
QDialog::accept();
|
||||
}
|
||||
|
||||
void ActionList::reject()
|
||||
{
|
||||
selectedAction = "";
|
||||
|
||||
QDialog::reject();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,29 +1,29 @@
|
|||
#ifndef ACTION_LIST_H
|
||||
#define ACTION_LIST_H
|
||||
|
||||
|
||||
#include "ui_action_list.h"
|
||||
#include <QString>
|
||||
|
||||
|
||||
class ActionList : public QDialog, public Ui::ActionListDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ActionList( QDialog *parent = NULL );
|
||||
~ActionList();
|
||||
void load();
|
||||
|
||||
QString getSelectedAction(){ return selectedAction; }
|
||||
|
||||
|
||||
public Q_SLOTS:
|
||||
void accept();
|
||||
void reject();
|
||||
|
||||
private:
|
||||
QString selectedAction;
|
||||
};
|
||||
|
||||
#endif
|
||||
#ifndef ACTION_LIST_H
|
||||
#define ACTION_LIST_H
|
||||
|
||||
|
||||
#include "ui_action_list.h"
|
||||
#include <QString>
|
||||
|
||||
|
||||
class ActionList : public QDialog, public Ui::ActionListDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ActionList( QDialog *parent = NULL );
|
||||
~ActionList();
|
||||
void load();
|
||||
|
||||
QString getSelectedAction(){ return selectedAction; }
|
||||
|
||||
|
||||
public Q_SLOTS:
|
||||
void accept();
|
||||
void reject();
|
||||
|
||||
private:
|
||||
QString selectedAction;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue