From 2d4e1467c28c360975a77b4014dfa81f3598bae9 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Fri, 6 Jul 2012 06:10:20 +0200 Subject: [PATCH] ADDED: #1471 Created ActionEditor, LinkEditor, ProcEditor, WidgetHierarchy dialogs for the GUI editor, altough obviously they are just an empty shell for now. http://www.youtube.com/watch?v=nOhlliU6tCE --HG-- branch : gsoc2012-gui-editor --- .../src/plugins/gui_editor/CMakeLists.txt | 21 +++- .../src/plugins/gui_editor/action_editor.cpp | 32 +++++ .../src/plugins/gui_editor/action_editor.h | 34 ++++++ .../src/plugins/gui_editor/action_editor.ui | 88 ++++++++++++++ .../plugins/gui_editor/gui_editor_window.cpp | 27 ++++ .../plugins/gui_editor/gui_editor_window.h | 4 + .../plugins/gui_editor/gui_editor_window.ui | 7 +- .../src/plugins/gui_editor/link_editor.cpp | 33 +++++ .../src/plugins/gui_editor/link_editor.h | 35 ++++++ .../src/plugins/gui_editor/link_editor.ui | 101 +++++++++++++++ .../src/plugins/gui_editor/proc_editor.cpp | 39 ++++++ .../src/plugins/gui_editor/proc_editor.h | 40 ++++++ .../src/plugins/gui_editor/proc_editor.ui | 115 ++++++++++++++++++ .../plugins/gui_editor/widget_hierarchy.cpp | 31 +++++ .../src/plugins/gui_editor/widget_hierarchy.h | 34 ++++++ .../plugins/gui_editor/widget_hierarchy.ui | 90 ++++++++++++++ 16 files changed, 724 insertions(+), 7 deletions(-) create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/action_editor.cpp create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/action_editor.h create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/action_editor.ui create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/link_editor.cpp create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/link_editor.h create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/link_editor.ui create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/proc_editor.cpp create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/proc_editor.h create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/proc_editor.ui create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_hierarchy.cpp create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_hierarchy.h create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_hierarchy.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/CMakeLists.txt index 9a24e2c3f..e9350bbf2 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/CMakeLists.txt @@ -9,8 +9,25 @@ 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_spec.h) -SET(OVQT_PLUGIN_GUI_EDITOR_HDR gui_editor_plugin.h gui_editor_window.h gui_editor_context.h widget_properties.h ) -SET(OVQT_PLUGIN_GUI_EDITOR_UIS gui_editor_window.ui widget_properties.ui ) +SET(OVQT_PLUGIN_GUI_EDITOR_HDR + gui_editor_plugin.h + gui_editor_window.h + gui_editor_context.h + widget_properties.h + widget_hierarchy.h + action_editor.h + link_editor.h + proc_editor.h + ) + +SET(OVQT_PLUGIN_GUI_EDITOR_UIS + gui_editor_window.ui + widget_properties.ui + widget_hierarchy.ui + action_editor.ui + link_editor.ui + proc_editor.ui + ) SET(QT_USE_QTGUI TRUE) SET(QT_USE_QTOPENGL TRUE) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/action_editor.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/action_editor.cpp new file mode 100644 index 000000000..abcfe1ec5 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/action_editor.cpp @@ -0,0 +1,32 @@ +// Object Viewer Qt GUI Editor plugin +// Copyright (C) 2010 Winch Gate Property Limited +// +// 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 . + + +#include "action_editor.h" + +namespace GUIEditor +{ + ActionEditor::ActionEditor( QWidget *parent ) + { + setupUi( this ); + connect( okButton, SIGNAL( clicked( bool ) ), this, SLOT( hide() ) ); + connect( cancelButton, SIGNAL( clicked( bool ) ), this, SLOT( hide() ) ); + } + + ActionEditor::~ActionEditor() + { + } +} diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/action_editor.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/action_editor.h new file mode 100644 index 000000000..6d2128c7d --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/action_editor.h @@ -0,0 +1,34 @@ +// Object Viewer Qt GUI Editor plugin +// Copyright (C) 2010 Winch Gate Property Limited +// +// 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 . + +#ifndef ACTION_EDITOR_H +#define ACTION_EDITOR_H + +#include "ui_action_editor.h" + +namespace GUIEditor +{ + class ActionEditor : public QWidget, public Ui::ActionEditor + { + Q_OBJECT + public: + ActionEditor( QWidget *parent = NULL ); + ~ActionEditor(); + }; +} + +#endif + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/action_editor.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/action_editor.ui new file mode 100644 index 000000000..e9d0188d9 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/action_editor.ui @@ -0,0 +1,88 @@ + + + ActionEditor + + + + 0 + 0 + 340 + 111 + + + + Action Editor + + + + + + + + Handler + + + + + + + Handler + + + + + + + Parameters + + + + + + + Parameters + + + + + + + + + + + + + OK + + + + + + + Cancel + + + + + + + + + Qt::Horizontal + + + + 38 + 20 + + + + + + + + + + + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_window.cpp index 832c39fe9..672df715a 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_window.cpp @@ -26,9 +26,13 @@ #include #include +#include #include "widget_properties.h" #include "widget_properties_parser.h" +#include "widget_hierarchy.h" +#include "link_editor.h" +#include "proc_editor.h" namespace GUIEditor { @@ -41,6 +45,8 @@ namespace GUIEditor m_ui.setupUi(this); m_undoStack = new QUndoStack(this); widgetProps = new CWidgetProperties; + linkEditor = new LinkEditor; + procEditor = new ProcEditor; createMenus(); readSettings(); @@ -49,13 +55,26 @@ namespace GUIEditor parser.setWidgetPropMap( &widgetInfo ); parser.parseGUIWidgets(); widgetProps->setupWidgetInfo( &widgetInfo ); + + QDockWidget *dock = new QDockWidget( "Widget Hierarchy", this ); + dock->setAllowedAreas( Qt::LeftDockWidgetArea ); + WidgetHierarchy *ha = new WidgetHierarchy; + dock->setWidget( ha ); + addDockWidget( Qt::LeftDockWidgetArea, dock ); } GUIEditorWindow::~GUIEditorWindow() { writeSettings(); + delete widgetProps; widgetProps = NULL; + + delete linkEditor; + linkEditor = NULL; + + delete procEditor; + procEditor = NULL; } QUndoStack *GUIEditorWindow::undoStack() const @@ -88,6 +107,14 @@ namespace GUIEditor QAction *a = new QAction( "Widget Properties", this ); connect( a, SIGNAL( triggered( bool ) ), widgetProps, SLOT( show() ) ); menu->addAction( a ); + + a = new QAction( "Link Editor", this ); + connect( a, SIGNAL( triggered( bool ) ), linkEditor, SLOT( show() ) ); + menu->addAction( a ); + + a = new QAction( "Proc Editor", this ); + connect( a, SIGNAL( triggered( bool ) ), procEditor, SLOT( show() ) ); + menu->addAction( a ); } } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_window.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_window.h index ee0db991b..0418a12e5 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_window.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_window.h @@ -27,6 +27,8 @@ namespace GUIEditor { class CWidgetProperties; + class LinkEditor; + class ProcEditor; class GUIEditorWindow: public QMainWindow { @@ -62,6 +64,8 @@ private: Ui::GUIEditorWindow m_ui; CWidgetProperties *widgetProps; + LinkEditor *linkEditor; + ProcEditor *procEditor; }; } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_window.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_window.ui index baf1f01f4..6b0a0f7c3 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_window.ui +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/gui_editor_window.ui @@ -14,11 +14,7 @@ MainWindow - - - - - + @@ -32,5 +28,6 @@ + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/link_editor.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/link_editor.cpp new file mode 100644 index 000000000..7a028f649 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/link_editor.cpp @@ -0,0 +1,33 @@ +// Object Viewer Qt GUI Editor plugin +// Copyright (C) 2010 Winch Gate Property Limited +// +// 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 . + + +#include "link_editor.h" + +namespace GUIEditor +{ + LinkEditor::LinkEditor( QWidget *parent ) : + QWidget( parent ) + { + setupUi( this ); + connect( okButton, SIGNAL( clicked( bool ) ), this, SLOT( hide() ) ); + connect( cancelButton, SIGNAL( clicked( bool ) ), this, SLOT( hide() ) ); + } + + LinkEditor::~LinkEditor() + { + } +} diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/link_editor.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/link_editor.h new file mode 100644 index 000000000..93b7fb348 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/link_editor.h @@ -0,0 +1,35 @@ +// Object Viewer Qt GUI Editor plugin +// Copyright (C) 2010 Winch Gate Property Limited +// +// 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 . + + +#ifndef LINK_EDITOR_H +#define LINK_EDITOR_H + +#include "ui_link_editor.h" + +namespace GUIEditor +{ + class LinkEditor : public QWidget, public Ui::LinkEditor + { + Q_OBJECT + public: + LinkEditor( QWidget *parent = NULL ); + ~LinkEditor(); + }; +} + +#endif + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/link_editor.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/link_editor.ui new file mode 100644 index 000000000..af2c24f72 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/link_editor.ui @@ -0,0 +1,101 @@ + + + LinkEditor + + + + 0 + 0 + 545 + 340 + + + + Link Editor + + + + + + Expression + + + + + + + expression + + + + + + + When the condition is met + + + + + + + Activate group + + + + + + + Run Action Handler + + + + + + + Group or action handler + + + + + + + Action Handler parameters + + + + + + + + + Qt::Horizontal + + + + 348 + 20 + + + + + + + + OK + + + + + + + Cancel + + + + + + + + + + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/proc_editor.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/proc_editor.cpp new file mode 100644 index 000000000..c9c728603 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/proc_editor.cpp @@ -0,0 +1,39 @@ +// Object Viewer Qt GUI Editor plugin +// Copyright (C) 2010 Winch Gate Property Limited +// +// 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 . + + +#include "proc_editor.h" +#include "action_editor.h" + + +namespace GUIEditor +{ + ProcEditor::ProcEditor( QWidget *parent ) + { + setupUi( this ); + actionEditor = new ActionEditor; + connect( okButton, SIGNAL( clicked( bool ) ), this, SLOT( hide() ) ); + connect( cancelButton, SIGNAL( clicked( bool ) ), this, SLOT( hide() ) ); + connect( editButton, SIGNAL( clicked( bool ) ), actionEditor, SLOT( show() ) ); + + } + + ProcEditor::~ProcEditor() + { + delete actionEditor; + actionEditor = NULL; + } +} \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/proc_editor.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/proc_editor.h new file mode 100644 index 000000000..b7ee0bff2 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/proc_editor.h @@ -0,0 +1,40 @@ +// Object Viewer Qt GUI Editor plugin +// Copyright (C) 2010 Winch Gate Property Limited +// +// 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 . + + +#ifndef PROC_EDITOR_H +#define PROC_EDITOR_H + +#include "ui_proc_editor.h" + +namespace GUIEditor +{ + class ActionEditor; + + class ProcEditor : public QWidget, public Ui::ProcEditor + { + Q_OBJECT + public: + ProcEditor( QWidget *parent = NULL ); + ~ProcEditor(); + + private: + ActionEditor *actionEditor; + }; +} + +#endif + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/proc_editor.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/proc_editor.ui new file mode 100644 index 000000000..f8c17af54 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/proc_editor.ui @@ -0,0 +1,115 @@ + + + ProcEditor + + + + 0 + 0 + 424 + 327 + + + + Proc Editor + + + + + + + action1 + + + + + action2 + + + + + action3 + + + + + + + + Move Up + + + + + + + Move Down + + + + + + + Add + + + + + + + Remove + + + + + + + Edit + + + + + + + Qt::Vertical + + + + 20 + 132 + + + + + + + + OK + + + + + + + Cancel + + + + + + + Qt::Horizontal + + + + 197 + 20 + + + + + + + + + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_hierarchy.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_hierarchy.cpp new file mode 100644 index 000000000..6bcd5cf0a --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_hierarchy.cpp @@ -0,0 +1,31 @@ +// Object Viewer Qt GUI Editor plugin +// Copyright (C) 2010 Winch Gate Property Limited +// +// 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 . + + +#include "widget_hierarchy.h" + +namespace GUIEditor +{ + WidgetHierarchy::WidgetHierarchy( QWidget *parent ) : + QWidget( parent ) + { + setupUi( this ); + } + + WidgetHierarchy::~WidgetHierarchy() + { + } +} diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_hierarchy.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_hierarchy.h new file mode 100644 index 000000000..17fde2c29 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_hierarchy.h @@ -0,0 +1,34 @@ +// Object Viewer Qt GUI Editor plugin +// Copyright (C) 2010 Winch Gate Property Limited +// +// 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 . + +#ifndef WIDGET_HA_H +#define WIDGET_HA_H + +#include "ui_widget_hierarchy.h" + +namespace GUIEditor +{ + class WidgetHierarchy : public QWidget, public Ui::WidgetHierarchyTree + { + Q_OBJECT + public: + WidgetHierarchy( QWidget *parent = NULL ); + ~WidgetHierarchy(); + + }; +} + +#endif diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_hierarchy.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_hierarchy.ui new file mode 100644 index 000000000..d0c1d9db5 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/gui_editor/widget_hierarchy.ui @@ -0,0 +1,90 @@ + + + WidgetHierarchyTree + + + + 0 + 0 + 497 + 434 + + + + Widget Hieararchy + + + + + + + Widgets + + + + + root + + + + container1 + + + + group1 + + + + group3 + + + + + group4 + + + + button1 + + + + + button2 + + + + + text1 + + + + + bitmap1 + + + + + + + group2 + + + + + + container2 + + + + + container3 + + + + + + + + + +