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:
@@ -193,6 +193,7 @@ void OptionsDialog::setMapper()
|
||||
|
||||
/* Window */
|
||||
#ifndef Q_OS_MAC
|
||||
mapper->addMapping(ui->hideTrayIcon, OptionsModel::HideTrayIcon);
|
||||
mapper->addMapping(ui->minimizeToTray, OptionsModel::MinimizeToTray);
|
||||
mapper->addMapping(ui->minimizeOnClose, OptionsModel::MinimizeOnClose);
|
||||
#endif
|
||||
@@ -238,6 +239,19 @@ void OptionsDialog::on_cancelButton_clicked()
|
||||
reject();
|
||||
}
|
||||
|
||||
void OptionsDialog::on_hideTrayIcon_stateChanged(int fState)
|
||||
{
|
||||
if(fState)
|
||||
{
|
||||
ui->minimizeToTray->setChecked(false);
|
||||
ui->minimizeToTray->setEnabled(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->minimizeToTray->setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
void OptionsDialog::showRestartWarning(bool fPersistent)
|
||||
{
|
||||
ui->statusLabel->setStyleSheet("QLabel { color: red; }");
|
||||
|
||||
Reference in New Issue
Block a user