mirror of
https://github.com/dashpay/dash.git
synced 2024-12-28 13:32:47 +01:00
8b0e497028
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.
71 lines
1.6 KiB
C++
71 lines
1.6 KiB
C++
// Copyright (c) 2011-2015 The Bitcoin Core developers
|
|
// Distributed under the MIT software license, see the accompanying
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
#ifndef BITCOIN_QT_OPTIONSDIALOG_H
|
|
#define BITCOIN_QT_OPTIONSDIALOG_H
|
|
|
|
#include <QDialog>
|
|
#include <QValidator>
|
|
|
|
class OptionsModel;
|
|
class QValidatedLineEdit;
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
class QDataWidgetMapper;
|
|
QT_END_NAMESPACE
|
|
|
|
namespace Ui {
|
|
class OptionsDialog;
|
|
}
|
|
|
|
/** Proxy address widget validator, checks for a valid proxy address.
|
|
*/
|
|
class ProxyAddressValidator : public QValidator
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit ProxyAddressValidator(QObject *parent);
|
|
|
|
State validate(QString &input, int &pos) const;
|
|
};
|
|
|
|
/** Preferences dialog. */
|
|
class OptionsDialog : public QDialog
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit OptionsDialog(QWidget *parent, bool enableWallet);
|
|
~OptionsDialog();
|
|
|
|
void setModel(OptionsModel *model);
|
|
void setMapper();
|
|
|
|
private Q_SLOTS:
|
|
/* set OK button state (enabled / disabled) */
|
|
void setOkButtonState(bool fState);
|
|
void on_resetButton_clicked();
|
|
void on_okButton_clicked();
|
|
void on_cancelButton_clicked();
|
|
|
|
void on_hideTrayIcon_stateChanged(int fState);
|
|
|
|
void showRestartWarning(bool fPersistent = false);
|
|
void clearStatusLabel();
|
|
void updateProxyValidationState();
|
|
/* query the networks, for which the default proxy is used */
|
|
void updateDefaultProxyNets();
|
|
|
|
Q_SIGNALS:
|
|
void proxyIpChecks(QValidatedLineEdit *pUiProxyIp, int nProxyPort);
|
|
|
|
private:
|
|
Ui::OptionsDialog *ui;
|
|
OptionsModel *model;
|
|
QDataWidgetMapper *mapper;
|
|
};
|
|
|
|
#endif // BITCOIN_QT_OPTIONSDIALOG_H
|