Skip to content

Commit

Permalink
Allow running on systems without systray support
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <falktx@falktx.com>
  • Loading branch information
falkTX committed Nov 10, 2023
1 parent 8280d2f commit 6c542ac
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
5 changes: 0 additions & 5 deletions systray/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,6 @@ int main(int argc, char* argv[])
app.setOrganizationName("MOD Audio");
app.setWindowIcon(QIcon(":/mod-logo.svg"));

if (! QSystemTrayIcon::isSystemTrayAvailable())
{
return 1;
}

#ifdef _WIN32
SetEnvironmentVariableW(L"LANG", L"en_US.UTF-8");

Expand Down
10 changes: 9 additions & 1 deletion systray/mod-app.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,15 @@ class AppWindow : public QMainWindow
QTimer::singleShot(100, this, &AppWindow::start);
}

QTimer::singleShot(1, systray, &QSystemTrayIcon::show);
if (QSystemTrayIcon::isSystemTrayAvailable())
{
QTimer::singleShot(1, systray, &QSystemTrayIcon::show);
}
else
{
ui.cb_systray->setChecked(false);
ui.cb_systray->hide();
}
}

void setStarting()
Expand Down

0 comments on commit 6c542ac

Please sign in to comment.