diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/CMakeLists.txt index 714d1f125..227210366 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/CMakeLists.txt @@ -15,10 +15,12 @@ SET(OVQT_PLUGIN_LANDSCAPE_EDITOR_HDR landscape_editor_plugin.h list_zones_model.h list_zones_widget.h landscape_actions.h + project_settings_dialog.h ) SET(OVQT_PLUGIN_LANDSCAPE_EDITOR_UIS landscape_editor_window.ui list_zones_widget.ui + project_settings_dialog.ui ) SET(OVQT_PLUGIN_LANDSCAPE_EDITOR_RCS landscape_editor.qrc) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/builder_zone.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/builder_zone.cpp index 42242921e..3db771224 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/builder_zone.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/builder_zone.cpp @@ -17,7 +17,6 @@ // Project includes #include "builder_zone.h" -#include "list_zones_model.h" // NeL includes #include @@ -25,20 +24,97 @@ // Qt includes #include #include +#include +#include namespace LandscapeEditor { +const int PixmapScale = 256; + +PixmapDatabase::PixmapDatabase() +{ +} + +PixmapDatabase::~PixmapDatabase() +{ + reset(); +} + +bool PixmapDatabase::loadPixmaps(const QString &zonePath, NLLIGO::CZoneBank &zoneBank) +{ + QProgressDialog *progressDialog = new QProgressDialog(); + progressDialog->show(); + + std::vector listNames; + zoneBank.getCategoryValues ("zone", listNames); + progressDialog->setRange(0, listNames.size()); + for (uint i = 0; i < listNames.size(); ++i) + { + QApplication::processEvents(); + progressDialog->setValue(i); + + NLLIGO::CZoneBankElement *zoneBankItem = zoneBank.getElementByZoneName (listNames[i]); + + // Read the texture file + QString zonePixmapName(listNames[i].c_str()); + uint8 sizeX = zoneBankItem->getSizeX(); + uint8 sizeY = zoneBankItem->getSizeY(); + + QPixmap *pixmap = new QPixmap(zonePath + zonePixmapName + ".png"); + if (pixmap->isNull()) + { + // Generate filled pixmap + } + // All pixmaps must be have same size + if (pixmap->width() != sizeX * PixmapScale) + { + QPixmap *scaledPixmap = new QPixmap(pixmap->scaled(sizeX * PixmapScale, sizeY * PixmapScale)); + delete pixmap; + m_pixmapMap.insert(zonePixmapName, scaledPixmap); + } + else + m_pixmapMap.insert(zonePixmapName, pixmap); + } + delete progressDialog; + return true; +} + +void PixmapDatabase::reset() +{ + QStringList listNames(m_pixmapMap.keys()); + Q_FOREACH(QString name, listNames) + { + QPixmap *pixmap = m_pixmapMap.value(name); + delete pixmap; + } + m_pixmapMap.clear(); +} + +QStringList PixmapDatabase::listPixmaps() const +{ + return m_pixmapMap.keys(); +} + +QPixmap *PixmapDatabase::pixmap(const QString &zoneName) const +{ + QPixmap *result = 0; + if (!m_pixmapMap.contains(zoneName)) + nlwarning("QPixmap %s not found", zoneName.toStdString().c_str()); + else + result = m_pixmapMap.value(zoneName); + return result; +} ZoneBuilder::ZoneBuilder() - : m_zoneListModel(0) + : m_pixmapDatabase(0) { - m_zoneListModel = new ListZonesModel(); + m_pixmapDatabase = new PixmapDatabase(); m_lastPathName = ""; } ZoneBuilder::~ZoneBuilder() { - delete m_zoneListModel; + delete m_pixmapDatabase; } bool ZoneBuilder::init(const QString &pathName, bool makeAZone) @@ -60,8 +136,8 @@ bool ZoneBuilder::init(const QString &pathName, bool makeAZone) // Construct the DataBase from the ZoneBank QString zoneBitmapPath = pathName; zoneBitmapPath += "/zonebitmaps/"; - m_zoneListModel->resetModel(); - if (!m_zoneListModel->rebuildModel(zoneBitmapPath, m_zoneBank)) + m_pixmapDatabase->reset(); + if (!m_pixmapDatabase->loadPixmaps(zoneBitmapPath, m_zoneBank)) { m_zoneBank.reset(); return false; @@ -91,9 +167,14 @@ bool ZoneBuilder::initZoneBank (const QString &pathName) return true; } -ListZonesModel *ZoneBuilder::zoneModel() const +PixmapDatabase *ZoneBuilder::pixmapDatabase() const { - return m_zoneListModel; + return m_pixmapDatabase; +} + +QString ZoneBuilder::dataPath() const +{ + return m_lastPathName; } void ZoneBuilder::newZone (bool bDisplay) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/builder_zone.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/builder_zone.h index 97c4d8d3a..f69c2f7fb 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/builder_zone.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/builder_zone.h @@ -29,16 +29,47 @@ // Qt includes #include +#include +#include +#include namespace LandscapeEditor { -class ListZonesModel; + +/** +@class PixmapDatabase +@brief PixmapDatabase contains the image database +@details +*/ +class PixmapDatabase +{ +public: + PixmapDatabase(); + ~PixmapDatabase(); + + /// Load all images(png) from zonePath, list images gets from zoneBank + bool loadPixmaps(const QString &zonePath, NLLIGO::CZoneBank &zoneBank); + + /// Unload all images + void reset(); + + /// Get list names all loaded pixmaps + QStringList listPixmaps() const; + + /// Get original pixmap + /// @return QPixmap* if the image is in the database ; otherwise returns 0. + QPixmap *pixmap(const QString &zoneName) const; +private: + + QMap m_pixmapMap; +}; + /** @class ZoneBuilder @brief ZoneBuilder contains all the shared data between the tools and the engine @details ZoneBank contains the macro zones that is composed of several zones plus a mask -ZoneListModel contains the graphics for the zones +PixmapDatabase contains the graphics for the zones */ class ZoneBuilder { @@ -56,7 +87,11 @@ public: { return m_zoneBank; } - ListZonesModel *zoneModel() const; + + PixmapDatabase *pixmapDatabase() const; + + QString dataPath() const; + private: // Scan ./zoneligos dir and add all *.ligozone files to zoneBank @@ -65,7 +100,7 @@ private: sint32 m_minX, m_maxX, m_minY, m_maxY; QString m_lastPathName; - ListZonesModel *m_zoneListModel; + PixmapDatabase *m_pixmapDatabase; NLLIGO::CZoneBank m_zoneBank; std::vector m_currentSelection; }; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_window.cpp index eb9b8b8e8..1b8716326 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_window.cpp @@ -18,7 +18,7 @@ // Project includes #include "landscape_editor_window.h" #include "landscape_editor_constants.h" -#include "list_zones_model.h" +#include "project_settings_dialog.h" #include "../core/icore.h" #include "../core/imenu_manager.h" @@ -43,15 +43,18 @@ LandscapeEditorWindow::LandscapeEditorWindow(QWidget *parent) m_undoStack = new QUndoStack(this); m_zoneBuilder = new ZoneBuilder(); m_zoneBuilder->init("e:/-nel-/install/continents/newbieland", false); - m_ui.zoneListWidget->setModel(m_zoneBuilder->zoneModel()); m_ui.zoneListWidget->setZoneBuilder(m_zoneBuilder); m_ui.zoneListWidget->updateUi(); createMenus(); + createToolBars(); readSettings(); + + connect(m_ui.projectSettingsAction, SIGNAL(triggered()), this, SLOT(openProjectSettings())); } LandscapeEditorWindow::~LandscapeEditorWindow() { + delete m_zoneBuilder; writeSettings(); } @@ -75,11 +78,37 @@ void LandscapeEditorWindow::open() setCursor(Qt::ArrowCursor); } +void LandscapeEditorWindow::openProjectSettings() +{ + ProjectSettingsDialog *dialog = new ProjectSettingsDialog(m_zoneBuilder->dataPath(), this); + dialog->show(); + int ok = dialog->exec(); + if (ok == QDialog::Accepted) + { + m_zoneBuilder->init(dialog->dataPath(), false); + m_ui.zoneListWidget->updateUi(); + } + delete dialog; +} + void LandscapeEditorWindow::createMenus() { Core::IMenuManager *menuManager = Core::ICore::instance()->menuManager(); } +void LandscapeEditorWindow::createToolBars() +{ + Core::IMenuManager *menuManager = Core::ICore::instance()->menuManager(); + //QAction *action = menuManager->action(Core::Constants::NEW); + //m_ui.fileToolBar->addAction(action); + QAction *action = menuManager->action(Core::Constants::OPEN); + m_ui.fileToolBar->addAction(action); + //action = menuManager->action(Core::Constants::SAVE); + //m_ui.fileToolBar->addAction(action); + //action = menuManager->action(Core::Constants::SAVE_AS); + //m_ui.fileToolBar->addAction(action); +} + void LandscapeEditorWindow::readSettings() { QSettings *settings = Core::ICore::instance()->settings(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_window.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_window.h index 61e0c7eb1..9b2ae0335 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_window.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_window.h @@ -43,8 +43,11 @@ public Q_SLOTS: void open(); private Q_SLOTS: + void openProjectSettings(); + private: void createMenus(); + void createToolBars(); void readSettings(); void writeSettings(); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_window.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_window.ui index ac16ad9fd..3877d9732 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_window.ui +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/landscape_editor_window.ui @@ -24,7 +24,7 @@ - + toolBar @@ -44,6 +44,27 @@ + + + toolBar_2 + + + TopToolBarArea + + + false + + + + + + + :/icons/ic_nel_landscape_settings.png:/icons/ic_nel_landscape_settings.png + + + Project settings + + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/list_zones_model.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/list_zones_model.cpp index ffcb7617b..622fd8fb8 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/list_zones_model.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/list_zones_model.cpp @@ -17,6 +17,7 @@ // Project includes #include "list_zones_model.h" +#include "builder_zone.h" // NeL includes #include @@ -27,15 +28,14 @@ // Qt includes #include -#include #include namespace LandscapeEditor { -ListZonesModel::ListZonesModel(int pixmapSize, QObject *parent) +ListZonesModel::ListZonesModel(int scaleRatio, QObject *parent) : QAbstractListModel(parent), - m_pixmapSize(pixmapSize) + m_scaleRatio(scaleRatio) { } @@ -46,7 +46,7 @@ ListZonesModel::~ListZonesModel() int ListZonesModel::rowCount(const QModelIndex & /* parent */) const { - return m_pixmapNameList.count(); + return m_listNames.count(); } int ListZonesModel::columnCount(const QModelIndex & /* parent */) const @@ -65,11 +65,11 @@ QVariant ListZonesModel::data(const QModelIndex &index, int role) const } else if (role == Qt::DisplayRole) { - return m_pixmapNameList.at(index.row()); + return m_listNames.at(index.row()); } else if (role == Qt::DecorationRole) { - QPixmap *pixmap = getSmallPixmap(m_pixmapNameList.at(index.row())); + QPixmap *pixmap = getPixmap(m_listNames.at(index.row())); return qVariantFromValue(*pixmap); } return QVariant(); @@ -84,73 +84,48 @@ QVariant ListZonesModel::headerData(int section, return QVariant(); } -void ListZonesModel::setSmallPixmapSize(int pixmapSize) +void ListZonesModel::setScaleRatio(int scaleRatio) { - m_pixmapSize = pixmapSize; + m_scaleRatio = scaleRatio; } void ListZonesModel::setListZones(QStringList &listZones) { beginResetModel(); - m_pixmapNameList.clear(); - m_pixmapNameList = listZones; + m_listNames.clear(); + m_listNames = listZones; endResetModel(); } void ListZonesModel::resetModel() { beginResetModel(); - Q_FOREACH(QString name, m_pixmapNameList) + QStringList listNames(m_pixmapMap.keys()); + Q_FOREACH(QString name, listNames) { QPixmap *pixmap = m_pixmapMap.value(name); delete pixmap; - QPixmap *smallPixmap = m_smallPixmapMap.value(name); - delete smallPixmap; } m_pixmapMap.clear(); - m_pixmapNameList.clear(); - m_smallPixmapMap.clear(); + m_listNames.clear(); endResetModel(); } -bool ListZonesModel::rebuildModel(const QString &zonePath, NLLIGO::CZoneBank &zoneBank) +void ListZonesModel::rebuildModel(PixmapDatabase *pixmapDatabase) { + resetModel(); + beginResetModel(); - m_zonePath = zonePath; + QStringList listNames; + listNames = pixmapDatabase->listPixmaps(); - QProgressDialog *progressDialog = new QProgressDialog(); - progressDialog->show(); - - std::vector zoneNames; - zoneBank.getCategoryValues ("zone", zoneNames); - progressDialog->setRange(0, zoneNames.size()); - for (uint i = 0; i < zoneNames.size(); ++i) + Q_FOREACH(QString name, listNames) { - QApplication::processEvents(); - progressDialog->setValue(i); - - NLLIGO::CZoneBankElement *zoneBankItem = zoneBank.getElementByZoneName (zoneNames[i]); - - // Read the texture file - QString zonePixmapName(zoneNames[i].c_str()); - uint8 sizeX = zoneBankItem->getSizeX(); - uint8 sizeY = zoneBankItem->getSizeY(); - const std::vector &rMask = zoneBankItem->getMask(); - - QPixmap *pixmap = new QPixmap(zonePath + zonePixmapName + ".png"); - if (pixmap->isNull()) - { - // Generate filled pixmap - } - QPixmap *smallPixmap = new QPixmap(pixmap->scaled(m_pixmapSize * sizeX, m_pixmapSize * sizeY)); - - m_pixmapMap.insert(zonePixmapName, pixmap); - m_smallPixmapMap.insert(zonePixmapName, smallPixmap); - + QPixmap *pixmap = pixmapDatabase->pixmap(name); + QPixmap *smallPixmap = new QPixmap(pixmap->scaled(pixmap->width() / m_scaleRatio, pixmap->height() / m_scaleRatio)); + m_pixmapMap.insert(name, smallPixmap); } endResetModel(); - delete progressDialog; - return true; } QPixmap *ListZonesModel::getPixmap(const QString &zoneName) const @@ -163,15 +138,4 @@ QPixmap *ListZonesModel::getPixmap(const QString &zoneName) const return result; } -QPixmap *ListZonesModel::getSmallPixmap(const QString &zoneName) const -{ - QPixmap *result = 0; - if (!m_pixmapMap.contains(zoneName)) - nlwarning("QPixmap %s not found", zoneName.toStdString().c_str()); - else - result = m_smallPixmapMap.value(zoneName); - return result; -} - - } /* namespace LandscapeEditor */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/list_zones_model.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/list_zones_model.h index 16a28bf07..475416887 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/list_zones_model.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/list_zones_model.h @@ -31,18 +31,18 @@ namespace LandscapeEditor { +class PixmapDatabase; /** @class ListZonesModel -@brief ListZonesModel contains the image database for QGraphicsScene and -small images for QListView +@brief ListZonesModel contains the small images for QListView @details */ class ListZonesModel : public QAbstractListModel { Q_OBJECT public: - ListZonesModel(int pixmapSize = 64, QObject *parent = 0); + ListZonesModel(int scaleRatio = 4, QObject *parent = 0); ~ListZonesModel(); int rowCount(const QModelIndex &parent) const; @@ -53,30 +53,25 @@ public: /// Set size for small pixmaps /// Value should be set before calling rebuildModel - void setSmallPixmapSize(int pixmapSize); + void setScaleRatio(int scaleRatio); /// Unload all images and reset model void resetModel(); + /// Set current list zones which will be available in QListView void setListZones(QStringList &listZones); - /// Load all images(png) from zonePath, list images gets from zoneBank - bool rebuildModel(const QString &zonePath, NLLIGO::CZoneBank &zoneBank); + /// Build own pixmaps database(all images are scaled: width/scaleRatio, height/scaleRatio) from pixmapDatabase + void rebuildModel(PixmapDatabase *pixmapDatabase); - /// Get original pixmap +private: + /// Get pixmap /// @return QPixmap* if the image is in the database ; otherwise returns 0. QPixmap *getPixmap(const QString &zoneName) const; - /// Get scaled pixmap (pixmapSize * zoneSize.sizeX, pixmapSize * zoneSize.sizeY) - /// @return QPixmap* if the image is in the database ; otherwise returns 0. - QPixmap *getSmallPixmap(const QString &zoneName) const; -private: - - QString m_zonePath; - int m_pixmapSize; + int m_scaleRatio; QMap m_pixmapMap; - QMap m_smallPixmapMap; - QList m_pixmapNameList; + QStringList m_listNames; }; } /* namespace LandscapeEditor */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/list_zones_widget.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/list_zones_widget.cpp index 8dcb87383..e4e3fae0d 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/list_zones_widget.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/list_zones_widget.cpp @@ -37,10 +37,14 @@ namespace LandscapeEditor ListZonesWidget::ListZonesWidget(QWidget *parent) : QWidget(parent), + m_listZonesModel(0), m_zoneBuilder(0) { m_ui.setupUi(this); + m_listZonesModel = new ListZonesModel(4, this); + m_ui.listView->setModel(m_listZonesModel); + m_ui.addFilterButton_1->setChecked(false); m_ui.addFilterButton_2->setChecked(false); m_ui.addFilterButton_3->setChecked(false); @@ -81,6 +85,10 @@ void ListZonesWidget::updateUi() m_ui.categoryTypeComboBox_2->clear(); m_ui.categoryTypeComboBox_3->clear(); m_ui.categoryTypeComboBox_4->clear(); + m_ui.categoryValueComboBox_1->clear(); + m_ui.categoryValueComboBox_2->clear(); + m_ui.categoryValueComboBox_3->clear(); + m_ui.categoryValueComboBox_4->clear(); m_ui.categoryTypeComboBox_1->addItems(listCategories); m_ui.categoryTypeComboBox_2->addItems(listCategories); @@ -88,11 +96,8 @@ void ListZonesWidget::updateUi() m_ui.categoryTypeComboBox_4->addItems(listCategories); disableSignals(false); -} -void ListZonesWidget::setModel(QAbstractItemModel *model) -{ - m_ui.listView->setModel(model); + m_listZonesModel->rebuildModel(m_zoneBuilder->pixmapDatabase()); } void ListZonesWidget::setZoneBuilder(ZoneBuilder *zoneBuilder) @@ -201,7 +206,8 @@ void ListZonesWidget::updateListZones() QStringList listSelection; for (size_t i = 0; i < currentSelection.size(); ++i) listSelection << currentSelection[i]->getName().c_str(); - m_zoneBuilder->zoneModel()->setListZones(listSelection); + + m_listZonesModel->setListZones(listSelection); } void ListZonesWidget::disableSignals(bool block) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/list_zones_widget.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/list_zones_widget.h index fed0134cf..049f0ebcb 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/list_zones_widget.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/list_zones_widget.h @@ -28,10 +28,11 @@ namespace LandscapeEditor { class ZoneBuilder; +class ListZonesModel; /** @class ZoneListWidget -@brief ZoneListWidget +@brief ZoneListWidget displays list available zones in accordance with the filter settings @details */ class ListZonesWidget: public QWidget @@ -44,21 +45,19 @@ public: void updateUi(); void setZoneBuilder(ZoneBuilder *zoneBuilder); - void setModel(QAbstractItemModel *model); Q_SIGNALS: -public Q_SLOTS: +private Q_SLOTS: void updateFilters_1(const QString &value); void updateFilters_2(const QString &value); void updateFilters_3(const QString &value); void updateFilters_4(const QString &value); - -private Q_SLOTS: void updateListZones(); private: void disableSignals(bool block); + ListZonesModel *m_listZonesModel; ZoneBuilder *m_zoneBuilder; Ui::ListZonesWidget m_ui; }; /* ZoneListWidget */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/project_settings_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/project_settings_dialog.cpp new file mode 100644 index 000000000..bf095e6cf --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/project_settings_dialog.cpp @@ -0,0 +1,52 @@ +// 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 "project_settings_dialog.h" +#include "landscape_editor_constants.h" + +#include "../core/icore.h" +#include "../core/core_constants.h" + +// NeL includes +#include + +// Qt includes +#include +#include + +namespace LandscapeEditor +{ + +ProjectSettingsDialog::ProjectSettingsDialog(const QString &dataPath, QWidget *parent) + : QDialog(parent) +{ + m_ui.setupUi(this); + m_ui.pathLineEdit->setText(dataPath); + setFixedHeight(sizeHint().height()); +} + +ProjectSettingsDialog::~ProjectSettingsDialog() +{ +} + +QString ProjectSettingsDialog::dataPath() const +{ + return m_ui.pathLineEdit->text(); +} + +} /* namespace LandscapeEditor */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/project_settings_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/project_settings_dialog.h new file mode 100644 index 000000000..74443e3f1 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/project_settings_dialog.h @@ -0,0 +1,46 @@ +// 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 PROJECT_SETTINGS_DIALOG_H +#define PROJECT_SETTINGS_DIALOG_H + +// Project includes +#include "ui_project_settings_dialog.h" + +// Qt includes + +namespace LandscapeEditor +{ + +class ProjectSettingsDialog: public QDialog +{ + Q_OBJECT + +public: + ProjectSettingsDialog(const QString &dataPath, QWidget *parent = 0); + ~ProjectSettingsDialog(); + + QString dataPath() const; + +private: + + Ui::ProjectSettingsDialog m_ui; +}; /* class ProjectSettingsDialog */ + +} /* namespace LandscapeEditor */ + +#endif // PROJECT_SETTINGS_DIALOG_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/project_settings_dialog.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/project_settings_dialog.ui new file mode 100644 index 000000000..bb94fcc0d --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/landscape_editor/project_settings_dialog.ui @@ -0,0 +1,97 @@ + + + ProjectSettingsDialog + + + + 0 + 0 + 419 + 93 + + + + Project settings + + + + :/icons/ic_nel_landscape_settings.png:/icons/ic_nel_landscape_settings.png + + + + + + Data directory: + + + + + + + + + + ... + + + + + + + Context: + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + + + buttonBox + accepted() + ProjectSettingsDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + ProjectSettingsDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + +