aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
Diffstat (limited to 'gui')
-rw-r--r--gui/launcher.cpp2
-rw-r--r--gui/message.cpp5
-rw-r--r--gui/message.h6
3 files changed, 10 insertions, 3 deletions
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index fde75f08b4..37db88cfa4 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -581,7 +581,7 @@ void LauncherDialog::addGame() {
void LauncherDialog::removeGame(int item) {
MessageDialog alert("Do you really want to remove this game configuration?", "Yes", "No");
- if (alert.runModal() > 0) {
+ if (alert.runModal() == GUI::kMessageOK) {
// Remove the currently selected game from the list
assert(item >= 0);
ConfMan.removeGameDomain(_domains[item]);
diff --git a/gui/message.cpp b/gui/message.cpp
index 206f145cdf..95b6ecfaf4 100644
--- a/gui/message.cpp
+++ b/gui/message.cpp
@@ -142,11 +142,12 @@ int MessageDialog::addLine(StringList &lines, const char *line, int size) {
}
void MessageDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
+ // FIXME: It's a really bad thing that we use two arbitrary constants
if (cmd == kOkCmd) {
- setResult(1);
+ setResult(kMessageOK);
close();
} else if (cmd == kCancelCmd) {
- setResult(2);
+ setResult(kMessageCancel);
close();
} else {
Dialog::handleCommand(sender, cmd, data);
diff --git a/gui/message.h b/gui/message.h
index 30a2c6bfa0..328eebf499 100644
--- a/gui/message.h
+++ b/gui/message.h
@@ -26,6 +26,12 @@
namespace GUI {
+enum {
+ kMessageOK = 1,
+ kMessageCancel = 0
+};
+
+
/**
* Simple message dialog ("alert box"): presents a text message in a dialog with up to two buttons.
*/