summaryrefslogtreecommitdiff
path: root/muse2/muse/app.cpp
diff options
context:
space:
mode:
authorRobert Jonsson <spamatica@gmail.com>2010-12-27 00:39:58 +0000
committerRobert Jonsson <spamatica@gmail.com>2010-12-27 00:39:58 +0000
commit8092776083f70a25b8615c7b8d6299e2daba8865 (patch)
tree43b919a724811690dfbff86c043ced76e632e2f8 /muse2/muse/app.cpp
parent64e73dd6d68da03c6c7fad0d314f237703e3996d (diff)
create new project dialog added
Diffstat (limited to 'muse2/muse/app.cpp')
-rw-r--r--muse2/muse/app.cpp30
1 files changed, 23 insertions, 7 deletions
diff --git a/muse2/muse/app.cpp b/muse2/muse/app.cpp
index eecc94ff..596c4f19 100644
--- a/muse2/muse/app.cpp
+++ b/muse2/muse/app.cpp
@@ -48,6 +48,7 @@
#include "transport.h"
#include "transpose.h"
#include "waveedit.h"
+#include "widgets/projectcreateimpl.h"
#ifdef DSSI_SUPPORT
#include "dssihost.h"
@@ -1678,6 +1679,7 @@ void MusE::loadProjectFile1(const QString& name, bool songTemplate, bool loadAll
return;
}
project.setFile("untitled");
+ museProject = museProjectInitPath;
}
else {
printf("Setting project path to %s\n", fi.absolutePath().toLatin1().constData());
@@ -1832,7 +1834,7 @@ void MusE::setUntitledProject()
{
setConfigDefaults();
QString name("untitled");
- museProject = QFileInfo(name).absolutePath();
+ museProject = "./"; //QFileInfo(name).absolutePath();
project.setFile(name);
setWindowTitle(tr("MusE: Song: ") + project.completeBaseName());
}
@@ -1913,7 +1915,7 @@ void MusE::loadProject()
void MusE::loadTemplate()
{
QString fn = getOpenFileName(QString("templates"), med_file_pattern, this,
- tr("MusE: load template"), 0);
+ tr("MusE: load template"), 0, MFileDialog::GLOBAL_VIEW);
if (!fn.isEmpty()) {
// museProject = QFileInfo(fn).absolutePath();
loadProjectFile(fn, true, true);
@@ -3046,10 +3048,25 @@ PopupView* MusE::prepareRoutingPopupView(Track* track, bool dst)
bool MusE::saveAs()
{
-// QString name = getSaveFileName(museProject, med_file_pattern, this,
-// QString name = getSaveFileName(QString(""), med_file_pattern, this,
- QString name = getSaveFileName(QString(""), med_file_save_pattern, this,
- tr("MusE: Save As"));
+ QString name;
+ if (museProject == museProjectInitPath ) {
+ ProjectCreateImpl pci(muse);
+ if (pci.exec() == QDialog::Rejected) {
+ return false;
+ }
+
+ name = pci.getProjectPath();
+ song->setSongInfo(pci.getSongInfo());
+ museProject = QFileInfo(name).absolutePath();
+ QDir dirmanipulator;
+ if (!dirmanipulator.mkpath(museProject)) {
+ QMessageBox::warning(this,"Path error","Can't create project path", QMessageBox::Ok);
+ return false;
+ }
+ }
+ else {
+ name = getSaveFileName(QString(""), med_file_save_pattern, this, tr("MusE: Save As"));
+ }
bool ok = false;
if (!name.isEmpty()) {
QString tempOldProj = museProject;
@@ -4843,4 +4860,3 @@ void MusE::execUserScript(int id)
{
song->executeScript(song->getScriptPath(id, false).toLatin1().constData(), song->getSelectedMidiParts(), 0, false); // TODO: get quant from arranger
}
-