aboutsummaryrefslogtreecommitdiff
path: root/src/ui_interface.h
diff options
context:
space:
mode:
authorPhilip Kaufmann <phil.kaufmann@t-online.de>2012-11-05 08:04:21 +0100
committerPhilip Kaufmann <phil.kaufmann@t-online.de>2012-11-26 13:32:31 +0100
commit5350ea4171be69d16a94e6f40c5e7fa41e00ac13 (patch)
tree26a9051543b64ff568c8f880c2ac75753af4870a /src/ui_interface.h
parent3ed1ccb0898b22353e9fcc942b43df98c9a3bf4c (diff)
downloadbitcoin-5350ea4171be69d16a94e6f40c5e7fa41e00ac13.tar.xz
update CClientUIInterface and remove orphan Wx stuff
- fix ThreadSafeMessageBox always displays error icon - allow to specify MSG_ERROR / MSG_WARNING or MSG_INFORMATION without a custom caption / title - allow to specify CClientUIInterface::ICON_ERROR / ICON_WARNING and ICON_INFORMATION (which is default) as message box icon - remove CClientUIInterface::OK from ThreadSafeMessageBox-calls, as the OK button will be set as default, if none is specified - prepend "Bitcoin - " to used captions - rename BitcoinGUI::error() -> BitcoinGUI::message() and add function documentation - change all style parameters and enum flags to unsigned - update code to use that new API - update Client- and WalletModel to use new BitcoinGUI::message() and rename the classes error() method into message() - include the possibility to supply the wanted icon for messages from Client- and WalletModel via "style" parameter
Diffstat (limited to 'src/ui_interface.h')
-rw-r--r--src/ui_interface.h66
1 files changed, 37 insertions, 29 deletions
diff --git a/src/ui_interface.h b/src/ui_interface.h
index 0f7fdef264..693411aa6d 100644
--- a/src/ui_interface.h
+++ b/src/ui_interface.h
@@ -29,38 +29,46 @@ public:
/** Flags for CClientUIInterface::ThreadSafeMessageBox */
enum MessageBoxFlags
{
- YES = 0x00000002,
- OK = 0x00000004,
- NO = 0x00000008,
- YES_NO = (YES|NO),
- CANCEL = 0x00000010,
- APPLY = 0x00000020,
- CLOSE = 0x00000040,
- OK_DEFAULT = 0x00000000,
- YES_DEFAULT = 0x00000000,
- NO_DEFAULT = 0x00000080,
- CANCEL_DEFAULT = 0x80000000,
- ICON_EXCLAMATION = 0x00000100,
- ICON_HAND = 0x00000200,
- ICON_WARNING = ICON_EXCLAMATION,
- ICON_ERROR = ICON_HAND,
- ICON_QUESTION = 0x00000400,
- ICON_INFORMATION = 0x00000800,
- ICON_STOP = ICON_HAND,
- ICON_ASTERISK = ICON_INFORMATION,
- ICON_MASK = (0x00000100|0x00000200|0x00000400|0x00000800),
- FORWARD = 0x00001000,
- BACKWARD = 0x00002000,
- RESET = 0x00004000,
- HELP = 0x00008000,
- MORE = 0x00010000,
- SETUP = 0x00020000,
- // Force blocking, modal message box dialog (not just OS notification)
- MODAL = 0x00040000
+ ICON_INFORMATION = 0,
+ ICON_WARNING = (1U << 0),
+ ICON_ERROR = (1U << 1),
+ /**
+ * Mask of all available icons in CClientUIInterface::MessageBoxFlags
+ * This needs to be updated, when icons are changed there!
+ */
+ ICON_MASK = (ICON_INFORMATION | ICON_WARNING | ICON_ERROR),
+
+ /** These values are taken from qmessagebox.h "enum StandardButton" to be directly usable */
+ BTN_OK = 0x00000400U, // QMessageBox::Ok
+ BTN_YES = 0x00004000U, // QMessageBox::Yes
+ BTN_NO = 0x00010000U, // QMessageBox::No
+ BTN_ABORT = 0x00040000U, // QMessageBox::Abort
+ BTN_RETRY = 0x00080000U, // QMessageBox::Retry
+ BTN_IGNORE = 0x00100000U, // QMessageBox::Ignore
+ BTN_CLOSE = 0x00200000U, // QMessageBox::Close
+ BTN_CANCEL = 0x00400000U, // QMessageBox::Cancel
+ BTN_DISCARD = 0x00800000U, // QMessageBox::Discard
+ BTN_HELP = 0x01000000U, // QMessageBox::Help
+ BTN_APPLY = 0x02000000U, // QMessageBox::Apply
+ BTN_RESET = 0x04000000U, // QMessageBox::Reset
+ /**
+ * Mask of all available buttons in CClientUIInterface::MessageBoxFlags
+ * This needs to be updated, when buttons are changed there!
+ */
+ BTN_MASK = (BTN_OK | BTN_YES | BTN_NO | BTN_ABORT | BTN_RETRY | BTN_IGNORE |
+ BTN_CLOSE | BTN_CANCEL | BTN_DISCARD | BTN_HELP | BTN_APPLY | BTN_RESET),
+
+ /** Force blocking, modal message box dialog (not just OS notification) */
+ MODAL = 0x10000000U,
+
+ /** Predefined combinations for certain default usage cases */
+ MSG_INFORMATION = (ICON_INFORMATION | BTN_OK),
+ MSG_WARNING = (ICON_WARNING | BTN_OK | MODAL),
+ MSG_ERROR = (ICON_ERROR | BTN_OK | MODAL)
};
/** Show message box. */
- boost::signals2::signal<void (const std::string& message, const std::string& caption, int style)> ThreadSafeMessageBox;
+ boost::signals2::signal<void (const std::string& message, const std::string& caption, unsigned int style)> ThreadSafeMessageBox;
/** Ask the user whether they want to pay a fee or not. */
boost::signals2::signal<bool (int64 nFeeRequired, const std::string& strCaption), boost::signals2::last_value<bool> > ThreadSafeAskFee;