diff options
author | Thierry Crozat | 2018-05-28 20:55:00 +0100 |
---|---|---|
committer | Thierry Crozat | 2018-05-28 20:55:00 +0100 |
commit | 44bc04e0d94d2cca2c575a05c8be298bf686c371 (patch) | |
tree | f3008cb713b3bda4f9a680ecd9fa127a930aab81 | |
parent | fed0dbf40f3bc877bf81269479f7e1f1138bbed3 (diff) | |
download | scummvm-rg350-44bc04e0d94d2cca2c575a05c8be298bf686c371.tar.gz scummvm-rg350-44bc04e0d94d2cca2c575a05c8be298bf686c371.tar.bz2 scummvm-rg350-44bc04e0d94d2cca2c575a05c8be298bf686c371.zip |
GUI: Move UnknownGameDialog to gui
-rw-r--r-- | engines/module.mk | 3 | ||||
-rw-r--r-- | gui/launcher.cpp | 2 | ||||
-rw-r--r-- | gui/module.mk | 1 | ||||
-rw-r--r-- | gui/unknown-game-dialog.cpp (renamed from engines/unknown-game-dialog.cpp) | 18 | ||||
-rw-r--r-- | gui/unknown-game-dialog.h (renamed from engines/unknown-game-dialog.h) | 13 | ||||
-rw-r--r-- | po/POTFILES | 2 |
6 files changed, 26 insertions, 13 deletions
diff --git a/engines/module.mk b/engines/module.mk index 6c05921c28..7849c2ff25 100644 --- a/engines/module.mk +++ b/engines/module.mk @@ -6,8 +6,7 @@ MODULE_OBJS := \ engine.o \ game.o \ obsolete.o \ - savestate.o \ - unknown-game-dialog.o + savestate.o # Include common rules include $(srcdir)/rules.mk diff --git a/gui/launcher.cpp b/gui/launcher.cpp index 7a37a7d3be..214dc30834 100644 --- a/gui/launcher.cpp +++ b/gui/launcher.cpp @@ -45,7 +45,7 @@ #include "gui/EventRecorder.h" #endif #include "gui/saveload.h" -#include "engines/unknown-game-dialog.h" +#include "gui/unknown-game-dialog.h" #include "gui/widgets/edittext.h" #include "gui/widgets/list.h" #include "gui/widgets/tab.h" diff --git a/gui/module.mk b/gui/module.mk index eb3ee88a9a..0218e082b4 100644 --- a/gui/module.mk +++ b/gui/module.mk @@ -25,6 +25,7 @@ MODULE_OBJS := \ ThemeLayout.o \ ThemeParser.o \ Tooltip.o \ + unknown-game-dialog.o \ animation/Animation.o \ animation/RepeatAnimationWrapper.o \ animation/SequenceAnimationComposite.o \ diff --git a/engines/unknown-game-dialog.cpp b/gui/unknown-game-dialog.cpp index 1b7dd73a92..01526d21ea 100644 --- a/engines/unknown-game-dialog.cpp +++ b/gui/unknown-game-dialog.cpp @@ -20,7 +20,7 @@ * */ -#include "engines/unknown-game-dialog.h" +#include "gui/unknown-game-dialog.h" #include "common/translation.h" #include "common/str-array.h" @@ -31,6 +31,8 @@ #include "gui/ThemeEval.h" #include "gui/widgets/popup.h" +namespace GUI { + enum { kCopyToClipboard = 'cpcl', kOpenBugtrackerURL = 'ourl', @@ -81,12 +83,12 @@ UnknownGameDialog::UnknownGameDialog(const DetectionResults &detectionResults) : _w = MAX(MAX(maxlineWidth, 0), totalButtonWidth) + 20; int buttonPos = _w - closeButtonWidth - 10; - new GUI::ButtonWidget(this, buttonPos, _h - buttonHeight - 8, buttonWidth, buttonHeight, _("Close"), 0, kClose); + new ButtonWidget(this, buttonPos, _h - buttonHeight - 8, buttonWidth, buttonHeight, _("Close"), 0, kClose); // Check if we have clipboard functionality if (g_system->hasFeature(OSystem::kFeatureClipboardSupport)) { buttonPos -= copyToClipboardButtonWidth + 5; - new GUI::ButtonWidget(this, buttonPos, _h - buttonHeight - 8, copyToClipboardButtonWidth, buttonHeight, _("Copy to clipboard"), 0, kCopyToClipboard); + new ButtonWidget(this, buttonPos, _h - buttonHeight - 8, copyToClipboardButtonWidth, buttonHeight, _("Copy to clipboard"), 0, kCopyToClipboard); } #if 0 @@ -100,7 +102,7 @@ UnknownGameDialog::UnknownGameDialog(const DetectionResults &detectionResults) : // Check if we have support for opening URLs if (g_system->hasFeature(OSystem::kFeatureOpenUrl)) { buttonPos -= openBugtrackerURLButtonWidth + 5; - new GUI::ButtonWidget(this, buttonPos, _h - buttonHeight - 8, openBugtrackerURLButtonWidth, buttonHeight, _("Report game"), 0, kOpenBugtrackerURL); + new ButtonWidget(this, buttonPos, _h - buttonHeight - 8, openBugtrackerURLButtonWidth, buttonHeight, _("Report game"), 0, kOpenBugtrackerURL); } #endif @@ -108,7 +110,7 @@ UnknownGameDialog::UnknownGameDialog(const DetectionResults &detectionResults) : // TODO: Use a ScrollContainer widget instead of truncated text. uint y = 10; for (uint i = 0; i < lines.size(); i++) { - new GUI::StaticTextWidget(this, 10, y, _w, kLineHeight, lines[i], Graphics::kTextAlignLeft); + new StaticTextWidget(this, 10, y, _w, kLineHeight, lines[i], Graphics::kTextAlignLeft); y += kLineHeight; } } @@ -116,7 +118,7 @@ UnknownGameDialog::UnknownGameDialog(const DetectionResults &detectionResults) : void UnknownGameDialog::reflowLayout() { _x = (g_system->getOverlayWidth() - _w) / 2; _y = (g_system->getOverlayHeight() - _h) / 2; - GUI::Dialog::reflowLayout(); + Dialog::reflowLayout(); } Common::String UnknownGameDialog::generateBugtrackerURL() { @@ -136,7 +138,7 @@ Common::String UnknownGameDialog::generateBugtrackerURL() { report.c_str()); } -void UnknownGameDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) { +void UnknownGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) { switch(cmd) { case kCopyToClipboard: { // TODO: Remove the filesystem path from the report @@ -160,3 +162,5 @@ void UnknownGameDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, ui break; } } + +} // End of namespace GUI diff --git a/engines/unknown-game-dialog.h b/gui/unknown-game-dialog.h index 0878406244..f7f9d5c118 100644 --- a/engines/unknown-game-dialog.h +++ b/gui/unknown-game-dialog.h @@ -20,11 +20,16 @@ * */ +#ifndef GUI_UNKNOWN_GAME_DIALOG_H +#define GUI_UNKNOWN_GAME_DIALOG_H + #include "gui/dialog.h" -#include "engines/metaengine.h" +#include "engines/game.h" + +namespace GUI { -class UnknownGameDialog : public GUI::Dialog { +class UnknownGameDialog : public Dialog { public: UnknownGameDialog(const DetectionResults &detectionResults); @@ -37,3 +42,7 @@ private: const DetectionResults &_detectionResults; }; + +} // End of namespace GUI + +#endif diff --git a/po/POTFILES b/po/POTFILES index 451db749a3..dc427a2fe6 100644 --- a/po/POTFILES +++ b/po/POTFILES @@ -23,6 +23,7 @@ gui/saveload-dialog.cpp gui/storagewizarddialog.cpp gui/themebrowser.cpp gui/ThemeEngine.cpp +gui/unknown-game-dialog.cpp gui/updates-dialog.cpp gui/widget.cpp @@ -35,7 +36,6 @@ common/updates.cpp engines/advancedDetector.cpp engines/dialogs.cpp engines/engine.cpp -engines/unknown-game-dialog.cpp audio/adlib.cpp audio/fmopl.cpp |