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 000000000..8f153292c Binary files /dev/null and b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/arrow-left-2.png differ 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 000000000..8b6d62c7a Binary files /dev/null and b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/arrow-left-double-2.png differ 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 000000000..d4016e2c7 Binary files /dev/null and b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/arrow-right-2.png differ 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 000000000..1fe9feb28 Binary files /dev/null and b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/arrow-right-double-2.png differ 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 000000000..bc7688858 Binary files /dev/null and b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/document-export-4.png differ 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 000000000..d5259a76b Binary files /dev/null and b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/news-subscribe-2.png differ 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 000000000..5fea6c540 Binary files /dev/null and b/code/nel/tools/3d/object_viewer_qt/src/plugins/mission_compiler/images/run-build-2.png differ diff --git a/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; }