From 527137e3ee542da5ecd4d04364fac0eb0067a2a4 Mon Sep 17 00:00:00 2001 From: p2k Date: Fri, 7 Oct 2011 13:21:45 +0200 Subject: Improved Mac experience; QDoubleSpinBox for BitcoinAmountField Now it can't be told if this is was a Windows App before. All Mac design principles are fulfilled and some cosmetics have been applied to suit the native look and feel. The biggest change there is the proper use of the Dock icon which takes the role of the Tray icon on Mac. The QDoubleSpinBox improves entering of Bitcoin amounts, no two separate fields are required anymore. All functionality and validation effects have been retained; pressing the comma key will be internally translated to a period to keep it consistent throughout the application and eases entering in countries which use the comma as decimal separator. Additionally, Notificator now supports Growl, Mac's native notification system. This is provided via Apple Script in order to avoid linking to Growl on compile time. Other changes involve encapsulation of Toolbar and Menubar creation, loading of Qt's own translation and some clean up. --- src/qt/optionsdialog.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/qt/optionsdialog.cpp') diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp index 7267e3d103..ea3164e3d7 100644 --- a/src/qt/optionsdialog.cpp +++ b/src/qt/optionsdialog.cpp @@ -30,9 +30,13 @@ public: void setMapper(MonitoredDataMapper *mapper); private: QCheckBox *bitcoin_at_startup; +#ifndef Q_WS_MAC QCheckBox *minimize_to_tray; +#endif QCheckBox *map_port_upnp; +#ifndef Q_WS_MAC QCheckBox *minimize_on_close; +#endif QCheckBox *connect_socks4; QLineEdit *proxy_ip; QLineEdit *proxy_port; @@ -167,17 +171,21 @@ MainOptionsPage::MainOptionsPage(QWidget *parent): bitcoin_at_startup->setToolTip(tr("Automatically start Bitcoin after the computer is turned on")); layout->addWidget(bitcoin_at_startup); +#ifndef Q_WS_MAC minimize_to_tray = new QCheckBox(tr("&Minimize to the tray instead of the taskbar")); minimize_to_tray->setToolTip(tr("Show only a tray icon after minimizing the window")); layout->addWidget(minimize_to_tray); +#endif map_port_upnp = new QCheckBox(tr("Map port using &UPnP")); map_port_upnp->setToolTip(tr("Automatically open the Bitcoin client port on the router. This only works when your router supports UPnP and it is enabled.")); layout->addWidget(map_port_upnp); +#ifndef Q_WS_MAC minimize_on_close = new QCheckBox(tr("M&inimize on close")); minimize_on_close->setToolTip(tr("Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.")); layout->addWidget(minimize_on_close); +#endif connect_socks4 = new QCheckBox(tr("&Connect through SOCKS4 proxy:")); connect_socks4->setToolTip(tr("Connect to the Bitcon network through a SOCKS4 proxy (e.g. when connecting through Tor)")); @@ -239,9 +247,13 @@ void MainOptionsPage::setMapper(MonitoredDataMapper *mapper) { // Map model to widgets mapper->addMapping(bitcoin_at_startup, OptionsModel::StartAtStartup); +#ifndef Q_WS_MAC mapper->addMapping(minimize_to_tray, OptionsModel::MinimizeToTray); +#endif mapper->addMapping(map_port_upnp, OptionsModel::MapPortUPnP); +#ifndef Q_WS_MAC mapper->addMapping(minimize_on_close, OptionsModel::MinimizeOnClose); +#endif mapper->addMapping(connect_socks4, OptionsModel::ConnectSOCKS4); mapper->addMapping(proxy_ip, OptionsModel::ProxyIP); mapper->addMapping(proxy_port, OptionsModel::ProxyPort); -- cgit v1.2.3