Changed: #1306 Radically changed the plugin in a new branch to match the way classic GE loads forms.
- Refactored the tree view to show only structs, arrays, vstructs and eliminated atoms from its view. - Refactored the form view to have a Qt Properties Browser - Refactored the loader to use the classic GE addStruct/addArray. - Moved some functionality into CFormItem. - Added icons from classic GE and configured model/item to return them appropriately. - Getting read for changes via undo commands. - Eliminating/ignoring the hold/slots business from classic GE code. --HG-- branch : branch-features-geqt-pluginhg/feature/cdb-packed
@ -0,0 +1,17 @@
|
||||
// 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/>.
|
||||
|
||||
#include "actions.h"
|
@ -0,0 +1,20 @@
|
||||
// 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
|
||||
|
||||
#endif // ACTIONS_H
|
@ -1,76 +1,84 @@
|
||||
// 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 FORMITEM_H
|
||||
#define FORMITEM_H
|
||||
|
||||
// NeL includes
|
||||
#include <nel/georges/u_form_elm.h>
|
||||
|
||||
// Qt includes
|
||||
#include <QList>
|
||||
#include <QVariant>
|
||||
|
||||
namespace GeorgesQt
|
||||
{
|
||||
|
||||
class CFormItem
|
||||
|
||||
{
|
||||
public:
|
||||
CFormItem(NLGEORGES::UFormElm *elm, const QList<QVariant> &data,
|
||||
CFormItem *parent = 0,
|
||||
NLGEORGES::UFormElm::TWhereIsValue wV = NLGEORGES::UFormElm::ValueForm,
|
||||
NLGEORGES::UFormElm::TWhereIsNode wN = NLGEORGES::UFormElm::NodeForm);
|
||||
~CFormItem();
|
||||
|
||||
void appendChild(CFormItem *child);
|
||||
//CFormItem *add (/*TSub type,*/ const char *name, uint structId, const char *formName, uint slot);
|
||||
CFormItem *add(NLGEORGES::UFormElm* root, std::string elmName);
|
||||
|
||||
CFormItem *child(int row);
|
||||
int childCount() const;
|
||||
int columnCount() const;
|
||||
QVariant data(int column) const;
|
||||
int row() const;
|
||||
CFormItem *parent();
|
||||
bool setData(int column, const QVariant &value);
|
||||
NLGEORGES::UFormElm* getFormElm() {return formElm;}
|
||||
NLGEORGES::UFormElm::TWhereIsValue valueFrom()
|
||||
{
|
||||
return whereV;
|
||||
}
|
||||
NLGEORGES::UFormElm::TWhereIsNode nodeFrom()
|
||||
{
|
||||
return whereN;
|
||||
}
|
||||
|
||||
void setValueFrom(NLGEORGES::UFormElm::TWhereIsValue wV) { whereV = wV; }
|
||||
void setNodeFrom(NLGEORGES::UFormElm::TWhereIsNode wN) { whereN = wN; }
|
||||
|
||||
|
||||
private:
|
||||
//CFormItem() { whereV = NLGEORGES::UFormElm::ValueForm; whereN = NLGEORGES::UFormElm::NodeForm; }
|
||||
QList<CFormItem*> childItems;
|
||||
QList<QVariant> itemData;
|
||||
CFormItem *parentItem;
|
||||
NLGEORGES::UFormElm* formElm;
|
||||
NLGEORGES::UFormElm::TWhereIsValue whereV;
|
||||
NLGEORGES::UFormElm::TWhereIsNode whereN;
|
||||
}; // CFormItem
|
||||
|
||||
}
|
||||
#endif // FORMITEM_H
|
||||
// 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 FORMITEM_H
|
||||
#define FORMITEM_H
|
||||
|
||||
// NeL includes
|
||||
#include <nel/georges/u_form.h>
|
||||
#include <nel/georges/u_form_elm.h>
|
||||
|
||||
// Qt includes
|
||||
#include <QList>
|
||||
#include <QVariant>
|
||||
|
||||
namespace GeorgesQt
|
||||
{
|
||||
|
||||
class CFormItem
|
||||
{
|
||||
public:
|
||||
// What is the sub object ?
|
||||
enum TSub
|
||||
{
|
||||
Null, // Nothing in this node (root ?)
|
||||
Header, // Header node
|
||||
Type, // This node is a type
|
||||
Dfn, // This node is a dfn
|
||||
Form, // This node is a form
|
||||
};
|
||||
|
||||
CFormItem();
|
||||
~CFormItem();
|
||||
|
||||
void appendChild(CFormItem *child);
|
||||
|
||||
CFormItem *add (TSub type, const char *name, uint structId, const char *formName, uint slot, NLGEORGES::UForm *formPtr);
|
||||
|
||||
CFormItem *child(int row);
|
||||
int childCount() const;
|
||||
int columnCount() const;
|
||||
QVariant data(int column) const;
|
||||
int row() const;
|
||||
CFormItem *parent();
|
||||
bool setData(int column, const QVariant &value);
|
||||
|
||||
TSub nodeType() { return _Type; }
|
||||
std::string formName() { return _FormName; }
|
||||
std::string name() { return _Name; }
|
||||
uint structId() { return _StructId; }
|
||||
|
||||
bool isEditable(int column);
|
||||
|
||||
QIcon getItemImage(CFormItem *rootItem);
|
||||
|
||||
private:
|
||||
QList<CFormItem*> childItems;
|
||||
QList<QVariant> itemData;
|
||||
CFormItem *parentItem;
|
||||
NLGEORGES::UFormElm* formElm;
|
||||
NLGEORGES::UForm *m_form;
|
||||
|
||||
uint _StructId;
|
||||
std::string _Name;
|
||||
std::string _FormName;
|
||||
TSub _Type;
|
||||
uint _Slot;
|
||||
|
||||
}; // CFormItem
|
||||
|
||||
}
|
||||
#endif // FORMITEM_H
|
||||
|
@ -1,5 +1,12 @@
|
||||
<RCC>
|
||||
<qresource>
|
||||
<file>images/array.ico</file>
|
||||
<file>images/header.ico</file>
|
||||
<file>images/hold.ico</file>
|
||||
<file>images/root.ico</file>
|
||||
<file>images/struct.ico</file>
|
||||
<file>images/vstruct.ico</file>
|
||||
<file>images/zfee51.ico</file>
|
||||
<file>images/ic_nel_georges_editor.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 318 B |
After Width: | Height: | Size: 318 B |
After Width: | Height: | Size: 318 B |
After Width: | Height: | Size: 318 B |
After Width: | Height: | Size: 318 B |
After Width: | Height: | Size: 2.2 KiB |