diff options
author | Ben Boeckel <MathStuf@gmail.com> | 2009-05-28 22:04:46 -0400 |
---|---|---|
committer | Ben Boeckel <MathStuf@gmail.com> | 2009-05-28 22:04:46 -0400 |
commit | 9e43147c2eae2cf3f57d3144d9f50c1423ff6f52 (patch) | |
tree | ee612453d433f99d4ee26971bab966a8b48b8e4e | |
parent | 327d403983184d90a3b25820bf112dd12c732814 (diff) | |
download | sigen-9e43147c2eae2cf3f57d3144d9f50c1423ff6f52.tar.gz sigen-9e43147c2eae2cf3f57d3144d9f50c1423ff6f52.tar.xz sigen-9e43147c2eae2cf3f57d3144d9f50c1423ff6f52.zip |
Add the flag for world map to the map widget
-rw-r--r-- | sigmodr/widgets/MapUI.cpp | 8 | ||||
-rw-r--r-- | sigmodr/widgets/MapUI_p.h | 3 | ||||
-rw-r--r-- | sigmodr/widgets/gui/map.ui | 27 |
3 files changed, 38 insertions, 0 deletions
diff --git a/sigmodr/widgets/MapUI.cpp b/sigmodr/widgets/MapUI.cpp index 3f2b90b2..b3ec5893 100644 --- a/sigmodr/widgets/MapUI.cpp +++ b/sigmodr/widgets/MapUI.cpp @@ -34,6 +34,7 @@ #include <KLineEdit> // Qt includes +#include <QtGui/QCheckBox> #include <QtGui/QGridLayout> using namespace Sigmod; @@ -74,10 +75,12 @@ QWidget* MapUI::Private::makeWidgets(ObjectUI* widget) { QWidget *form = openUiFile(":/gui/map.ui", widget); ui_name = form->findChild<KLineEdit*>("varName"); + ui_isWorld = form->findChild<QCheckBox*>("varIsWorld"); QGridLayout* editorLayout = form->findChild<QGridLayout*>("editorLayout"); ui_editor = new MapEditor(m_map, widget); editorLayout->addWidget(ui_editor, 0, 0); connect(ui_name, SIGNAL(textChanged(QString)), this, SLOT(nameChanged(QString))); + connect(ui_isWorld, SIGNAL(toggled(bool)), this, SLOT(isWorldChanged(bool))); connect(ui_editor, SIGNAL(changed()), this, SIGNAL(changed())); widget->setTabOrder(ui_name, ui_editor); return form; @@ -95,3 +98,8 @@ void MapUI::Private::nameChanged(const QString& name) m_map->setName(name); ui_name->setCursorPosition(cursor); } + +void MapUI::Private::isWorldChanged(const bool isWorld) +{ + m_map->setIsWorld(isWorld); +} diff --git a/sigmodr/widgets/MapUI_p.h b/sigmodr/widgets/MapUI_p.h index 0080174e..4aff417c 100644 --- a/sigmodr/widgets/MapUI_p.h +++ b/sigmodr/widgets/MapUI_p.h @@ -25,6 +25,7 @@ #include "ObjectUIPrivate.h" // Forward declarations +class QCheckBox; class KComboBox; class KLineEdit; @@ -49,8 +50,10 @@ class SIGMODRWIDGETS_NO_EXPORT MapUI::Private : public ObjectUIPrivate void resetGui(); protected slots: void nameChanged(const QString& name); + void isWorldChanged(const bool isWorld); private: KLineEdit* ui_name; + QCheckBox* ui_isWorld; MapEditor* ui_editor; }; } diff --git a/sigmodr/widgets/gui/map.ui b/sigmodr/widgets/gui/map.ui index 996d095e..f1dbb8dd 100644 --- a/sigmodr/widgets/gui/map.ui +++ b/sigmodr/widgets/gui/map.ui @@ -32,6 +32,32 @@ </property> </widget> </item> + <item row="1" column="0"> + <widget class="QLabel" name="labelIsWorld"> + <property name="text"> + <string>World Map:</string> + </property> + <property name="alignment"> + <set>Qt::AlignRight|Qt::AlignVCenter</set> + </property> + <property name="buddy"> + <cstring>varIsWorld</cstring> + </property> + </widget> + </item> + <item row="1" column="1"> + <widget class="QCheckBox" name="varIsWorld"> + <property name="toolTip"> + <string>Whether the map is a world map or not</string> + </property> + <property name="statusTip"> + <string>Whether the map is a world map or not</string> + </property> + <property name="whatsThis"> + <string>Whether the map is a world map or not</string> + </property> + </widget> + </item> <item row="2" column="0" colspan="2"> <widget class="QGroupBox" name="boxMap"> <property name="title"> @@ -56,5 +82,6 @@ </customwidgets> <tabstops> <tabstop>varName</tabstop> + <tabstop>varIsWorld</tabstop> </tabstops> </ui> |