forked from mirror/openmw-tes3mp
fixed save path for newly created addons
This commit is contained in:
parent
63e0cf5154
commit
74d683b530
4 changed files with 14 additions and 9 deletions
|
@ -30,7 +30,8 @@ CS::Editor::Editor() : mViewManager (mDocumentManager)
|
||||||
connect (&mStartup, SIGNAL (editConfig()), this, SLOT (showSettings ()));
|
connect (&mStartup, SIGNAL (editConfig()), this, SLOT (showSettings ()));
|
||||||
|
|
||||||
connect (&mFileDialog, SIGNAL(openFiles()), this, SLOT(openFiles()));
|
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&)),
|
connect (&mNewGame, SIGNAL (createRequest (const boost::filesystem::path&)),
|
||||||
this, SLOT (createNewGame (const boost::filesystem::path&)));
|
this, SLOT (createNewGame (const boost::filesystem::path&)));
|
||||||
|
@ -138,7 +139,7 @@ void CS::Editor::openFiles()
|
||||||
mFileDialog.hide();
|
mFileDialog.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CS::Editor::createNewFile()
|
void CS::Editor::createNewFile (const boost::filesystem::path& savePath)
|
||||||
{
|
{
|
||||||
std::vector<boost::filesystem::path> files;
|
std::vector<boost::filesystem::path> files;
|
||||||
QStringList paths = mFileDialog.checkedItemsPaths();
|
QStringList paths = mFileDialog.checkedItemsPaths();
|
||||||
|
@ -149,9 +150,7 @@ void CS::Editor::createNewFile()
|
||||||
|
|
||||||
files.push_back(mFileDialog.fileName().toStdString());
|
files.push_back(mFileDialog.fileName().toStdString());
|
||||||
|
|
||||||
/// \todo Get the save path from the file dialogue.
|
CSMDoc::Document *document = mDocumentManager.addDocument (files, savePath, true);
|
||||||
|
|
||||||
CSMDoc::Document *document = mDocumentManager.addDocument (files, *files.rbegin(), true);
|
|
||||||
|
|
||||||
mViewManager.addView (document);
|
mViewManager.addView (document);
|
||||||
mFileDialog.hide();
|
mFileDialog.hide();
|
||||||
|
|
|
@ -60,7 +60,7 @@ namespace CS
|
||||||
|
|
||||||
void loadDocument();
|
void loadDocument();
|
||||||
void openFiles();
|
void openFiles();
|
||||||
void createNewFile();
|
void createNewFile (const boost::filesystem::path& savePath);
|
||||||
void createNewGame (const boost::filesystem::path& file);
|
void createNewGame (const boost::filesystem::path& file);
|
||||||
|
|
||||||
void showStartup();
|
void showStartup();
|
||||||
|
|
|
@ -35,7 +35,7 @@ CSVDoc::FileDialog::FileDialog(QWidget *parent) :
|
||||||
mFileWidget->setType(true);
|
mFileWidget->setType(true);
|
||||||
mFileWidget->extensionLabelIsVisible(false);
|
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(accepted()), this, SIGNAL(openFiles()));
|
||||||
connect(projectButtonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
connect(projectButtonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
||||||
|
@ -120,3 +120,8 @@ 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:
|
signals:
|
||||||
void openFiles();
|
void openFiles();
|
||||||
void createNewFile();
|
void createNewFile (const boost::filesystem::path& savePath);
|
||||||
|
|
||||||
void signalUpdateCreateButton (bool, int);
|
void signalUpdateCreateButton (bool, int);
|
||||||
void signalUpdateCreateButtonFlags(int);
|
void signalUpdateCreateButtonFlags(int);
|
||||||
|
@ -71,6 +71,7 @@ namespace CSVDoc
|
||||||
void slotEnableCreateButton(bool enable, int widgetNumber);
|
void slotEnableCreateButton(bool enable, int widgetNumber);
|
||||||
void slotAdjusterChanged(bool value);
|
void slotAdjusterChanged(bool value);
|
||||||
void slotGameFileSelected(int value);
|
void slotGameFileSelected(int value);
|
||||||
|
void createNewFile();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#endif // FILEDIALOG_HPP
|
#endif // FILEDIALOG_HPP
|
||||||
|
|
Loading…
Reference in a new issue