From 2029cdbac939dbe06d1f6211c47ea788c0b7c863 Mon Sep 17 00:00:00 2001 From: sfb Date: Wed, 1 Jun 2011 07:44:44 -0500 Subject: [PATCH 02/12] Changed: Fixed a bug with the log plugin causing crashes when the apply button was clicked for settings. --- .../object_viewer_qt/src/plugins/log/log_plugin.cpp | 2 +- .../src/plugins/log/log_settings_page.cpp | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_plugin.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_plugin.cpp index 2f88200ec..b1f3cbc18 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_plugin.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_plugin.cpp @@ -103,7 +103,7 @@ namespace Plugin QString CLogPlugin::name() const { - return "NeL Log"; + return "LogPlugin"; } QString CLogPlugin::version() const diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_settings_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_settings_page.cpp index f75d6ab37..02d6cd24d 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_settings_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_settings_page.cpp @@ -99,11 +99,14 @@ namespace Plugin writeSettings(); ExtensionSystem::IPluginManager *p = Core::ICore::instance()->pluginManager(); - ExtensionSystem::IPlugin *plugin = p->pluginByName("LogPlugin")->plugin(); - CLogPlugin* lp = dynamic_cast(plugin); - if (lp) + ExtensionSystem::IPluginSpec *spec = p->pluginByName("LogPlugin"); + + if(spec) { - lp->setDisplayers(); + ExtensionSystem::IPlugin *plugin = spec->plugin(); + CLogPlugin* lp = dynamic_cast(plugin); + if (lp) + lp->setDisplayers(); } } From f22c066863e81c4d6c5046de22841455967b28e7 Mon Sep 17 00:00:00 2001 From: sfb Date: Wed, 1 Jun 2011 07:45:20 -0500 Subject: [PATCH 03/12] Changed: Added the primitive file path and ligo config file to the "data section" - automatically applied these paths to addSearchPath. --- .../src/plugins/core/core_constants.h | 2 + .../plugins/core/general_settings_page.cpp | 36 +++++++++++++++++ .../src/plugins/core/general_settings_page.h | 2 + .../src/plugins/core/general_settings_page.ui | 40 +++++++++++++++++-- 4 files changed, 77 insertions(+), 3 deletions(-) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_constants.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_constants.h index 7f0b5cd15..745812c2a 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_constants.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_constants.h @@ -78,6 +78,8 @@ const char * const SEARCH_PATHS = "SearchPaths"; const char * const RECURSIVE_SEARCH_PATHS = "RecursiveSearchPathes"; const char * const LEVELDESIGN_PATH = "LevelDesignPath"; const char * const ASSETS_PATH = "AssetsPath"; +const char * const PRIMITIVES_PATH = "PrimitivesPath"; +const char * const LIGOCONFIG_FILE = "LigoConfigFile"; const char * const REMAP_EXTENSIONS = "RemapExtensions"; const char * const LOG_SECTION = "LogSettings"; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/general_settings_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/general_settings_page.cpp index 51da80f67..a050f4789 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/general_settings_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/general_settings_page.cpp @@ -82,6 +82,15 @@ void GeneralSettingsPage::applyGeneralSettings() else QApplication::setPalette(m_originalPalette); settings->endGroup(); + + // Add primitives path and ligo config file to CPath + settings->beginGroup(Core::Constants::DATA_PATH_SECTION); + QString primitivePath = settings->value(Core::Constants::PRIMITIVES_PATH, "l:/primitives").toString(); + QString ligoConfigFile = settings->value(Core::Constants::LIGOCONFIG_FILE, "l:/leveldesign/world_editor_files/world_editor_classes.xml").toString(); + NLMISC::CPath::addSearchPath(primitivePath.toStdString(), true, false); + NLMISC::CPath::display(); + NLMISC::CPath::addSearchFile(ligoConfigFile.toStdString()); + settings->endGroup(); } QWidget *GeneralSettingsPage::createPage(QWidget *parent) @@ -94,6 +103,8 @@ QWidget *GeneralSettingsPage::createPage(QWidget *parent) connect(m_ui.pluginsPathButton, SIGNAL(clicked()), this, SLOT(setPluginsPath())); connect(m_ui.leveldesignPathButton, SIGNAL(clicked()), this, SLOT(setLevelDesignPath())); connect(m_ui.assetsPathButton, SIGNAL(clicked()), this, SLOT(setAssetsPath())); + connect(m_ui.primitivesPathButton, SIGNAL(clicked()), this, SLOT(setPrimitivesPath())); + connect(m_ui.ligoConfigFileButton, SIGNAL(clicked()), this, SLOT(setLigoConfigFile())); return m_page; } @@ -135,6 +146,27 @@ void GeneralSettingsPage::setLevelDesignPath() } } +void GeneralSettingsPage::setPrimitivesPath() +{ + QString newPath = QFileDialog::getExistingDirectory(0, tr("Set the primitives path"), + m_ui.primitivesPathLineEdit->text()); + if (!newPath.isEmpty()) + { + m_ui.primitivesPathLineEdit->setText(newPath); + } +} + +void GeneralSettingsPage::setLigoConfigFile() +{ + QString newFile = QFileDialog::getOpenFileName(0, tr("Set the ligo config file"), + m_ui.ligoConfigFileLineEdit->text()); + if (!newFile.isEmpty()) + { + m_ui.ligoConfigFileLineEdit->setText(newFile); + } +} + + void GeneralSettingsPage::setAssetsPath() { QString newPath = QFileDialog::getExistingDirectory(0, tr("Set the assets path"), @@ -165,6 +197,8 @@ void GeneralSettingsPage::readSettings() settings->beginGroup(Core::Constants::DATA_PATH_SECTION); m_ui.leveldesignPathLineEdit->setText(settings->value(Core::Constants::LEVELDESIGN_PATH, "l:/leveldesign").toString()); m_ui.assetsPathLineEdit->setText(settings->value(Core::Constants::ASSETS_PATH, "w:/database").toString()); + m_ui.primitivesPathLineEdit->setText(settings->value(Core::Constants::PRIMITIVES_PATH, "l:/primitives").toString()); + m_ui.ligoConfigFileLineEdit->setText(settings->value(Core::Constants::LIGOCONFIG_FILE, "l:/leveldesign/world_editor_files/world_editor_classes.xml").toString()); settings->endGroup(); } @@ -185,6 +219,8 @@ void GeneralSettingsPage::writeSettings() settings->beginGroup(Core::Constants::DATA_PATH_SECTION); settings->setValue(Core::Constants::LEVELDESIGN_PATH, m_ui.leveldesignPathLineEdit->text()); settings->setValue(Core::Constants::ASSETS_PATH, m_ui.assetsPathLineEdit->text()); + settings->setValue(Core::Constants::PRIMITIVES_PATH, m_ui.primitivesPathLineEdit->text()); + settings->setValue(Core::Constants::LIGOCONFIG_FILE, m_ui.ligoConfigFileLineEdit->text()); settings->endGroup(); settings->sync(); } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/general_settings_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/general_settings_page.h index 2fbcb842a..22ab30e45 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/general_settings_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/general_settings_page.h @@ -57,6 +57,8 @@ private Q_SLOTS: void setPluginsPath(); void setLevelDesignPath(); void setAssetsPath(); + void setPrimitivesPath(); + void setLigoConfigFile(); private: void readSettings(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/general_settings_page.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/general_settings_page.ui index d2aa042e3..7d40b65df 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/general_settings_page.ui +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/general_settings_page.ui @@ -105,7 +105,7 @@ - Plugins path: + Plugins @@ -129,7 +129,7 @@ - Level design path: + Sheets @@ -153,7 +153,7 @@ - Assets path: + Assets Database: @@ -174,6 +174,40 @@ + + + + Primitives + + + + + + + + + + ... + + + + + + + + + + Ligo Config File + + + + + + + ... + + + From 08f911759ac8e73cf747fbc9839815a11d0ec1bb Mon Sep 17 00:00:00 2001 From: sfb Date: Wed, 1 Jun 2011 07:45:55 -0500 Subject: [PATCH 04/12] Changed: Initial footwork on OVQT-based mission compiler plugin. --- .../src/plugins/CMakeLists.txt | 1 + .../plugins/mission_compiler/CMakeLists.txt | 41 ++++ .../mission_compiler_main_window.cpp | 63 ++++++ .../mission_compiler_main_window.h | 36 ++++ .../mission_compiler_main_window.ui | 195 ++++++++++++++++++ .../mission_compiler_plugin.cpp | 132 ++++++++++++ .../mission_compiler_plugin.h | 105 ++++++++++ 7 files changed, 573 insertions(+) create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/CMakeLists.txt create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.h create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.ui create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_plugin.cpp create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_plugin.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/CMakeLists.txt index bec71cf94..c5d49418d 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/CMakeLists.txt @@ -7,3 +7,4 @@ ADD_SUBDIRECTORY(disp_sheet_id) ADD_SUBDIRECTORY(object_viewer) ADD_SUBDIRECTORY(zone_painter) ADD_SUBDIRECTORY(georges_editor) +ADD_SUBDIRECTORY(mission_compiler) \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/CMakeLists.txt new file mode 100644 index 000000000..70f4d0642 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/CMakeLists.txt @@ -0,0 +1,41 @@ +INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${LIBXML2_INCLUDE_DIR} + ${QT_INCLUDES}) + +FILE(GLOB SRC *.cpp *.h) + +SET(OVQT_EXT_SYS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin.h + ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin_manager.h + ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin_spec.h) + +SET(OVQT_PLUG_MISSION_COMPILER_HDR mission_compiler_plugin.h + mission_compiler_main_window.h) + +SET(OVQT_PLUG_MISSION_COMPILER_UIS mission_compiler_main_window.ui) + +#SET(OVQT_PLUG_ZONE_PAINTER_RCS zone_painter.qrc) + +SET(QT_USE_QTGUI TRUE) + +QT4_WRAP_CPP(OVQT_PLUG_MISSION_COMPILER_MOC_SRC ${OVQT_PLUG_MISSION_COMPILER_HDR}) +#QT4_ADD_RESOURCES( OVQT_PLUG_ZONE_PAINTER_RC_SRCS ${OVQT_PLUG_ZONE_PAINTER_RCS}) +QT4_WRAP_UI(OVQT_PLUG_MISSION_COMPILER_UI_HDRS ${OVQT_PLUG_MISSION_COMPILER_UIS}) + +SOURCE_GROUP(QtResources FILES ${OVQT_PLUG_MISSION_COMPILER_UIS}) +SOURCE_GROUP(QtGeneratedUiHdr FILES ${OVQT_PLUG_MISSION_COMPILER_UI_HDRS}) +SOURCE_GROUP(QtGeneratedMocSrc FILES ${OVQT_PLUG_MISSION_COMPILER_MOC_SRC} ) +SOURCE_GROUP("Mission Compiler Plugin" FILES ${SRC}) +SOURCE_GROUP("OVQT Extension System" FILES ${OVQT_EXT_SYS_SRC}) + +ADD_LIBRARY(ovqt_plugin_mission_compiler MODULE ${SRC} ${OVQT_PLUG_MISSION_COMPILER_MOC_SRC} ${OVQT_EXT_SYS_SRC} ${OVQT_PLUG_MISSION_COMPILER_UI_HDRS}) + +TARGET_LINK_LIBRARIES(ovqt_plugin_mission_compiler ovqt_plugin_core nelmisc nelligo ${QT_LIBRARIES} ${QT_QTOPENGL_LIBRARY}) + +NL_DEFAULT_PROPS(ovqt_plugin_mission_compiler "NeL, Tools, 3D: Object Viewer Qt Plugin: Mission Compiler") +NL_ADD_RUNTIME_FLAGS(ovqt_plugin_mission_compiler) +NL_ADD_LIB_SUFFIX(ovqt_plugin_mission_compiler) + +ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS}) + +INSTALL(TARGETS ovqt_plugin_mission_compiler LIBRARY DESTINATION lib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib COMPONENT tools3d) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp new file mode 100644 index 000000000..dcf17ba34 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp @@ -0,0 +1,63 @@ +#include "mission_compiler_main_window.h" +#include "ui_mission_compiler_main_window.h" + +#include +#include +#include +#include +#include + +#include "../core/icore.h" +#include "../core/imenu_manager.h" +#include "../core/core_constants.h" + +#include + +MissionCompilerMainWindow::MissionCompilerMainWindow(QWidget *parent) : + QMainWindow(parent), + ui(new Ui::MissionCompilerMainWindow) +{ + ui->setupUi(this); + + // Load the settings. + loadConfig(); + + m_undoStack = new QUndoStack(this); + + // Populate the "all" primitives box. + std::vector paths; + NLMISC::CPath::getFileList("primitive", paths); + + std::vector::iterator itr = paths.begin(); + while( itr != paths.end() ) + { + const char *path2 = (*itr).c_str(); + ui->allPrimitivesList->insertItem(0,path2); + ++itr; + } +} + +void MissionCompilerMainWindow::loadConfig() { + QSettings *settings = Core::ICore::instance()->settings(); + settings->beginGroup("MissionCompiler"); + + //QColor color; + //color = settings->value("BackgroundColor", QColor(80, 80, 80)).value(); + //m_nelWidget->setBackgroundColor(NLMISC::CRGBA(color.red(), color.green(), color.blue(), color.alpha())); +} + +void MissionCompilerMainWindow::saveConfig() { + QSettings *settings = Core::ICore::instance()->settings(); + settings->beginGroup("MissionCompiler" ); + + //QColor color(m_nelWidget->backgroundColor().R, m_nelWidget->backgroundColor().G, m_nelWidget->backgroundColor().B, m_nelWidget->backgroundColor().A); + //settings->setValue("BackgroundColor", color); + + settings->endGroup(); + settings->sync(); +} + +MissionCompilerMainWindow::~MissionCompilerMainWindow() +{ + delete ui; +} diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.h new file mode 100644 index 000000000..9e94ea9fb --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.h @@ -0,0 +1,36 @@ +#ifndef MISSION_COMPILER_MAIN_WINDOW_H +#define MISSION_COMPILER_MAIN_WINDOW_H + +#include +#include +#include +#include +#include +#include + +namespace Ui { + class MissionCompilerMainWindow; +} + +class MissionCompilerMainWindow : public QMainWindow +{ + Q_OBJECT + +public: + explicit MissionCompilerMainWindow(QWidget *parent = 0); + ~MissionCompilerMainWindow(); + + void loadConfig(); + void saveConfig(); + QUndoStack *getUndoStack() { return m_undoStack; } + + +private: + Ui::MissionCompilerMainWindow *ui; + + QMenu *_toolModeMenu; + QUndoStack *m_undoStack; + QStringListModel *m_allPrimitivesModel; +}; + +#endif // MISSION_COMPILER_MAIN_WINDOW_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.ui new file mode 100644 index 000000000..30756f91c --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.ui @@ -0,0 +1,195 @@ + + + MissionCompilerMainWindow + + + + 0 + 0 + 794 + 600 + + + + MainWindow + + + + + + + 0 + + + + + 0 + 0 + 776 + 398 + + + + Mission Compiler Options + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + >> + + + + + + + ALL >> + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + << ALL + + + + + + + << + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + Publish Options + + + + + + + + + + + 0 + 0 + 776 + 398 + + + + Compilation Output + + + + + + true + + + + + + + + + + + Actions + + + + + + Validate + + + + + + + Compile + + + + + + + Compile and Publish + + + + + + + + + + + + 0 + 0 + 794 + 21 + + + + + + + + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_plugin.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_plugin.cpp new file mode 100644 index 000000000..cfea63959 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_plugin.cpp @@ -0,0 +1,132 @@ +// Project includes +#include "mission_compiler_plugin.h" +#include "../core/icore.h" +#include "../core/core_constants.h" +#include "../core/imenu_manager.h" +#include "../../extension_system/iplugin_spec.h" + +// NeL includes +#include "nel/misc/debug.h" + +// Qt includes +#include +#include +#include +#include +#include +#include + +namespace Plugin +{ + +MissionCompilerPlugin::~MissionCompilerPlugin() +{ + Q_FOREACH(QObject *obj, _autoReleaseObjects) + { + _plugMan->removeObject(obj); + } + qDeleteAll(_autoReleaseObjects); + _autoReleaseObjects.clear(); +} + +bool MissionCompilerPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) +{ + Q_UNUSED(errorString); + _plugMan = pluginManager; + + //addAutoReleasedObject(new CZonePainterSettingsPage(this)); + addAutoReleasedObject(new CMissionCompilerContext(this)); + //addAutoReleasedObject(new CCoreListener(this)); + return true; +} + +void MissionCompilerPlugin::extensionsInitialized() +{ + Core::ICore *core = Core::ICore::instance(); + QSettings *settings = Core::ICore::instance()->settings(); + Core::IMenuManager *menuManager = core->menuManager(); + //menuManager = _plugMan->getObject(); + //QAction *exampleAction1 = new QAction("Zone1", this); + //QAction *exampleAction2 = new QAction("Zone2", this); + //QMenu *toolsMenu = menuManager->menu(Core::Constants::M_TOOLS); + //helpMenu->insertAction(aboutQtAction, exampleAction1); + //helpMenu->addSeparator(); + //helpMenu->addAction(exampleAction2); + //QMenu *zoneMenu = menuManager->menuBar()->addMenu("ZoneMenu"); + //zoneMenu->insertAction(aboutQtAction, exampleAction1); + //zoneMenu->addSeparator(); + //zoneMenu->addAction(exampleAction2); + + // Initialize Ligo. + settings->beginGroup(Core::Constants::DATA_PATH_SECTION); + QString ligoConfigFile = settings->value(Core::Constants::DATA_PATH_SECTION).toString(); + settings->beginGroup(Core::Constants::DATA_PATH_SECTION); + + NLLIGO::Register(); + LigoConfig.readPrimitiveClass(ligoConfigFile.toAscii().data(), false); + NLLIGO::CPrimitiveContext::instance().CurrentLigoConfig = &LigoConfig; +} + +void MissionCompilerPlugin::setNelContext(NLMISC::INelContext *nelContext) +{ +#ifdef NL_OS_WINDOWS + // Ensure that a context doesn't exist yet. + // This only applies to platforms without PIC, e.g. Windows. + nlassert(!NLMISC::INelContext::isContextInitialised()); +#endif // NL_OS_WINDOWS + _LibContext = new NLMISC::CLibraryContext(*nelContext); +} + +QString MissionCompilerPlugin::name() const +{ + return "MissionCompilerPlugin"; +} + +QString MissionCompilerPlugin::version() const +{ + return "0.1"; +} + +QString MissionCompilerPlugin::vendor() const +{ + return "Ryzom Core"; +} + +QString MissionCompilerPlugin::description() const +{ + return "Mission Compiler Plugin"; +} + +QStringList MissionCompilerPlugin::dependencies() const +{ + QStringList list; + list.append(Core::Constants::OVQT_CORE_PLUGIN); + //list.append("ObjectViewer"); + return list; +} + +void MissionCompilerPlugin::addAutoReleasedObject(QObject *obj) +{ + _plugMan->addObject(obj); + _autoReleaseObjects.prepend(obj); +} + +QObject* MissionCompilerPlugin::objectByName(const QString &name) const +{ + Q_FOREACH (QObject *qobj, _plugMan->allObjects()) + if (qobj->objectName() == name) + return qobj; + return 0; +} + +ExtensionSystem::IPluginSpec *MissionCompilerPlugin::pluginByName(const QString &name) const +{ + Q_FOREACH (ExtensionSystem::IPluginSpec *spec, _plugMan->plugins()) + if (spec->name() == name) + return spec; + return 0; +} + +} + +Q_EXPORT_PLUGIN(Plugin::MissionCompilerPlugin) \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_plugin.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_plugin.h new file mode 100644 index 000000000..a9d34bd13 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_plugin.h @@ -0,0 +1,105 @@ +#ifndef MISSION_COMPILER_PLUGIN_H +#define MISSION_COMPILER_PLUGIN_H + +// Project includes +#include "../../extension_system/iplugin.h" +#include "../core/icontext.h" +#include "mission_compiler_main_window.h" + +// NeL includes +#include +#include +#include +#include + +// Qt includes +#include +#include + +namespace NLMISC +{ +class CLibraryContext; +} + +namespace ExtensionSystem +{ +class IPluginSpec; +} + +namespace Plugin +{ + +class MissionCompilerPlugin : public QObject, public ExtensionSystem::IPlugin +{ + Q_OBJECT + Q_INTERFACES(ExtensionSystem::IPlugin) +public: + + virtual ~MissionCompilerPlugin(); + + bool initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString); + void extensionsInitialized(); + + void setNelContext(NLMISC::INelContext *nelContext); + + QString name() const; + QString version() const; + QString vendor() const; + QString description() const; + QStringList dependencies() const; + + void addAutoReleasedObject(QObject *obj); + + QObject *objectByName(const QString &name) const; + ExtensionSystem::IPluginSpec *pluginByName(const QString &name) const; + + NLLIGO::CLigoConfig LigoConfig; + +protected: + NLMISC::CLibraryContext *_LibContext; + +private: + ExtensionSystem::IPluginManager *_plugMan; + QList _autoReleaseObjects; +}; + +class CMissionCompilerContext: public Core::IContext +{ + Q_OBJECT +public: + CMissionCompilerContext(QObject *parent = 0): IContext(parent) + { + m_missionCompilerMainWindow = new MissionCompilerMainWindow(); + } + virtual ~CMissionCompilerContext() {} + + virtual QString id() const + { + return QLatin1String("MissionCompilerContext"); + } + virtual QString trName() const + { + return tr("Mission Compiler"); + } + virtual QIcon icon() const + { + return QIcon(); + } + virtual QWidget *widget() + { + return m_missionCompilerMainWindow; + } + + virtual QUndoStack *undoStack() + { + return m_missionCompilerMainWindow->getUndoStack(); + } + virtual void open() {} + + + MissionCompilerMainWindow *m_missionCompilerMainWindow; +}; + +} // namespace Plugin + +#endif // MISSION_COMPILER_PLUGIN_H From 4247257e77ad5da6c3899543b026b2c3bd1ddbc4 Mon Sep 17 00:00:00 2001 From: sfb Date: Wed, 1 Jun 2011 18:41:01 -0500 Subject: [PATCH 05/12] Changed: Added some more UI tweaks - most of the UI design is now done. --- .../plugins/mission_compiler/CMakeLists.txt | 10 +- .../mission_compiler/images/arrow-left-2.png | Bin 0 -> 1512 bytes .../images/arrow-left-double-2.png | Bin 0 -> 1893 bytes .../mission_compiler/images/arrow-right-2.png | Bin 0 -> 1478 bytes .../images/arrow-right-double-2.png | Bin 0 -> 1899 bytes .../images/document-export-4.png | Bin 0 -> 1604 bytes .../images/news-subscribe-2.png | Bin 0 -> 1805 bytes .../mission_compiler/images/run-build-2.png | Bin 0 -> 2228 bytes .../mission_compiler/mission_compiler.qrc | 11 + .../mission_compiler_main_window.cpp | 25 ++- .../mission_compiler_main_window.h | 7 + .../mission_compiler_main_window.ui | 212 ++++++++++++++---- .../mission_compiler_plugin.cpp | 11 +- 13 files changed, 222 insertions(+), 54 deletions(-) create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/arrow-left-2.png create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/arrow-left-double-2.png create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/arrow-right-2.png create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/arrow-right-double-2.png create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/document-export-4.png create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/news-subscribe-2.png create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/run-build-2.png create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler.qrc diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/CMakeLists.txt index 70f4d0642..af39fc18a 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/CMakeLists.txt @@ -14,21 +14,21 @@ SET(OVQT_PLUG_MISSION_COMPILER_HDR mission_compiler_plugin.h SET(OVQT_PLUG_MISSION_COMPILER_UIS mission_compiler_main_window.ui) -#SET(OVQT_PLUG_ZONE_PAINTER_RCS zone_painter.qrc) +SET(OVQT_PLUG_MISSION_COMPILER_RCS mission_compiler.qrc) SET(QT_USE_QTGUI TRUE) QT4_WRAP_CPP(OVQT_PLUG_MISSION_COMPILER_MOC_SRC ${OVQT_PLUG_MISSION_COMPILER_HDR}) -#QT4_ADD_RESOURCES( OVQT_PLUG_ZONE_PAINTER_RC_SRCS ${OVQT_PLUG_ZONE_PAINTER_RCS}) +QT4_ADD_RESOURCES( OVQT_PLUG_MISSION_COMPILER_RC_SRCS ${OVQT_PLUG_MISSION_COMPILER_RCS}) QT4_WRAP_UI(OVQT_PLUG_MISSION_COMPILER_UI_HDRS ${OVQT_PLUG_MISSION_COMPILER_UIS}) -SOURCE_GROUP(QtResources FILES ${OVQT_PLUG_MISSION_COMPILER_UIS}) +SOURCE_GROUP(QtResources FILES ${OVQT_PLUG_MISSION_COMPILER_UIS} ${OVQT_PLUG_MISSION_COMPILER_RCS}) SOURCE_GROUP(QtGeneratedUiHdr FILES ${OVQT_PLUG_MISSION_COMPILER_UI_HDRS}) -SOURCE_GROUP(QtGeneratedMocSrc FILES ${OVQT_PLUG_MISSION_COMPILER_MOC_SRC} ) +SOURCE_GROUP(QtGeneratedMocSrc FILES ${OVQT_PLUG_MISSION_COMPILER_MOC_SRC} ${OVQT_PLUG_MISSION_COMPILER_RC_SRCS}) SOURCE_GROUP("Mission Compiler Plugin" FILES ${SRC}) SOURCE_GROUP("OVQT Extension System" FILES ${OVQT_EXT_SYS_SRC}) -ADD_LIBRARY(ovqt_plugin_mission_compiler MODULE ${SRC} ${OVQT_PLUG_MISSION_COMPILER_MOC_SRC} ${OVQT_EXT_SYS_SRC} ${OVQT_PLUG_MISSION_COMPILER_UI_HDRS}) +ADD_LIBRARY(ovqt_plugin_mission_compiler MODULE ${SRC} ${OVQT_PLUG_MISSION_COMPILER_MOC_SRC} ${OVQT_PLUG_MISSION_COMPILER_RC_SRCS} ${OVQT_EXT_SYS_SRC} ${OVQT_PLUG_MISSION_COMPILER_UI_HDRS}) TARGET_LINK_LIBRARIES(ovqt_plugin_mission_compiler ovqt_plugin_core nelmisc nelligo ${QT_LIBRARIES} ${QT_QTOPENGL_LIBRARY}) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/arrow-left-2.png b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/arrow-left-2.png new file mode 100644 index 0000000000000000000000000000000000000000..8f153292c3c8f4e41e5ce87e5eb8e72fad7ba126 GIT binary patch literal 1512 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjEa{HEjtmUzPnffIy#(^vlDyqr zfHV;NblzPLq&N#aB8!2v2N=7Z%(epwmK8Xr18J~%3>7|0moYFfKk#&M4DmR=_3G{X z5LcN4AK#yuv-x?>cPD*s?+GQEsh$fWc5+S>*lFkRC@VvWtIPkGxT)5p2b1-WnHyd_ zvgBHey@RliNUvb>qKgp+JiJ4t8lw`TS1r|f8+R`CyyatNI{~e{wZFX8Ci^`5{yW8J z^3Q|+Ws>gAd|j=0Va@BfGnby`)_nQt+9dFz{*yg}*%!x!JZsCOJ91Bj%=D1FpP4yt z@&AN^-(ipC#rN;$*9o4qG5mPaG4Jf%w>~unbRLZFQfJnk&%Evo|BVlNKNMYVEqapY zzkKcV?fH54e;v73eRe&&x}?;~6wZ=Q=eF!*l>WUSidpsYkB9rN`8;aA6#h>v%6$ww|%^%?$keVOKjY3&Rt??x7=Dl zqG)AH`eyHFzGvm@vtoCu9XDs~E@thGpZDpc9+cr<`*MHLY zTcCO&A*#(Va`TU}2qP0dRsJQb1qF}zT>k8I_@J4x%jf%cPNvzZh4&cSy3J#MA9_); ze06e}b8;6)r+B1J+>~jjqmFFql3rI-`&Bwf^o5Na zZ_CRGj+-=DFD;O|Wn#KKGJes2wPj5Xuj>Vxa2b}m21 zw)MrP;8kS;Y~7Q%rCcn=&N(ZSk*1|tIlOI<@FT?2~{LnA9wV=F^rT?2C~1B3agXKY~_ zKq{>ux_}xC4Rj5Rbd3x`jEt>}%&ZJeAsX1MV;WI308-w%HO3D+9QW+dm@{>{(JaZG%Q-e|y zQz{EjrrH1%@j?`p7A2=L_?4FB=OnK2H~k2dFhNMfhX(n;oLpXBu9umdpQoFhnU}5y jbhv&&QGQlxa!Ij%9$346ne7%(SgTe~DWM4fC9QN+ literal 0 HcmV?d00001 diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/arrow-left-double-2.png b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/arrow-left-double-2.png new file mode 100644 index 0000000000000000000000000000000000000000..8b6d62c7a6cfa1ff82302ff120359a54b7af657d GIT binary patch literal 1893 zcmai#c|04~7RNJM#!`E=YORW;LskhDd#PB$SZfa&p+Uq%BvMPLdc;=KD%Az;h<#rN zWu~f$Wzas`Ywc=z9;H-c>#GUgeBS5%_3r0$&+p!I&-b2l|G9_hV2>6RmJ+U3dVATv8N0HCHvk3V&Vw->l!i?-k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_Q2Bce3m*ovUAyaIp_qRr6CEQ)o@bt}DKrTxb|W?{Y@26^T^m za_ZCK7Z&YzzsN-uM}boo^-2P_3%VRuF;aKV@~L=!N7}<~FHiYxKN;If*112LxcKwt zJMT-s+me2DvW>3bt^gdX7uPs<(C?wPy=!w1@8|;}e-BH$a_wNJk?VCCHGL ze|qhjL`2eTke13rWNCMFlc|v&w%8=y^zt@ZIK<=S1`V9P(_x^1>OHT)u5fbaYGnQE z^wm|hwYw3YlCH3OR3nhsPv-e4NDT=Lq%kGr^(zhQC(4DLZ3f9%;ASJcCZ(-DyTbuv zf~ns#g2kL_-eP-~_u(*O`&5>&3Mk#>QyRCT!540u8#BAVa=5&EKDH2<)2)?f$NP2F zDA(L6I5OU!f(Hfg3;+&=>Vsf#5cG-*430wTppMphD4th}!~6?4ibS1IJOBm-LE#`c z)CI1Cg6pDS$P+-oz&qi803s=X5J>+I00Y5bE>L|G9EyU$P5_bTSS$}f9+iY4;P7D) zc)(2xB^(8T9OoiX@i-EZND7MplgL4k(36k|2nOwdfxy8qh{4Ooqb_p%rjum<=S_jX z)OGNH3r889Nr4oaKN$}&3n1OVU$iFr2jQLY{sHu#dhv$5AkmYcNHPu&u#cpYLj5a$ zL~im95dS^!b#=o0RWgl60~2thFi;2~EC|di91>0@1>Z^XY{{$yGPTv3k literal 0 HcmV?d00001 diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/arrow-right-2.png b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/arrow-right-2.png new file mode 100644 index 0000000000000000000000000000000000000000..d4016e2c72a2461b0722fc3aa38b48408a69c629 GIT binary patch literal 1478 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjEa{HEjtmUzPnffIy#(^vlDyqr zfHV;NblzPLq&N#aB8!2v2N=7Z%(epwmK8Xr18J~%3>7|0moYFf@AGtV4DmR=_tNR? zm{f`5AKzD7razlA^Q6kd^L zo#?XOg-a9eC*RÅZ){re2Z8$Y+_3r~;@KCofaH$mZBs%z#hxKKQIE$feOM|qix zZYJd}7kl)!y4~8ZFXjC&i)Y90FaDb*ChGNV&R$st-JlEK6Si5`y?Nnrd*9x_=a)zS zoy_tsIO6rj@7fhbkK!2`M4Q?IQg)dYKM4qvuc`WQ(fYl|T!oU7g9;bf?e>eJ6>gqr@Z&u<$E|mPo9^(F~*@&(naUVL-WK>cS{+fzd3K+lkxcF=cTJO z<4%YE(&9BLeP|qfp<>?Y69GZXY_8VYo@buw5WQqq%hgc1DsDCR>kMh-E`eKFZp3m^S^D;N9L@3xa?3ODb}jX|+aD{Uq(E-Pht@Jig^ zx8;}pSB~WGlxX#tp1o{yOy;+%AD$kqJli`dA$*NZ z=t;kR9N6~dUDLfMXQn(>u{p6sC;S=D<^63(gRaio=rqr%YvPttf#Fe2;c~5=U-4l4sVd6MXo*NOu!lQ#Wg2mIC$SHKb7Ln1Y=(tqyYSzOk8*3V-#0$BqCUIKG#v22zDq&rjw$_mOYmjLMOWGkN z{{>$xHz+>Vea-cMX7o0hSr;?ZwU@|kbP}ETNqWzh_a>)4oILiZo;ik1Vdu)$6CSI+ zax7{3_@(Xf|I>dNcY3vT+@9EJ3Cz~2C9V-A$wjG&C8@e8K!U-@z`#=1&`8(7BE-CMA49&pOTqY z3DsbzYiJl^U}KKAFj>dBv#=86_nJR{Hv2yE4mClk;Bl$^@oS6Y^zleos;^dnHh1R)V08sr0Wa(Q{V uUS@KBo^Ez#Ub-I8;razd`B|ySCB^!AVD0*4wp&0YHG`+CpUXO@geCxCqjY!x literal 0 HcmV?d00001 diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/arrow-right-double-2.png b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/arrow-right-double-2.png new file mode 100644 index 0000000000000000000000000000000000000000..1fe9feb284002c2c194f74aeb4c1985e12e729d1 GIT binary patch literal 1899 zcmai#c{~*A8po$&--_fU6glM6WmelU(qyumOj)L}H^vy-%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l%Y2VrZ z$ti&S;IRlew(HS_5MGyd%{uDogmOTkaBsddr{xRV%2xmk_3j0Qp5qJW?DUwbJ z#Z{w?S40;^|Gn^ab4L9ga#U0lC14DwyM35+Oa99K-n1H8I!Q?$0Ot)y*EvEo` MYbUGw$Sc?X1Hp?})c^nh literal 0 HcmV?d00001 diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/document-export-4.png b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/document-export-4.png new file mode 100644 index 0000000000000000000000000000000000000000..bc76888585fa83ffc6e6acc390fefdbb83ab4316 GIT binary patch literal 1604 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjY)RhkEu-kbUIVD{!X-4)8V`{&-A`TqC4>dog(tgL=H+Q{u!UaBI{ z$k4#y!ou)%=iXwISproP ztvDo-Z`{9szs|t+uZ)9sAKa_+Q9y*z}F5A`2fMUxEZ%2S;rD7z$jqP5$a3HP7Z6gTnOFjvS2{CS5*ikLBg$`1<<$w+l7Ac(lOxl7f=Bg{6nZ zbB%fP7Oh{;Z)i{FPXUc2_J zxq*Set$X+W1*jgsUMXoIc+li*T33s}S(CzZic4Mc^Yxn!Dli-{=qWOq>GOKmzkpng z_V6y5iz`=g?Z1DYMa0R$i!=6mVNp@jzkhWM4oibpst9%7J$v?S`_ZJ2%ek3u?{1V$ zRF>e`_QuxQ+SzXY@dpnSm>L;YUCpYjt*y15>ScSWwANC9BZ5co>$_PNwTpK!Bt(jB zx~X&Mp@Gvv0j;U0Dvf6T(Vps6TU}AHLxhKI?aGy!SF#_xFrVJId+{b6?x#hP7c)fW z6u)`%CL}yOe16#KtE{eptAvGx%T{mb_K{PFdl2LmF^%<{<)1qHvhwncTfeHCnVAI@ z7k@rIYguSoTAJRjOz-wD9-X_z<`hrq5#sw?c_m9MWGk=q{{P#4pN@L;+UHs5vW0&Z z-Td2sQ9;n@fQj#(Yw?Ts#yYDMF}E&uscJ5T_ zj~cr@cW#|JXIJ;<>YX=lHm^(A@JzMuVVC}8-=s(}ucbmFt_S7yN8V+UVQZD&*$t}X`#NKU;Sd_5WL9Ca7y)9jxvMF zQk{kWj>j=8$Q+ARWAI3yB+77|;YZGUv-!Cx^6MB^Fj=rCSj}7gZ4X<+fA*QNm*!Rm zG4lgU4%HIZh?3-@)Wnih-4r0fU}RumscUGcYiJr`Xl`X-WMyowYXD>zwDV8thiL$* zw1VgYYA`g=H89dOG6*p;wlXraGBkx~V6%>CMA49&pOTqY3Dp3!!7#+Y5~RVz5Td~^ zMxhp{Asyr-pUmXcyy8@bjFOT9D}8;iU72O6$@#gt`FX{9`9=0i`}Mu~s?$I%44$rjF6*2UngH#hkgNaz literal 0 HcmV?d00001 diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/news-subscribe-2.png b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/news-subscribe-2.png new file mode 100644 index 0000000000000000000000000000000000000000..d5259a76be445872183b39b00889f995f0b6d9d0 GIT binary patch literal 1805 zcma)+c~nzZ9>*Vx7zB~HV4!hOkZ6UFJAX#>2c z%8$v34s=*Q@j!}K-3w<5O7QgU3ylC7VZ+-H}eH_nh+eibm3=*$jJ-wwP^HB zoaVm5n+MA?{1E%CA{GvyHaqCrOz@o&1enbuA2Xby5snHM$DYo}pjWyk!TWCQD+x~J zSoZaW4K#=AjDl^$J9mzLc)hgNZaB8=F*o+$+3>Id6l`SFu=Vib*@d-tzvf+Fxl&Gx zZpJW1wr6-t_<7pry+3>;$G*GM7;(txRaY>e&?AvZ?RF^b^gz0O@hNqjHqSV3dle1Z zFD=T`rJi||Dn-*C4G)LtA?=V?j}KTm%G!JWz@)C7UcZx2p{-VWRVsIwkTl@*i(R`= zew2c1KkyIT==*YUsHng7BBa^TUATK*Y_GPZh&L4A&T_HHY8DXXFlGb z7!N)zl45pLBQiTPE^a57IA=BM=o~CmmD&N2U-`N0YA`#`+qHZ9E&$A9xT>rM*q(Ek zzPB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I~7j<2GukTPapWtbOgoU>+@EXi!ndBv9U_`r@g+l;y-~Az}>~ixydn- F_a_&a9Pj`D literal 0 HcmV?d00001 diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/run-build-2.png b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/run-build-2.png new file mode 100644 index 0000000000000000000000000000000000000000..5fea6c540bc908826f0d875e9b490146fcddf973 GIT binary patch literal 2228 zcma);cU05K7RP^5Lz66m1PDbQ7(hb`)eu@j6In_C1qCS~uu%hnP{InK3kn-7VL>Sg zPlF^LnkWj0NHeR5EFA(+vJ2^F z0Qhx30HkIDz#2G|`WFDip#k9UU;w}s0e~vKq{#~pPDq6wadrSLSXPP6DWH*|yZAG} z&?DP*7r~&Ixjh(9w~qkrcOd}Njb8zxw8IYeJ}#o)e7(+iKT)wZ`8-+A)kLu8i}b=~ zf-`t&vif@ZF8c#JFPzf1S?h?GJ5ul|ZE*Q|f$pb)NZZQHwey48nVtvK&9bCk2*p(N z?Z+-x<%B6AsR}n_Mg^MbSN!TUtrlAn7kj>lU%pHdoPGF~{kH7vVo9G`Ix4L>VNpsv z%}&g&9x6u2Da;~FfA+rVuF~qZX+Cj3TAbt>(DJJaK!5v8EufXPq0w7reE@cDpL_?@ zgKHDm693`&;#hseF5q6&)H#llqP9&^wnw5B3=Z$CI&p8^#Kh#|*x1&PNj|K#N6hpShwmWS3ct)P&k7CwLWir>NEDxndO%3#OhN}tWfWUy!SI;NKd z$={Zf5ry3wtkBTcbE`=Y>F@gaAND{AV$S(m8?jrP8&fp`K_AY_D#g!0*@k-Rl5gy*p-cvV|+=H+3{PIk~02v2iu8 zf~r0TzgF?iDq&%e&v{isgruFiD@y=s79{oMIV63h^QKMJas#IO_&%pkpY9FAUbPil zkq1V@cex6@gMy|e`}=P@`}(><(l|;L)PH&!@JNDGsF*0u%c!RO6lW>`ody+appj{` z9yJXO4K+>84Vn!%NE&GJ=hf6ieO&!K*ZMrXUZZ+Gox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code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler.qrc b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler.qrc new file mode 100644 index 000000000..8d31abddc --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler.qrc @@ -0,0 +1,11 @@ + + + images/arrow-left-2.png + images/arrow-left-double-2.png + images/arrow-right-2.png + images/arrow-right-double-2.png + images/document-export-4.png + images/news-subscribe-2.png + images/run-build-2.png + + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp index dcf17ba34..b233ce922 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp @@ -25,6 +25,7 @@ MissionCompilerMainWindow::MissionCompilerMainWindow(QWidget *parent) : m_undoStack = new QUndoStack(this); // Populate the "all" primitives box. + QStringList list; std::vector paths; NLMISC::CPath::getFileList("primitive", paths); @@ -32,9 +33,31 @@ MissionCompilerMainWindow::MissionCompilerMainWindow(QWidget *parent) : while( itr != paths.end() ) { const char *path2 = (*itr).c_str(); - ui->allPrimitivesList->insertItem(0,path2); + list << path2; ++itr; } + + m_regexpFilter = new QRegExp(); + m_regexpFilter->setPatternSyntax(QRegExp::FixedString); + m_regexpFilter->setCaseSensitivity(Qt::CaseInsensitive); + + m_allPrimitivesModel = new QStringListModel(list, this); + m_filteredProxyModel = new QSortFilterProxyModel(this); + m_filteredProxyModel->setSourceModel(m_allPrimitivesModel); + m_filteredProxyModel->setDynamicSortFilter(true); + m_filteredProxyModel->setFilterRegExp(*m_regexpFilter); + ui->allPrimitivesList->setModel(m_filteredProxyModel); + m_selectedPrimitivesModel = new QStringListModel(this); + ui->selectedPrimitivesList->setModel(m_selectedPrimitivesModel); + + connect(ui->filterEdit, SIGNAL(textEdited(const QString&)), this, SLOT(handleFilterChanged(const QString&))); + +} + +void MissionCompilerMainWindow::handleFilterChanged(const QString &text) +{ + m_regexpFilter->setPattern(text); + m_filteredProxyModel->setFilterRegExp(*m_regexpFilter); } void MissionCompilerMainWindow::loadConfig() { diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.h index 9e94ea9fb..388b5c57d 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.h @@ -7,6 +7,8 @@ #include #include #include +#include +#include namespace Ui { class MissionCompilerMainWindow; @@ -24,6 +26,8 @@ public: void saveConfig(); QUndoStack *getUndoStack() { return m_undoStack; } +public Q_SLOTS: + void handleFilterChanged(const QString &text); private: Ui::MissionCompilerMainWindow *ui; @@ -31,6 +35,9 @@ private: QMenu *_toolModeMenu; QUndoStack *m_undoStack; QStringListModel *m_allPrimitivesModel; + QStringListModel *m_selectedPrimitivesModel; + QSortFilterProxyModel *m_filteredProxyModel; + QRegExp *m_regexpFilter; }; #endif // MISSION_COMPILER_MAIN_WINDOW_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.ui index 30756f91c..865cb20d2 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.ui +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.ui @@ -15,7 +15,7 @@ - + 0 @@ -26,17 +26,14 @@ 0 0 776 - 398 + 426 Mission Compiler Options - - - - + @@ -53,15 +50,29 @@ + + Add Selected + - >> + + + + + :/buttons/images/arrow-right-2.png:/buttons/images/arrow-right-2.png + + Add All + - ALL >> + + + + + :/buttons/images/arrow-right-double-2.png:/buttons/images/arrow-right-double-2.png @@ -80,15 +91,29 @@ + + Remove All + - << ALL + + + + + :/buttons/images/arrow-left-double-2.png:/buttons/images/arrow-left-double-2.png + + Remove Selected + - << + + + + + :/buttons/images/arrow-left-2.png:/buttons/images/arrow-left-2.png @@ -107,8 +132,87 @@ + + + + true + + + QAbstractItemView::NoEditTriggers + + + true + + + QAbstractItemView::DragDrop + + + Qt::MoveAction + + + true + + + QAbstractItemView::ExtendedSelection + + + + + + + true + + + QAbstractItemView::NoEditTriggers + + + true + + + QAbstractItemView::DragDrop + + + Qt::MoveAction + + + true + + + QAbstractItemView::ExtendedSelection + + + - + + + All Primitives + + + + + + + Selected Primitives + + + + + + + + + Filter + + + + + + + type filter here + + + + @@ -128,7 +232,7 @@ 0 0 776 - 398 + 426 @@ -146,36 +250,6 @@ - - - - Actions - - - - - - Validate - - - - - - - Compile - - - - - - - Compile and Publish - - - - - - @@ -189,7 +263,59 @@ + + + toolBar + + + TopToolBarArea + + + false + + + + + + + + + :/buttons/images/run-build-2.png:/buttons/images/run-build-2.png + + + Compile + + + Compile + + + + + + :/buttons/images/news-subscribe-2.png:/buttons/images/news-subscribe-2.png + + + Validate + + + Validate + + + + + + :/buttons/images/document-export-4.png:/buttons/images/document-export-4.png + + + Publish + + + Compile and Publish + + - + + + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_plugin.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_plugin.cpp index cfea63959..005140391 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_plugin.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_plugin.cpp @@ -6,7 +6,8 @@ #include "../../extension_system/iplugin_spec.h" // NeL includes -#include "nel/misc/debug.h" +#include +#include // Qt includes #include @@ -58,12 +59,12 @@ void MissionCompilerPlugin::extensionsInitialized() //zoneMenu->addAction(exampleAction2); // Initialize Ligo. - settings->beginGroup(Core::Constants::DATA_PATH_SECTION); - QString ligoConfigFile = settings->value(Core::Constants::DATA_PATH_SECTION).toString(); - settings->beginGroup(Core::Constants::DATA_PATH_SECTION); + //settings->beginGroup(Core::Constants::DATA_PATH_SECTION); + //QString ligoConfigFile = settings->value(Core::Constants::DATA_PATH_SECTION).toString(); + //settings->beginGroup(Core::Constants::DATA_PATH_SECTION); NLLIGO::Register(); - LigoConfig.readPrimitiveClass(ligoConfigFile.toAscii().data(), false); + LigoConfig.readPrimitiveClass(NLMISC::CPath::lookup("world_editor_classes.xml").c_str(), false); NLLIGO::CPrimitiveContext::instance().CurrentLigoConfig = &LigoConfig; } From 3e6d643056dae8bcf37d83dfd12448db88a2c52b Mon Sep 17 00:00:00 2001 From: sfb Date: Thu, 2 Jun 2011 13:47:31 -0500 Subject: [PATCH 06/12] Changed: Implemented mission validation. --- .../mission_compiler_main_window.cpp | 114 +++++++++++++++ .../mission_compiler_main_window.h | 14 ++ .../mission_compiler_plugin.cpp | 4 - .../mission_compiler_plugin.h | 4 - .../mission_compiler/validation_file.cpp | 133 ++++++++++++++++++ .../mission_compiler/validation_file.h | 51 +++++++ 6 files changed, 312 insertions(+), 8 deletions(-) create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/validation_file.cpp create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/validation_file.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp index b233ce922..0cbb1e708 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp @@ -1,17 +1,24 @@ #include "mission_compiler_main_window.h" #include "ui_mission_compiler_main_window.h" +#include "validation_file.h" #include #include #include #include #include +#include #include "../core/icore.h" #include "../core/imenu_manager.h" #include "../core/core_constants.h" +#include + #include +#include +#include +#include MissionCompilerMainWindow::MissionCompilerMainWindow(QWidget *parent) : QMainWindow(parent), @@ -19,6 +26,9 @@ MissionCompilerMainWindow::MissionCompilerMainWindow(QWidget *parent) : { ui->setupUi(this); + m_compileLog = ""; + updateCompileLog(); + // Load the settings. loadConfig(); @@ -51,7 +61,11 @@ MissionCompilerMainWindow::MissionCompilerMainWindow(QWidget *parent) : ui->selectedPrimitivesList->setModel(m_selectedPrimitivesModel); connect(ui->filterEdit, SIGNAL(textEdited(const QString&)), this, SLOT(handleFilterChanged(const QString&))); + connect(ui->actionValidate, SIGNAL(triggered()), this, SLOT(handleValidation())); + NLLIGO::Register(); + m_ligoConfig.readPrimitiveClass(NLMISC::CPath::lookup("world_editor_classes.xml").c_str(), false); + NLLIGO::CPrimitiveContext::instance().CurrentLigoConfig = &m_ligoConfig; } void MissionCompilerMainWindow::handleFilterChanged(const QString &text) @@ -60,6 +74,106 @@ void MissionCompilerMainWindow::handleFilterChanged(const QString &text) m_filteredProxyModel->setFilterRegExp(*m_regexpFilter); } +void MissionCompilerMainWindow::handleValidation() +{ + // First switch toolbox pages to show the compilation output. + ui->toolBox->setCurrentIndex(2); + + m_compileLog.append("Begin mission validation.\n"); + updateCompileLog(); + + // Load existing validation + CValidationFile validation; + validation.loadMissionValidationFile("mission_validation.cfg"); + + // Go through each file. + QStringList list = m_selectedPrimitivesModel->stringList(); + QStringListIterator itr(list); + while(itr.hasNext()) + { + QString filename = itr.next(); + //QString filePath = NLMISC::CPath::lookup(filename.toAscii().data(), false).c_str(); + m_compileLog.append("Parsing '"+filename+"'...\n"); + updateCompileLog(); + + TMissionContainer missions; + NLLIGO::CPrimitives primDoc; + NLLIGO::CPrimitiveContext::instance().CurrentPrimitive = &primDoc; + NLLIGO::loadXmlPrimitiveFile(primDoc, NLMISC::CPath::lookup(filename.toAscii().data(), false), m_ligoConfig); + parsePrimForMissions(primDoc.RootNode, missions); + + // Parse missions to check modification + std::map::iterator itMission, itMissionEnd = missions.end(); + for (itMission=missions.begin(); itMission!=itMissionEnd; ++itMission) + { + CValidationFile::TMissionStateContainer::iterator itMissionValidation = validation._MissionStates.find(itMission->first); + if (itMissionValidation!=validation._MissionStates.end()) + { + // Mission already registered, check hash key + if (itMissionValidation->second.hashKey!=itMission->second.hashKey) + { + itMissionValidation->second.hashKey = itMission->second.hashKey; + itMissionValidation->second.state = validation.defaultState(); + } + } + else + { + // New mission + validation.insertMission(itMission->first, itMission->second.hashKey); + } + m_compileLog.append("Mission: '"+QString(itMission->first.c_str())+"->"+QString(itMission->second.hashKey.c_str())+"\n"); + updateCompileLog(); + } + } + validation.saveMissionValidationFile("mission_validation.cfg"); + + m_compileLog.append("Validation finished"); + updateCompileLog(); +} + +bool MissionCompilerMainWindow::parsePrimForMissions(NLLIGO::IPrimitive const *prim, TMissionContainer &missions) +{ + std::string value; + // if the node is a mission parse it + if (prim->getPropertyByName("class",value) && !stricmp(value.c_str(),"mission") ) + { + std::string name; + prim->getPropertyByName("name",name); + + m_compileLog.append(" ** Parsing mission '"+QString(name.c_str())+"'\n"); + updateCompileLog(); + + // parse the mission and put it in our manager + CMission mission(value, ""); + if (!mission.parsePrim(prim) ) + { + m_compileLog.append(" ** Previous errors in mission '"+QString(name.c_str())+"'"); + updateCompileLog(); + return false; + } + missions.insert(make_pair(name, mission)); + return true; + } + else + { + //this is not a mission node, so lookup recursively in the children + bool ok = true; + for (uint i=0;igetNumChildren();++i) + { + const NLLIGO::IPrimitive *child; + if ( !prim->getChild(child,i) || !parsePrimForMissions(child, missions) ) + ok = false; + } + return ok; + } +} + +void MissionCompilerMainWindow::updateCompileLog() +{ + ui->compileOutputText->setPlainText(m_compileLog); + QCoreApplication::processEvents(); +} + void MissionCompilerMainWindow::loadConfig() { QSettings *settings = Core::ICore::instance()->settings(); settings->beginGroup("MissionCompiler"); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.h index 388b5c57d..de8328dee 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.h @@ -10,10 +10,15 @@ #include #include +#include +#include + namespace Ui { class MissionCompilerMainWindow; } +struct CMission; + class MissionCompilerMainWindow : public QMainWindow { Q_OBJECT @@ -26,18 +31,27 @@ public: void saveConfig(); QUndoStack *getUndoStack() { return m_undoStack; } + typedef std::map TMissionContainer; + public Q_SLOTS: void handleFilterChanged(const QString &text); + void handleValidation(); private: Ui::MissionCompilerMainWindow *ui; + void updateCompileLog(); + bool parsePrimForMissions(NLLIGO::IPrimitive const *prim, TMissionContainer &missions); + QMenu *_toolModeMenu; QUndoStack *m_undoStack; QStringListModel *m_allPrimitivesModel; QStringListModel *m_selectedPrimitivesModel; QSortFilterProxyModel *m_filteredProxyModel; QRegExp *m_regexpFilter; + QString m_compileLog; + + NLLIGO::CLigoConfig m_ligoConfig; }; #endif // MISSION_COMPILER_MAIN_WINDOW_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_plugin.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_plugin.cpp index 005140391..7bd06de91 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_plugin.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_plugin.cpp @@ -62,10 +62,6 @@ void MissionCompilerPlugin::extensionsInitialized() //settings->beginGroup(Core::Constants::DATA_PATH_SECTION); //QString ligoConfigFile = settings->value(Core::Constants::DATA_PATH_SECTION).toString(); //settings->beginGroup(Core::Constants::DATA_PATH_SECTION); - - NLLIGO::Register(); - LigoConfig.readPrimitiveClass(NLMISC::CPath::lookup("world_editor_classes.xml").c_str(), false); - NLLIGO::CPrimitiveContext::instance().CurrentLigoConfig = &LigoConfig; } void MissionCompilerPlugin::setNelContext(NLMISC::INelContext *nelContext) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_plugin.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_plugin.h index a9d34bd13..773c984ea 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_plugin.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_plugin.h @@ -9,8 +9,6 @@ // NeL includes #include #include -#include -#include // Qt includes #include @@ -53,8 +51,6 @@ public: QObject *objectByName(const QString &name) const; ExtensionSystem::IPluginSpec *pluginByName(const QString &name) const; - NLLIGO::CLigoConfig LigoConfig; - protected: NLMISC::CLibraryContext *_LibContext; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/validation_file.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/validation_file.cpp new file mode 100644 index 000000000..3e166da6b --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/validation_file.cpp @@ -0,0 +1,133 @@ +#include "validation_file.h" + +#include +#include + +void CValidationFile::loadMissionValidationFile(std::string filename) +{ + // load the configuration file + NLMISC::CConfigFile cf; + std::string pathName = NLMISC::CPath::lookup(filename, false); + + if (pathName.empty()) + { + nlwarning("Can't find index file '%s' in search path, no mission will be valid", filename.c_str()); + return; + } + cf.load(pathName); + + // get the variable + NLMISC::CConfigFile::CVar* var = cf.getVarPtr("AuthorizedStates"); + if (var) + { + for (uint i=0; isize(); ++i) + _AuthorizedStates.push_back(var->asString(i)); + } + int missionStatesFields = 3; + var = cf.getVarPtr("MissionStatesFields"); + if (var) + missionStatesFields = var->asInt(); + else + nlwarning("Mission validation file does not contain MissionStatesFields variable. Parsing may fail and corrupt data."); + + var = cf.getVarPtr("MissionStates"); + if (var) + { + for (uint i=0; isize()/missionStatesFields; ++i) + { + std::string mission = var->asString(i*missionStatesFields); + std::string stateName = var->asString(i*missionStatesFields+1); + std::string hashKey = var->asString(i*missionStatesFields+2); + _MissionStates.insert(std::make_pair(mission, CMissionState(mission, stateName, hashKey))); + } + } +} + +void CValidationFile::saveMissionValidationFile(std::string filename) +{ + // load the configuration file + std::string pathName = NLMISC::CPath::lookup(filename, false); + + if (pathName.empty()) + { + nlwarning("Can't find index file '%s' in search path, no mission will be valid", filename.c_str()); + return; + } + FILE* file = fopen(pathName.c_str(), "w"); + nlassert(file!=NULL); + + // AuthorizedStates + fprintf(file, "%s", + "// AuthorizedStates contains the list of authorized states. EGS mission\n" + "// manager can accept any number of states. Default state is the first one.\n" + "AuthorizedStates = {\n"); + std::deque::iterator itAuth, itAuthEnd = _AuthorizedStates.end(); + for (itAuth=_AuthorizedStates.begin(); itAuth!=itAuthEnd; ++itAuth) + fprintf(file, "\t\"%s\",\n", itAuth->c_str()); + fprintf(file, "%s", "};\n\n"); + + // MissionStatesFields + fprintf(file, "%s", + "// MissionStatesFields contains the number of fields in MissionStates, for\n" + "// future compatibility purpose.\n" + "MissionStatesFields = "); + fprintf(file, "%d", 3); // 3 fields: name, state, hash key + fprintf(file, "%s", ";\n\n"); + + // MissionStates + fprintf(file, "%s", + "// MissionStates contains a list of mission with for each the state of the\n" + "// mission and its hash key. The tool will add new missions with the default\n" + "// state. It will flag missions with a modified hash key with default state to\n" + "// prevent untested modified missions to be published.\n" + "// :NOTE: You can add a field to this structure without the need to modify EGS\n" + "// code. Simply update MissionStatesFields.\n" + "MissionStates = {\n"); + TMissionStateContainer::iterator itMission, itMissionEnd = _MissionStates.end(); + for (itMission=_MissionStates.begin(); itMission!=itMissionEnd; ++itMission) + fprintf(file, "\t%-42s %-12s \"%s\",\n", ("\""+itMission->second.name+"\",").c_str(), ("\""+itMission->second.state+"\",").c_str(), itMission->second.hashKey.c_str()); + fprintf(file, "};\n\n"); + + fclose(file); +} + +// :NOTE: This function exists in mission_template.cpp. If you change it here modify the other file. +std::string buildHashKey(std::string const& content) +{ + uint32 sum = 0; + size_t size = content.length()/4; + for (size_t i=0; i>1 | 0x80000000; + else + sum = sum>>1; + } + return NLMISC::toString("0x%08X", sum); +} + +bool CMission::parsePrim(NLLIGO::IPrimitive const* prim) +{ + // init default values + std::vector* params; + // get the mission script + if (!prim->getPropertyByName("script", params) || !params) + { + nlwarning("ERROR : cant find mission script!!!!!!"); + return false; + } + + // parse them + std::string content; + std::vector::iterator itParam, itParamEnd = params->end(); + for (itParam=params->begin(); itParam!=itParamEnd; ++itParam) + { + content += *itParam + "\n"; + } + hashKey = buildHashKey(content); + return true; +} \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/validation_file.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/validation_file.h new file mode 100644 index 000000000..73d661a26 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/validation_file.h @@ -0,0 +1,51 @@ +#ifndef VALIDATION_FILE_H +#define VALIDATION_FILE_H + +#include +#include +#include + +#include + +struct CMissionState +{ + std::string name; + std::string state; + std::string hashKey; + CMissionState(std::string _name, std::string _state, std::string _hashKey) + : name(_name), state(_state), hashKey(_hashKey) { } +}; + +struct CMission +{ + std::string name; + std::string hashKey; + CMission(std::string _name, std::string _hashKey) + : name(_name), hashKey(_hashKey) { } + bool parsePrim(NLLIGO::IPrimitive const* prim); +}; + +class CValidationFile +{ +public: + typedef std::map TMissionStateContainer; + std::deque _AuthorizedStates; + TMissionStateContainer _MissionStates; +public: + // CValidationFile() { } + void loadMissionValidationFile(std::string filename); + void saveMissionValidationFile(std::string filename); + void insertMission(std::string const& mission, std::string const& hashKey) + { + _MissionStates.insert(std::make_pair(mission, CMissionState(mission, defaultState(), hashKey))); + } + std::string defaultState() + { + if (!_AuthorizedStates.empty()) + return _AuthorizedStates.front(); + else + return ""; + } +}; + +#endif // VALIDATION_FILE_H \ No newline at end of file From 99387de82736bbcc47d2623dc0d7f653848d101d Mon Sep 17 00:00:00 2001 From: sfb Date: Thu, 2 Jun 2011 15:15:12 -0500 Subject: [PATCH 07/12] Changed: Implemented basic mission compilation without publishing. --- .../src/plugins/CMakeLists.txt | 6 +- .../plugins/mission_compiler/CMakeLists.txt | 8 +- .../mission_compiler_main_window.cpp | 77 ++++++++++++++++++- .../mission_compiler_main_window.h | 3 + 4 files changed, 91 insertions(+), 3 deletions(-) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/CMakeLists.txt index c5d49418d..66cbdb188 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/CMakeLists.txt @@ -7,4 +7,8 @@ ADD_SUBDIRECTORY(disp_sheet_id) ADD_SUBDIRECTORY(object_viewer) ADD_SUBDIRECTORY(zone_painter) ADD_SUBDIRECTORY(georges_editor) -ADD_SUBDIRECTORY(mission_compiler) \ No newline at end of file + +# Ryzom Specific Plugins +IF(WITH_RYZOM AND WITH_RYZOM_TOOLS) + ADD_SUBDIRECTORY(mission_compiler) +ENDIF(WITH_RYZOM AND WITH_RYZOM_TOOLS) \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/CMakeLists.txt index af39fc18a..4d11e808e 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/CMakeLists.txt @@ -28,9 +28,15 @@ SOURCE_GROUP(QtGeneratedMocSrc FILES ${OVQT_PLUG_MISSION_COMPILER_MOC_SRC} ${OVQ SOURCE_GROUP("Mission Compiler Plugin" FILES ${SRC}) SOURCE_GROUP("OVQT Extension System" FILES ${OVQT_EXT_SYS_SRC}) +# Mission Compiler Library +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/ryzom/tools/leveldesign/mission_compiler_lib) + +# Game Share Library +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/common/src) + ADD_LIBRARY(ovqt_plugin_mission_compiler MODULE ${SRC} ${OVQT_PLUG_MISSION_COMPILER_MOC_SRC} ${OVQT_PLUG_MISSION_COMPILER_RC_SRCS} ${OVQT_EXT_SYS_SRC} ${OVQT_PLUG_MISSION_COMPILER_UI_HDRS}) -TARGET_LINK_LIBRARIES(ovqt_plugin_mission_compiler ovqt_plugin_core nelmisc nelligo ${QT_LIBRARIES} ${QT_QTOPENGL_LIBRARY}) +TARGET_LINK_LIBRARIES(ovqt_plugin_mission_compiler ovqt_plugin_core nelmisc nelligo ryzom_mission_compiler_lib ${QT_LIBRARIES} ${QT_QTOPENGL_LIBRARY}) NL_DEFAULT_PROPS(ovqt_plugin_mission_compiler "NeL, Tools, 3D: Object Viewer Qt Plugin: Mission Compiler") NL_ADD_RUNTIME_FLAGS(ovqt_plugin_mission_compiler) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp index 0cbb1e708..e760d9f94 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp @@ -1,6 +1,7 @@ #include "mission_compiler_main_window.h" #include "ui_mission_compiler_main_window.h" #include "validation_file.h" +#include "mission_compiler.h" #include #include @@ -62,6 +63,8 @@ MissionCompilerMainWindow::MissionCompilerMainWindow(QWidget *parent) : connect(ui->filterEdit, SIGNAL(textEdited(const QString&)), this, SLOT(handleFilterChanged(const QString&))); connect(ui->actionValidate, SIGNAL(triggered()), this, SLOT(handleValidation())); + connect(ui->actionCompile, SIGNAL(triggered()), this, SLOT(handleCompile())); + connect(ui->actionPublish, SIGNAL(triggered()), this, SLOT(handlePublish())); NLLIGO::Register(); m_ligoConfig.readPrimitiveClass(NLMISC::CPath::lookup("world_editor_classes.xml").c_str(), false); @@ -74,6 +77,79 @@ void MissionCompilerMainWindow::handleFilterChanged(const QString &text) m_filteredProxyModel->setFilterRegExp(*m_regexpFilter); } +void MissionCompilerMainWindow::handleCompile() +{ + compileMission(); +} + +void MissionCompilerMainWindow::handlePublish() +{ + compileMission(true); +} + +void MissionCompilerMainWindow::compileMission(bool publish) +{ + uint nbMission = 0; + + // First switch toolbox pages to show the compilation output. + ui->toolBox->setCurrentIndex(2); + + m_compileLog.append("Begin mission compilation.\n"); + updateCompileLog(); + + // Go through each file. + QStringList list = m_selectedPrimitivesModel->stringList(); + QStringListIterator itr(list); + while(itr.hasNext()) + { + QString filename = itr.next(); + m_compileLog.append("Compiling '"+filename+"'...\n"); + updateCompileLog(); + + NLLIGO::CPrimitives primDoc; + NLLIGO::CPrimitiveContext::instance().CurrentPrimitive = &primDoc; + NLLIGO::loadXmlPrimitiveFile(primDoc, NLMISC::CPath::lookup(filename.toAscii().data(), false), m_ligoConfig); + NLLIGO::CPrimitiveContext::instance().CurrentPrimitive = NULL; + + try + { + CMissionCompiler mc; + mc.compileMissions(primDoc.RootNode, filename.toStdString()); + m_compileLog.append("Found "+QString::number(mc.getMissionsCount())+" valid missions\n"); + updateCompileLog(); + + mc.installCompiledMission(m_ligoConfig, filename.toStdString()); + nbMission += mc.getMissionsCount(); + + // publish files to selected servers + //if (publish) + //for (uint i=0 ; i Date: Tue, 7 Jun 2011 12:14:10 -0500 Subject: [PATCH 08/12] Changed: Added 'data directory' box and re-arranged filters. --- .../mission_compiler_main_window.cpp | 82 +++++++++++++++--- .../mission_compiler_main_window.h | 5 ++ .../mission_compiler_main_window.ui | 86 ++++++++++++++----- 3 files changed, 137 insertions(+), 36 deletions(-) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp index e760d9f94..f7da41ff2 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp @@ -9,6 +9,8 @@ #include #include #include +#include +#include #include "../core/icore.h" #include "../core/imenu_manager.h" @@ -27,6 +29,7 @@ MissionCompilerMainWindow::MissionCompilerMainWindow(QWidget *parent) : { ui->setupUi(this); + m_lastDir = "."; m_compileLog = ""; updateCompileLog(); @@ -35,24 +38,11 @@ MissionCompilerMainWindow::MissionCompilerMainWindow(QWidget *parent) : m_undoStack = new QUndoStack(this); - // Populate the "all" primitives box. - QStringList list; - std::vector paths; - NLMISC::CPath::getFileList("primitive", paths); - - std::vector::iterator itr = paths.begin(); - while( itr != paths.end() ) - { - const char *path2 = (*itr).c_str(); - list << path2; - ++itr; - } - m_regexpFilter = new QRegExp(); m_regexpFilter->setPatternSyntax(QRegExp::FixedString); m_regexpFilter->setCaseSensitivity(Qt::CaseInsensitive); - m_allPrimitivesModel = new QStringListModel(list, this); + m_allPrimitivesModel = new QStringListModel(this); m_filteredProxyModel = new QSortFilterProxyModel(this); m_filteredProxyModel->setSourceModel(m_allPrimitivesModel); m_filteredProxyModel->setDynamicSortFilter(true); @@ -65,12 +55,63 @@ MissionCompilerMainWindow::MissionCompilerMainWindow(QWidget *parent) : connect(ui->actionValidate, SIGNAL(triggered()), this, SLOT(handleValidation())); connect(ui->actionCompile, SIGNAL(triggered()), this, SLOT(handleCompile())); connect(ui->actionPublish, SIGNAL(triggered()), this, SLOT(handlePublish())); + connect(ui->allPrimitivesList, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT(handleAllDoubleClick(const QModelIndex &))); + connect(ui->dataDirButton, SIGNAL(clicked()), this, SLOT(handleDataDirButton())); + connect(ui->dataDirEdit, SIGNAL(textChanged(const QString &)), this, SLOT(handleDataDirChanged(const QString &))); + + // Set the default data dir to the primitives path. + QSettings *settings = Core::ICore::instance()->settings(); + settings->beginGroup(Core::Constants::DATA_PATH_SECTION); + m_lastDir = settings->value(Core::Constants::PRIMITIVES_PATH).toString(); + ui->dataDirEdit->setText(m_lastDir); + populateAllPrimitives(m_lastDir); + settings->endGroup(); NLLIGO::Register(); m_ligoConfig.readPrimitiveClass(NLMISC::CPath::lookup("world_editor_classes.xml").c_str(), false); NLLIGO::CPrimitiveContext::instance().CurrentLigoConfig = &m_ligoConfig; } +void MissionCompilerMainWindow::populateAllPrimitives(const QString &dataDir) +{ + // First we need to clear out the models entirely. + QStringList emptyList; + m_selectedPrimitivesModel->setStringList(emptyList); + m_allPrimitivesModel->setStringList(emptyList); + + + // Populate the "all" primitives box. + QStringList list; + + // Filter for only primitive files. + QStringList filters; + filters << "*.primitive"; + + QDirIterator it(dataDir, filters, QDir::Files, QDirIterator::Subdirectories|QDirIterator::FollowSymlinks); + while(it.hasNext()) + { + it.next(); + list << it.fileName(); + } + + m_allPrimitivesModel->setStringList(list); +} +void MissionCompilerMainWindow::handleDataDirChanged(const QString &text) +{ + populateAllPrimitives(text); +} + +void MissionCompilerMainWindow::handleDataDirButton() +{ + QString newPath = QFileDialog::getExistingDirectory(this, "", m_lastDir); + if(!newPath.isEmpty()) + { + ui->dataDirEdit->setText(newPath); + m_lastDir = newPath; + populateAllPrimitives(newPath); + } +} + void MissionCompilerMainWindow::handleFilterChanged(const QString &text) { m_regexpFilter->setPattern(text); @@ -87,6 +128,19 @@ void MissionCompilerMainWindow::handlePublish() compileMission(true); } +void MissionCompilerMainWindow::handleAllDoubleClick(const QModelIndex &index) +{ + const QAbstractItemModel *model = index.model(); + QString item = model->data(index).toString(); + nlinfo("all primitives was double clicked: %s", item.toAscii().data()); + + m_filteredProxyModel->removeRows(index.row(),1); + + QStringList list = m_selectedPrimitivesModel->stringList(); + list << item; + m_selectedPrimitivesModel->setStringList(list); +} + void MissionCompilerMainWindow::compileMission(bool publish) { uint nbMission = 0; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.h index 7c4feb78a..2248a7cc5 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.h @@ -38,11 +38,15 @@ public Q_SLOTS: void handleValidation(); void handleCompile(); void handlePublish(); + void handleAllDoubleClick(const QModelIndex &index); + void handleDataDirButton(); + void handleDataDirChanged(const QString &text); private: Ui::MissionCompilerMainWindow *ui; void updateCompileLog(); + void populateAllPrimitives(const QString &dataDir = QString()); bool parsePrimForMissions(NLLIGO::IPrimitive const *prim, TMissionContainer &missions); void compileMission(bool publish=false); @@ -53,6 +57,7 @@ private: QSortFilterProxyModel *m_filteredProxyModel; QRegExp *m_regexpFilter; QString m_compileLog; + QString m_lastDir; NLLIGO::CLigoConfig m_ligoConfig; }; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.ui index 865cb20d2..a995f0dab 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.ui +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.ui @@ -33,7 +33,7 @@ Mission Compiler Options - + @@ -132,7 +132,7 @@ - + true @@ -157,7 +157,7 @@ - + true @@ -182,41 +182,83 @@ - + All Primitives - + Selected Primitives - - - - - - Filter - - - - - - - type filter here - - - - + + + + Filter Criteria + + + + + + + + Data Directory + + + + + + + + + + ... + + + + + + + + + + + Filter + + + + + + + type filter here + + + + + + + horizontalLayoutWidget + dataDirLabel + horizontalLayoutWidget + + + + + 0 + 0 + 776 + 426 + + Publish Options From effaba1a1152a5991c6ae420c8fff7a48df4f9ed Mon Sep 17 00:00:00 2001 From: sfb Date: Tue, 7 Jun 2011 14:30:34 -0500 Subject: [PATCH 09/12] Changed: Mission Compiler add/remove selected/all and reset filter functions. --- .../mission_compiler_main_window.cpp | 80 ++++++++++++++++--- .../mission_compiler_main_window.h | 7 ++ .../mission_compiler_main_window.ui | 10 +++ 3 files changed, 87 insertions(+), 10 deletions(-) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp index f7da41ff2..95d7ca50f 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp @@ -50,14 +50,25 @@ MissionCompilerMainWindow::MissionCompilerMainWindow(QWidget *parent) : ui->allPrimitivesList->setModel(m_filteredProxyModel); m_selectedPrimitivesModel = new QStringListModel(this); ui->selectedPrimitivesList->setModel(m_selectedPrimitivesModel); - - connect(ui->filterEdit, SIGNAL(textEdited(const QString&)), this, SLOT(handleFilterChanged(const QString&))); + + // Connections for toolbar buttons. connect(ui->actionValidate, SIGNAL(triggered()), this, SLOT(handleValidation())); connect(ui->actionCompile, SIGNAL(triggered()), this, SLOT(handleCompile())); connect(ui->actionPublish, SIGNAL(triggered()), this, SLOT(handlePublish())); + + // Connections for selected item moves. connect(ui->allPrimitivesList, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT(handleAllDoubleClick(const QModelIndex &))); + connect(ui->selectedPrimitivesList, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT(handleSelDoubleClick(const QModelIndex &))); + connect(ui->addSelectedButton, SIGNAL(clicked()), this, SLOT(handleMoveSelectedRight())); + connect(ui->removeSelectedButton, SIGNAL(clicked()), this, SLOT(handleMoveSelectedLeft())); + connect(ui->addAllButton, SIGNAL(clicked()), this, SLOT(handleMoveAllRight())); + connect(ui->removeAllButton, SIGNAL(clicked()), this, SLOT(handleMoveAllLeft())); + + // Connections for the filter group box. connect(ui->dataDirButton, SIGNAL(clicked()), this, SLOT(handleDataDirButton())); connect(ui->dataDirEdit, SIGNAL(textChanged(const QString &)), this, SLOT(handleDataDirChanged(const QString &))); + connect(ui->filterEdit, SIGNAL(textEdited(const QString&)), this, SLOT(handleFilterChanged(const QString&))); + connect(ui->resetFiltersButton, SIGNAL(clicked()), this, SLOT(handleResetFiltersButton())); // Set the default data dir to the primitives path. QSettings *settings = Core::ICore::instance()->settings(); @@ -96,6 +107,14 @@ void MissionCompilerMainWindow::populateAllPrimitives(const QString &dataDir) m_allPrimitivesModel->setStringList(list); } + +void MissionCompilerMainWindow::handleResetFiltersButton() +{ + handleDataDirChanged(m_lastDir); + ui->filterEdit->setText(""); + handleFilterChanged(""); +} + void MissionCompilerMainWindow::handleDataDirChanged(const QString &text) { populateAllPrimitives(text); @@ -128,17 +147,58 @@ void MissionCompilerMainWindow::handlePublish() compileMission(true); } +void MissionCompilerMainWindow::handleMoveSelectedRight() +{ + QModelIndexList indexes = ui->allPrimitivesList->selectionModel()->selectedIndexes(); + while(!indexes.isEmpty()) + { + const QModelIndex index = indexes.takeFirst(); + moveSelectedItem(index, m_allPrimitivesModel, m_selectedPrimitivesModel); + indexes = ui->allPrimitivesList->selectionModel()->selectedIndexes(); + } +} + +void MissionCompilerMainWindow::handleMoveAllRight() +{ + ui->allPrimitivesList->selectAll(); + handleMoveSelectedRight(); +} + +void MissionCompilerMainWindow::handleMoveSelectedLeft() +{ + QModelIndexList indexes = ui->selectedPrimitivesList->selectionModel()->selectedIndexes(); + while(!indexes.isEmpty()) + { + const QModelIndex index = indexes.takeFirst(); + moveSelectedItem(index, m_selectedPrimitivesModel, m_allPrimitivesModel); + indexes = ui->selectedPrimitivesList->selectionModel()->selectedIndexes(); + } +} + +void MissionCompilerMainWindow::handleMoveAllLeft() +{ + ui->selectedPrimitivesList->selectAll(); + handleMoveSelectedLeft(); +} + +void MissionCompilerMainWindow::moveSelectedItem(const QModelIndex &index, QStringListModel *from, QStringListModel *to) +{ + QString item = from->data(index, Qt::DisplayRole).toString(); + + from->removeRows(index.row(),1); + QStringList list = to->stringList(); + list << item; + to->setStringList(list); +} + void MissionCompilerMainWindow::handleAllDoubleClick(const QModelIndex &index) { - const QAbstractItemModel *model = index.model(); - QString item = model->data(index).toString(); - nlinfo("all primitives was double clicked: %s", item.toAscii().data()); + moveSelectedItem(index, m_allPrimitivesModel, m_selectedPrimitivesModel); +} - m_filteredProxyModel->removeRows(index.row(),1); - - QStringList list = m_selectedPrimitivesModel->stringList(); - list << item; - m_selectedPrimitivesModel->setStringList(list); +void MissionCompilerMainWindow::handleSelDoubleClick(const QModelIndex &index) +{ + moveSelectedItem(index, m_selectedPrimitivesModel, m_allPrimitivesModel); } void MissionCompilerMainWindow::compileMission(bool publish) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.h index 2248a7cc5..7ea2e1f81 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.h @@ -39,8 +39,14 @@ public Q_SLOTS: void handleCompile(); void handlePublish(); void handleAllDoubleClick(const QModelIndex &index); + void handleSelDoubleClick(const QModelIndex &index); + void handleMoveSelectedRight(); + void handleMoveSelectedLeft(); + void handleMoveAllRight(); + void handleMoveAllLeft(); void handleDataDirButton(); void handleDataDirChanged(const QString &text); + void handleResetFiltersButton(); private: Ui::MissionCompilerMainWindow *ui; @@ -49,6 +55,7 @@ private: void populateAllPrimitives(const QString &dataDir = QString()); bool parsePrimForMissions(NLLIGO::IPrimitive const *prim, TMissionContainer &missions); void compileMission(bool publish=false); + void moveSelectedItem(const QModelIndex &index, QStringListModel *from, QStringListModel *to); QMenu *_toolModeMenu; QUndoStack *m_undoStack; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.ui index a995f0dab..d68b1a76d 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.ui +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.ui @@ -239,6 +239,16 @@ + + + + Blanks out the filter and reloads all files from the data directory. + + + Reset + + + From c1e86e657960a42cdcbb70a90adc35a355bf1861 Mon Sep 17 00:00:00 2001 From: sfb Date: Thu, 9 Jun 2011 14:26:02 -0500 Subject: [PATCH 10/12] Changed: Started to add dialogs for server and publishing settings. --- .../plugins/mission_compiler/CMakeLists.txt | 2 +- .../images/ic_nel_add_item.png | Bin 0 -> 3270 bytes .../images/ic_nel_delete_item.png | Bin 0 -> 1496 bytes .../images/ic_nel_down_item.png | Bin 0 -> 3812 bytes .../images/ic_nel_generic_settings.png | Bin 0 -> 5633 bytes .../images/ic_nel_reset_all.png | Bin 0 -> 5938 bytes .../images/ic_nel_up_item.png | Bin 0 -> 3304 bytes .../mission_compiler/mission_compiler.qrc | 6 + .../mission_compiler_settings_page.cpp | 212 ++++++++++++++ .../mission_compiler_settings_page.h | 74 +++++ .../mission_compiler_settings_page.ui | 265 ++++++++++++++++++ .../mission_compiler/server_entry_dialog.ui | 108 +++++++ 12 files changed, 666 insertions(+), 1 deletion(-) create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/ic_nel_add_item.png create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/ic_nel_delete_item.png create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/ic_nel_down_item.png create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/ic_nel_generic_settings.png create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/ic_nel_reset_all.png create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/ic_nel_up_item.png create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_settings_page.cpp create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_settings_page.h create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_settings_page.ui create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/server_entry_dialog.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/CMakeLists.txt index 4d11e808e..cc6d8489f 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/CMakeLists.txt @@ -12,7 +12,7 @@ SET(OVQT_EXT_SYS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin. SET(OVQT_PLUG_MISSION_COMPILER_HDR mission_compiler_plugin.h mission_compiler_main_window.h) -SET(OVQT_PLUG_MISSION_COMPILER_UIS mission_compiler_main_window.ui) +SET(OVQT_PLUG_MISSION_COMPILER_UIS mission_compiler_main_window.ui server_entry_dialog.ui mission_compiler_settings_page.ui) SET(OVQT_PLUG_MISSION_COMPILER_RCS mission_compiler.qrc) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/ic_nel_add_item.png b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/ic_nel_add_item.png new file mode 100644 index 0000000000000000000000000000000000000000..bde338f7851d2675b29272c7dcf9471196a8f6cc GIT binary patch literal 3270 z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c^nh literal 0 HcmV?d00001 diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/ic_nel_delete_item.png b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/ic_nel_delete_item.png new file mode 100644 index 0000000000000000000000000000000000000000..a5a1787d593591f855be9a7eb8da271cc8d8f214 GIT binary patch literal 1496 zcmaKs{XY{30LC|C-c2!W(h#B2QhA@kOt{brn;~tK$;-mn#DM?-zdb>=i zu*@RTd8@_pvUxpuxyoG1>Bsxw?uX}jKHujL_-0@|T~w8{l>h*Ms+%k3&``sHb<81=-~(e+|N^9C&_KHVw5X^3IM3J{S1(sAHJ}8!egC%W4+FY#L`JIX8~B! zIZ7C+< z6bcMhk7Jz$z zt<~^Npzeyeat^;b(tkMW#bRkwb5S`|-P(cZ{!1geIKC7Tzpi^Q9XhN7r*| zh)Tmw?h}4)r(e%EPx*~jbiDn>W9k_F^gyx#1J1b!&uZuD!J$Duh_I|$-B|3)pjcABT`DZr@@$gnJ?g*7niqC zPg~-q=_uM61|+bWZC}wlE4;C-L;LVrU6J(R@D0Z4=p`kt`4==LnW(d8wXiBZND)3NugXyk}j`B>QSp`rx>7I47#1U z_C?Zqn_!w_iq*Q=7#33$KOO+R;CW!bcdn#k;~tqqg>*o8s|#;{%M1@^2B=`1X*QOW z`~~EL<8YMd;Wk~hP%ln9+T{3weTCGPC>#3IdbbgtfSL(^;<-$(&+()%CWY(ZY}rUs zYZ^=Sws7E+dDpj6e_>>!qz;jFg;SMzWx6GvaM=_CJv#h+^qF(IggsR{8BYMQlBT|c zLR(J;=NJUkn>YRLcdDtY?zXt@zIEUuTe=1hEndEU6|7%)i#=`5cs5S}P9Mh=PcJfo z{ZbSwueq|yZyG~GMGk&1;XI&33fgfyu~6eIQgk!Fkv4<^W8F=|9U5oXINb+#fCen_ z{sB?u3Xfi@SxqMAC%ZI%1BJIf0uMiCx!yXz62rndMv z$=6toP8$LinV$s7C|ZjMS5+@W1rn4NxN=o7bmp|tGx-1vXy7V6(LK7Owl1b<1|o_O z>bY9rcsZ;+(mT(U8Vqy|@K*SC7Xeg!@WG?ntw{ZC`G3Vh1-90Bf1vJ=9f)jI$P4Q6YBQ@Z8;^^H#>9pe+1$q6DXU$-5VbBeJ(3kUiuh943T}3C$!G=4Zw&rX zIZx;etQ%$b10W;H`0fD|-g&n~Eq? zJZ zC}pc4u@0qD`7mQX=zMD+8o3Hi#&31p7{mxJ*6-KkigeYIgt}@Xn1a05YyE6U8VHU~ z8PL=CTn*0W$(#-|89Sz`9P!(hY?pOfm^ZQVXfjUeBhD+B#yUg0vkok?_%`$Xq0`=> g{}tB1bjDO$2a)_&SEAML{IoE@&Dj&vfF`E?18{b*hyVZp literal 0 HcmV?d00001 diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/ic_nel_down_item.png b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/ic_nel_down_item.png new file mode 100644 index 0000000000000000000000000000000000000000..fc86c4f6db072ec99ee76b81b8ea21d607226dd7 GIT binary patch literal 3812 zcmVN2bPDNB8 zb~7$DE;i7Ety%y84q-_|K~#8N?VAa7RMi>B-!e;PGRY*9l{F!dKnMxh6Cl83lFVc! z`@XO2C{P3sXk)F)QbADK(~8RxS!72<1VyA++|a7^C|Hl@s7Nb%tf#G75&8Ok_r8~z zutuAwCl=26pZng+%gz1$zwdtUzB_{;T>p37f$I)jcR*7I96CX8`lCh&Le5ldn*_nN zOppqHFBwaA>dh5L^}Y>n8-hDNFokxWwhZY!6A;$?rpdqPVL_ZSSrF1hO^2sl=gx9L zF4}1d?l@@;U+_h6%qT{p=OpvAcJ0QfVb7AW`0e1>Zji0@ptsh6;8h8-xeBboEf5qw7lw`hB}8Ye zf`qK~kdXTzq?K<4N7Lhw-?1068@J)lRsv=W8q)c>AWR9?aHv{zohHeay3f6W+Q8Ly z1S%H44sCb54;?E{!^|~jVa~eGU^Z%&s&`Ox*=s*#W(0@L0?Ax~nNzY#!@+9N zb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1iUi~~gy!AaN zFFlY8BFwH-Ht4ngSAiEkg1^69g4th=Vf;f7re-hI=cX1gzF?8aONotXY@bK~lF9FN zoB@k|Fwd!v{^Y@RusZ`+?JS(*7mmA@w*=hA6<~|+mH#YvqkNxrFO-)@QJy}d2 z2p#eGXGcB%*${U+hWD*7>M0YEqQOk_d5KEi$HVl#X?~&yV@Mc~oa|{ZXoq=E(Q4ES zr%{<*isIRrkr|oE#{T&TE>XE^ys<0yW&9rXq8S>%ESf0Uvc z-lSos`C+D9o(Yq`yX|myOL~%FVUa4Ax0dNNzo;|U4VOa*yePqcbZSP@^DqSRl*b(E z@R>`!&}v_h2laqx2XcU2xc&$#&lXq^|3eJB)+vJv82p8<(P+4VKV`juYZV|q<^2lx zgX5H*$(t%LG%~YP%7IFA-3OfQEyI5Z>ya8)Vh?dC(p~=lK^}$-|97Aevr0wy|3C>) zie#%8S}(V=zENgn{$`p&z5`Cz7jtO;T6+W}Nul!=Ks3f{Tdr1fqFkqa9wqJTb(Ut= z>aEOwUtzBOq*$x^d5%`|Vun_8IbNgM6=}4{icu;YL3;X|ou{Otf8X?P2}lz7e`Kd! UsoZjLV*mgE07*qoM6N<$g2^9G?f?J) literal 0 HcmV?d00001 diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/ic_nel_up_item.png b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/ic_nel_up_item.png new file mode 100644 index 0000000000000000000000000000000000000000..ee471023e095a1ae11a0f614eb953b727b0b169d GIT binary patch literal 3304 zcmVWi>P)N2bPDNB8 zb~7$DE;i7Ety%y83}s0~K~#8N?OO?O6W1Bum9(p4C0UXs-!>RyY>dGi33dP@8H`UX zpZLJwLp~rFbA=-qgGox7yG@f$(rKGXOB)h$G;MRxoK2cEZQ2}7nkJ-a=`?B5kfxb- z+O$Jc{P+J?e&SikAV4;#gJ-^Z@9nO3|L^<%_rJIAtp(xY-$ey3DscW3DApR|di!lT zLz@L*nfd(LabBM6(OX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z;!YF1uQkN;e6*k`9ej zajn+65|_rR1H^&}GvY)x6tc@mfMSr%^&mTYHX$)t5avc|cne3L#kfgXh$R4LHVzv2VA;tGGHq4ibP7CGx?fDT(pODjgBP)rE^7<<;R>d;wikAJk1Cbc^*?K32Mu5sB0qu(!+V`1$0f3SE~w8b5eh2-e$z9M z?}H4A09_gAF_JJ5CtpD1!ZD@DOOq2Oz^Ob>gn1BoRe69u3lII8||W;T)pnE=6|PGKMH`E2h&Ag~A!rAiPSKK!)C zjq{JF`a=QGa})ug`ubR5&%!^e>RvShM4WDGoL$E-3F@PYK6=cnQD=gF0fIAps6Nlg zQv{FzQ!DPq*V-zOT)qFmIX_N=qw25FD<_};__CB!;~(CFz0R^d3;WisK5fD~2q1z|y@A<5qbnD-fB=4mQ<(&Tj>6an;!41N>vQ4|W0Uu?k7VUkCc zp~y2Kc=FS5A%r48XQ%;7VlVCdL|Fvr<}X%~y0Ht?ofQ5&VHN?w-Y4>^0JzF)P3nCQ zUyGyd^VtOj<^&V~Ka~j;`b2mv^33}rfJ7fi#rGVELIK=!tRw(N03Y_j{hmZ1!aRsL zYfGjTxaQZ5n;pexx43!!GN)&THKFT-0ABy}HaOEWq7)I#^X!;E0-8YQ=sJv_*+!cH zMVShIJ0Rm~ZO+Kto{jH(=o4Ai|5?AMl12c6WNHD?-u0U(6u^^aaMCc?fCA9e)<3!7 z`+g|zGZ6v;D6Jsad~cutVJyR)zjzPv@;#b${aHN%P(h2w=sv088h~(IutOLs?L8!p3uJU4RFU0fb mw#_~9)Gt2qq5{#N!2bXMO`x+Fh$+(m0000 + images/ic_nel_reset_all.png + images/ic_nel_add_item.png + images/ic_nel_delete_item.png + images/ic_nel_down_item.png + images/ic_nel_generic_settings.png + images/ic_nel_up_item.png images/arrow-left-2.png images/arrow-left-double-2.png images/arrow-right-2.png diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_settings_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_settings_page.cpp new file mode 100644 index 000000000..2d92bd45e --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_settings_page.cpp @@ -0,0 +1,212 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// +// 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 . + +// Project includes +#include "mission_compiler_settings_page.h" +#include "../core/core_constants.h" +#include "../core/icore.h" + +// NeL includes +#include + +// Qt includes +#include +#include +#include + +namespace Plugin +{ + +QString lastDir = "."; + +MissionCompilerSettingsPage::MissionCompilerSettingsPage(QObject *parent) + : IOptionsPage(parent), + m_page(0) +{ +} + +MissionCompilerSettingsPage::~MissionCompilerSettingsPage() +{ +} + +QString MissionCompilerSettingsPage::id() const +{ + return QLatin1String("mission_compiler_settings"); +} + +QString MissionCompilerSettingsPage::trName() const +{ + return tr("Mission Compiler Settings"); +} + +QString MissionCompilerSettingsPage::category() const +{ + return QLatin1String("MissionCompilerSettings"); +} + +QString MissionCompilerSettingsPage::trCategory() const +{ + return tr("MissionCompilerSettings"); +} + +QIcon MissionCompilerSettingsPage::categoryIcon() const +{ + return QIcon(); +} + +QWidget *MissionCompilerSettingsPage::createPage(QWidget *parent) +{ + m_page = new QWidget(parent); + m_ui.setupUi(m_page); + + readSettings(); + checkEnabledButton(); + connect(m_ui.addToolButton, SIGNAL(clicked()), this, SLOT(addPath())); + connect(m_ui.removeToolButton, SIGNAL(clicked()), this, SLOT(delPath())); + connect(m_ui.upToolButton, SIGNAL(clicked()), this, SLOT(upPath())); + connect(m_ui.downToolButton, SIGNAL(clicked()), this, SLOT(downPath())); + connect(m_ui.resetToolButton, SIGNAL(clicked()), m_ui.serversTreeWidget, SLOT(clear())); + return m_page; +} + +void MissionCompilerSettingsPage::apply() +{ + writeSettings(); + applySearchPaths(); +} + +void MissionCompilerSettingsPage::finish() +{ + delete m_page; + m_page = 0; +} + +void MissionCompilerSettingsPage::applySearchPaths() +{ + QStringList paths, remapExt; + QSettings *settings = Core::ICore::instance()->settings(); + settings->beginGroup(Core::Constants::DATA_PATH_SECTION); + if (m_recurse) + paths = settings->value(Core::Constants::RECURSIVE_SEARCH_PATHS).toStringList(); + else + paths = settings->value(Core::Constants::SEARCH_PATHS).toStringList(); + + remapExt = settings->value(Core::Constants::REMAP_EXTENSIONS).toStringList(); + settings->endGroup(); + + for (int i = 1; i < remapExt.size(); i += 2) + NLMISC::CPath::remapExtension(remapExt.at(i - 1).toStdString(), remapExt.at(i).toStdString(), true); + + Q_FOREACH(QString path, paths) + { + NLMISC::CPath::addSearchPath(path.toStdString(), m_recurse, false); + } +} + +void MissionCompilerSettingsPage::addPath() +{ + QString newPath = QFileDialog::getExistingDirectory(m_page, "", lastDir); + if (!newPath.isEmpty()) + { + QTreeWidgetItem *newItem = new QTreeWidgetItem; + newItem->setText(newPath); + newItem->setFlags(Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable); + m_ui.serversTreeWidget->addItem(newItem); + lastDir = newPath; + } + + checkEnabledButton(); +} + +void MissionCompilerSettingsPage::delPath() +{ + QTreeWidgetItem *removeItem = m_ui.serversTreeWidget->takeItem(m_ui.serversTreeWidget->currentRow()); + if (!removeItem) + delete removeItem; + + checkEnabledButton(); +} + +void MissionCompilerSettingsPage::upPath() +{ + int currentRow = m_ui.serversTreeWidget->currentRow(); + if (!(currentRow == 0)) + { + QListWidgetItem *item = m_ui.serversListWidget->takeItem(currentRow); + m_ui.serversListWidget->insertItem(--currentRow, item); + m_ui.serversListWidget->setCurrentRow(currentRow); + } +} + +void MissionCompilerSettingsPage::downPath() +{ + int currentRow = m_ui.serversListWidget->currentRow(); + if (!(currentRow == m_ui.serversListWidget->count()-1)) + { + QListWidgetItem *item = m_ui.serversListWidget->takeItem(currentRow); + m_ui.serversTreeWidget->insertItem(++currentRow, item); + m_ui.serversTreeWidget->setCurrentRow(currentRow); + } +} + +void MissionCompilerSettingsPage::readSettings() +{ + QStringList paths; + QSettings *settings = Core::ICore::instance()->settings(); + settings->beginGroup(Core::Constants::DATA_PATH_SECTION); + if (m_recurse) + paths = settings->value(Core::Constants::RECURSIVE_SEARCH_PATHS).toStringList(); + else + paths = settings->value(Core::Constants::SEARCH_PATHS).toStringList(); + settings->endGroup(); + Q_FOREACH(QString path, paths) + { + QListWidgetItem *newItem = new QListWidgetItem; + newItem->setText(path); + newItem->setFlags(Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable); + m_ui.serversTreeWidget->addItem(newItem); + } +} + +void MissionCompilerSettingsPage::writeSettings() +{ + QStringList paths; + for (int i = 0; i < m_ui.serversTreeWidget->count(); ++i) + paths << m_ui.serversTreeWidget->item(i)->text(); + + QSettings *settings = Core::ICore::instance()->settings(); + settings->beginGroup(Core::Constants::DATA_PATH_SECTION); + if (m_recurse) + settings->setValue(Core::Constants::RECURSIVE_SEARCH_PATHS, paths); + else + settings->setValue(Core::Constants::SEARCH_PATHS, paths); + settings->endGroup(); + settings->sync(); +} + +void MissionCompilerSettingsPage::checkEnabledButton() +{ + bool bEnabled = true; + if (m_ui.serversTreeWidget->count() == 0) + bEnabled = false; + + m_ui.removeToolButton->setEnabled(bEnabled); + m_ui.upToolButton->setEnabled(bEnabled); + m_ui.downToolButton->setEnabled(bEnabled); +} + +} /* namespace Plugin */ \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_settings_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_settings_page.h new file mode 100644 index 000000000..43fc4ec5c --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_settings_page.h @@ -0,0 +1,74 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// +// 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 MISSION_COMPILER_SETTINGS_PAGE_H +#define MISSION_COMPILER_SETTINGS_PAGE_H + +#include + +#include "../core/ioptions_page.h" + +#include "ui_mission_compiler_settings_page.h" + +class QWidget; + +namespace Plugin +{ +/** +@class MissionCompilerSettingsPage +*/ +class MissionCompilerSettingsPage : public Core::IOptionsPage +{ + Q_OBJECT + +public: + MissionCompilerSettingsPage(QObject *parent = 0); + ~MissionCompilerSettingsPage(); + + QString id() const; + QString trName() const; + QString category() const; + QString trCategory() const; + QIcon categoryIcon() const; + QWidget *createPage(QWidget *parent); + + void apply(); + void finish(); + + // Set of the search paths(not recursive) and the remap extensions (loading from settings file) + void applySearchPaths(); + +private Q_SLOTS: + void addPath(); + void delPath(); + void upPath(); + void downPath(); + +private: + void readSettings(); + void writeSettings(); + void checkEnabledButton(); + + bool m_recurse; + QWidget *m_page; + Ui::MissionCompilerSettingsPage m_ui; +}; + +} // namespace Plugin + +#endif // MISSION_COMPILER_SETTINGS_PAGE_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_settings_page.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_settings_page.ui new file mode 100644 index 000000000..c5640750b --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_settings_page.ui @@ -0,0 +1,265 @@ + + + MissionCompilerSettingsPage + + + + 0 + 0 + 496 + 544 + + + + Form + + + + 6 + + + 3 + + + + + Publication Servers + + + + + + + + + 0 + 0 + + + + Delete + + + + + + + :/buttons/images/ic_nel_delete_item.png:/buttons/images/ic_nel_delete_item.png + + + + 20 + 20 + + + + true + + + + + + + + 0 + 0 + + + + Add + + + + + + + :/buttons/images/ic_nel_add_item.png:/buttons/images/ic_nel_add_item.png + + + + 20 + 20 + + + + true + + + + + + + + 0 + 0 + + + + Up + + + + + + + :/buttons/images/ic_nel_up_item.png:/buttons/images/ic_nel_up_item.png + + + + 20 + 20 + + + + true + + + + + + + + 0 + 0 + + + + Down + + + + + + + :/buttons/images/ic_nel_down_item.png:/buttons/images/ic_nel_down_item.png + + + + 20 + 20 + + + + true + + + + + + + Reset + + + + + + + :/buttons/images/ic_nel_reset_all.png:/buttons/images/ic_nel_reset_all.png + + + + 20 + 20 + + + + true + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + true + + + 100 + + + true + + + + Server Name + + + + + Server Text Path + + + + + Server Primitive Path + + + + + + + + + + + General Settings + + + + + + Local Text Path + + + + + + + Local path for compiled mission texts. + + + + + + + ... + + + + + + + + + + + + + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/server_entry_dialog.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/server_entry_dialog.ui new file mode 100644 index 000000000..5f7c6d827 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/server_entry_dialog.ui @@ -0,0 +1,108 @@ + + + ServerEntryDialog + + + + 0 + 0 + 400 + 300 + + + + Dialog + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + Server Name + + + + + + + Server Text Path + + + + + + + Server Primitive Path + + + + + + + + + + + + + + + + ... + + + + + + + ... + + + + + + + + + buttonBox + accepted() + ServerEntryDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + ServerEntryDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + From f49b178b78073977955f47eab771dfedb09ef1e4 Mon Sep 17 00:00:00 2001 From: sfb Date: Sat, 11 Jun 2011 08:48:16 -0500 Subject: [PATCH 11/12] Changed: Fixed the 'QMetaObject' linking error and commented out most of the old code to be replaced. --- .../plugins/mission_compiler/CMakeLists.txt | 3 +- .../mission_compiler_settings_page.cpp | 127 +++++++++--------- .../mission_compiler_settings_page.ui | 2 +- 3 files changed, 69 insertions(+), 63 deletions(-) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/CMakeLists.txt index cc6d8489f..4919bceff 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/CMakeLists.txt @@ -10,7 +10,8 @@ SET(OVQT_EXT_SYS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin. ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin_spec.h) SET(OVQT_PLUG_MISSION_COMPILER_HDR mission_compiler_plugin.h - mission_compiler_main_window.h) + mission_compiler_main_window.h + mission_compiler_settings_page.h) SET(OVQT_PLUG_MISSION_COMPILER_UIS mission_compiler_main_window.ui server_entry_dialog.ui mission_compiler_settings_page.ui) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_settings_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_settings_page.cpp index 2d92bd45e..f500933a7 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_settings_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_settings_page.cpp @@ -20,6 +20,8 @@ #include "../core/core_constants.h" #include "../core/icore.h" +#include "ui_server_entry_dialog.h" + // NeL includes #include @@ -27,6 +29,7 @@ #include #include #include +#include namespace Plugin { @@ -79,7 +82,7 @@ QWidget *MissionCompilerSettingsPage::createPage(QWidget *parent) connect(m_ui.removeToolButton, SIGNAL(clicked()), this, SLOT(delPath())); connect(m_ui.upToolButton, SIGNAL(clicked()), this, SLOT(upPath())); connect(m_ui.downToolButton, SIGNAL(clicked()), this, SLOT(downPath())); - connect(m_ui.resetToolButton, SIGNAL(clicked()), m_ui.serversTreeWidget, SLOT(clear())); + //connect(m_ui.resetToolButton, SIGNAL(clicked()), m_ui.serversTreeWidget, SLOT(clear())); return m_page; } @@ -119,94 +122,96 @@ void MissionCompilerSettingsPage::applySearchPaths() void MissionCompilerSettingsPage::addPath() { - QString newPath = QFileDialog::getExistingDirectory(m_page, "", lastDir); - if (!newPath.isEmpty()) - { - QTreeWidgetItem *newItem = new QTreeWidgetItem; - newItem->setText(newPath); - newItem->setFlags(Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable); - m_ui.serversTreeWidget->addItem(newItem); - lastDir = newPath; - } + Ui::ServerEntryDialog serverEntryDialog; - checkEnabledButton(); + //QString newPath = QFileDialog::getExistingDirectory(m_page, "", lastDir); + //if (!newPath.isEmpty()) + //{ + // QTreeWidgetItem *newItem = new QTreeWidgetItem; + // newItem->setText(newPath); + // newItem->setFlags(Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable); + // m_ui.serversTreeWidget->addItem(newItem); + // lastDir = newPath; + //} + + //checkEnabledButton(); } void MissionCompilerSettingsPage::delPath() { - QTreeWidgetItem *removeItem = m_ui.serversTreeWidget->takeItem(m_ui.serversTreeWidget->currentRow()); - if (!removeItem) - delete removeItem; + //QTreeWidgetItem *removeItem = m_ui.serversTreeWidget->takeItem(m_ui.serversTreeWidget->currentRow()); + //if (!removeItem) + // delete removeItem; - checkEnabledButton(); + //checkEnabledButton(); } void MissionCompilerSettingsPage::upPath() { - int currentRow = m_ui.serversTreeWidget->currentRow(); - if (!(currentRow == 0)) - { - QListWidgetItem *item = m_ui.serversListWidget->takeItem(currentRow); - m_ui.serversListWidget->insertItem(--currentRow, item); - m_ui.serversListWidget->setCurrentRow(currentRow); - } + //int currentRow = m_ui.serversTreeWidget->currentRow(); + //if (!(currentRow == 0)) + //{ + // QListWidgetItem *item = m_ui.serversListWidget->takeItem(currentRow); + // m_ui.serversListWidget->insertItem(--currentRow, item); + // m_ui.serversListWidget->setCurrentRow(currentRow); + //} } void MissionCompilerSettingsPage::downPath() { - int currentRow = m_ui.serversListWidget->currentRow(); - if (!(currentRow == m_ui.serversListWidget->count()-1)) - { - QListWidgetItem *item = m_ui.serversListWidget->takeItem(currentRow); - m_ui.serversTreeWidget->insertItem(++currentRow, item); - m_ui.serversTreeWidget->setCurrentRow(currentRow); - } + //int currentRow = m_ui.serversListWidget->currentRow(); + //if (!(currentRow == m_ui.serversListWidget->count()-1)) + //{ + // QListWidgetItem *item = m_ui.serversListWidget->takeItem(currentRow); + // m_ui.serversTreeWidget->insertItem(++currentRow, item); + // m_ui.serversTreeWidget->setCurrentRow(currentRow); + //} } void MissionCompilerSettingsPage::readSettings() { - QStringList paths; - QSettings *settings = Core::ICore::instance()->settings(); - settings->beginGroup(Core::Constants::DATA_PATH_SECTION); - if (m_recurse) - paths = settings->value(Core::Constants::RECURSIVE_SEARCH_PATHS).toStringList(); - else - paths = settings->value(Core::Constants::SEARCH_PATHS).toStringList(); - settings->endGroup(); - Q_FOREACH(QString path, paths) - { - QListWidgetItem *newItem = new QListWidgetItem; - newItem->setText(path); - newItem->setFlags(Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable); - m_ui.serversTreeWidget->addItem(newItem); - } + //QStringList paths; + //QSettings *settings = Core::ICore::instance()->settings(); + //settings->beginGroup(Core::Constants::DATA_PATH_SECTION); + //if (m_recurse) + // paths = settings->value(Core::Constants::RECURSIVE_SEARCH_PATHS).toStringList(); + //else + // paths = settings->value(Core::Constants::SEARCH_PATHS).toStringList(); + //settings->endGroup(); + //Q_FOREACH(QString path, paths) + //{ + // QListWidgetItem *newItem = new QListWidgetItem; + // newItem->setText(path); + // newItem->setFlags(Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable); + // m_ui.serversTreeWidget->addItem(newItem); + //} } void MissionCompilerSettingsPage::writeSettings() { - QStringList paths; - for (int i = 0; i < m_ui.serversTreeWidget->count(); ++i) - paths << m_ui.serversTreeWidget->item(i)->text(); + //QStringList paths; + //for (int i = 0; i < m_ui.serversTreeWidget->count(); ++i) + // paths << m_ui.serversTreeWidget->item(i)->text(); - QSettings *settings = Core::ICore::instance()->settings(); - settings->beginGroup(Core::Constants::DATA_PATH_SECTION); - if (m_recurse) - settings->setValue(Core::Constants::RECURSIVE_SEARCH_PATHS, paths); - else - settings->setValue(Core::Constants::SEARCH_PATHS, paths); - settings->endGroup(); - settings->sync(); + //QSettings *settings = Core::ICore::instance()->settings(); + //settings->beginGroup(Core::Constants::DATA_PATH_SECTION); + //if (m_recurse) + // settings->setValue(Core::Constants::RECURSIVE_SEARCH_PATHS, paths); + //else + // settings->setValue(Core::Constants::SEARCH_PATHS, paths); + //settings->endGroup(); + //settings->sync(); } void MissionCompilerSettingsPage::checkEnabledButton() { - bool bEnabled = true; - if (m_ui.serversTreeWidget->count() == 0) - bEnabled = false; + //bool bEnabled = true; + //if (m_ui.serversTreeWidget->count() == 0) + // bEnabled = false; - m_ui.removeToolButton->setEnabled(bEnabled); - m_ui.upToolButton->setEnabled(bEnabled); - m_ui.downToolButton->setEnabled(bEnabled); + //m_ui.removeToolButton->setEnabled(bEnabled); + //m_ui.upToolButton->setEnabled(bEnabled); + //m_ui.downToolButton->setEnabled(bEnabled); } } /* namespace Plugin */ \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_settings_page.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_settings_page.ui index c5640750b..905cc5185 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_settings_page.ui +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_settings_page.ui @@ -183,7 +183,7 @@ - + Qt::Horizontal From 2a1505cb20bb24bceae3ca2a43b8c0c953fb1181 Mon Sep 17 00:00:00 2001 From: sfb Date: Fri, 1 Jul 2011 07:19:46 -0500 Subject: [PATCH 12/12] Changed: Implementing server list in settings page. Added dialog for editing/adding entries. Can add, remove and edit entries. Still need to implement read/write settings and provide a method to connect the table to the publishing options table. --- .../plugins/mission_compiler/CMakeLists.txt | 3 +- .../mission_compiler_main_window.cpp | 1 + .../mission_compiler_plugin.cpp | 4 +- .../mission_compiler_settings_page.cpp | 120 +++++++----------- .../mission_compiler_settings_page.h | 12 +- .../mission_compiler_settings_page.ui | 61 +-------- .../mission_compiler/server_entry_dialog.cpp | 89 +++++++++++++ .../mission_compiler/server_entry_dialog.h | 59 +++++++++ .../mission_compiler/server_entry_dialog.ui | 110 +++++++++------- 9 files changed, 270 insertions(+), 189 deletions(-) create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/server_entry_dialog.cpp create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/server_entry_dialog.h diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/CMakeLists.txt index 4919bceff..f277a4b14 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/CMakeLists.txt @@ -11,7 +11,8 @@ SET(OVQT_EXT_SYS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin. SET(OVQT_PLUG_MISSION_COMPILER_HDR mission_compiler_plugin.h mission_compiler_main_window.h - mission_compiler_settings_page.h) + mission_compiler_settings_page.h + server_entry_dialog.h) SET(OVQT_PLUG_MISSION_COMPILER_UIS mission_compiler_main_window.ui server_entry_dialog.ui mission_compiler_settings_page.ui) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp index 95d7ca50f..9bab135d4 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_main_window.cpp @@ -79,6 +79,7 @@ MissionCompilerMainWindow::MissionCompilerMainWindow(QWidget *parent) : settings->endGroup(); NLLIGO::Register(); + // TODO try/catch exception. Crashes if path invalid. m_ligoConfig.readPrimitiveClass(NLMISC::CPath::lookup("world_editor_classes.xml").c_str(), false); NLLIGO::CPrimitiveContext::instance().CurrentLigoConfig = &m_ligoConfig; } diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_plugin.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_plugin.cpp index 7bd06de91..d67128a50 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_plugin.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_plugin.cpp @@ -17,6 +17,8 @@ #include #include +#include "mission_compiler_settings_page.h" + namespace Plugin { @@ -35,7 +37,7 @@ bool MissionCompilerPlugin::initialize(ExtensionSystem::IPluginManager *pluginMa Q_UNUSED(errorString); _plugMan = pluginManager; - //addAutoReleasedObject(new CZonePainterSettingsPage(this)); + addAutoReleasedObject(new MissionCompilerSettingsPage(this)); addAutoReleasedObject(new CMissionCompilerContext(this)); //addAutoReleasedObject(new CCoreListener(this)); return true; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_settings_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_settings_page.cpp index f500933a7..028ac51db 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_settings_page.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_settings_page.cpp @@ -20,7 +20,7 @@ #include "../core/core_constants.h" #include "../core/icore.h" -#include "ui_server_entry_dialog.h" +#include "server_entry_dialog.h" // NeL includes #include @@ -58,12 +58,12 @@ QString MissionCompilerSettingsPage::trName() const QString MissionCompilerSettingsPage::category() const { - return QLatin1String("MissionCompilerSettings"); + return QLatin1String("Mission Compiler"); } QString MissionCompilerSettingsPage::trCategory() const { - return tr("MissionCompilerSettings"); + return tr("Mission Compiler"); } QIcon MissionCompilerSettingsPage::categoryIcon() const @@ -77,19 +77,15 @@ QWidget *MissionCompilerSettingsPage::createPage(QWidget *parent) m_ui.setupUi(m_page); readSettings(); - checkEnabledButton(); - connect(m_ui.addToolButton, SIGNAL(clicked()), this, SLOT(addPath())); - connect(m_ui.removeToolButton, SIGNAL(clicked()), this, SLOT(delPath())); - connect(m_ui.upToolButton, SIGNAL(clicked()), this, SLOT(upPath())); - connect(m_ui.downToolButton, SIGNAL(clicked()), this, SLOT(downPath())); - //connect(m_ui.resetToolButton, SIGNAL(clicked()), m_ui.serversTreeWidget, SLOT(clear())); + connect(m_ui.addToolButton, SIGNAL(clicked()), this, SLOT(addServer())); + connect(m_ui.removeToolButton, SIGNAL(clicked()), this, SLOT(delServer())); + connect(m_ui.serversTableWidget, SIGNAL(cellDoubleClicked(int,int)), this, SLOT(editServer(int,int))); return m_page; } void MissionCompilerSettingsPage::apply() { writeSettings(); - applySearchPaths(); } void MissionCompilerSettingsPage::finish() @@ -98,74 +94,57 @@ void MissionCompilerSettingsPage::finish() m_page = 0; } -void MissionCompilerSettingsPage::applySearchPaths() +void MissionCompilerSettingsPage::editServer(int row, int column) { - QStringList paths, remapExt; - QSettings *settings = Core::ICore::instance()->settings(); - settings->beginGroup(Core::Constants::DATA_PATH_SECTION); - if (m_recurse) - paths = settings->value(Core::Constants::RECURSIVE_SEARCH_PATHS).toStringList(); - else - paths = settings->value(Core::Constants::SEARCH_PATHS).toStringList(); + ServerEntryDialog serverEntryDialog; + serverEntryDialog.setModal(true); + serverEntryDialog.show(); - remapExt = settings->value(Core::Constants::REMAP_EXTENSIONS).toStringList(); - settings->endGroup(); + // Copy the values from the row to the dialog. + QTableWidgetItem *item1 = m_ui.serversTableWidget->item(row,0); + QTableWidgetItem *item2 = m_ui.serversTableWidget->item(row,1); + QTableWidgetItem *item3 = m_ui.serversTableWidget->item(row,2); + serverEntryDialog.setServerName(item1->text()); + serverEntryDialog.setTextPath(item2->text()); + serverEntryDialog.setPrimPath(item3->text()); - for (int i = 1; i < remapExt.size(); i += 2) - NLMISC::CPath::remapExtension(remapExt.at(i - 1).toStdString(), remapExt.at(i).toStdString(), true); - - Q_FOREACH(QString path, paths) + if(serverEntryDialog.exec()) { - NLMISC::CPath::addSearchPath(path.toStdString(), m_recurse, false); + item1->setText(serverEntryDialog.getServerName()); + item2->setText(serverEntryDialog.getTextPath()); + item3->setText(serverEntryDialog.getPrimPath()); } } -void MissionCompilerSettingsPage::addPath() +void MissionCompilerSettingsPage::addServer() { - Ui::ServerEntryDialog serverEntryDialog; + ServerEntryDialog serverEntryDialog; + serverEntryDialog.setModal(true); + serverEntryDialog.show(); + - //QString newPath = QFileDialog::getExistingDirectory(m_page, "", lastDir); - //if (!newPath.isEmpty()) - //{ - // QTreeWidgetItem *newItem = new QTreeWidgetItem; - // newItem->setText(newPath); - // newItem->setFlags(Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable); - // m_ui.serversTreeWidget->addItem(newItem); - // lastDir = newPath; - //} + if(serverEntryDialog.exec()) + { + int row = m_ui.serversTableWidget->rowCount(); + m_ui.serversTableWidget->insertRow(row); + QTableWidgetItem *item1 = new QTableWidgetItem(serverEntryDialog.getServerName()); + QTableWidgetItem *item2 = new QTableWidgetItem(serverEntryDialog.getTextPath()); + QTableWidgetItem *item3 = new QTableWidgetItem(serverEntryDialog.getPrimPath()); - //checkEnabledButton(); + m_ui.serversTableWidget->setItem(row, 0, item1); + m_ui.serversTableWidget->setItem(row, 1, item2); + m_ui.serversTableWidget->setItem(row, 2, item3); + } } -void MissionCompilerSettingsPage::delPath() +void MissionCompilerSettingsPage::delServer() { - //QTreeWidgetItem *removeItem = m_ui.serversTreeWidget->takeItem(m_ui.serversTreeWidget->currentRow()); - //if (!removeItem) - // delete removeItem; - - //checkEnabledButton(); -} - -void MissionCompilerSettingsPage::upPath() -{ - //int currentRow = m_ui.serversTreeWidget->currentRow(); - //if (!(currentRow == 0)) - //{ - // QListWidgetItem *item = m_ui.serversListWidget->takeItem(currentRow); - // m_ui.serversListWidget->insertItem(--currentRow, item); - // m_ui.serversListWidget->setCurrentRow(currentRow); - //} -} - -void MissionCompilerSettingsPage::downPath() -{ - //int currentRow = m_ui.serversListWidget->currentRow(); - //if (!(currentRow == m_ui.serversListWidget->count()-1)) - //{ - // QListWidgetItem *item = m_ui.serversListWidget->takeItem(currentRow); - // m_ui.serversTreeWidget->insertItem(++currentRow, item); - // m_ui.serversTreeWidget->setCurrentRow(currentRow); - //} + QList selectedItems = m_ui.serversTableWidget->selectedItems(); + while(selectedItems.size() > 0) + { + m_ui.serversTableWidget->removeRow(selectedItems.back()->row()); + selectedItems = m_ui.serversTableWidget->selectedItems(); + } } void MissionCompilerSettingsPage::readSettings() @@ -203,15 +182,4 @@ void MissionCompilerSettingsPage::writeSettings() //settings->sync(); } -void MissionCompilerSettingsPage::checkEnabledButton() -{ - //bool bEnabled = true; - //if (m_ui.serversTreeWidget->count() == 0) - // bEnabled = false; - - //m_ui.removeToolButton->setEnabled(bEnabled); - //m_ui.upToolButton->setEnabled(bEnabled); - //m_ui.downToolButton->setEnabled(bEnabled); -} - } /* namespace Plugin */ \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_settings_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_settings_page.h index 43fc4ec5c..32b59e050 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_settings_page.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_settings_page.h @@ -50,21 +50,15 @@ public: void apply(); void finish(); - // Set of the search paths(not recursive) and the remap extensions (loading from settings file) - void applySearchPaths(); - private Q_SLOTS: - void addPath(); - void delPath(); - void upPath(); - void downPath(); + void addServer(); + void delServer(); + void editServer(int row, int column); private: void readSettings(); void writeSettings(); - void checkEnabledButton(); - bool m_recurse; QWidget *m_page; Ui::MissionCompilerSettingsPage m_ui; }; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_settings_page.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_settings_page.ui index 905cc5185..2ee2c2bce 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_settings_page.ui +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/mission_compiler_settings_page.ui @@ -86,64 +86,6 @@ - - - - - 0 - 0 - - - - Up - - - - - - - :/buttons/images/ic_nel_up_item.png:/buttons/images/ic_nel_up_item.png - - - - 20 - 20 - - - - true - - - - - - - - 0 - 0 - - - - Down - - - - - - - :/buttons/images/ic_nel_down_item.png:/buttons/images/ic_nel_down_item.png - - - - 20 - 20 - - - - true - - - @@ -197,6 +139,9 @@ + + QAbstractItemView::NoEditTriggers + true diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/server_entry_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/server_entry_dialog.cpp new file mode 100644 index 000000000..b930eb5ec --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/server_entry_dialog.cpp @@ -0,0 +1,89 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// +// 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 . + +// Project includes +#include "server_entry_dialog.h" + +#include "ui_server_entry_dialog.h" + +// NeL includes + +// Qt includes +#include + +namespace Plugin +{ + +ServerEntryDialog::ServerEntryDialog(QWidget *parent) + : QDialog(parent), + m_ui(new Ui::ServerEntryDialog) +{ + m_ui->setupUi(this); + + connect(m_ui->serverTextPathButton, SIGNAL(clicked()), this, SLOT(lookupTextPath())); + connect(m_ui->serverPrimPathButton, SIGNAL(clicked()), this, SLOT(lookupPrimPath())); +} + +ServerEntryDialog::~ServerEntryDialog() +{ + delete m_ui; +} + +QString ServerEntryDialog::getServerName() +{ + return m_ui->serverNameEdit->text(); +} + +QString ServerEntryDialog::getTextPath() +{ + return m_ui->serverTextPathEdit->text(); +} + +QString ServerEntryDialog::getPrimPath() +{ + return m_ui->serverPrimPathEdit->text(); +} + +void ServerEntryDialog::setServerName(QString name) +{ + m_ui->serverNameEdit->setText(name); +} + +void ServerEntryDialog::setTextPath(QString path) +{ + m_ui->serverTextPathEdit->setText(path); +} + +void ServerEntryDialog::setPrimPath(QString path) +{ + m_ui->serverPrimPathEdit->setText(path); +} + +void ServerEntryDialog::lookupTextPath() +{ + QString curPath = m_ui->serverTextPathEdit->text(); + QString path = QFileDialog::getExistingDirectory(this, "", curPath); + m_ui->serverTextPathEdit->setText(path); +} + +void ServerEntryDialog::lookupPrimPath() +{ + QString curPath = m_ui->serverPrimPathEdit->text(); + QString path = QFileDialog::getExistingDirectory(this, "", curPath); + m_ui->serverPrimPathEdit->setText(path); +} +} /* namespace Plugin */ \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/server_entry_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/server_entry_dialog.h new file mode 100644 index 000000000..e2a1d5016 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/server_entry_dialog.h @@ -0,0 +1,59 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// +// 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 SERVER_ENTRY_DIALOG_H +#define SERVER_ENTRY_DIALOG_H + +#include + +namespace Ui { + class ServerEntryDialog; +} + +namespace Plugin +{ +/** +@class ServerEntryDialog +*/ +class ServerEntryDialog : public QDialog +{ + Q_OBJECT + +public: + explicit ServerEntryDialog(QWidget *parent = 0); + ~ServerEntryDialog(); + + QString getServerName(); + QString getTextPath(); + QString getPrimPath(); + + void setServerName(QString name); + void setTextPath(QString path); + void setPrimPath(QString path); + +public Q_SLOTS: + void lookupTextPath(); + void lookupPrimPath(); + +private: + Ui::ServerEntryDialog *m_ui; +}; + +} // namespace Plugin + +#endif // SERVER_ENTRY_DIALOG_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/server_entry_dialog.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/server_entry_dialog.ui index 5f7c6d827..002af82eb 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/server_entry_dialog.ui +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/server_entry_dialog.ui @@ -6,15 +6,15 @@ 0 0 - 400 - 300 + 488 + 175 Dialog - + Qt::Horizontal @@ -24,48 +24,70 @@ - - - - Server Name - - - - - - - Server Text Path - - - - - - - Server Primitive Path - - - - - - - - - - - - - - - - ... - - - - - - - ... + + + + Server Settings + + + + + Server Name + + + + + + + + + + Server Text Path + + + + + + + + + + ... + + + + + + + Server Primitive Path + + + + + + + + + + ... + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + +