diff --git a/src/debugger/gui/DebuggerDialog.cxx b/src/debugger/gui/DebuggerDialog.cxx index c1a183f32..f7772e83a 100644 --- a/src/debugger/gui/DebuggerDialog.cxx +++ b/src/debugger/gui/DebuggerDialog.cxx @@ -157,9 +157,9 @@ void DebuggerDialog::showFatalMessage(const string& msg) delete myFatalError; myFatalError = - new MessageBox(this, instance().consoleFont(), msg, - r.width(), r.height(), kDDExitFatalCmd, - "Exit ROM", "Continue"); + new GUI::MessageBox(this, instance().consoleFont(), msg, + r.width(), r.height(), kDDExitFatalCmd, + "Exit ROM", "Continue"); myFatalError->show(); } diff --git a/src/debugger/gui/DebuggerDialog.hxx b/src/debugger/gui/DebuggerDialog.hxx index d0a029a8d..c3a536a98 100644 --- a/src/debugger/gui/DebuggerDialog.hxx +++ b/src/debugger/gui/DebuggerDialog.hxx @@ -36,9 +36,9 @@ class EditTextWidget; class TiaInfoWidget; class TiaOutputWidget; class TiaZoomWidget; -class MessageBox; #include "Dialog.hxx" +#include "MessageBox.hxx" class DebuggerDialog : public Dialog { @@ -83,7 +83,7 @@ class DebuggerDialog : public Dialog RomWidget* myRom; EditTextWidget* myMessageBox; ButtonWidget* myRewindButton; - MessageBox* myFatalError; + GUI::MessageBox* myFatalError; private: void addTiaArea(); diff --git a/src/gui/LauncherDialog.cxx b/src/gui/LauncherDialog.cxx index 4589278b5..49fbb1cb2 100644 --- a/src/gui/LauncherDialog.cxx +++ b/src/gui/LauncherDialog.cxx @@ -251,8 +251,8 @@ void LauncherDialog::loadConfig() msg.push_back(""); msg.push_back("Click 'OK' to select a default ROM directory,"); msg.push_back("or 'Cancel' to browse the filesystem manually."); - myFirstRunMsg = new MessageBox(this, instance().font(), msg, - _w, _h, kFirstRunMsgChosenCmd); + myFirstRunMsg = new GUI::MessageBox(this, instance().font(), msg, + _w, _h, kFirstRunMsgChosenCmd); } myFirstRunMsg->show(); } diff --git a/src/gui/LauncherDialog.hxx b/src/gui/LauncherDialog.hxx index 064c103a6..90a1d35f1 100644 --- a/src/gui/LauncherDialog.hxx +++ b/src/gui/LauncherDialog.hxx @@ -34,7 +34,6 @@ class BrowserDialog; class OptionsDialog; class GlobalPropsDialog; class LauncherFilterDialog; -class MessageBox; class OSystem; class Properties; class EditTextWidget; @@ -46,6 +45,7 @@ class StringListWidget; #include "FSNode.hxx" #include "StringList.hxx" #include "Stack.hxx" +#include "MessageBox.hxx" // These must be accessible from dialogs created by this class enum { @@ -118,8 +118,8 @@ class LauncherDialog : public Dialog GlobalPropsDialog* myGlobalProps; LauncherFilterDialog* myFilters; - MessageBox* myFirstRunMsg; - BrowserDialog* myRomDir; + GUI::MessageBox* myFirstRunMsg; + BrowserDialog* myRomDir; int mySelectedItem; int myRomInfoSize; diff --git a/src/gui/MessageBox.cxx b/src/gui/MessageBox.cxx index 6d3aed290..98df7ecd3 100644 --- a/src/gui/MessageBox.cxx +++ b/src/gui/MessageBox.cxx @@ -25,6 +25,8 @@ #include "MessageBox.hxx" +namespace GUI { + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - MessageBox::MessageBox(GuiObject* boss, const GUI::Font& font, const StringList& text, int max_w, int max_h, int cmd, @@ -107,3 +109,5 @@ void MessageBox::handleCommand(CommandSender* sender, int cmd, int data, int id) break; } } + +} // namespace GUI diff --git a/src/gui/MessageBox.hxx b/src/gui/MessageBox.hxx index c4a078728..89f4759ae 100644 --- a/src/gui/MessageBox.hxx +++ b/src/gui/MessageBox.hxx @@ -27,6 +27,8 @@ class StaticTextWidget; #include "Command.hxx" #include "DialogContainer.hxx" +namespace GUI { + /** * Show a simple message box containing the given text, with buttons * prompting the user to accept or reject. If the user selects 'OK', @@ -54,4 +56,6 @@ class MessageBox : public Dialog, public CommandSender int myCmd; }; +} // namespace GUI + #endif diff --git a/src/gui/Rect.hxx b/src/gui/Rect.hxx index 05dd63df7..7b4ce3771 100644 --- a/src/gui/Rect.hxx +++ b/src/gui/Rect.hxx @@ -166,6 +166,6 @@ struct Rect } }; -} // End of namespace Common +} // End of namespace GUI #endif diff --git a/src/gui/RomAuditDialog.cxx b/src/gui/RomAuditDialog.cxx index b9c32f224..397db3abe 100644 --- a/src/gui/RomAuditDialog.cxx +++ b/src/gui/RomAuditDialog.cxx @@ -190,8 +190,9 @@ void RomAuditDialog::handleCommand(CommandSender* sender, int cmd, msg.push_back("If you're sure you want to proceed with the"); msg.push_back("audit, click 'OK', otherwise click 'Cancel'."); myConfirmMsg = - new MessageBox(this, instance().font(), msg, myMaxWidth, myMaxHeight, - kConfirmAuditCmd); + new GUI::MessageBox(this, instance().font(), msg, + myMaxWidth, myMaxHeight, + kConfirmAuditCmd); } myConfirmMsg->show(); break; diff --git a/src/gui/RomAuditDialog.hxx b/src/gui/RomAuditDialog.hxx index 942f161a7..6ea68b3bb 100644 --- a/src/gui/RomAuditDialog.hxx +++ b/src/gui/RomAuditDialog.hxx @@ -29,11 +29,11 @@ class DialogContainer; class BrowserDialog; class EditTextWidget; class StaticTextWidget; -class MessageBox; #include "Dialog.hxx" #include "Command.hxx" #include "FSNode.hxx" +#include "MessageBox.hxx" class RomAuditDialog : public Dialog { @@ -68,7 +68,7 @@ class RomAuditDialog : public Dialog BrowserDialog* myBrowser; // Show a message about the dangers of using this function - MessageBox* myConfirmMsg; + GUI::MessageBox* myConfirmMsg; // Maximum width and height for this dialog int myMaxWidth, myMaxHeight;