Commit 37dc2940 authored by Jan Möbius's avatar Jan Möbius

Some More directory settings

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@11167 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 7c76bf5b
......@@ -259,12 +259,18 @@ void VSI::BaseWidget::load()
if (!saveIfChanged ())
return;
QString filename = QFileDialog::getOpenFileName (this, tr("Load Visual Script"), QString (),
QString filename = QFileDialog::getOpenFileName (this,
tr("Load Visual Script"),
OpenFlipperSettings().value("Core/CurrentDir").toString(),
tr("Visual Script File (*.ofvs)"));
if (filename.isEmpty ())
return;
// Get the chosen directory and remember it.
QFileInfo fileInfo(filename);
OpenFlipperSettings().setValue("Core/CurrentDir", fileInfo.absolutePath() );
QFile f (filename);
if (!f.open (QFile::ReadOnly))
{
......@@ -309,11 +315,13 @@ void VSI::BaseWidget::load()
/// Save file
bool BaseWidget::save(bool _newName)
{
QString filename;
if (fileName_.isEmpty () || _newName)
{
QFileDialog *d = new QFileDialog (this, tr("Save Visual Script"), QString (),
QFileDialog *d = new QFileDialog (this, tr("Save Visual Script"),
OpenFlipperSettings().value("Core/CurrentDir").toString(),
tr("Visual Script File (*.ofvs)"));
d->setAcceptMode (QFileDialog::AcceptSave);
......@@ -328,6 +336,10 @@ bool BaseWidget::save(bool _newName)
if (filename.isEmpty ())
return false;
// Get the chosen directory and remember it.
QFileInfo fileInfo(filename);
OpenFlipperSettings().setValue("Core/CurrentDir", fileInfo.absolutePath() );
QFile f (filename);
if (!f.open (QFile::WriteOnly))
{
......
......@@ -144,7 +144,8 @@ void FilenameWidget::toDefault()
// Show file dialog
void FilenameWidget::showDialog()
{
QFileDialog d (this, tr("Select File"), QString (), filter_);
QFileDialog d (this, tr("Select File"), QString() , filter_);
d.setAcceptMode (mode_);
d.setDefaultSuffix (defaultSuffix_);
if (dirOnly_)
......
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