summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-07-26 08:36:47 +0200
committerStanislaw Halik <sthalik@misaki.pl>2015-07-26 08:36:47 +0200
commitf01314fa7fb2560cdfd3eb645e8bfa7b2139d656 (patch)
treecbad5c01a38d31fa2885233a656dc0e5d068259a
parent4589370ad6fa88a7255cc4673dbbcec28d06d2f5 (diff)
parent2f631a5159542f7e2813ca6ed7bc0be37c50afae (diff)
merge unstable
-rw-r--r--facetracknoir/curve-config.h1
-rw-r--r--facetracknoir/main.cpp24
-rw-r--r--facetracknoir/options-dialog.hpp3
-rw-r--r--facetracknoir/ui.cpp4
4 files changed, 14 insertions, 18 deletions
diff --git a/facetracknoir/curve-config.h b/facetracknoir/curve-config.h
index d1ef7ad2..0cbc7055 100644
--- a/facetracknoir/curve-config.h
+++ b/facetracknoir/curve-config.h
@@ -11,6 +11,7 @@ public:
private:
Ui::UICCurveConfigurationDialog ui;
Mappings& m;
+ void closeEvent(QCloseEvent *) override { doCancel(); }
private slots:
void doOK();
void doCancel();
diff --git a/facetracknoir/main.cpp b/facetracknoir/main.cpp
index eff35c0b..85c4c7bd 100644
--- a/facetracknoir/main.cpp
+++ b/facetracknoir/main.cpp
@@ -18,18 +18,14 @@ using namespace options;
// workaround QTBUG-38598, allow for launching from another directory
static void add_program_library_path()
{
+ char* p = _pgmptr;
+ char path[MAX_PATH+1];
+ strcpy(path, p);
+ char* ptr = strrchr(path, '\\');
+ if (ptr)
{
- char* p = _pgmptr;
- {
- char path[MAX_PATH+1];
- strcpy(path, p);
- char* ptr = strrchr(path, '\\');
- if (ptr)
- {
- *ptr = '\0';
- QCoreApplication::addLibraryPath(path);
- }
- }
+ *ptr = '\0';
+ QCoreApplication::addLibraryPath(path);
}
}
#endif
@@ -38,12 +34,14 @@ int main(int argc, char** argv)
{
#ifdef _WIN32
add_program_library_path();
-#endif
+#elif !defined(__linux)
// workaround QTBUG-38598
QCoreApplication::addLibraryPath(".");
+#endif
+#if defined(_WIN32) || defined(__APPLE__)
// qt5 designer-made controls look like shit on 'doze -sh 20140921
-#ifdef _WIN32
+ // also our OSX look leaves a lot to be desired -sh 20150726
{
const QStringList preferred { "fusion", "windowsvista", "jazzbands'-marijuana", "macintosh", "windowsxp" };
for (const auto& style_name : preferred)
diff --git a/facetracknoir/options-dialog.hpp b/facetracknoir/options-dialog.hpp
index af3e185c..8e71bd40 100644
--- a/facetracknoir/options-dialog.hpp
+++ b/facetracknoir/options-dialog.hpp
@@ -29,13 +29,14 @@ private:
bool trans_calib_running;
Tracker_PT* get_pt();
+ void closeEvent(QCloseEvent *) override { doCancel(); }
private slots:
void update_ewma_display(int value);
void update_rot_display(int value);
void update_trans_display(int value);
void update_rot_dz_display(int value);
void update_trans_dz_display(int value);
-private slots:
+
void doOK();
void doCancel();
void startstop_trans_calib(bool start);
diff --git a/facetracknoir/ui.cpp b/facetracknoir/ui.cpp
index 8501e2ae..4f1d8c18 100644
--- a/facetracknoir/ui.cpp
+++ b/facetracknoir/ui.cpp
@@ -125,10 +125,6 @@ void MainWindow::save_mappings() {
pose.save_mappings();
}
-#if defined(__unix) || defined(__linux) || defined(__APPLE__)
-# include <unistd.h>
-#endif
-
void MainWindow::save() {
s.b->save();
save_mappings();