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