Qt: Add option to hide the system tray icon
My changes leave all tray icon and menu creation/initialization logic untouched. It only shows or hides the icon according to the setting. A new checkbox was added to the OptionsDialog under the Window tab. A bool option named "hideTrayIcon" was added to OptionsModel. This checkbox was mapped like other all options to the OptionsModel. A signal was added to the OptionsModel for broadcasting changes the the hideTrayIcon option. This signal was connected to a new slot added to BitcoinGUI named setTrayIconVisible(bool). The slot simply hides or shows the trayIcon in BitcoinGUI according to the parameter recieved.
This commit is contained in:
@@ -28,6 +28,7 @@ public:
|
||||
|
||||
enum OptionID {
|
||||
StartAtStartup, // bool
|
||||
HideTrayIcon, // bool
|
||||
MinimizeToTray, // bool
|
||||
MapPortUPnP, // bool
|
||||
MinimizeOnClose, // bool
|
||||
@@ -58,6 +59,7 @@ public:
|
||||
void setDisplayUnit(const QVariant &value);
|
||||
|
||||
/* Explicit getters */
|
||||
bool getHideTrayIcon() { return fHideTrayIcon; }
|
||||
bool getMinimizeToTray() { return fMinimizeToTray; }
|
||||
bool getMinimizeOnClose() { return fMinimizeOnClose; }
|
||||
int getDisplayUnit() { return nDisplayUnit; }
|
||||
@@ -72,6 +74,7 @@ public:
|
||||
|
||||
private:
|
||||
/* Qt-only settings */
|
||||
bool fHideTrayIcon;
|
||||
bool fMinimizeToTray;
|
||||
bool fMinimizeOnClose;
|
||||
QString language;
|
||||
@@ -87,6 +90,7 @@ private:
|
||||
Q_SIGNALS:
|
||||
void displayUnitChanged(int unit);
|
||||
void coinControlFeaturesChanged(bool);
|
||||
void hideTrayIconChanged(bool);
|
||||
};
|
||||
|
||||
#endif // BITCOIN_QT_OPTIONSMODEL_H
|
||||
|
||||
Reference in New Issue
Block a user