Skip to content

Commit

Permalink
Added inforamtive notification on first window close
Browse files Browse the repository at this point in the history
  • Loading branch information
Odizinne committed Sep 12, 2024
1 parent 6c969a5 commit b3bd83d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/HeadsetControlQt/headsetcontrolqt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -483,4 +483,14 @@ void HeadsetControlQt::trayIconActivated(QSystemTrayIcon::ActivationReason reaso
void HeadsetControlQt::closeEvent(QCloseEvent *event)
{
trayIcon->contextMenu()->actions().first()->setText("Show");
sendFirstMinimizeNotification();

}

void HeadsetControlQt::sendFirstMinimizeNotification()
{
if (firstRun) {
sendNotification(tr("HeadsetControl-Qt"), QString(tr("The application is still running in the background.")), QIcon(":/icons/icon.png"), 5000);
firstRun = false;
}
}
2 changes: 2 additions & 0 deletions src/HeadsetControlQt/headsetcontrolqt.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ private slots:
void updateUIWithHeadsetInfo(const QJsonObject &headsetInfo);
void noDeviceFound();
void toggleUIElements(bool show);
void sendFirstMinimizeNotification();
static const QString settingsFile;
static const QString headsetcontrolExecutable;
static const QString desktopFile;
Expand All @@ -75,6 +76,7 @@ private slots:
QThread workerThread;
Worker *worker;


protected:
void closeEvent(QCloseEvent *event) override;
};
Expand Down

0 comments on commit b3bd83d

Please sign in to comment.