Add tooltips, make "amount" entry consistent in Options dialog

This commit is contained in:
Wladimir J. van der Laan
2011-06-11 12:46:09 +02:00
parent 4181184acf
commit 5e1feddcb6
7 changed files with 82 additions and 13 deletions

View File

@@ -75,10 +75,13 @@ BitcoinGUI::BitcoinGUI(QWidget *parent):
address = new QLineEdit();
address->setReadOnly(true);
address->setFont(GUIUtil::bitcoinAddressFont());
address->setToolTip(tr("Your current default receiving address"));
hbox_address->addWidget(address);
QPushButton *button_new = new QPushButton(tr("&New..."));
button_new->setToolTip(tr("Create new receiving address"));
QPushButton *button_clipboard = new QPushButton(tr("&Copy to clipboard"));
button_clipboard->setToolTip(tr("Copy current receiving address to the system clipboard"));
hbox_address->addWidget(button_new);
hbox_address->addWidget(button_clipboard);
@@ -89,6 +92,7 @@ BitcoinGUI::BitcoinGUI(QWidget *parent):
labelBalance = new QLabel();
labelBalance->setFont(QFont("Monospace"));
labelBalance->setToolTip(tr("Your current balance"));
hbox_balance->addWidget(labelBalance);
hbox_balance->addStretch(1);
@@ -108,15 +112,18 @@ BitcoinGUI::BitcoinGUI(QWidget *parent):
labelConnections = new QLabel();
labelConnections->setFrameStyle(QFrame::Panel | QFrame::Sunken);
labelConnections->setMinimumWidth(130);
labelConnections->setToolTip(tr("Number of connections to other clients"));
labelBlocks = new QLabel();
labelBlocks->setFrameStyle(QFrame::Panel | QFrame::Sunken);
labelBlocks->setMinimumWidth(130);
labelBlocks->setToolTip(tr("Number of blocks in the block chain"));
labelTransactions = new QLabel();
labelTransactions->setFrameStyle(QFrame::Panel | QFrame::Sunken);
labelTransactions->setMinimumWidth(130);
labelTransactions->setToolTip(tr("Number of transactions in your wallet"));
statusBar()->addPermanentWidget(labelConnections);
statusBar()->addPermanentWidget(labelBlocks);
statusBar()->addPermanentWidget(labelTransactions);
@@ -131,12 +138,19 @@ BitcoinGUI::BitcoinGUI(QWidget *parent):
void BitcoinGUI::createActions()
{
quit = new QAction(QIcon(":/icons/quit"), tr("&Exit"), this);
quit->setToolTip(tr("Quit application"));
sendcoins = new QAction(QIcon(":/icons/send"), tr("&Send coins"), this);
sendcoins->setToolTip(tr("Send coins to a bitcoin address"));
addressbook = new QAction(QIcon(":/icons/address-book"), tr("&Address Book"), this);
addressbook->setToolTip(tr("Edit the list of stored addresses and labels"));
about = new QAction(QIcon(":/icons/bitcoin"), tr("&About"), this);
about->setToolTip(tr("Show information about Bitcoin"));
receivingAddresses = new QAction(QIcon(":/icons/receiving-addresses"), tr("Your &Receiving Addresses..."), this);
receivingAddresses->setToolTip(tr("Show the list of receiving addresses and edit their labels"));
options = new QAction(QIcon(":/icons/options"), tr("&Options..."), this);
options->setToolTip(tr("Modify configuration options for bitcoin"));
openBitcoin = new QAction(QIcon(":/icons/bitcoin"), "Open &Bitcoin", this);
openBitcoin->setToolTip(tr("Show the Bitcoin window"));
connect(quit, SIGNAL(triggered()), qApp, SLOT(quit()));
connect(sendcoins, SIGNAL(triggered()), this, SLOT(sendcoinsClicked()));

View File

@@ -33,5 +33,6 @@ void GUIUtil::setupAmountWidget(QLineEdit *widget, QWidget *parent)
amountValidator->setDecimals(8);
amountValidator->setBottom(0.0);
widget->setValidator(amountValidator);
widget->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
}

View File

@@ -1,6 +1,7 @@
#include "optionsdialog.h"
#include "optionsmodel.h"
#include "monitoreddatamapper.h"
#include "guiutil.h"
#include <QHBoxLayout>
#include <QVBoxLayout>
@@ -144,18 +145,23 @@ MainOptionsPage::MainOptionsPage(QWidget *parent):
QVBoxLayout *layout = new QVBoxLayout();
bitcoin_at_startup = new QCheckBox(tr("&Start Bitcoin on window system startup"));
bitcoin_at_startup->setToolTip(tr("Automatically start Bitcoin after the computer is turned on"));
layout->addWidget(bitcoin_at_startup);
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);
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);
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);
connect_socks4 = new QCheckBox(tr("&Connect through socks4 proxy:"));
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)"));
layout->addWidget(connect_socks4);
QHBoxLayout *proxy_hbox = new QHBoxLayout();
@@ -166,6 +172,7 @@ MainOptionsPage::MainOptionsPage(QWidget *parent):
proxy_ip->setMaximumWidth(140);
proxy_ip->setEnabled(false);
proxy_ip->setValidator(new QRegExpValidator(QRegExp("[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}"), this));
proxy_ip->setToolTip(tr("IP address of the proxy (e.g. 127.0.0.1)"));
proxy_ip_label->setBuddy(proxy_ip);
proxy_hbox->addWidget(proxy_ip);
QLabel *proxy_port_label = new QLabel(tr("&Port: "));
@@ -174,6 +181,7 @@ MainOptionsPage::MainOptionsPage(QWidget *parent):
proxy_port->setMaximumWidth(55);
proxy_port->setValidator(new QIntValidator(0, 65535, this));
proxy_port->setEnabled(false);
proxy_port->setToolTip(tr("Port of the proxy (e.g. 1234)"));
proxy_port_label->setBuddy(proxy_port);
proxy_hbox->addWidget(proxy_port);
proxy_hbox->addStretch(1);
@@ -188,12 +196,10 @@ MainOptionsPage::MainOptionsPage(QWidget *parent):
QLabel *fee_label = new QLabel(tr("Pay transaction &fee"));
fee_hbox->addWidget(fee_label);
fee_edit = new QLineEdit();
fee_edit->setMaximumWidth(70);
fee_edit->setMaximumWidth(100);
fee_edit->setToolTip(tr("Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended."));
QDoubleValidator *amountValidator = new QDoubleValidator(this);
amountValidator->setDecimals(8);
amountValidator->setBottom(0.0);
fee_edit->setValidator(amountValidator);
GUIUtil::setupAmountWidget(fee_edit, this);
fee_label->setBuddy(fee_edit);
fee_hbox->addWidget(fee_edit);