[Scummvm-git-logs] scummvm master -> 8e86a72beaa6e2e8f7e732e8a2b36c80b8375d56
sev-
noreply at scummvm.org
Tue Apr 8 19:53:25 UTC 2025
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
8c7e8bf715 GUI: Implement GlobalOptionsDialog dumping in dumpAllDialogs
8e86a72bea AGOS: Fix missing include
Commit: 8c7e8bf7158c995b4f6ed6abeb5c12db4eb401f5
https://github.com/scummvm/scummvm/commit/8c7e8bf7158c995b4f6ed6abeb5c12db4eb401f5
Author: TusharGautam29 (tushar.gautam.23033 at iitgoa.ac.in)
Date: 2025-04-08T21:53:20+02:00
Commit Message:
GUI: Implement GlobalOptionsDialog dumping in dumpAllDialogs
Changed paths:
gui/dialog.cpp
gui/dialog.h
gui/dump-all-dialogs.cpp
gui/dump-all-dialogs.h
gui/launcher.cpp
gui/launcher.h
gui/widget.cpp
gui/widget.h
gui/widgets/tab.cpp
gui/widgets/tab.h
diff --git a/gui/dialog.cpp b/gui/dialog.cpp
index 7e8234ffcce..5f46bcd5952 100644
--- a/gui/dialog.cpp
+++ b/gui/dialog.cpp
@@ -405,6 +405,10 @@ Widget *Dialog::findWidget(const char *name) {
return Widget::findWidgetInChain(_firstWidget, name);
}
+Widget *Dialog::findWidget(uint32 type) {
+ return Widget::findWidgetInChain(_firstWidget, type);
+}
+
void Dialog::removeWidget(Widget *del) {
if (del == _mouseWidget || del->containsWidget(_mouseWidget))
_mouseWidget = nullptr;
diff --git a/gui/dialog.h b/gui/dialog.h
index 2a60987b829..2262857337e 100644
--- a/gui/dialog.h
+++ b/gui/dialog.h
@@ -95,6 +95,8 @@ public:
virtual void open();
virtual void close();
+ Widget *findWidget(uint32 type);
+
protected:
/** Recursively mark all the widgets in this dialog as dirty so they are redrawn */
void markWidgetsAsDirty();
diff --git a/gui/dump-all-dialogs.cpp b/gui/dump-all-dialogs.cpp
index 7799dbb5b5d..03007497b91 100644
--- a/gui/dump-all-dialogs.cpp
+++ b/gui/dump-all-dialogs.cpp
@@ -43,6 +43,8 @@
#include "gui/themebrowser.h"
#include "gui/massadd.h"
#include "gui/options.h"
+#include "gui/widgets/tab.h"
+#include "gui/launcher.h"
#include "image/png.h"
@@ -70,6 +72,22 @@ void handleSimpleDialog(GUI::Dialog &dialog, const Common::String &filename,Grap
dialog.close();
}
+void loopThroughTabs(GUI::Dialog &dialog, const Common::String &lang, Graphics::Surface surf, const Common::String name) {
+ dialog.open();
+ GUI::Widget *widget = nullptr;
+ widget = dialog.findWidget((uint32)kTabWidget);
+
+ if (widget) {
+ TabWidget *tabWidget = (TabWidget *)widget;
+ for (int tabNo = 0; tabNo < tabWidget->getTabCount(); tabNo++) {
+ Common::String suffix = Common::String::format("-%d-%dx%d-%s.png", tabNo + 1, g_system->getOverlayWidth(), g_system->getOverlayHeight(), lang.c_str());
+ tabWidget->setActiveTab(tabNo);
+ handleSimpleDialog(dialog, name + suffix, surf);
+ }
+ }
+ dialog.close();
+}
+
void dumpDialogs(const Common::String &message, const Common::String &lang) {
#ifdef USE_TRANSLATION
// Update GUI language
@@ -130,6 +148,11 @@ void dumpDialogs(const Common::String &message, const Common::String &lang) {
GUI::MassAddDialog massAddDialog(Common::FSNode("."));
handleSimpleDialog(massAddDialog, "massAddDialog-" + suffix, surf);
+ // GlobalOptionsDialog
+ LauncherSimple launcherDialog("Launcher");
+ GUI::GlobalOptionsDialog globalOptionsDialog(&launcherDialog);
+ loopThroughTabs(globalOptionsDialog, lang, surf, "GlobalOptionDialog");
+
// LauncherDialog
#if 0
GUI::LauncherChooser chooser;
diff --git a/gui/dump-all-dialogs.h b/gui/dump-all-dialogs.h
index 154a60ea269..4a086a908f6 100644
--- a/gui/dump-all-dialogs.h
+++ b/gui/dump-all-dialogs.h
@@ -28,8 +28,9 @@
namespace GUI {
void saveGUISnapshot(Graphics::Surface surf, const Common::String &filename);
-void dumpDialogs(const Common::String &message, int resolution, const Common::String &lang);
+void dumpDialogs(const Common::String &message, const Common::String &lang);
void dumpAllDialogs(const Common::String &message = "test");
+void loopThroughTabs(GUI::Dialog &dialog, const Common::String &lang, Graphics::Surface surf, const Common::String name);
} // End of namespace GUI
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index 5a8ceca327a..c83400d5188 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -982,28 +982,6 @@ LauncherDisplayType getRequestedLauncherType() {
}
#endif // !DISABLE_LAUNCHERDISPLAY_GRID
-class LauncherSimple : public LauncherDialog {
-public:
- LauncherSimple(const Common::String &title);
- ~LauncherSimple() override;
-
- void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
- void handleKeyDown(Common::KeyState state) override;
-
- LauncherDisplayType getType() const override { return kLauncherDisplayList; }
-
-protected:
- void updateListing(int selPos = -1) override;
- int getNextPos(int item) override;
- void groupEntries(const Common::Array<LauncherEntry> &metadata);
- void updateButtons() override;
- void selectTarget(const Common::String &target) override;
- int getSelected() override;
- void build() override;
-private:
- GroupedListWidget *_list;
-};
-
#ifndef DISABLE_LAUNCHERDISPLAY_GRID
class LauncherGrid : public LauncherDialog {
public:
diff --git a/gui/launcher.h b/gui/launcher.h
index c0431d7167d..efe7cdc3c83 100644
--- a/gui/launcher.h
+++ b/gui/launcher.h
@@ -230,6 +230,29 @@ public:
void selectLauncher();
};
+class LauncherSimple : public LauncherDialog {
+public:
+ LauncherSimple(const Common::String &title);
+ ~LauncherSimple() override;
+
+ void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
+ void handleKeyDown(Common::KeyState state) override;
+
+ LauncherDisplayType getType() const override { return kLauncherDisplayList; }
+
+protected:
+ void updateListing(int selPos = -1) override;
+ int getNextPos(int item) override;
+ void groupEntries(const Common::Array<LauncherEntry> &metadata);
+ void updateButtons() override;
+ void selectTarget(const Common::String &target) override;
+ int getSelected() override;
+ void build() override;
+
+private:
+ GroupedListWidget *_list;
+};
+
} // End of namespace GUI
#endif
diff --git a/gui/widget.cpp b/gui/widget.cpp
index 8e0e77858d1..cb3eac811ec 100644
--- a/gui/widget.cpp
+++ b/gui/widget.cpp
@@ -185,6 +185,16 @@ Widget *Widget::findWidgetInChain(Widget *w, const char *name) {
return nullptr;
}
+Widget *Widget::findWidgetInChain(Widget *w, uint32 type) {
+ while (w) {
+ if (w->_type == type) {
+ return w;
+ }
+ w = w->_next;
+ }
+ return nullptr;
+}
+
bool Widget::containsWidgetInChain(Widget *w, Widget *search) {
while (w) {
if (w == search || w->containsWidget(search))
diff --git a/gui/widget.h b/gui/widget.h
index 72223c2f43e..f79d3621645 100644
--- a/gui/widget.h
+++ b/gui/widget.h
@@ -115,6 +115,7 @@ private:
public:
static Widget *findWidgetInChain(Widget *start, int x, int y);
static Widget *findWidgetInChain(Widget *start, const char *name);
+ static Widget *findWidgetInChain(Widget *w, uint32 type);
static bool containsWidgetInChain(Widget *start, Widget *search);
public:
diff --git a/gui/widgets/tab.cpp b/gui/widgets/tab.cpp
index 965b000b3c9..83354982ff0 100644
--- a/gui/widgets/tab.cpp
+++ b/gui/widgets/tab.cpp
@@ -175,6 +175,10 @@ void TabWidget::removeTab(int tabID) {
g_gui.scheduleTopDialogRedraw();
}
+int TabWidget::getTabCount() {
+ return (int)_tabs.size();
+}
+
void TabWidget::setActiveTab(int tabID) {
assert(0 <= tabID && tabID < (int)_tabs.size());
if (_activeTab != tabID) {
diff --git a/gui/widgets/tab.h b/gui/widgets/tab.h
index 2d85471ecc5..26f531531a4 100644
--- a/gui/widgets/tab.h
+++ b/gui/widgets/tab.h
@@ -101,6 +101,8 @@ public:
*/
void setActiveTab(int tabID);
+ int getTabCount();
+
void setTabTitle(int tabID, const Common::U32String &title) {
assert(0 <= tabID && tabID < (int)_tabs.size());
_tabs[tabID].title = title;
Commit: 8e86a72beaa6e2e8f7e732e8a2b36c80b8375d56
https://github.com/scummvm/scummvm/commit/8e86a72beaa6e2e8f7e732e8a2b36c80b8375d56
Author: TusharGautam29 (tushar.gautam.23033 at iitgoa.ac.in)
Date: 2025-04-08T21:53:20+02:00
Commit Message:
AGOS: Fix missing include
Changed paths:
gui/dump-all-dialogs.h
diff --git a/gui/dump-all-dialogs.h b/gui/dump-all-dialogs.h
index 4a086a908f6..53082b748f8 100644
--- a/gui/dump-all-dialogs.h
+++ b/gui/dump-all-dialogs.h
@@ -24,6 +24,7 @@
#include "common/str.h"
#include "graphics/surface.h"
+#include "dialog.h"
namespace GUI {
More information about the Scummvm-git-logs
mailing list