File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -413,7 +413,13 @@ void LightpackApplication::processCommandLineArguments()
413413 DEBUG_LOW_LEVEL << " Application running no_GUI mode" ;
414414 }
415415 else if (parser.isSet (optionWizard)) {
416- Sleep (500 ); // Give calling instance a chance to release device
416+ if (isRunning ()) {
417+ DEBUG_LOW_LEVEL << " Application still running, telling it to quit" ;
418+ sendMessage (" quitForWizard" );
419+ while (isRunning ()) {
420+ Sleep (200 );
421+ }
422+ }
417423 bool isInitFromSettings = Settings::Initialize (m_applicationDirPath, false );
418424 runWizardLoop (isInitFromSettings);
419425 }
Original file line number Diff line number Diff line change @@ -845,15 +845,18 @@ void SettingsWindow::processMessage(const QString &message)
845845{
846846 DEBUG_LOW_LEVEL << Q_FUNC_INFO << message;
847847
848- if (" on " == message )
848+ if (message == " on " )
849849 setBacklightStatus (Backlight::StatusOn);
850- else if (" off " == message )
850+ else if (message == " off " )
851851 setBacklightStatus (Backlight::StatusOff);
852852 else if (message.startsWith (" set-profile " )) {
853853 QString profile = message.mid (12 );
854854 profileSwitch (profile);
855- }
856- else if (m_trayIcon != NULL ) {
855+ } else if (message == " quitForWizard" ) {
856+ qWarning () << " Wizard was started, quitting!" ;
857+ LightpackApplication::quit ();
858+ } else if (m_trayIcon != NULL ) {
859+ qWarning (qPrintable (message));
857860 m_trayIcon->showMessage (SysTrayIcon::MessageAnotherInstance);
858861 }
859862}
You can’t perform that action at this time.
0 commit comments