fixed save path for newly created addons

actorid
Marc Zinnschlag 11 years ago
parent 63e0cf5154
commit 74d683b530

@ -30,7 +30,8 @@ CS::Editor::Editor() : mViewManager (mDocumentManager)
connect (&mStartup, SIGNAL (editConfig()), this, SLOT (showSettings ()));
connect (&mFileDialog, SIGNAL(openFiles()), this, SLOT(openFiles()));
connect (&mFileDialog, SIGNAL(createNewFile()), this, SLOT(createNewFile()));
connect (&mFileDialog, SIGNAL(createNewFile (const boost::filesystem::path&)),
this, SLOT(createNewFile (const boost::filesystem::path&)));
connect (&mNewGame, SIGNAL (createRequest (const boost::filesystem::path&)),
this, SLOT (createNewGame (const boost::filesystem::path&)));
@ -138,7 +139,7 @@ void CS::Editor::openFiles()
mFileDialog.hide();
}
void CS::Editor::createNewFile()
void CS::Editor::createNewFile (const boost::filesystem::path& savePath)
{
std::vector<boost::filesystem::path> files;
QStringList paths = mFileDialog.checkedItemsPaths();
@ -149,9 +150,7 @@ void CS::Editor::createNewFile()
files.push_back(mFileDialog.fileName().toStdString());
/// \todo Get the save path from the file dialogue.
CSMDoc::Document *document = mDocumentManager.addDocument (files, *files.rbegin(), true);
CSMDoc::Document *document = mDocumentManager.addDocument (files, savePath, true);
mViewManager.addView (document);
mFileDialog.hide();

@ -60,7 +60,7 @@ namespace CS
void loadDocument();
void openFiles();
void createNewFile();
void createNewFile (const boost::filesystem::path& savePath);
void createNewGame (const boost::filesystem::path& file);
void showStartup();

@ -35,7 +35,7 @@ CSVDoc::FileDialog::FileDialog(QWidget *parent) :
mFileWidget->setType(true);
mFileWidget->extensionLabelIsVisible(false);
connect(projectCreateButton, SIGNAL(clicked()), this, SIGNAL(createNewFile()));
connect(projectCreateButton, SIGNAL(clicked()), this, SLOT(createNewFile()));
connect(projectButtonBox, SIGNAL(accepted()), this, SIGNAL(openFiles()));
connect(projectButtonBox, SIGNAL(rejected()), this, SLOT(reject()));
@ -118,5 +118,10 @@ void CSVDoc::FileDialog::slotAdjusterChanged(bool value)
void CSVDoc::FileDialog::slotGameFileSelected(int value)
{
emit signalUpdateCreateButton(value > -1, 1);
emit signalUpdateCreateButton(value > -1, 1);
}
void CSVDoc::FileDialog::createNewFile()
{
emit createNewFile (mAdjusterWidget->getPath());
}

@ -58,7 +58,7 @@ namespace CSVDoc
signals:
void openFiles();
void createNewFile();
void createNewFile (const boost::filesystem::path& savePath);
void signalUpdateCreateButton (bool, int);
void signalUpdateCreateButtonFlags(int);
@ -71,6 +71,7 @@ namespace CSVDoc
void slotEnableCreateButton(bool enable, int widgetNumber);
void slotAdjusterChanged(bool value);
void slotGameFileSelected(int value);
void createNewFile();
};
}
#endif // FILEDIALOG_HPP

Loading…
Cancel
Save