diff options
author | Robert Bieber <robby@bieberphoto.com> | 2010-07-23 21:15:15 +0000 |
---|---|---|
committer | Robert Bieber <robby@bieberphoto.com> | 2010-07-23 21:15:15 +0000 |
commit | 5297db990412a34dee96de5bf61258ae31f3b4f9 (patch) | |
tree | 8b7d850cf3051549e04492a260049328b55641f5 /utils/themeeditor/gui/projectexporter.cpp | |
parent | d15a4f617f7d6e524ef811efef5707958031dc8f (diff) | |
download | rockbox-5297db990412a34dee96de5bf61258ae31f3b4f9.tar.gz rockbox-5297db990412a34dee96de5bf61258ae31f3b4f9.zip |
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/projectexporter.cpp')
-rw-r--r-- | utils/themeeditor/gui/projectexporter.cpp | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/utils/themeeditor/gui/projectexporter.cpp b/utils/themeeditor/gui/projectexporter.cpp new file mode 100644 index 0000000000..b9718d11c5 --- /dev/null +++ b/utils/themeeditor/gui/projectexporter.cpp | |||
@@ -0,0 +1,79 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2010 Robert Bieber | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | |||
22 | #include "projectexporter.h" | ||
23 | #include "ui_projectexporter.h" | ||
24 | |||
25 | ProjectExporter::ProjectExporter(QString path, ProjectModel* project, | ||
26 | QWidget *parent) | ||
27 | :QDialog(parent), | ||
28 | ui(new Ui::ProjectExporter), zipFile(path) | ||
29 | { | ||
30 | ui->setupUi(this); | ||
31 | |||
32 | QObject::connect(ui->closeButton, SIGNAL(clicked()), | ||
33 | this, SLOT(close())); | ||
34 | |||
35 | if(zipFile.open(QuaZip::mdCreate)) | ||
36 | { | ||
37 | writeZip(project); | ||
38 | } | ||
39 | else | ||
40 | { | ||
41 | html += tr("<span style = \"color:red\">Error opening zip file</span><br>"); | ||
42 | ui->statusBox->document()->setHtml(html); | ||
43 | } | ||
44 | } | ||
45 | |||
46 | ProjectExporter::~ProjectExporter() | ||
47 | { | ||
48 | delete ui; | ||
49 | } | ||
50 | |||
51 | void ProjectExporter::changeEvent(QEvent *e) | ||
52 | { | ||
53 | QDialog::changeEvent(e); | ||
54 | switch (e->type()) { | ||
55 | case QEvent::LanguageChange: | ||
56 | ui->retranslateUi(this); | ||
57 | break; | ||
58 | default: | ||
59 | break; | ||
60 | } | ||
61 | } | ||
62 | |||
63 | void ProjectExporter::closeEvent(QCloseEvent *event) | ||
64 | { | ||
65 | close(); | ||
66 | event->accept(); | ||
67 | } | ||
68 | |||
69 | void ProjectExporter::close() | ||
70 | { | ||
71 | deleteLater(); | ||
72 | hide(); | ||
73 | } | ||
74 | |||
75 | void ProjectExporter::writeZip(ProjectModel *project) | ||
76 | { | ||
77 | (void)project; | ||
78 | zipFile.close(); | ||
79 | } | ||