forked from len0rd/rockbox
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
This commit is contained in:
parent
d15a4f617f
commit
5297db9904
7 changed files with 239 additions and 4 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue