summaryrefslogtreecommitdiffstats
path: root/gui/CustomMessageBox.cpp
diff options
context:
space:
mode:
authorSky <git@bunnies.cc>2013-10-29 12:40:09 +0000
committerSky <git@bunnies.cc>2013-10-29 12:40:09 +0000
commitb0ef429786bef64799d43f1ac502c139bbde8dc5 (patch)
treeb419161990d382edd0033b097880e044de4f75c7 /gui/CustomMessageBox.cpp
parente7e03c2b542b1cceda63628dd7ca6fa9c875cfd2 (diff)
downloadMultiMC-b0ef429786bef64799d43f1ac502c139bbde8dc5.tar
MultiMC-b0ef429786bef64799d43f1ac502c139bbde8dc5.tar.gz
MultiMC-b0ef429786bef64799d43f1ac502c139bbde8dc5.tar.lz
MultiMC-b0ef429786bef64799d43f1ac502c139bbde8dc5.tar.xz
MultiMC-b0ef429786bef64799d43f1ac502c139bbde8dc5.zip
Add selectable message box helper, use it, make login GUI error label selectable
Diffstat (limited to 'gui/CustomMessageBox.cpp')
-rw-r--r--gui/CustomMessageBox.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/gui/CustomMessageBox.cpp b/gui/CustomMessageBox.cpp
new file mode 100644
index 00000000..e55ebbbb
--- /dev/null
+++ b/gui/CustomMessageBox.cpp
@@ -0,0 +1,19 @@
+#include "CustomMessageBox.h"
+
+namespace CustomMessageBox
+{
+ QMessageBox *selectable(QWidget *parent, const QString &title, const QString &text,
+ QMessageBox::Icon icon, QMessageBox::StandardButtons buttons,
+ QMessageBox::StandardButton defaultButton)
+ {
+ QMessageBox *messageBox = new QMessageBox(parent);
+ messageBox->setWindowTitle(title);
+ messageBox->setText(text);
+ messageBox->setStandardButtons(buttons);
+ messageBox->setDefaultButton(defaultButton);
+ messageBox->setTextInteractionFlags(Qt::TextSelectableByMouse);
+ messageBox->setIcon(icon);
+
+ return messageBox;
+ }
+}