From 98ecc8a132becaa4e37939ca5f7fd2031c603565 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 23 Oct 2019 14:14:54 +0200 Subject: Try even harder to restore focus after spawning openbox I just need a bigger hammer. --- src/dialog.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/dialog.cpp') diff --git a/src/dialog.cpp b/src/dialog.cpp index dbc4b8e..bdeab16 100644 --- a/src/dialog.cpp +++ b/src/dialog.cpp @@ -26,11 +26,14 @@ static bool isProcessRunning(const QString &binary); +QDialog* Dialog::instance = nullptr; + static QDomDocument toDomDocument(const QString& what, const QByteArray& data, const QString& backupFile, const QString& mandatoryChild); Dialog::Dialog(QWidget *parent) : QDialog(parent), ui(new Ui::Dialog) { + instance = this; model_[TAB_NATIVE] = new SessionTreeModel(parent); model_[TAB_RECENT_COURSES] = new SessionTreeModel(parent, true); model_[TAB_ALL_VMS] = new SessionTreeModel(parent); @@ -110,6 +113,7 @@ Dialog::Dialog(QWidget *parent) } Dialog::~Dialog() { + instance = nullptr; delete ui; } @@ -821,6 +825,11 @@ void Dialog::showEvent(QShowEvent *e) }); } +QDialog* Dialog::getInstance() +{ + return instance; +} + static bool isProcessRunning(const QString &binary) { bool full = binary.contains('/'); -- cgit v1.2.3-55-g7522