seened easy enougth to try :)
From 53368147cf4cdb03bb33b420428b62a17940606f Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava <[email protected]>
Date: Tue, 6 Oct 2015 19:01:00 -0300
Subject: [PATCH 1/2] Simplify code

Do not call the setAttributte *everytime* the Preferences
is called, call it once on the constructor.

Also, no need to call the LanguageModel::instance() on the
instance method, it will be already called on the constructor
it seems that it's a leftover from a long while.

Signed-off-by: Tomaz Canabrava <[email protected]>
---
 qt-ui/preferences.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/qt-ui/preferences.cpp b/qt-ui/preferences.cpp
index 715745e..6450c41 100644
--- a/qt-ui/preferences.cpp
+++ b/qt-ui/preferences.cpp
@@ -23,14 +23,13 @@
 PreferencesDialog *PreferencesDialog::instance()
 {
 	static PreferencesDialog *dialog = new PreferencesDialog(MainWindow::instance());
-	dialog->setAttribute(Qt::WA_QuitOnClose, false);
-	LanguageModel::instance();
 	return dialog;
 }
 
 PreferencesDialog::PreferencesDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f)
 {
 	ui.setupUi(this);
+	setAttribute(Qt::WA_QuitOnClose, false);
 
 #if defined(Q_OS_ANDROID) || !defined(FBSUPPORT)
 	for (int i = 0; i < ui.listWidget->count(); i++) {
-- 
2.6.1

From e545ea64820ea635e5ac6beccd8eef8954df553e Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava <[email protected]>
Date: Tue, 6 Oct 2015 19:02:38 -0300
Subject: [PATCH 2/2] Ask the Preferences Widget to show and be visible

The 'show' call only makes the dialog visible, but if it's
covered by any other window that's not from *this* program
it could still be hidden in some OSes. the call to raise()
asks the window manager to make the widget to be on top of the
widget stack.

Signed-off-by: Tomaz Canabrava <[email protected]>
---
 qt-ui/mainwindow.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index 8f2f7cd..317980d 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -589,6 +589,7 @@ void MainWindow::showProfile()
 void MainWindow::on_actionPreferences_triggered()
 {
 	PreferencesDialog::instance()->show();
+	PreferencesDialog::instance()->raise();
 }
 
 void MainWindow::on_actionQuit_triggered()
-- 
2.6.1

_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to