GUI: Move UnknownGameDialog to gui
This commit is contained in:
parent
fed0dbf40f
commit
44bc04e0d9
6 changed files with 26 additions and 13 deletions
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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 \
|
||||
|
|
|
@ -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
|
|
@ -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"
|
||||
|
||||
class UnknownGameDialog : public GUI::Dialog {
|
||||
namespace GUI {
|
||||
|
||||
class UnknownGameDialog : public Dialog {
|
||||
public:
|
||||
UnknownGameDialog(const DetectionResults &detectionResults);
|
||||
|
||||
|
@ -37,3 +42,7 @@ private:
|
|||
|
||||
const DetectionResults &_detectionResults;
|
||||
};
|
||||
|
||||
} // End of namespace GUI
|
||||
|
||||
#endif
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue