summaryrefslogtreecommitdiff
path: root/utils/themeeditor/gui/editorwindow.cpp
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-07-23 21:15:15 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-07-23 21:15:15 +0000
commit5297db990412a34dee96de5bf61258ae31f3b4f9 (patch)
tree8b7d850cf3051549e04492a260049328b55641f5 /utils/themeeditor/gui/editorwindow.cpp
parentd15a4f617f7d6e524ef811efef5707958031dc8f (diff)
Theme Editor: Added interface for project export, exporting files to zip is still todo
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27534 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/themeeditor/gui/editorwindow.cpp')
-rw-r--r--utils/themeeditor/gui/editorwindow.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/utils/themeeditor/gui/editorwindow.cpp b/utils/themeeditor/gui/editorwindow.cpp
index 57de72358a..f919224a2f 100644
--- a/utils/themeeditor/gui/editorwindow.cpp
+++ b/utils/themeeditor/gui/editorwindow.cpp
@@ -25,6 +25,7 @@
#include "rbfontcache.h"
#include "rbtextcache.h"
#include "newprojectdialog.h"
+#include "projectexporter.h"
#include <QDesktopWidget>
#include <QFileSystemModel>
@@ -220,6 +221,8 @@ void EditorWindow::setupMenus()
this, SLOT(saveCurrentAs()));
QObject::connect(ui->actionToolbarSave, SIGNAL(triggered()),
this, SLOT(saveCurrent()));
+ QObject::connect(ui->actionExport_Project, SIGNAL(triggered()),
+ this, SLOT(exportProject()));
QObject::connect(ui->actionOpen_Document, SIGNAL(triggered()),
this, SLOT(openFile()));
@@ -466,6 +469,7 @@ void EditorWindow::closeProject()
}
ui->actionClose_Project->setEnabled(false);
+ ui->actionExport_Project->setEnabled(false);
}
void EditorWindow::saveCurrent()
@@ -480,6 +484,25 @@ void EditorWindow::saveCurrentAs()
dynamic_cast<TabContent*>(ui->editorTabs->currentWidget())->saveAs();
}
+void EditorWindow::exportProject()
+{
+ QDir dir = project->getSetting("themebase", "");
+ dir.cdUp();
+ QString file = project->getSetting("configfile", "").split("/").
+ last().split(".").first() + ".zip";
+ file = dir.filePath(file);
+
+ file = QFileDialog::getSaveFileName(this, tr("Export Project"),
+ file, "Zip Files (*.zip *.ZIP);;"
+ "All Files (*)");
+
+ if(file != "")
+ {
+ ProjectExporter* exporter = new ProjectExporter(file, project, this);
+ exporter->show();
+ }
+}
+
void EditorWindow::openFile()
{
QStringList fileNames;
@@ -724,6 +747,7 @@ void EditorWindow::loadProjectFile(QString fileName)
project->deleteLater();
ui->actionClose_Project->setEnabled(true);
+ ui->actionExport_Project->setEnabled(true);
project = new ProjectModel(fileName, this);
ui->projectTree->setModel(project);