Changed: #1302 Added world edit mode toolbar.

--HG--
branch : gsoc2011-worldeditorqt
This commit is contained in:
dnk-88 2011-07-30 21:58:48 +03:00
parent c5dbe3cc82
commit 14272b5e79
9 changed files with 220 additions and 2 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

View file

@ -1,5 +1,10 @@
<RCC> <RCC>
<qresource prefix="/"> <qresource prefix="/">
<file>icons/ic_nel_select.png</file>
<file>icons/ic_nel_scale.png</file>
<file>icons/ic_nel_rotate.png</file>
<file>icons/ic_nel_move.png</file>
<file>icons/ic_nel_turn.png</file>
<file>icons/ic_nel_world_editor.png</file> <file>icons/ic_nel_world_editor.png</file>
</qresource> </qresource>
</RCC> </RCC>

View file

@ -40,6 +40,7 @@
// Qt includes // Qt includes
#include <QtCore/QSettings> #include <QtCore/QSettings>
#include <QtCore/QSignalMapper>
#include <QtGui/QFileDialog> #include <QtGui/QFileDialog>
namespace WorldEditor namespace WorldEditor
@ -54,12 +55,28 @@ WorldEditorWindow::WorldEditorWindow(QWidget *parent)
m_ui.setupUi(this); m_ui.setupUi(this);
m_undoStack = new QUndoStack(this); m_undoStack = new QUndoStack(this);
QActionGroup *sceneModeGroup = new QActionGroup(this);
sceneModeGroup->addAction(m_ui.selectAction);
sceneModeGroup->addAction(m_ui.moveAction);
sceneModeGroup->addAction(m_ui.rotateAction);
sceneModeGroup->addAction(m_ui.scaleAction);
sceneModeGroup->addAction(m_ui.turnAction);
sceneModeGroup->addAction(m_ui.radiusAction);
m_ui.selectAction->setChecked(true);
m_ui.newWorldEditAction->setIcon(QIcon(Core::Constants::ICON_NEW));
m_ui.saveWorldEditAction->setIcon(QIcon(Core::Constants::ICON_SAVE));
m_primitivesModel = new PrimitivesTreeModel(); m_primitivesModel = new PrimitivesTreeModel();
m_ui.treePrimitivesView->setModel(m_primitivesModel); m_ui.treePrimitivesView->setModel(m_primitivesModel);
createMenus(); createMenus();
createToolBars(); createToolBars();
readSettings(); readSettings();
connect(m_ui.newWorldEditAction, SIGNAL(triggered()), this, SLOT(newWorldEditFile()));
connect(m_ui.saveWorldEditAction, SIGNAL(triggered()), this, SLOT(saveAllWorldEditFiles()));
} }
WorldEditorWindow::~WorldEditorWindow() WorldEditorWindow::~WorldEditorWindow()
@ -96,6 +113,14 @@ void WorldEditorWindow::loadPrimitive(const QString &fileName)
m_primitivesModel->loadPrimitive(fileName); m_primitivesModel->loadPrimitive(fileName);
} }
void WorldEditorWindow::newWorldEditFile()
{
}
void WorldEditorWindow::saveAllWorldEditFiles()
{
}
void WorldEditorWindow::openProjectSettings() void WorldEditorWindow::openProjectSettings()
{ {
/* /*
@ -119,8 +144,11 @@ void WorldEditorWindow::createToolBars()
Core::IMenuManager *menuManager = Core::ICore::instance()->menuManager(); Core::IMenuManager *menuManager = Core::ICore::instance()->menuManager();
//QAction *action = menuManager->action(Core::Constants::NEW); //QAction *action = menuManager->action(Core::Constants::NEW);
//m_ui.fileToolBar->addAction(action); //m_ui.fileToolBar->addAction(action);
m_ui.fileToolBar->addAction(m_ui.newWorldEditAction);
QAction *action = menuManager->action(Core::Constants::OPEN); QAction *action = menuManager->action(Core::Constants::OPEN);
m_ui.fileToolBar->addAction(action); m_ui.fileToolBar->addAction(action);
m_ui.fileToolBar->addAction(m_ui.saveWorldEditAction);
m_ui.fileToolBar->addSeparator(); m_ui.fileToolBar->addSeparator();
action = menuManager->action(Core::Constants::UNDO); action = menuManager->action(Core::Constants::UNDO);

View file

@ -43,6 +43,8 @@ public Q_SLOTS:
void open(); void open();
private Q_SLOTS: private Q_SLOTS:
void newWorldEditFile();
void saveAllWorldEditFiles();
void openProjectSettings(); void openProjectSettings();
private: private:

View file

@ -45,10 +45,19 @@
<attribute name="toolBarBreak"> <attribute name="toolBarBreak">
<bool>false</bool> <bool>false</bool>
</attribute> </attribute>
<addaction name="newPrimitiveAction"/> <addaction name="selectAction"/>
<addaction name="loadPrimitiveAction"/> <addaction name="moveAction"/>
<addaction name="rotateAction"/>
<addaction name="scaleAction"/>
<addaction name="turnAction"/>
<addaction name="radiusAction"/>
<addaction name="separator"/>
<addaction name="pointsAction"/>
</widget> </widget>
<widget class="QDockWidget" name="treePrimitivesDockWidget"> <widget class="QDockWidget" name="treePrimitivesDockWidget">
<property name="windowTitle">
<string>Primitives</string>
</property>
<attribute name="dockWidgetArea"> <attribute name="dockWidgetArea">
<number>2</number> <number>2</number>
</attribute> </attribute>
@ -82,6 +91,23 @@
</layout> </layout>
</widget> </widget>
</widget> </widget>
<widget class="QToolBar" name="shToolBar">
<property name="windowTitle">
<string>toolBar</string>
</property>
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
<addaction name="visibleLandAction"/>
<addaction name="visiblePrimitivesAction"/>
<addaction name="visibleLayersAction"/>
<addaction name="visibleDetailsAction"/>
<addaction name="visibleGridAction"/>
<addaction name="visibleGridPointsAction"/>
</widget>
<action name="loadPrimitiveAction"> <action name="loadPrimitiveAction">
<property name="text"> <property name="text">
<string>loadPrimitive</string> <string>loadPrimitive</string>
@ -92,6 +118,162 @@
<string>newPrimitive</string> <string>newPrimitive</string>
</property> </property>
</action> </action>
<action name="loadLandAction">
<property name="icon">
<iconset resource="../landscape_editor/landscape_editor.qrc">
<normaloff>:/icons/ic_nel_zonel.png</normaloff>:/icons/ic_nel_zonel.png</iconset>
</property>
<property name="text">
<string>loadLand</string>
</property>
</action>
<action name="landSettingsAction">
<property name="icon">
<iconset resource="../landscape_editor/landscape_editor.qrc">
<normaloff>:/icons/ic_nel_landscape_settings.png</normaloff>:/icons/ic_nel_landscape_settings.png</iconset>
</property>
<property name="text">
<string>LandSettings</string>
</property>
</action>
<action name="visibleLandAction">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>S/H Land</string>
</property>
</action>
<action name="visiblePrimitivesAction">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>S/H Primitives</string>
</property>
</action>
<action name="visibleLayersAction">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>S/H Layers</string>
</property>
</action>
<action name="visibleDetailsAction">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>S/H Details</string>
</property>
</action>
<action name="visibleGridAction">
<property name="checkable">
<bool>true</bool>
</property>
<property name="icon">
<iconset resource="../landscape_editor/landscape_editor.qrc">
<normaloff>:/icons/ic_grid.png</normaloff>:/icons/ic_grid.png</iconset>
</property>
<property name="text">
<string>S/H Grid</string>
</property>
</action>
<action name="visibleGridPointsAction">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>S/H Grid points</string>
</property>
</action>
<action name="newWorldEditAction">
<property name="text">
<string>New World Edit file</string>
</property>
</action>
<action name="saveWorldEditAction">
<property name="text">
<string>Save World Edit file</string>
</property>
</action>
<action name="selectAction">
<property name="checkable">
<bool>true</bool>
</property>
<property name="icon">
<iconset resource="world_editor.qrc">
<normaloff>:/icons/ic_nel_select.png</normaloff>:/icons/ic_nel_select.png</iconset>
</property>
<property name="text">
<string>Select</string>
</property>
</action>
<action name="moveAction">
<property name="checkable">
<bool>true</bool>
</property>
<property name="icon">
<iconset resource="world_editor.qrc">
<normaloff>:/icons/ic_nel_move.png</normaloff>:/icons/ic_nel_move.png</iconset>
</property>
<property name="text">
<string>Move</string>
</property>
</action>
<action name="rotateAction">
<property name="checkable">
<bool>true</bool>
</property>
<property name="icon">
<iconset resource="world_editor.qrc">
<normaloff>:/icons/ic_nel_rotate.png</normaloff>:/icons/ic_nel_rotate.png</iconset>
</property>
<property name="text">
<string>Rotate</string>
</property>
</action>
<action name="scaleAction">
<property name="checkable">
<bool>true</bool>
</property>
<property name="icon">
<iconset resource="world_editor.qrc">
<normaloff>:/icons/ic_nel_scale.png</normaloff>:/icons/ic_nel_scale.png</iconset>
</property>
<property name="text">
<string>Scale</string>
</property>
</action>
<action name="turnAction">
<property name="checkable">
<bool>true</bool>
</property>
<property name="icon">
<iconset resource="world_editor.qrc">
<normaloff>:/icons/ic_nel_turn.png</normaloff>:/icons/ic_nel_turn.png</iconset>
</property>
<property name="text">
<string>Turn</string>
</property>
</action>
<action name="radiusAction">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Radius</string>
</property>
</action>
<action name="pointsAction">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Edit points</string>
</property>
</action>
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget> <customwidget>
@ -107,6 +289,7 @@
</customwidgets> </customwidgets>
<resources> <resources>
<include location="world_editor.qrc"/> <include location="world_editor.qrc"/>
<include location="../landscape_editor/landscape_editor.qrc"/>
</resources> </resources>
<connections/> <connections/>
</ui> </ui>