Fixed: EOL

hg/feature/cdb-packed
kervala 10 years ago
parent 687927ba10
commit 3625818283

@ -1,48 +1,48 @@
// Object Viewer Qt - Georges Editor Plugin - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/> // Object Viewer Qt - Georges Editor Plugin - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2011 Adrian Jaekel <aj at elane2k dot com> // Copyright (C) 2011 Adrian Jaekel <aj at elane2k dot com>
// //
// This program is free software: you can redistribute it and/or modify // This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as // it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the // published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version. // License, or (at your option) any later version.
// //
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details. // GNU Affero General Public License for more details.
// //
// You should have received a copy of the GNU Affero General Public License // 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/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef ACTIONS_H #ifndef ACTIONS_H
#define ACTIONS_H #define ACTIONS_H
#include <QtGui/QUndoCommand> #include <QtGui/QUndoCommand>
#include <QModelIndex> #include <QModelIndex>
namespace GeorgesQt namespace GeorgesQt
{ {
class CFormItem; class CFormItem;
class CGeorgesFormModel; class CGeorgesFormModel;
class CUndoFormArrayRenameCommand : public QUndoCommand class CUndoFormArrayRenameCommand : public QUndoCommand
{ {
public: public:
CUndoFormArrayRenameCommand(CGeorgesFormModel *model, CFormItem *item, const QVariant &value, QUndoCommand *parent = 0); CUndoFormArrayRenameCommand(CGeorgesFormModel *model, CFormItem *item, const QVariant &value, QUndoCommand *parent = 0);
~CUndoFormArrayRenameCommand() {} ~CUndoFormArrayRenameCommand() {}
void redo(); void redo();
void undo(); void undo();
void update(bool redo); void update(bool redo);
protected: protected:
CFormItem *m_item; CFormItem *m_item;
CGeorgesFormModel *m_model; CGeorgesFormModel *m_model;
QString m_newValue; QString m_newValue;
QString m_oldValue; QString m_oldValue;
}; };
} }
#endif // ACTIONS_H #endif // ACTIONS_H

@ -1,47 +1,47 @@
#ifndef BROWSER_CTRL_H #ifndef BROWSER_CTRL_H
#define BROWSER_CTRL_H #define BROWSER_CTRL_H
#include <QObject> #include <QObject>
namespace NLGEORGES namespace NLGEORGES
{ {
class UForm; class UForm;
} }
class QtTreePropertyBrowser; class QtTreePropertyBrowser;
class QModelIndex; class QModelIndex;
class QVariant; class QVariant;
class QtProperty; class QtProperty;
class BrowserCtrlPvt; class BrowserCtrlPvt;
class BrowserCtrl : public QObject class BrowserCtrl : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
BrowserCtrl( QtTreePropertyBrowser *browser ); BrowserCtrl( QtTreePropertyBrowser *browser );
~BrowserCtrl(); ~BrowserCtrl();
void setForm( NLGEORGES::UForm *form ){ m_form = form; } void setForm( NLGEORGES::UForm *form ){ m_form = form; }
public Q_SLOTS: public Q_SLOTS:
void clicked( const QModelIndex &idx ); void clicked( const QModelIndex &idx );
Q_SIGNALS: Q_SIGNALS:
void arrayResized( const QString &name, int size ); void arrayResized( const QString &name, int size );
void modified(); void modified();
private Q_SLOTS: private Q_SLOTS:
void onValueChanged( QtProperty *p, const QVariant &value ); void onValueChanged( QtProperty *p, const QVariant &value );
void onArrayResized( const QString &name, int size ); void onArrayResized( const QString &name, int size );
void onModified(); void onModified();
private: private:
void enableMgrConnections(); void enableMgrConnections();
void disableMgrConnections(); void disableMgrConnections();
BrowserCtrlPvt *m_pvt; BrowserCtrlPvt *m_pvt;
NLGEORGES::UForm *m_form; NLGEORGES::UForm *m_form;
}; };
#endif #endif

@ -1,54 +1,54 @@
#ifndef BROWSER_CTRL_PVT_H #ifndef BROWSER_CTRL_PVT_H
#define BROWSER_CTRL_PVT_H #define BROWSER_CTRL_PVT_H
#include <QObject> #include <QObject>
namespace NLGEORGES namespace NLGEORGES
{ {
class CFormElm; class CFormElm;
class UFormElm; class UFormElm;
class CFormElmStruct; class CFormElmStruct;
} }
class QtVariantPropertyManager; class QtVariantPropertyManager;
class QtVariantEditorFactory; class QtVariantEditorFactory;
class QtTreePropertyBrowser; class QtTreePropertyBrowser;
class QVariant; class QVariant;
class QtProperty; class QtProperty;
class BrowserCtrlPvt : public QObject class BrowserCtrlPvt : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
BrowserCtrlPvt( QObject *parent = NULL ); BrowserCtrlPvt( QObject *parent = NULL );
~BrowserCtrlPvt(); ~BrowserCtrlPvt();
void clear(); void clear();
void setupNode( NLGEORGES::UFormElm *node ); void setupNode( NLGEORGES::UFormElm *node );
void onValueChanged( QtProperty *p, const QVariant &value ); void onValueChanged( QtProperty *p, const QVariant &value );
QtVariantPropertyManager* manager() const{ return mgr; } QtVariantPropertyManager* manager() const{ return mgr; }
void setRootNode( NLGEORGES::CFormElm *root ){ m_rootNode = root; } void setRootNode( NLGEORGES::CFormElm *root ){ m_rootNode = root; }
void setBrowser( QtTreePropertyBrowser *browser ){ m_browser = browser; } void setBrowser( QtTreePropertyBrowser *browser ){ m_browser = browser; }
Q_SIGNALS: Q_SIGNALS:
void arrayResized( const QString &name, int size ); void arrayResized( const QString &name, int size );
void modified(); void modified();
private: private:
void setupStruct( NLGEORGES::UFormElm *node ); void setupStruct( NLGEORGES::UFormElm *node );
void setupArray( NLGEORGES::UFormElm *node ); void setupArray( NLGEORGES::UFormElm *node );
void setupAtom( NLGEORGES::CFormElmStruct::CFormElmStructElm &elm ); void setupAtom( NLGEORGES::CFormElmStruct::CFormElmStructElm &elm );
void onStructValueChanged( QtProperty *p, const QVariant &value ); void onStructValueChanged( QtProperty *p, const QVariant &value );
void onArrayValueChanged( QtProperty *p, const QVariant &value ); void onArrayValueChanged( QtProperty *p, const QVariant &value );
QtVariantPropertyManager *mgr; QtVariantPropertyManager *mgr;
QtVariantEditorFactory *factory; QtVariantEditorFactory *factory;
QtTreePropertyBrowser *m_browser; QtTreePropertyBrowser *m_browser;
NLGEORGES::UFormElm *m_currentNode; NLGEORGES::UFormElm *m_currentNode;
NLGEORGES::CFormElm *m_rootNode; NLGEORGES::CFormElm *m_rootNode;
}; };
#endif #endif

@ -1,49 +1,49 @@
#include "action_list.h" #include "action_list.h"
#include "nel/gui/action_handler.h" #include "nel/gui/action_handler.h"
#include <vector> #include <vector>
#include <string> #include <string>
ActionList::ActionList( QDialog *parent ) : ActionList::ActionList( QDialog *parent ) :
QDialog( parent ) QDialog( parent )
{ {
setupUi( this ); setupUi( this );
} }
ActionList::~ActionList() ActionList::~ActionList()
{ {
} }
void ActionList::load() void ActionList::load()
{ {
actionList->clear(); actionList->clear();
NLGUI::CAHManager *am = NLGUI::CAHManager::getInstance(); NLGUI::CAHManager *am = NLGUI::CAHManager::getInstance();
std::vector< std::string > handlers; std::vector< std::string > handlers;
am->getActionHandlers( handlers ); am->getActionHandlers( handlers );
std::vector< std::string >::const_iterator itr = handlers.begin(); std::vector< std::string >::const_iterator itr = handlers.begin();
while( itr != handlers.end() ) while( itr != handlers.end() )
{ {
actionList->addItem( itr->c_str() ); actionList->addItem( itr->c_str() );
++itr; ++itr;
} }
} }
void ActionList::accept() void ActionList::accept()
{ {
QListWidgetItem *item = actionList->currentItem(); QListWidgetItem *item = actionList->currentItem();
if( item == NULL ) if( item == NULL )
return; return;
selectedAction = item->text(); selectedAction = item->text();
QDialog::accept(); QDialog::accept();
} }
void ActionList::reject() void ActionList::reject()
{ {
selectedAction = ""; selectedAction = "";
QDialog::reject(); QDialog::reject();
} }

@ -1,29 +1,29 @@
#ifndef ACTION_LIST_H #ifndef ACTION_LIST_H
#define ACTION_LIST_H #define ACTION_LIST_H
#include "ui_action_list.h" #include "ui_action_list.h"
#include <QString> #include <QString>
class ActionList : public QDialog, public Ui::ActionListDialog class ActionList : public QDialog, public Ui::ActionListDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
ActionList( QDialog *parent = NULL ); ActionList( QDialog *parent = NULL );
~ActionList(); ~ActionList();
void load(); void load();
QString getSelectedAction(){ return selectedAction; } QString getSelectedAction(){ return selectedAction; }
public Q_SLOTS: public Q_SLOTS:
void accept(); void accept();
void reject(); void reject();
private: private:
QString selectedAction; QString selectedAction;
}; };
#endif #endif

Loading…
Cancel
Save