diff options
author | Robert Bieber <robby@bieberphoto.com> | 2010-07-15 21:39:09 +0000 |
---|---|---|
committer | Robert Bieber <robby@bieberphoto.com> | 2010-07-15 21:39:09 +0000 |
commit | c272144867f94dc7e99f8333bec5dd052878ecd8 (patch) | |
tree | 6ceb4ce5111b05da666ab2c0a1fda571d84ccd42 /utils/themeeditor/gui | |
parent | e700e195d88f09a94fe681fd2906564ade2be0d0 (diff) | |
download | rockbox-c272144867f94dc7e99f8333bec5dd052878ecd8.tar.gz rockbox-c272144867f94dc7e99f8333bec5dd052878ecd8.zip |
Theme Editor: Added New Project feature
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27439 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/themeeditor/gui')
-rw-r--r-- | utils/themeeditor/gui/editorwindow.cpp | 192 | ||||
-rw-r--r-- | utils/themeeditor/gui/editorwindow.h | 5 | ||||
-rw-r--r-- | utils/themeeditor/gui/editorwindow.ui | 9 | ||||
-rw-r--r-- | utils/themeeditor/gui/newprojectdialog.cpp | 105 | ||||
-rw-r--r-- | utils/themeeditor/gui/newprojectdialog.h | 95 | ||||
-rw-r--r-- | utils/themeeditor/gui/newprojectdialog.ui | 209 |
6 files changed, 575 insertions, 40 deletions
diff --git a/utils/themeeditor/gui/editorwindow.cpp b/utils/themeeditor/gui/editorwindow.cpp index 247109cc19..043c08badd 100644 --- a/utils/themeeditor/gui/editorwindow.cpp +++ b/utils/themeeditor/gui/editorwindow.cpp | |||
@@ -24,12 +24,16 @@ | |||
24 | #include "ui_editorwindow.h" | 24 | #include "ui_editorwindow.h" |
25 | #include "rbfontcache.h" | 25 | #include "rbfontcache.h" |
26 | #include "rbtextcache.h" | 26 | #include "rbtextcache.h" |
27 | #include "newprojectdialog.h" | ||
27 | 28 | ||
28 | #include <QDesktopWidget> | 29 | #include <QDesktopWidget> |
29 | #include <QFileSystemModel> | 30 | #include <QFileSystemModel> |
30 | #include <QSettings> | 31 | #include <QSettings> |
31 | #include <QFileDialog> | 32 | #include <QFileDialog> |
33 | #include <QMessageBox> | ||
32 | #include <QGraphicsScene> | 34 | #include <QGraphicsScene> |
35 | #include <QDir> | ||
36 | #include <QFile> | ||
33 | 37 | ||
34 | EditorWindow::EditorWindow(QWidget *parent) : | 38 | EditorWindow::EditorWindow(QWidget *parent) : |
35 | QMainWindow(parent), ui(new Ui::EditorWindow), parseTreeSelection(0) | 39 | QMainWindow(parent), ui(new Ui::EditorWindow), parseTreeSelection(0) |
@@ -200,6 +204,8 @@ void EditorWindow::setupMenus() | |||
200 | /* Connecting the document management actions */ | 204 | /* Connecting the document management actions */ |
201 | QObject::connect(ui->actionNew_Document, SIGNAL(triggered()), | 205 | QObject::connect(ui->actionNew_Document, SIGNAL(triggered()), |
202 | this, SLOT(newTab())); | 206 | this, SLOT(newTab())); |
207 | QObject::connect(ui->actionNew_Project, SIGNAL(triggered()), | ||
208 | this, SLOT(newProject())); | ||
203 | QObject::connect(ui->actionToolbarNew, SIGNAL(triggered()), | 209 | QObject::connect(ui->actionToolbarNew, SIGNAL(triggered()), |
204 | this, SLOT(newTab())); | 210 | this, SLOT(newTab())); |
205 | 211 | ||
@@ -261,6 +267,93 @@ void EditorWindow::newTab() | |||
261 | ui->editorTabs->setCurrentWidget(doc); | 267 | ui->editorTabs->setCurrentWidget(doc); |
262 | } | 268 | } |
263 | 269 | ||
270 | void EditorWindow::newProject() | ||
271 | { | ||
272 | NewProjectDialog dialog(this); | ||
273 | if(dialog.exec() == QDialog::Rejected) | ||
274 | return; | ||
275 | |||
276 | /* Assembling the new project if the dialog was accepted */ | ||
277 | NewProjectDialog::NewProjectInfo info = dialog.results(); | ||
278 | |||
279 | QDir path(info.path); | ||
280 | if(!path.exists()) | ||
281 | { | ||
282 | QMessageBox::warning(this, tr("Error Creating Project"), tr("Error:" | ||
283 | " Project directory does not exist")); | ||
284 | return; | ||
285 | } | ||
286 | |||
287 | if(path.exists(info.name)) | ||
288 | { | ||
289 | QMessageBox::warning(this, tr("Error Creating Project"), tr("Error:" | ||
290 | " Project directory already exists")); | ||
291 | return; | ||
292 | } | ||
293 | |||
294 | if(!path.mkdir(info.name)) | ||
295 | { | ||
296 | QMessageBox::warning(this, tr("Error Creating Project"), tr("Error:" | ||
297 | " Project directory not writeable")); | ||
298 | return; | ||
299 | } | ||
300 | |||
301 | path.cd(info.name); | ||
302 | |||
303 | /* Making standard directories */ | ||
304 | path.mkdir("fonts"); | ||
305 | path.mkdir("icons"); | ||
306 | path.mkdir("backdrops"); | ||
307 | |||
308 | /* Adding the desired wps documents */ | ||
309 | path.mkdir("wps"); | ||
310 | path.cd("wps"); | ||
311 | |||
312 | if(info.sbs) | ||
313 | createFile(path.filePath(info.name + ".sbs"), tr("# SBS Document\n")); | ||
314 | if(info.wps) | ||
315 | createFile(path.filePath(info.name + ".wps"), tr("# WPS Document\n")); | ||
316 | if(info.fms) | ||
317 | createFile(path.filePath(info.name + ".fms"), tr("# FMS Document\n")); | ||
318 | if(info.rsbs) | ||
319 | createFile(path.filePath(info.name + ".rsbs"), tr("# RSBS Document\n")); | ||
320 | if(info.rwps) | ||
321 | createFile(path.filePath(info.name + ".rwps"), tr("# RWPS Document\n")); | ||
322 | if(info.rfms) | ||
323 | createFile(path.filePath(info.name + ".rfms"), tr("# RFMS Document\n")); | ||
324 | |||
325 | path.mkdir(info.name); | ||
326 | |||
327 | path.cdUp(); | ||
328 | |||
329 | /* Adding the config file */ | ||
330 | path.mkdir("themes"); | ||
331 | path.cd("themes"); | ||
332 | |||
333 | /* Generating the config file */ | ||
334 | QString config = tr("# Config file for ") + info.name + "\n"; | ||
335 | QString wpsBase = "/.rockbox/wps/"; | ||
336 | if(info.sbs) | ||
337 | config.append("sbs: " + wpsBase + info.name + ".sbs\n"); | ||
338 | if(info.wps) | ||
339 | config.append("wps: " + wpsBase + info.name + ".wps\n"); | ||
340 | if(info.fms) | ||
341 | config.append("fms: " + wpsBase + info.name + ".fms\n"); | ||
342 | if(info.rsbs) | ||
343 | config.append("rsbs: " + wpsBase + info.name + ".rsbs\n"); | ||
344 | if(info.rwps) | ||
345 | config.append("rwps: " + wpsBase + info.name + ".rwps\n"); | ||
346 | if(info.rfms) | ||
347 | config.append("rfms: " + wpsBase + info.name + ".rfms\n"); | ||
348 | |||
349 | |||
350 | createFile(path.filePath(info.name + ".cfg"), | ||
351 | config); | ||
352 | |||
353 | /* Opening the new project */ | ||
354 | loadProjectFile(path.filePath(info.name + ".cfg")); | ||
355 | } | ||
356 | |||
264 | void EditorWindow::shiftTab(int index) | 357 | void EditorWindow::shiftTab(int index) |
265 | { | 358 | { |
266 | TabContent* widget = dynamic_cast<TabContent*> | 359 | TabContent* widget = dynamic_cast<TabContent*> |
@@ -424,47 +517,8 @@ void EditorWindow::openProject() | |||
424 | fileName = QFileDialog::getOpenFileName(this, tr("Open Project"), directory, | 517 | fileName = QFileDialog::getOpenFileName(this, tr("Open Project"), directory, |
425 | ProjectModel::fileFilter()); | 518 | ProjectModel::fileFilter()); |
426 | 519 | ||
427 | if(QFile::exists(fileName)) | ||
428 | { | ||
429 | |||
430 | if(project) | ||
431 | project->deleteLater(); | ||
432 | |||
433 | ui->actionClose_Project->setEnabled(true); | ||
434 | |||
435 | project = new ProjectModel(fileName, this); | ||
436 | ui->projectTree->setModel(project); | ||
437 | |||
438 | if(project->getSetting("#screenwidth") != "") | ||
439 | deviceConfig->setData("screenwidth", | ||
440 | project->getSetting("#screenwidth")); | ||
441 | if(project->getSetting("#screenheight") != "") | ||
442 | deviceConfig->setData("screenheight", | ||
443 | project->getSetting("#screenheight")); | ||
444 | |||
445 | QObject::connect(ui->projectTree, SIGNAL(activated(QModelIndex)), | ||
446 | project, SLOT(activated(QModelIndex))); | ||
447 | |||
448 | fileName.chop(fileName.length() - fileName.lastIndexOf('/') - 1); | ||
449 | settings.setValue("defaultDirectory", fileName); | ||
450 | |||
451 | for(int i = 0; i < ui->editorTabs->count(); i++) | ||
452 | { | ||
453 | TabContent* doc = dynamic_cast<TabContent*> | ||
454 | (ui->editorTabs->widget(i)); | ||
455 | if(doc->type() == TabContent::Skin) | ||
456 | { | ||
457 | dynamic_cast<SkinDocument*>(doc)->setProject(project); | ||
458 | if(i == ui->editorTabs->currentIndex()) | ||
459 | { | ||
460 | viewer->setScene(dynamic_cast<SkinDocument*>(doc)->scene()); | ||
461 | } | ||
462 | } | ||
463 | } | ||
464 | |||
465 | } | ||
466 | |||
467 | settings.endGroup(); | 520 | settings.endGroup(); |
521 | loadProjectFile(fileName); | ||
468 | 522 | ||
469 | } | 523 | } |
470 | 524 | ||
@@ -657,3 +711,61 @@ void EditorWindow::sizeColumns() | |||
657 | ui->parseTree->resizeColumnToContents(ParseTreeModel::typeColumn); | 711 | ui->parseTree->resizeColumnToContents(ParseTreeModel::typeColumn); |
658 | ui->parseTree->resizeColumnToContents(ParseTreeModel::valueColumn); | 712 | ui->parseTree->resizeColumnToContents(ParseTreeModel::valueColumn); |
659 | } | 713 | } |
714 | |||
715 | void EditorWindow::loadProjectFile(QString fileName) | ||
716 | { | ||
717 | QSettings settings; | ||
718 | settings.beginGroup("ProjectModel"); | ||
719 | |||
720 | if(QFile::exists(fileName)) | ||
721 | { | ||
722 | if(project) | ||
723 | project->deleteLater(); | ||
724 | |||
725 | ui->actionClose_Project->setEnabled(true); | ||
726 | |||
727 | project = new ProjectModel(fileName, this); | ||
728 | ui->projectTree->setModel(project); | ||
729 | |||
730 | if(project->getSetting("#screenwidth") != "") | ||
731 | deviceConfig->setData("screenwidth", | ||
732 | project->getSetting("#screenwidth")); | ||
733 | if(project->getSetting("#screenheight") != "") | ||
734 | deviceConfig->setData("screenheight", | ||
735 | project->getSetting("#screenheight")); | ||
736 | |||
737 | QObject::connect(ui->projectTree, SIGNAL(activated(QModelIndex)), | ||
738 | project, SLOT(activated(QModelIndex))); | ||
739 | |||
740 | fileName.chop(fileName.length() - fileName.lastIndexOf('/') - 1); | ||
741 | settings.setValue("defaultDirectory", fileName); | ||
742 | |||
743 | for(int i = 0; i < ui->editorTabs->count(); i++) | ||
744 | { | ||
745 | TabContent* doc = dynamic_cast<TabContent*> | ||
746 | (ui->editorTabs->widget(i)); | ||
747 | if(doc->type() == TabContent::Skin) | ||
748 | { | ||
749 | dynamic_cast<SkinDocument*>(doc)->setProject(project); | ||
750 | if(i == ui->editorTabs->currentIndex()) | ||
751 | { | ||
752 | viewer->setScene(dynamic_cast<SkinDocument*>(doc)->scene()); | ||
753 | } | ||
754 | } | ||
755 | } | ||
756 | |||
757 | } | ||
758 | |||
759 | settings.endGroup(); | ||
760 | |||
761 | } | ||
762 | |||
763 | void EditorWindow::createFile(QString filename, QString contents) | ||
764 | { | ||
765 | QFile fout(filename); | ||
766 | fout.open(QFile::WriteOnly); | ||
767 | |||
768 | fout.write(contents.toAscii()); | ||
769 | |||
770 | fout.close(); | ||
771 | } | ||
diff --git a/utils/themeeditor/gui/editorwindow.h b/utils/themeeditor/gui/editorwindow.h index 0178f602b2..5bfa795714 100644 --- a/utils/themeeditor/gui/editorwindow.h +++ b/utils/themeeditor/gui/editorwindow.h | |||
@@ -64,6 +64,7 @@ public slots: | |||
64 | private slots: | 64 | private slots: |
65 | void showPanel(); | 65 | void showPanel(); |
66 | void newTab(); | 66 | void newTab(); |
67 | void newProject(); | ||
67 | void shiftTab(int index); | 68 | void shiftTab(int index); |
68 | bool closeTab(int index); | 69 | bool closeTab(int index); |
69 | void closeCurrent(); | 70 | void closeCurrent(); |
@@ -88,11 +89,15 @@ private: | |||
88 | void saveSettings(); | 89 | void saveSettings(); |
89 | void setupUI(); | 90 | void setupUI(); |
90 | void setupMenus(); | 91 | void setupMenus(); |
92 | |||
91 | void addTab(TabContent* doc); | 93 | void addTab(TabContent* doc); |
92 | void expandLine(ParseTreeModel* model, QModelIndex parent, int line, | 94 | void expandLine(ParseTreeModel* model, QModelIndex parent, int line, |
93 | bool highlight); | 95 | bool highlight); |
94 | void sizeColumns(); | 96 | void sizeColumns(); |
95 | 97 | ||
98 | void loadProjectFile(QString fileName); | ||
99 | static void createFile(QString filename, QString contents); | ||
100 | |||
96 | Ui::EditorWindow *ui; | 101 | Ui::EditorWindow *ui; |
97 | PreferencesDialog* prefs; | 102 | PreferencesDialog* prefs; |
98 | QLabel* parseStatus; | 103 | QLabel* parseStatus; |
diff --git a/utils/themeeditor/gui/editorwindow.ui b/utils/themeeditor/gui/editorwindow.ui index ab8dc61896..a7246b9def 100644 --- a/utils/themeeditor/gui/editorwindow.ui +++ b/utils/themeeditor/gui/editorwindow.ui | |||
@@ -48,6 +48,7 @@ | |||
48 | <string>&File</string> | 48 | <string>&File</string> |
49 | </property> | 49 | </property> |
50 | <addaction name="actionNew_Document"/> | 50 | <addaction name="actionNew_Document"/> |
51 | <addaction name="actionNew_Project"/> | ||
51 | <addaction name="actionOpen_Document"/> | 52 | <addaction name="actionOpen_Document"/> |
52 | <addaction name="actionOpen_Project"/> | 53 | <addaction name="actionOpen_Project"/> |
53 | <addaction name="separator"/> | 54 | <addaction name="separator"/> |
@@ -386,6 +387,14 @@ | |||
386 | <string>Ctrl+Shift+W</string> | 387 | <string>Ctrl+Shift+W</string> |
387 | </property> | 388 | </property> |
388 | </action> | 389 | </action> |
390 | <action name="actionNew_Project"> | ||
391 | <property name="text"> | ||
392 | <string>N&ew Project</string> | ||
393 | </property> | ||
394 | <property name="shortcut"> | ||
395 | <string>Ctrl+Shift+N</string> | ||
396 | </property> | ||
397 | </action> | ||
389 | </widget> | 398 | </widget> |
390 | <tabstops> | 399 | <tabstops> |
391 | <tabstop>projectTree</tabstop> | 400 | <tabstop>projectTree</tabstop> |
diff --git a/utils/themeeditor/gui/newprojectdialog.cpp b/utils/themeeditor/gui/newprojectdialog.cpp new file mode 100644 index 0000000000..50a8bc4631 --- /dev/null +++ b/utils/themeeditor/gui/newprojectdialog.cpp | |||
@@ -0,0 +1,105 @@ | |||
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 "newprojectdialog.h" | ||
23 | #include "ui_newprojectdialog.h" | ||
24 | |||
25 | #include <QSettings> | ||
26 | #include <QFileDialog> | ||
27 | #include <QDir> | ||
28 | |||
29 | NewProjectDialog::NewProjectDialog(QWidget *parent) : | ||
30 | QDialog(parent), | ||
31 | ui(new Ui::NewProjectDialog) | ||
32 | { | ||
33 | ui->setupUi(this); | ||
34 | |||
35 | /* Getting the default directory from the application settings */ | ||
36 | QSettings settings; | ||
37 | settings.beginGroup("NewProjectDialog"); | ||
38 | |||
39 | ui->locationBox->setText(settings.value("defaultDir", | ||
40 | QDir::home().absolutePath()) | ||
41 | .toString()); | ||
42 | |||
43 | settings.endGroup(); | ||
44 | |||
45 | /* Connecting the browse button */ | ||
46 | QObject::connect(ui->browseButton, SIGNAL(clicked()), | ||
47 | this, SLOT(browse())); | ||
48 | } | ||
49 | |||
50 | NewProjectDialog::~NewProjectDialog() | ||
51 | { | ||
52 | delete ui; | ||
53 | } | ||
54 | |||
55 | void NewProjectDialog::accept() | ||
56 | { | ||
57 | status.name = ui->nameBox->text(); | ||
58 | status.path = ui->locationBox->text(); | ||
59 | status.sbs = ui->sbsBox->isChecked(); | ||
60 | status.wps = ui->wpsBox->isChecked(); | ||
61 | status.fms = ui->fmsBox->isChecked(); | ||
62 | status.rsbs = ui->rsbsBox->isChecked(); | ||
63 | status.rwps = ui->rwpsBox->isChecked(); | ||
64 | status.rfms = ui->rfmsBox->isChecked(); | ||
65 | |||
66 | QSettings settings; | ||
67 | settings.beginGroup("NewProjectDialog"); | ||
68 | |||
69 | settings.setValue("defaultDir", ui->locationBox->text()); | ||
70 | |||
71 | settings.endGroup(); | ||
72 | |||
73 | QDialog::accept(); | ||
74 | } | ||
75 | |||
76 | void NewProjectDialog::reject() | ||
77 | { | ||
78 | ui->nameBox->setText(status.name); | ||
79 | ui->locationBox->setText(status.path); | ||
80 | ui->sbsBox->setChecked(status.sbs); | ||
81 | ui->wpsBox->setChecked(status.wps); | ||
82 | ui->fmsBox->setChecked(status.fms); | ||
83 | ui->rsbsBox->setChecked(status.rsbs); | ||
84 | ui->rwpsBox->setChecked(status.rwps); | ||
85 | ui->rfmsBox->setChecked(status.rfms); | ||
86 | |||
87 | QSettings settings; | ||
88 | settings.beginGroup("NewProjectDialog"); | ||
89 | |||
90 | ui->locationBox->setText(settings.value("defaultDir", | ||
91 | QDir::home().absolutePath()) | ||
92 | .toString()); | ||
93 | |||
94 | settings.endGroup(); | ||
95 | |||
96 | QDialog::reject(); | ||
97 | } | ||
98 | |||
99 | void NewProjectDialog::browse() | ||
100 | { | ||
101 | QString path; | ||
102 | path = QFileDialog::getExistingDirectory(this, "New Project Location", | ||
103 | ui->locationBox->text()); | ||
104 | ui->locationBox->setText(path); | ||
105 | } | ||
diff --git a/utils/themeeditor/gui/newprojectdialog.h b/utils/themeeditor/gui/newprojectdialog.h new file mode 100644 index 0000000000..c59607c53f --- /dev/null +++ b/utils/themeeditor/gui/newprojectdialog.h | |||
@@ -0,0 +1,95 @@ | |||
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 | #ifndef NEWPROJECTDIALOG_H | ||
23 | #define NEWPROJECTDIALOG_H | ||
24 | |||
25 | #include <QDialog> | ||
26 | |||
27 | namespace Ui { | ||
28 | class NewProjectDialog; | ||
29 | } | ||
30 | |||
31 | class NewProjectDialog : public QDialog { | ||
32 | Q_OBJECT | ||
33 | public: | ||
34 | struct NewProjectInfo | ||
35 | { | ||
36 | QString name; | ||
37 | QString path; | ||
38 | bool sbs; | ||
39 | bool wps; | ||
40 | bool fms; | ||
41 | bool rsbs; | ||
42 | bool rwps; | ||
43 | bool rfms; | ||
44 | |||
45 | NewProjectInfo() | ||
46 | { | ||
47 | name = ""; | ||
48 | path = ""; | ||
49 | sbs = true; | ||
50 | wps = true; | ||
51 | fms = false; | ||
52 | rsbs = false; | ||
53 | rwps = false; | ||
54 | rfms = false; | ||
55 | } | ||
56 | |||
57 | NewProjectInfo(const NewProjectInfo& other) | ||
58 | { | ||
59 | operator=(other); | ||
60 | } | ||
61 | |||
62 | const NewProjectInfo& operator=(const NewProjectInfo& other) | ||
63 | { | ||
64 | name = other.name; | ||
65 | path = other.path; | ||
66 | sbs = other.sbs; | ||
67 | wps = other.wps; | ||
68 | fms = other.fms; | ||
69 | rsbs = other.rsbs; | ||
70 | rwps = other.rwps; | ||
71 | rfms = other.rfms; | ||
72 | |||
73 | return *this; | ||
74 | } | ||
75 | }; | ||
76 | |||
77 | NewProjectDialog(QWidget *parent = 0); | ||
78 | virtual ~NewProjectDialog(); | ||
79 | |||
80 | NewProjectInfo results(){ return status; } | ||
81 | |||
82 | public slots: | ||
83 | void accept(); | ||
84 | void reject(); | ||
85 | |||
86 | private slots: | ||
87 | void browse(); | ||
88 | |||
89 | private: | ||
90 | Ui::NewProjectDialog *ui; | ||
91 | |||
92 | NewProjectInfo status; | ||
93 | }; | ||
94 | |||
95 | #endif // NEWPROJECTDIALOG_H | ||
diff --git a/utils/themeeditor/gui/newprojectdialog.ui b/utils/themeeditor/gui/newprojectdialog.ui new file mode 100644 index 0000000000..f6e2dcc139 --- /dev/null +++ b/utils/themeeditor/gui/newprojectdialog.ui | |||
@@ -0,0 +1,209 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <ui version="4.0"> | ||
3 | <class>NewProjectDialog</class> | ||
4 | <widget class="QDialog" name="NewProjectDialog"> | ||
5 | <property name="geometry"> | ||
6 | <rect> | ||
7 | <x>0</x> | ||
8 | <y>0</y> | ||
9 | <width>400</width> | ||
10 | <height>275</height> | ||
11 | </rect> | ||
12 | </property> | ||
13 | <property name="windowTitle"> | ||
14 | <string>New Project</string> | ||
15 | </property> | ||
16 | <property name="windowIcon"> | ||
17 | <iconset resource="../resources.qrc"> | ||
18 | <normaloff>:/resources/windowicon.png</normaloff>:/resources/windowicon.png</iconset> | ||
19 | </property> | ||
20 | <layout class="QVBoxLayout" name="verticalLayout"> | ||
21 | <item> | ||
22 | <layout class="QFormLayout" name="formLayout_2"> | ||
23 | <item row="0" column="0"> | ||
24 | <widget class="QLabel" name="label_2"> | ||
25 | <property name="text"> | ||
26 | <string>Name:</string> | ||
27 | </property> | ||
28 | <property name="buddy"> | ||
29 | <cstring>nameBox</cstring> | ||
30 | </property> | ||
31 | </widget> | ||
32 | </item> | ||
33 | <item row="0" column="1"> | ||
34 | <widget class="QLineEdit" name="nameBox"/> | ||
35 | </item> | ||
36 | <item row="1" column="0"> | ||
37 | <widget class="QLabel" name="label"> | ||
38 | <property name="text"> | ||
39 | <string>Create In:</string> | ||
40 | </property> | ||
41 | <property name="buddy"> | ||
42 | <cstring>locationBox</cstring> | ||
43 | </property> | ||
44 | </widget> | ||
45 | </item> | ||
46 | <item row="1" column="1"> | ||
47 | <layout class="QHBoxLayout" name="horizontalLayout"> | ||
48 | <item> | ||
49 | <widget class="QLineEdit" name="locationBox"/> | ||
50 | </item> | ||
51 | <item> | ||
52 | <widget class="QPushButton" name="browseButton"> | ||
53 | <property name="text"> | ||
54 | <string>Browse...</string> | ||
55 | </property> | ||
56 | </widget> | ||
57 | </item> | ||
58 | </layout> | ||
59 | </item> | ||
60 | <item row="2" column="0"> | ||
61 | <widget class="QLabel" name="label_3"> | ||
62 | <property name="text"> | ||
63 | <string>Target:</string> | ||
64 | </property> | ||
65 | <property name="buddy"> | ||
66 | <cstring>comboBox</cstring> | ||
67 | </property> | ||
68 | </widget> | ||
69 | </item> | ||
70 | <item row="2" column="1"> | ||
71 | <widget class="QComboBox" name="comboBox"> | ||
72 | <item> | ||
73 | <property name="text"> | ||
74 | <string>Not Yet Available</string> | ||
75 | </property> | ||
76 | </item> | ||
77 | </widget> | ||
78 | </item> | ||
79 | <item row="4" column="0" colspan="2"> | ||
80 | <widget class="QGroupBox" name="groupBox"> | ||
81 | <property name="title"> | ||
82 | <string>Add Documents</string> | ||
83 | </property> | ||
84 | <property name="flat"> | ||
85 | <bool>false</bool> | ||
86 | </property> | ||
87 | <property name="checkable"> | ||
88 | <bool>false</bool> | ||
89 | </property> | ||
90 | <layout class="QFormLayout" name="formLayout"> | ||
91 | <property name="fieldGrowthPolicy"> | ||
92 | <enum>QFormLayout::AllNonFixedFieldsGrow</enum> | ||
93 | </property> | ||
94 | <item row="0" column="0"> | ||
95 | <widget class="QCheckBox" name="sbsBox"> | ||
96 | <property name="text"> | ||
97 | <string>SBS</string> | ||
98 | </property> | ||
99 | <property name="checked"> | ||
100 | <bool>true</bool> | ||
101 | </property> | ||
102 | </widget> | ||
103 | </item> | ||
104 | <item row="0" column="1"> | ||
105 | <widget class="QCheckBox" name="rsbsBox"> | ||
106 | <property name="text"> | ||
107 | <string>RSBS</string> | ||
108 | </property> | ||
109 | </widget> | ||
110 | </item> | ||
111 | <item row="1" column="0"> | ||
112 | <widget class="QCheckBox" name="wpsBox"> | ||
113 | <property name="text"> | ||
114 | <string>WPS</string> | ||
115 | </property> | ||
116 | <property name="checked"> | ||
117 | <bool>true</bool> | ||
118 | </property> | ||
119 | </widget> | ||
120 | </item> | ||
121 | <item row="1" column="1"> | ||
122 | <widget class="QCheckBox" name="rwpsBox"> | ||
123 | <property name="text"> | ||
124 | <string>RWPS</string> | ||
125 | </property> | ||
126 | </widget> | ||
127 | </item> | ||
128 | <item row="2" column="0"> | ||
129 | <widget class="QCheckBox" name="fmsBox"> | ||
130 | <property name="text"> | ||
131 | <string>FMS</string> | ||
132 | </property> | ||
133 | </widget> | ||
134 | </item> | ||
135 | <item row="2" column="1"> | ||
136 | <widget class="QCheckBox" name="rfmsBox"> | ||
137 | <property name="text"> | ||
138 | <string>RFMS</string> | ||
139 | </property> | ||
140 | </widget> | ||
141 | </item> | ||
142 | </layout> | ||
143 | </widget> | ||
144 | </item> | ||
145 | <item row="3" column="0"> | ||
146 | <spacer name="verticalSpacer"> | ||
147 | <property name="orientation"> | ||
148 | <enum>Qt::Vertical</enum> | ||
149 | </property> | ||
150 | <property name="sizeHint" stdset="0"> | ||
151 | <size> | ||
152 | <width>20</width> | ||
153 | <height>40</height> | ||
154 | </size> | ||
155 | </property> | ||
156 | </spacer> | ||
157 | </item> | ||
158 | </layout> | ||
159 | </item> | ||
160 | <item> | ||
161 | <widget class="QDialogButtonBox" name="buttonBox"> | ||
162 | <property name="orientation"> | ||
163 | <enum>Qt::Horizontal</enum> | ||
164 | </property> | ||
165 | <property name="standardButtons"> | ||
166 | <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> | ||
167 | </property> | ||
168 | </widget> | ||
169 | </item> | ||
170 | </layout> | ||
171 | </widget> | ||
172 | <resources> | ||
173 | <include location="../resources.qrc"/> | ||
174 | </resources> | ||
175 | <connections> | ||
176 | <connection> | ||
177 | <sender>buttonBox</sender> | ||
178 | <signal>accepted()</signal> | ||
179 | <receiver>NewProjectDialog</receiver> | ||
180 | <slot>accept()</slot> | ||
181 | <hints> | ||
182 | <hint type="sourcelabel"> | ||
183 | <x>248</x> | ||
184 | <y>254</y> | ||
185 | </hint> | ||
186 | <hint type="destinationlabel"> | ||
187 | <x>157</x> | ||
188 | <y>274</y> | ||
189 | </hint> | ||
190 | </hints> | ||
191 | </connection> | ||
192 | <connection> | ||
193 | <sender>buttonBox</sender> | ||
194 | <signal>rejected()</signal> | ||
195 | <receiver>NewProjectDialog</receiver> | ||
196 | <slot>reject()</slot> | ||
197 | <hints> | ||
198 | <hint type="sourcelabel"> | ||
199 | <x>316</x> | ||
200 | <y>260</y> | ||
201 | </hint> | ||
202 | <hint type="destinationlabel"> | ||
203 | <x>286</x> | ||
204 | <y>274</y> | ||
205 | </hint> | ||
206 | </hints> | ||
207 | </connection> | ||
208 | </connections> | ||
209 | </ui> | ||