Changeset View
Changeset View
Standalone View
Standalone View
src/qt/bitcoingui.cpp
Show First 20 Lines • Show All 643 Lines • ▼ Show 20 Lines | #ifndef Q_OS_MAC | ||||
trayIconMenu = new QMenu(this); | trayIconMenu = new QMenu(this); | ||||
trayIcon->setContextMenu(trayIconMenu); | trayIcon->setContextMenu(trayIconMenu); | ||||
connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), | connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), | ||||
this, SLOT(trayIconActivated(QSystemTrayIcon::ActivationReason))); | this, SLOT(trayIconActivated(QSystemTrayIcon::ActivationReason))); | ||||
#else | #else | ||||
// Note: On Mac, the dock icon is used to provide the tray's functionality. | // Note: On Mac, the dock icon is used to provide the tray's functionality. | ||||
MacDockIconHandler *dockIconHandler = MacDockIconHandler::instance(); | MacDockIconHandler *dockIconHandler = MacDockIconHandler::instance(); | ||||
dockIconHandler->setMainWindow((QMainWindow *)this); | dockIconHandler->setMainWindow(static_cast<QMainWindow *>(this)); | ||||
trayIconMenu = dockIconHandler->dockMenu(); | trayIconMenu = dockIconHandler->dockMenu(); | ||||
#endif | #endif | ||||
// Configuration of the tray icon (or dock icon) icon menu | // Configuration of the tray icon (or dock icon) icon menu | ||||
trayIconMenu->addAction(toggleHideAction); | trayIconMenu->addAction(toggleHideAction); | ||||
trayIconMenu->addSeparator(); | trayIconMenu->addSeparator(); | ||||
trayIconMenu->addAction(sendCoinsMenuAction); | trayIconMenu->addAction(sendCoinsMenuAction); | ||||
trayIconMenu->addAction(receiveCoinsMenuAction); | trayIconMenu->addAction(receiveCoinsMenuAction); | ||||
▲ Show 20 Lines • Show All 312 Lines • ▼ Show 20 Lines | void BitcoinGUI::message(const QString &title, const QString &message, | ||||
if (style & CClientUIInterface::MODAL) { | if (style & CClientUIInterface::MODAL) { | ||||
// Check for buttons, use OK as default, if none was supplied | // Check for buttons, use OK as default, if none was supplied | ||||
QMessageBox::StandardButton buttons; | QMessageBox::StandardButton buttons; | ||||
if (!(buttons = (QMessageBox::StandardButton)( | if (!(buttons = (QMessageBox::StandardButton)( | ||||
style & CClientUIInterface::BTN_MASK))) | style & CClientUIInterface::BTN_MASK))) | ||||
buttons = QMessageBox::Ok; | buttons = QMessageBox::Ok; | ||||
showNormalIfMinimized(); | showNormalIfMinimized(); | ||||
QMessageBox mBox((QMessageBox::Icon)nMBoxIcon, strTitle, message, | QMessageBox mBox(static_cast<QMessageBox::Icon>(nMBoxIcon), strTitle, | ||||
buttons, this); | message, buttons, this); | ||||
int r = mBox.exec(); | int r = mBox.exec(); | ||||
if (ret != nullptr) { | if (ret != nullptr) { | ||||
*ret = r == QMessageBox::Ok; | *ret = r == QMessageBox::Ok; | ||||
} | } | ||||
} else | } else | ||||
notificator->notify((Notificator::Class)nNotifyIcon, strTitle, message); | notificator->notify(static_cast<Notificator::Class>(nNotifyIcon), | ||||
strTitle, message); | |||||
} | } | ||||
void BitcoinGUI::changeEvent(QEvent *e) { | void BitcoinGUI::changeEvent(QEvent *e) { | ||||
QMainWindow::changeEvent(e); | QMainWindow::changeEvent(e); | ||||
#ifndef Q_OS_MAC // Ignored on Mac | #ifndef Q_OS_MAC // Ignored on Mac | ||||
if (e->type() == QEvent::WindowStateChange) { | if (e->type() == QEvent::WindowStateChange) { | ||||
if (clientModel && clientModel->getOptionsModel() && | if (clientModel && clientModel->getOptionsModel() && | ||||
clientModel->getOptionsModel()->getMinimizeToTray()) { | clientModel->getOptionsModel()->getMinimizeToTray()) { | ||||
▲ Show 20 Lines • Show All 338 Lines • Show Last 20 Lines |