Commit 8d24a504 authored by Matthias Möller's avatar Matthias Möller

remember and go to last directory, when saving/loading files

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@20120 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 8cd38c98
......@@ -539,12 +539,18 @@ void ScriptingPlugin::waitContinue( QString _msg, int _x, int _y ) {
void ScriptingPlugin::slotLoadScript(){
QString lastOpened = OpenFlipperSettings().value("Scripting/CurrentDir",OpenFlipper::Options::currentScriptDirStr()).toString();
QString filename = QFileDialog::getOpenFileName(0,
tr("Load Script"),OpenFlipper::Options::currentScriptDirStr(), tr("Script Files (*.ofs)"));
tr("Load Script"),lastOpened , tr("Script Files (*.ofs)"));
if (filename == "")
return;
QFileInfo info (filename);
OpenFlipperSettings().setValue("Scripting/CurrentDir",info.path());
slotLoadScript(filename);
}
......@@ -593,11 +599,17 @@ void ScriptingPlugin::slotSaveScript(){
}
void ScriptingPlugin::slotSaveScriptAs(){
QString lastOpened = OpenFlipperSettings().value("Scripting/CurrentDir",OpenFlipper::Options::currentScriptDirStr()).toString();
QString filename = QFileDialog::getSaveFileName(scriptWidget_,
tr("Save Script"),OpenFlipper::Options::currentScriptDirStr(), tr("Script Files (*.ofs)"));
tr("Save Script"),lastOpened, tr("Script Files (*.ofs)"));
if (filename == "") return;
QFileInfo info (filename);
OpenFlipperSettings().setValue("Scripting/CurrentDir",info.path());
QFile data(filename);
//perhaps add an extension
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment