From 7715bdeb2996a72da68378d15cbba0c8937b300e Mon Sep 17 00:00:00 2001 From: Jeremy Borgman Date: Thu, 17 Sep 2020 19:55:37 -0500 Subject: [PATCH] adjusted to only open one window for the launcher --- src/core/controller.cpp | 6 ++++-- src/core/controller.h | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/core/controller.cpp b/src/core/controller.cpp index f04ce2a7..b2756ee0 100644 --- a/src/core/controller.cpp +++ b/src/core/controller.cpp @@ -188,8 +188,10 @@ Controller::openInfoWindow() void Controller::openLauncherWindow() { - CaptureLauncher* w = new CaptureLauncher(); - w->show(); + if (!m_launcherWindow) { + m_launcherWindow = new CaptureLauncher(); + } + m_launcherWindow->show(); } void diff --git a/src/core/controller.h b/src/core/controller.h index ba9ac24d..86ccdfc6 100644 --- a/src/core/controller.h +++ b/src/core/controller.h @@ -29,7 +29,7 @@ class CaptureWidget; class ConfigWindow; class InfoWindow; class QSystemTrayIcon; - +class CaptureLauncher; using lambda = std::function; class Controller : public QObject @@ -82,6 +82,7 @@ private: QMap m_requestMap; QPointer m_captureWindow; QPointer m_infoWindow; + QPointer m_launcherWindow; QPointer m_configWindow; QPointer m_trayIcon; };