summaryrefslogtreecommitdiffhomepage
path: root/gui/options-dialog.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-07-31 07:25:25 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-07-31 07:25:25 +0200
commit5a4af5208db2eb9fb09191c3617fa7e6d854bb64 (patch)
treeb66ae47b3596bc80e5f753b961f71da64ea2f520 /gui/options-dialog.cpp
parentd1db463367e28588c774167e5dece0a3a186e2eb (diff)
gui/options: use and restore program directory around dialog
Diffstat (limited to 'gui/options-dialog.cpp')
-rw-r--r--gui/options-dialog.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/gui/options-dialog.cpp b/gui/options-dialog.cpp
index 9dcb7879..814cf298 100644
--- a/gui/options-dialog.cpp
+++ b/gui/options-dialog.cpp
@@ -8,6 +8,7 @@
#include "options-dialog.hpp"
#include "keyboard.h"
+#include "opentrack-library-path.h"
#include <QPushButton>
#include <QLayout>
#include <QDialog>
@@ -173,7 +174,7 @@ void OptionsDialog::browse_datalogging_file()
{
QString filename = ui.tracklogging_filenameedit->text();
if (filename.isEmpty())
- filename = QDir::currentPath();
+ filename = OPENTRACK_BASE_PATH;
/* Sometimes this function freezes the app before opening the dialog.
Might be related to https://forum.qt.io/topic/49209/qfiledialog-getopenfilename-hangs-in-windows-when-using-the-native-dialog/8
and be a known problem. Possible solution is to use the QFileDialog::DontUseNativeDialog flag.
@@ -182,10 +183,13 @@ void OptionsDialog::browse_datalogging_file()
QString newfilename = QFileDialog::getSaveFileName(this, tr("Select Filename"), filename, tr("CSV File (*.csv)"), nullptr, QFileDialog::DontUseNativeDialog);
if (!newfilename.isEmpty())
ui.tracklogging_filenameedit->setText(newfilename);
+
+ // dialog likes to mess with current directory
+ QDir::setCurrent(OPENTRACK_BASE_PATH);
}
void OptionsDialog::update_widgets_states(bool tracker_is_running)
{
ui.tracklogging_enabled->setEnabled(!tracker_is_running);
ui.tracklogging_fileselectbtn->setEnabled(!tracker_is_running);
-} \ No newline at end of file
+}