summaryrefslogtreecommitdiffhomepage
path: root/logic
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-11-05 13:04:42 +0100
committerStanislaw Halik <sthalik@misaki.pl>2016-11-05 13:07:34 +0100
commit395d606ab74c25e3c107e59a6b0933de9bf79d20 (patch)
tree7ccc69a7956564373a0a5c41c3dc1dce2b548980 /logic
parentdfa40a083dc3efaf665bc1f5e54633deda79a956 (diff)
modules: make more strings translatable
Diffstat (limited to 'logic')
-rw-r--r--logic/work.cpp15
-rw-r--r--logic/work.hpp1
2 files changed, 11 insertions, 5 deletions
diff --git a/logic/work.cpp b/logic/work.cpp
index c5fcad9a..d2a16139 100644
--- a/logic/work.cpp
+++ b/logic/work.cpp
@@ -1,11 +1,12 @@
#include "work.hpp"
#include "opentrack-library-path.h"
+#include <QObject>
#include <QMessageBox>
#include <QFileDialog>
-static QString browse_datalogging_file(main_settings &s)
+QString Work::browse_datalogging_file(main_settings &s)
{
QString filename = s.tracklogging_filename;
if (filename.isEmpty())
@@ -15,7 +16,11 @@ static QString browse_datalogging_file(main_settings &s)
and be a known problem. Possible solution is to use the QFileDialog::DontUseNativeDialog flag.
Since the freeze is apparently random, I'm not sure it helped.
*/
- QString newfilename = QFileDialog::getSaveFileName(nullptr, QFileDialog::tr("Select Filename"), filename, QFileDialog::tr("CSV File (*.csv)"), nullptr); //, QFileDialog::DontUseNativeDialog);
+ QString newfilename = QFileDialog::getSaveFileName(nullptr,
+ QCoreApplication::translate("Work", "Select filename"),
+ filename,
+ QCoreApplication::translate("Work", "CSV File (*.csv)"),
+ nullptr);
if (!newfilename.isEmpty())
{
s.tracklogging_filename = newfilename;
@@ -30,7 +35,7 @@ std::shared_ptr<TrackLogger> Work::make_logger(main_settings &s)
if (s.tracklogging_enabled)
{
QString filename = browse_datalogging_file(s);
- if (static_cast<QString>(s.tracklogging_filename).isEmpty())
+ if (filename.isEmpty())
{
// The user probably canceled the file dialog. In this case we don't want to do anything.
}
@@ -40,8 +45,8 @@ std::shared_ptr<TrackLogger> Work::make_logger(main_settings &s)
if (!logger->is_open())
{
logger = nullptr;
- QMessageBox::warning(nullptr, "Logging Error",
- "Unable to open file: " + s.tracklogging_filename + ". Proceeding without logging.",
+ QMessageBox::warning(nullptr, QCoreApplication::translate("Work", "Logging error"),
+ QCoreApplication::translate("Work", "Unable to open file '%1'. Proceeding without logging.").arg(s.tracklogging_filename),
QMessageBox::Ok,
QMessageBox::NoButton);
}
diff --git a/logic/work.hpp b/logic/work.hpp
index c29a53b0..b614c580 100644
--- a/logic/work.hpp
+++ b/logic/work.hpp
@@ -40,4 +40,5 @@ struct OPENTRACK_LOGIC_EXPORT Work
private:
static std::shared_ptr<TrackLogger> make_logger(main_settings &s);
+ static QString browse_datalogging_file(main_settings &s);
};