Changeset View
Changeset View
Standalone View
Standalone View
src/qt/bitcoingui.cpp
Show First 20 Lines • Show All 103 Lines • ▼ Show 20 Lines | #ifdef ENABLE_WALLET | ||||
} else | } else | ||||
#endif // ENABLE_WALLET | #endif // ENABLE_WALLET | ||||
{ | { | ||||
/** | /** | ||||
* When compiled without wallet or -disablewallet is provided, the | * When compiled without wallet or -disablewallet is provided, the | ||||
* central widget is the rpc console. | * central widget is the rpc console. | ||||
*/ | */ | ||||
setCentralWidget(rpcConsole); | setCentralWidget(rpcConsole); | ||||
Q_EMIT consoleShown(rpcConsole); | |||||
} | } | ||||
// Accept D&D of URIs | // Accept D&D of URIs | ||||
setAcceptDrops(true); | setAcceptDrops(true); | ||||
// Create actions for the toolbar, menu bar and tray/dock icon | // Create actions for the toolbar, menu bar and tray/dock icon | ||||
// Needs walletFrame to be initialized | // Needs walletFrame to be initialized | ||||
createActions(); | createActions(); | ||||
▲ Show 20 Lines • Show All 254 Lines • ▼ Show 20 Lines | #endif // ENABLE_WALLET | ||||
openRPCConsoleAction = | openRPCConsoleAction = | ||||
new QAction(platformStyle->TextColorIcon(":/icons/debugwindow"), | new QAction(platformStyle->TextColorIcon(":/icons/debugwindow"), | ||||
tr("&Debug window"), this); | tr("&Debug window"), this); | ||||
openRPCConsoleAction->setStatusTip( | openRPCConsoleAction->setStatusTip( | ||||
tr("Open debugging and diagnostic console")); | tr("Open debugging and diagnostic console")); | ||||
// initially disable the debug window menu item | // initially disable the debug window menu item | ||||
openRPCConsoleAction->setEnabled(false); | openRPCConsoleAction->setEnabled(false); | ||||
openRPCConsoleAction->setObjectName("openRPCConsoleAction"); | |||||
usedSendingAddressesAction = | usedSendingAddressesAction = | ||||
new QAction(platformStyle->TextColorIcon(":/icons/address-book"), | new QAction(platformStyle->TextColorIcon(":/icons/address-book"), | ||||
tr("&Sending addresses..."), this); | tr("&Sending addresses..."), this); | ||||
usedSendingAddressesAction->setStatusTip( | usedSendingAddressesAction->setStatusTip( | ||||
tr("Show the list of used sending addresses and labels")); | tr("Show the list of used sending addresses and labels")); | ||||
usedReceivingAddressesAction = | usedReceivingAddressesAction = | ||||
new QAction(platformStyle->TextColorIcon(":/icons/address-book"), | new QAction(platformStyle->TextColorIcon(":/icons/address-book"), | ||||
▲ Show 20 Lines • Show All 284 Lines • ▼ Show 20 Lines | void BitcoinGUI::setWalletActionsEnabled(bool enabled) { | ||||
usedReceivingAddressesAction->setEnabled(enabled); | usedReceivingAddressesAction->setEnabled(enabled); | ||||
openAction->setEnabled(enabled); | openAction->setEnabled(enabled); | ||||
} | } | ||||
void BitcoinGUI::createTrayIcon(const NetworkStyle *networkStyle) { | void BitcoinGUI::createTrayIcon(const NetworkStyle *networkStyle) { | ||||
assert(QSystemTrayIcon::isSystemTrayAvailable()); | assert(QSystemTrayIcon::isSystemTrayAvailable()); | ||||
#ifndef Q_OS_MAC | #ifndef Q_OS_MAC | ||||
trayIcon = new QSystemTrayIcon(networkStyle->getTrayAndWindowIcon(), this); | if (QSystemTrayIcon::isSystemTrayAvailable()) { | ||||
trayIcon = | |||||
new QSystemTrayIcon(networkStyle->getTrayAndWindowIcon(), this); | |||||
QString toolTip = tr("%1 client").arg(tr(PACKAGE_NAME)) + " " + | QString toolTip = tr("%1 client").arg(tr(PACKAGE_NAME)) + " " + | ||||
networkStyle->getTitleAddText(); | networkStyle->getTitleAddText(); | ||||
trayIcon->setToolTip(toolTip); | trayIcon->setToolTip(toolTip); | ||||
} | |||||
#endif | #endif | ||||
} | } | ||||
void BitcoinGUI::createTrayIconMenu() { | void BitcoinGUI::createTrayIconMenu() { | ||||
#ifndef Q_OS_MAC | #ifndef Q_OS_MAC | ||||
// Return if trayIcon is unset (only on non-macOSes) | // Return if trayIcon is unset (only on non-macOSes) | ||||
if (!trayIcon) { | if (!trayIcon) { | ||||
return; | return; | ||||
▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | void BitcoinGUI::aboutClicked() { | ||||
if (!clientModel) return; | if (!clientModel) return; | ||||
HelpMessageDialog dlg(m_node, this, true); | HelpMessageDialog dlg(m_node, this, true); | ||||
dlg.exec(); | dlg.exec(); | ||||
} | } | ||||
void BitcoinGUI::showDebugWindow() { | void BitcoinGUI::showDebugWindow() { | ||||
GUIUtil::bringToFront(rpcConsole); | GUIUtil::bringToFront(rpcConsole); | ||||
Q_EMIT consoleShown(rpcConsole); | |||||
} | } | ||||
void BitcoinGUI::showDebugWindowActivateConsole() { | void BitcoinGUI::showDebugWindowActivateConsole() { | ||||
rpcConsole->setTabFocus(RPCConsole::TAB_CONSOLE); | rpcConsole->setTabFocus(RPCConsole::TAB_CONSOLE); | ||||
showDebugWindow(); | showDebugWindow(); | ||||
} | } | ||||
void BitcoinGUI::showHelpMessageClicked() { | void BitcoinGUI::showHelpMessageClicked() { | ||||
▲ Show 20 Lines • Show All 649 Lines • Show Last 20 Lines |