indicator: add singleClick to open main app interface

This commit is contained in:
Piyush Aggarwal 2021-07-02 23:09:41 +05:30
parent 89e7c36158
commit e683dd218a

View file

@ -140,8 +140,11 @@ int main(int argc, char** argv)
systray.setToolTip(i18np("%1 device connected", "%1 devices connected", model.rowCount()));
});
QObject::connect(&systray, &QSystemTrayIcon::activated, [&iface](QSystemTrayIcon::ActivationReason reason) {
if (reason == QSystemTrayIcon::DoubleClick) {
iface.openConfiguration();
if (reason == QSystemTrayIcon::Trigger) {
const QString kdeconnectAppExecutable = QStandardPaths::findExecutable(QStringLiteral("kdeconnect-app"), { QCoreApplication::applicationDirPath() });
if (!kdeconnectAppExecutable.isEmpty()) {
QProcess::startDetached(kdeconnectAppExecutable);
}
}
});