This repository has been archived by the owner on Dec 10, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Qt has fixed System Tray for awhile. For users who use old Linux distributions, they should consider upgrading, or using AppImage
- Loading branch information
Showing
7 changed files
with
9 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright (C) 2015-2016 Symeon Huang <[email protected]> | ||
* Copyright (C) 2015-2017 Symeon Huang <[email protected]> | ||
* | ||
* shadowsocks-qt5 is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published | ||
|
@@ -24,47 +24,24 @@ | |
#include <QMenu> | ||
#include <QStringList> | ||
|
||
#ifdef USE_APP_INDICATOR | ||
#undef signals | ||
extern "C" | ||
{ | ||
#include <libappindicator/app-indicator.h> | ||
#include <gtk/gtk.h> | ||
} | ||
#define signals public | ||
#endif | ||
|
||
class MainWindow; | ||
|
||
class StatusNotifier : public QObject | ||
{ | ||
Q_OBJECT | ||
public: | ||
explicit StatusNotifier(MainWindow *w, bool startHiden, QObject *parent = 0); | ||
~StatusNotifier(); | ||
|
||
bool isUsingAppIndicator() const; | ||
StatusNotifier(MainWindow *w, bool startHiden, QObject *parent = 0); | ||
|
||
public slots: | ||
void activate(); | ||
void showNotification(const QString &); | ||
void onWindowVisibleChanged(bool visible); | ||
|
||
private: | ||
#ifdef USE_APP_INDICATOR | ||
GtkWidget *minimiseRestoreGtkItem; | ||
void createAppIndicator(bool startHiden); | ||
#endif | ||
|
||
QMenu systrayMenu; | ||
QAction *minimiseRestoreAction; | ||
QSystemTrayIcon systray; | ||
MainWindow *window; | ||
|
||
bool useAppIndicator; | ||
|
||
//desktop environments that need application indicator | ||
static const QStringList appIndicatorDE; | ||
}; | ||
|
||
#endif // STATUSNOTIFIER_H |