[Scummvm-git-logs] scummvm master -> 581b4ca5947ced7c8db62147eafc54694d4a4f31
sev-
sev at scummvm.org
Wed Aug 26 17:20:41 UTC 2020
This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
27ea5239b4 GUI: Introduced MessageDialogWithURL()
1302adc796 ENGINES: Added GUIErrorMessageWithURL()
8dd0eaa6b3 DRAGONS: Use GUIErrorMessageWithURL() for referring to our Wiki
581b4ca594 CONFIGURE: Do not enable Sparkle in release mode on platforms without it. Fixes #11217
Commit: 27ea5239b4738379ec18137b7c479d5a2e112ca7
https://github.com/scummvm/scummvm/commit/27ea5239b4738379ec18137b7c479d5a2e112ca7
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-08-26T17:28:12+02:00
Commit Message:
GUI: Introduced MessageDialogWithURL()
Changed paths:
gui/message.cpp
gui/message.h
po/POTFILES
diff --git a/gui/message.cpp b/gui/message.cpp
index 471ca8eb5e..e91ccf268f 100644
--- a/gui/message.cpp
+++ b/gui/message.cpp
@@ -22,6 +22,7 @@
#include "common/str.h"
#include "common/system.h"
+#include "common/translation.h"
#include "gui/message.h"
#include "gui/gui-manager.h"
#include "gui/ThemeEval.h"
@@ -38,9 +39,11 @@ enum {
// TODO: The default button should be visibly distinct from the alternate button
-MessageDialog::MessageDialog(const Common::String &message, const char *defaultButton, const char *altButton, Graphics::TextAlign alignment)
+MessageDialog::MessageDialog(const Common::String &message, const char *defaultButton, const char *altButton, Graphics::TextAlign alignment, const char *url)
: Dialog(30, 20, 260, 124) {
+ _url = url;
+
const int screenW = g_system->getOverlayWidth();
const int screenH = g_system->getOverlayHeight();
@@ -103,7 +106,14 @@ void MessageDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data
setResult(kMessageOK);
close();
} else if (cmd == kCancelCmd) {
- setResult(kMessageCancel);
+ if (_url) {
+ if (g_system->hasFeature(OSystem::kFeatureOpenUrl))
+ g_system->openUrl(_url);
+
+ setResult(kMessageOK);
+ } else {
+ setResult(kMessageCancel);
+ }
close();
} else {
Dialog::handleCommand(sender, cmd, data);
@@ -121,4 +131,9 @@ void TimedMessageDialog::handleTickle() {
close();
}
+MessageDialogWithURL::MessageDialogWithURL(const Common::String &message, const char *url, const char *defaultButton, Graphics::TextAlign alignment)
+ : MessageDialog(message, defaultButton, _s("Open URL"), alignment, url) {
+}
+
+
} // End of namespace GUI
diff --git a/gui/message.h b/gui/message.h
index 0a311575a3..327445e5f2 100644
--- a/gui/message.h
+++ b/gui/message.h
@@ -41,9 +41,12 @@ enum {
*/
class MessageDialog : public Dialog {
public:
- MessageDialog(const Common::String &message, const char *defaultButton = "OK", const char *altButton = nullptr, Graphics::TextAlign alignment = Graphics::kTextAlignCenter);
+ MessageDialog(const Common::String &message, const char *defaultButton = "OK", const char *altButton = nullptr, Graphics::TextAlign alignment = Graphics::kTextAlignCenter, const char *url = nullptr);
void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
+
+private:
+ const char *_url;
};
/**
@@ -59,6 +62,16 @@ protected:
uint32 _timer;
};
+/**
+ * Message dialog with button to open a specified URL
+ */
+class MessageDialogWithURL : public MessageDialog {
+public:
+ MessageDialogWithURL(const Common::String &message, const char *url, const char *defaultButton = "OK", Graphics::TextAlign alignment = Graphics::kTextAlignCenter);
+};
+
+
+
} // End of namespace GUI
#endif
diff --git a/po/POTFILES b/po/POTFILES
index fcb2c0caa6..bce85d277f 100644
--- a/po/POTFILES
+++ b/po/POTFILES
@@ -13,6 +13,7 @@ gui/KeysDialog.cpp
gui/KeysDialog.h
gui/launcher.cpp
gui/massadd.cpp
+gui/message.cpp
gui/onscreendialog.cpp
gui/options.cpp
gui/predictivedialog.cpp
Commit: 1302adc7961b9fb93077da7dedbd7dac864cdb1a
https://github.com/scummvm/scummvm/commit/1302adc7961b9fb93077da7dedbd7dac864cdb1a
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-08-26T17:28:13+02:00
Commit Message:
ENGINES: Added GUIErrorMessageWithURL()
Changed paths:
engines/engine.cpp
engines/engine.h
diff --git a/engines/engine.cpp b/engines/engine.cpp
index be24f0b83a..ba0a223625 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -394,14 +394,23 @@ void initGraphics(int width, int height) {
initGraphics(width, height, &format);
}
-void GUIErrorMessage(const Common::String &msg) {
+void GUIErrorMessageWithURL(const Common::String &msg, const char *url) {
+ GUIErrorMessage(msg, url);
+}
+
+void GUIErrorMessage(const Common::String &msg, const char *url) {
g_system->setWindowCaption("Error");
g_system->beginGFXTransaction();
initCommonGFX();
g_system->initSize(320, 200);
if (g_system->endGFXTransaction() == OSystem::kTransactionSuccess) {
- GUI::MessageDialog dialog(msg);
- dialog.runModal();
+ if (url) {
+ GUI::MessageDialogWithURL dialog(msg, url);
+ dialog.runModal();
+ } else {
+ GUI::MessageDialog dialog(msg);
+ dialog.runModal();
+ }
} else {
error("%s", msg.c_str());
}
diff --git a/engines/engine.h b/engines/engine.h
index e7cf444d88..babbf69ba8 100644
--- a/engines/engine.h
+++ b/engines/engine.h
@@ -53,7 +53,8 @@ class Dialog;
/**
* Initializes graphics and shows error message.
*/
-void GUIErrorMessage(const Common::String &msg);
+void GUIErrorMessage(const Common::String &msg, const char *url = nullptr);
+void GUIErrorMessageWithURL(const Common::String &msg, const char *url);
void GUIErrorMessageFormat(const char *fmt, ...) GCC_PRINTF(1, 2);
class Engine;
Commit: 8dd0eaa6b3500b887939476cefb0edb3e4c35b3f
https://github.com/scummvm/scummvm/commit/8dd0eaa6b3500b887939476cefb0edb3e4c35b3f
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-08-26T17:28:13+02:00
Commit Message:
DRAGONS: Use GUIErrorMessageWithURL() for referring to our Wiki
Changed paths:
engines/dragons/dragons.cpp
diff --git a/engines/dragons/dragons.cpp b/engines/dragons/dragons.cpp
index fe254dcdcc..b7abbef5e5 100644
--- a/engines/dragons/dragons.cpp
+++ b/engines/dragons/dragons.cpp
@@ -1780,7 +1780,8 @@ bool DragonsEngine::validateAVFile(const char *filename) {
file.close();
if(!fileValid) {
- GUIErrorMessage(Common::String::format(_("Error: The file '%s' hasn't been extracted properly.\nPlease refer to the wiki page\nhttps://wiki.scummvm.org/index.php?title=HOWTO-PlayStation_Videos for details on how to properly extract the DTSPEECH.XA and *.STR files from your game disc."), filename));
+ GUIErrorMessageWithURL(Common::String::format(_("Error: The file '%s' hasn't been extracted properly.\nPlease refer to the wiki page\nhttps://wiki.scummvm.org/index.php?title=HOWTO-PlayStation_Videos for details on how to properly extract the DTSPEECH.XA and *.STR files from your game disc."), filename),
+ "https://wiki.scummvm.org/index.php?title=HOWTO-PlayStation_Videos");
}
return fileValid;
}
Commit: 581b4ca5947ced7c8db62147eafc54694d4a4f31
https://github.com/scummvm/scummvm/commit/581b4ca5947ced7c8db62147eafc54694d4a4f31
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-08-26T19:19:28+02:00
Commit Message:
CONFIGURE: Do not enable Sparkle in release mode on platforms without it. Fixes #11217
Changed paths:
configure
diff --git a/configure b/configure
index f9447dc52d..dbcc223286 100755
--- a/configure
+++ b/configure
@@ -1463,7 +1463,7 @@ for ac_option in $@; do
--enable-release)
_release_build=yes
_optimizations=yes
- _updates=yes
+ _updates=auto
;;
--disable-release)
_release_build=no
More information about the Scummvm-git-logs
mailing list