summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-06-25 05:49:16 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-06-25 05:49:16 +0000
commit0db8bc4664cd12ea406a905d7a4237992f393753 (patch)
tree8511276b847667426db7c22c3dabc08362883dda /utils
parentdb50e49f20619bdc95a01e5fda0f707be0b9f5a2 (diff)
Theme Editor: Made the device configuration menu dockable
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27128 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils')
-rw-r--r--utils/themeeditor/gui/editorwindow.cpp35
-rw-r--r--utils/themeeditor/gui/editorwindow.h4
2 files changed, 23 insertions, 16 deletions
diff --git a/utils/themeeditor/gui/editorwindow.cpp b/utils/themeeditor/gui/editorwindow.cpp
index 81d05c8ed4..94e744e957 100644
--- a/utils/themeeditor/gui/editorwindow.cpp
+++ b/utils/themeeditor/gui/editorwindow.cpp
@@ -30,18 +30,27 @@
#include <QGraphicsScene>
EditorWindow::EditorWindow(QWidget *parent) :
- QMainWindow(parent),
- ui(new Ui::EditorWindow),
- parseTreeSelection(0)
+ QMainWindow(parent), ui(new Ui::EditorWindow), parseTreeSelection(0)
{
ui->setupUi(this);
prefs = new PreferencesDialog(this);
project = 0;
- loadSettings();
setupUI();
+ loadSettings();
setupMenus();
}
+
+EditorWindow::~EditorWindow()
+{
+ delete ui;
+ delete prefs;
+ if(project)
+ delete project;
+ delete deviceConfig;
+ delete deviceDock;
+}
+
void EditorWindow::loadTabFromSkinFile(QString fileName)
{
/* Checking to see if the file is already open */
@@ -146,9 +155,13 @@ void EditorWindow::setupUI()
ui->skinPreviewLayout->addWidget(viewer);
/* Positioning the device settings dialog */
- QPoint thisPos = pos();
- deviceConfig.move(thisPos.x() + width() / 4, thisPos.y() + height() / 4);
+ deviceDock = new QDockWidget(tr("Device Configuration"), this);
+ deviceConfig = new DeviceState(deviceDock);
+ deviceDock->setObjectName("deviceDock");
+ deviceDock->setWidget(deviceConfig);
+ deviceDock->setFloating(true);
+ deviceDock->hide();
}
void EditorWindow::setupMenus()
@@ -161,7 +174,7 @@ void EditorWindow::setupMenus()
QObject::connect(ui->actionPreview_Panel, SIGNAL(triggered()),
this, SLOT(showPanel()));
QObject::connect(ui->actionDevice_Configuration, SIGNAL(triggered()),
- &deviceConfig, SLOT(show()));
+ deviceDock, SLOT(show()));
/* Connecting the document management actions */
QObject::connect(ui->actionNew_Document, SIGNAL(triggered()),
@@ -483,11 +496,3 @@ void EditorWindow::sizeColumns()
ui->parseTree->resizeColumnToContents(ParseTreeModel::typeColumn);
ui->parseTree->resizeColumnToContents(ParseTreeModel::valueColumn);
}
-
-EditorWindow::~EditorWindow()
-{
- delete ui;
- delete prefs;
- if(project)
- delete project;
-}
diff --git a/utils/themeeditor/gui/editorwindow.h b/utils/themeeditor/gui/editorwindow.h
index 0bfaac3957..ab75cc54fa 100644
--- a/utils/themeeditor/gui/editorwindow.h
+++ b/utils/themeeditor/gui/editorwindow.h
@@ -25,6 +25,7 @@
#include <QMainWindow>
#include <QLabel>
#include <QItemSelectionModel>
+#include <QDockWidget>
#include "parsetreemodel.h"
#include "skinhighlighter.h"
@@ -89,7 +90,8 @@ private:
ProjectModel* project;
QItemSelectionModel* parseTreeSelection;
SkinViewer* viewer;
- DeviceState deviceConfig;
+ DeviceState* deviceConfig;
+ QDockWidget* deviceDock;
};
#endif // EDITORWINDOW_H