summaryrefslogtreecommitdiffhomepage
path: root/gui
diff options
context:
space:
mode:
authorDaMichel <mw.pub@welter-4d.de>2016-07-29 16:32:54 +0200
committerDaMichel <mw.pub@welter-4d.de>2016-07-29 16:32:54 +0200
commit12d2080865958cc07d37dddd28240f40423fb292 (patch)
tree240a7e71221279206ae1618e86cb66770913547a /gui
parent884b3f013045d60d586c55338a76feb4dfa30c9b (diff)
logger: it is definitely nicer to not have things all over the place
Diffstat (limited to 'gui')
-rw-r--r--gui/ui.cpp50
-rw-r--r--gui/ui.h2
2 files changed, 1 insertions, 51 deletions
diff --git a/gui/ui.cpp b/gui/ui.cpp
index 3bda6ee2..94fd0cbf 100644
--- a/gui/ui.cpp
+++ b/gui/ui.cpp
@@ -15,7 +15,6 @@
#include <QFileDialog>
#include <QDesktopServices>
#include <QCoreApplication>
-#include <cassert>
#ifdef _WIN32
# include <windows.h>
@@ -286,44 +285,6 @@ void MainWindow::reload_options()
ensure_tray();
}
-/*
- Allocates a new logger instance depending on main settings. Result is assigned to logger variable of State object.
- May open warning dialogs.
- May also assign nullptr in case of an error.
-*/
-void MainWindow::initialize_logger()
-{
- logger = nullptr;
- if (s.tracklogging_enabled)
- {
- if (static_cast<QString>(s.tracklogging_filename).isEmpty())
- {
- QMessageBox::warning(this, tr("Logging Error"),
- tr("No filename given for track logging. Aborting."),
- QMessageBox::Ok,
- QMessageBox::NoButton);
- return;
- }
- try
- {
- logger = TrackLoggerCSV::make(s);
- }
- catch (std::ios_base::failure &)
- {
- QMessageBox::warning(this, tr("Logging Error"),
- tr("Unable to open file: ") + s.tracklogging_filename + tr(". Aborting."),
- QMessageBox::Ok,
- QMessageBox::NoButton);
- return;
- }
- }
- else
- {
- logger = TrackLogger::make();
- }
- assert(logger != nullptr);
-}
-
void MainWindow::startTracker()
{
@@ -350,17 +311,9 @@ void MainWindow::startTracker()
return;
}
- initialize_logger();
- if (logger == nullptr)
- {
- // error -> rollback
- libs = SelectedLibraries();
- return;
- }
-
save_modules();
- work = std::make_shared<Work>(pose, libs, *logger, winId());
+ work = std::make_shared<Work>(pose, libs, winId());
reload_options();
@@ -412,7 +365,6 @@ void MainWindow::stopTracker()
work = nullptr;
libs = SelectedLibraries();
- logger = nullptr;
{
double p[6] = {0,0,0, 0,0,0};
diff --git a/gui/ui.h b/gui/ui.h
index acec615e..d6f5e400 100644
--- a/gui/ui.h
+++ b/gui/ui.h
@@ -103,8 +103,6 @@ private slots:
void stopTracker();
void reload_options();
- void initialize_logger();
-
signals:
void emit_start_tracker();
void emit_stop_tracker();