[Scummvm-git-logs] scummvm branch-2-7 -> e6d1ffd7fe1ae146a4ff8a855dff4a15bbaa31fc

sev- noreply at scummvm.org
Sat Mar 25 16:31:38 UTC 2023


This automated email contains information about 6 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
8b2f953f62 OSYSTEM: Expose getDefaultLogFileName() via OSystem
a885356714 GUI: Display scummvm.log path and add viewer
bf293a878c GUI: Expose Debug Level int the GUI (Misc tab), bump theme version
50b2dbb1f4 GUI: Regenerated theme files
9b49bf0a88 NEWS: Mention new GUI additions
e6d1ffd7fe GUI: Fix crash in TextViewer


Commit: 8b2f953f62474e5bbf29f16b52f771198e7cd88a
    https://github.com/scummvm/scummvm/commit/8b2f953f62474e5bbf29f16b52f771198e7cd88a
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-03-25T17:18:12+01:00

Commit Message:
OSYSTEM: Expose getDefaultLogFileName() via OSystem

Changed paths:
    backends/platform/sdl/sdl.h
    common/system.h


diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index 263f82e5578..28ba76a09ed 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -158,7 +158,6 @@ protected:
 	virtual AudioCDManager *createAudioCDManager();
 
 	// Logging
-	virtual Common::String getDefaultLogFileName() { return Common::String(); }
 	virtual Common::WriteStream *createLogFile();
 	Backends::Log::Log *_logger;
 
diff --git a/common/system.h b/common/system.h
index 02b8535cbda..1daea18567b 100644
--- a/common/system.h
+++ b/common/system.h
@@ -1650,6 +1650,14 @@ public:
 	 */
 	virtual Common::String getDefaultConfigFileName();
 
+	/**
+	 * Get the default file name (or even path) where the scummvm.log
+	 * will be saved.
+	 *
+	 * Note that not all ports can use this.
+	 */
+	virtual Common::String getDefaultLogFileName() { return Common::String(); }
+
 	/**
 	 * Register the default values for the settings the backend uses into the
 	 * configuration manager.


Commit: a885356714dce6cb46332723974b3ba2d3fd55c0
    https://github.com/scummvm/scummvm/commit/a885356714dce6cb46332723974b3ba2d3fd55c0
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-03-25T17:18:12+01:00

Commit Message:
GUI: Display scummvm.log path and add viewer

Changed paths:
  A gui/textviewer.cpp
  A gui/textviewer.h
    gui/module.mk
    gui/options.cpp
    gui/themes/common/highres_layout.stx
    gui/themes/common/lowres_layout.stx
    gui/themes/scummclassic/classic_layout.stx
    gui/themes/scummclassic/classic_layout_lowres.stx


diff --git a/gui/module.mk b/gui/module.mk
index e7db62dd677..28a854cb0bb 100644
--- a/gui/module.mk
+++ b/gui/module.mk
@@ -22,6 +22,7 @@ MODULE_OBJS := \
 	saveload.o \
 	saveload-dialog.o \
 	shaderbrowser-dialog.o \
+	textviewer.o \
 	themebrowser.o \
 	ThemeEngine.o \
 	ThemeEval.o \
diff --git a/gui/options.cpp b/gui/options.cpp
index 081cfdf7f3d..eba91849c36 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -29,6 +29,7 @@
 #include "gui/widgets/tab.h"
 #include "gui/ThemeEval.h"
 #include "gui/launcher.h"
+#include "gui/textviewer.h"
 
 #include "backends/keymapper/keymapper.h"
 #include "backends/keymapper/remap-widget.h"
@@ -106,6 +107,7 @@ enum {
 	kScalerPopUpCmd			= 'scPU',
 	kFullscreenToggled		= 'oful',
 	kRandomSeedClearCmd     = 'rndc',
+	kViewLogCmd             = 'vwlg',
 };
 
 enum {
@@ -2484,10 +2486,13 @@ void GlobalOptionsDialog::addPathsControls(GuiObject *boss, const Common::String
 	Common::U32String confPath = ConfMan.getCustomConfigFileName();
 	if (confPath.empty())
 		confPath = g_system->getDefaultConfigFileName();
-	StaticTextWidget* configPathWidget = new StaticTextWidget(boss, prefix + "ConfigPath", _("ScummVM config path: ") + confPath, confPath);
+	StaticTextWidget *configPathWidget = new StaticTextWidget(boss, prefix + "ConfigPath", _("ScummVM config path: ") + confPath, confPath);
 	if (ConfMan.isKeyTemporary("config"))
 		configPathWidget->setFontColor(ThemeEngine::FontColor::kFontColorOverride);
 
+	Common::U32String logPath = g_system->getDefaultLogFileName();
+	new StaticTextWidget(boss, prefix + "LogPath", _("ScummVM log path: ") + logPath, logPath);
+	new ButtonWidget(boss, prefix + "ViewButton", _("View"), Common::U32String(), kViewLogCmd);
 
 	Common::U32String browserPath = _("<default>");
 	if (ConfMan.hasKey("browser_lastpath"))
@@ -3220,6 +3225,12 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
 		_browserPath->setLabel(_("Last browser path: ") + _("<default>"));
 
 		break;
+	case kViewLogCmd: {
+		TextViewerDialog viewer(g_system->getDefaultLogFileName());
+		viewer.runModal();
+		g_gui.scheduleTopDialogRedraw();
+		break;
+	}
 #ifdef USE_CLOUD
 #ifdef USE_SDL_NET
 	case kRootPathClearCmd:
diff --git a/gui/textviewer.cpp b/gui/textviewer.cpp
new file mode 100644
index 00000000000..6748ac401dc
--- /dev/null
+++ b/gui/textviewer.cpp
@@ -0,0 +1,209 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "common/file.h"
+#include "common/tokenizer.h"
+
+#include "graphics/font.h"
+#include "graphics/fontman.h"
+
+#include "gui/gui-manager.h"
+#include "gui/ThemeEval.h"
+#include "gui/textviewer.h"
+#include "gui/widgets/scrollbar.h"
+
+namespace GUI {
+
+#define kDialogWidthPercent 0.8f
+#define kDialogHeightPercent 0.8f
+
+#define kPadX 0.05
+#define kPadY 0.05
+
+TextViewerDialog::TextViewerDialog(Common::String fname)
+	: Dialog(0, 0, 1, 1), _fname(fname) {
+	_font = &g_gui.getFont(ThemeEngine::kFontStyleConsole);
+	_charWidth = _font->getMaxCharWidth();
+	_lineHeight = _font->getFontHeight() + 2;
+
+	// Add scrollbar
+	_scrollbarWidth = g_gui.xmlEval()->getVar("Globals.Scrollbar.Width", 0);
+	_scrollBar = new ScrollBarWidget(this, _w - _scrollbarWidth - 1, 0, _scrollbarWidth, _h);
+	_scrollBar->setTarget(this);
+
+	_currentPos = 0;
+	_scrollLine = _linesPerPage - 1;
+
+	reflowLayout();
+
+	loadFile(fname);
+}
+
+TextViewerDialog::~TextViewerDialog() {
+	destroy();
+}
+
+bool TextViewerDialog::loadFile(Common::String &fname) {
+	Common::FSNode file(fname);
+
+	if (!file.exists()) {
+		warning("TextViewerDialog::loadFile(): Cannot open file %s", fname.c_str());
+
+		return false;
+	}
+
+	Common::SeekableReadStream *stream = file.createReadStream();
+
+	warning("TextViewerDialog::loadFile(): File size is: %ld", stream->size());
+
+	_linesArray.clear();
+
+	while (!stream->eos()) {
+		Common::String line = stream->readString('\n');
+
+		line.wordWrap(_lineWidth);
+
+		Common::StringTokenizer lines(line, "\n");
+		while (!lines.empty())
+			_linesArray.push_back(lines.nextToken());
+	}
+
+	delete stream;
+
+	return true;
+}
+
+void TextViewerDialog::destroy() {
+	_linesArray.clear();
+}
+
+void TextViewerDialog::reflowLayout() {
+	// Calculate the real width/height (rounded to char/line multiples)
+	_w = (uint16)(kDialogWidthPercent * g_system->getOverlayWidth());
+	_h = (uint16)((kDialogHeightPercent * g_system->getOverlayHeight() - 2) / _lineHeight);
+	_h = _h * _lineHeight + 2;
+
+	_x = (g_system->getOverlayWidth() - _w) / 2;
+	_y = (g_system->getOverlayHeight() - _h) / 2;
+
+	_padX = _w * kPadX;
+	_padY = _h * kPadY;
+
+	// Calculate depending values
+	_lineWidth = (_w - _scrollbarWidth - _padX * 2) / _charWidth;
+	_linesPerPage = (_h - _padY * 2) / _lineHeight;
+
+	_scrollBar->setPos(_w - _scrollbarWidth - 1, 0);
+	_scrollBar->setSize(_scrollbarWidth, _h);
+}
+
+void TextViewerDialog::open() {
+	Dialog::open();
+}
+
+void TextViewerDialog::drawDialog(DrawLayer layerToDraw) {
+	Dialog::drawDialog(layerToDraw);
+
+	setTextDrawableArea(Common::Rect(_x, _y, _x + _w, _y + _h));
+
+	// Draw a border
+	//g_gui.hLine(_x, _y + _h - 1, _x + _w - 1, g_gui._color);
+
+	// Draw text
+	int y = _y + _padY;
+
+	for (int line = 0; (line < _linesPerPage) && ((_currentPos + line) < (int)_linesArray.size()); line++) {
+		int x = _x + _padX;
+		const char *text = _linesArray[line + _currentPos].c_str();
+		int w = MIN<int>(_lineWidth,  _linesArray[line + _currentPos].size());
+
+		for (int column = 0; column < w; column++) {
+			byte c = text[column];
+			g_gui.theme()->drawChar(Common::Rect(x, y, x + _charWidth, y + _lineHeight), c, _font);
+			x += _charWidth;
+		}
+
+		y += _lineHeight;
+	}
+
+	// Draw the scrollbar
+	_scrollBar->_numEntries = _linesArray.size();
+	_scrollBar->_currentPos = _currentPos;
+	_scrollBar->_entriesPerPage = _linesPerPage;
+	_scrollBar->recalc();
+	_scrollBar->draw();
+}
+
+
+void TextViewerDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
+	switch (cmd) {
+	case kSetPositionCmd:
+		_currentPos = _scrollBar->_currentPos;
+		drawDialog(kDrawLayerForeground);
+		break;
+	default:
+		return;
+	}
+}
+
+void TextViewerDialog::handleMouseWheel(int x, int y, int direction) {
+	_scrollBar->handleMouseWheel(x, y, direction);
+}
+
+void TextViewerDialog::handleKeyDown(Common::KeyState state) {
+	switch (state.keycode) {
+	case Common::KEYCODE_ESCAPE:
+		close();
+		break;
+	case Common::KEYCODE_UP:
+		_currentPos--;
+		break;
+	case Common::KEYCODE_DOWN:
+		_currentPos++;
+		break;
+	case Common::KEYCODE_HOME:
+		_currentPos = 0;
+		break;
+	case Common::KEYCODE_END:
+		_currentPos = _linesArray.size() - _linesPerPage;
+		break;
+	case Common::KEYCODE_PAGEUP:
+		_currentPos -= _linesPerPage;
+		break;
+	case Common::KEYCODE_PAGEDOWN:
+		_currentPos += _linesPerPage;
+		break;
+	default:
+		return;
+	}
+
+	if (_currentPos < 0) {
+		_currentPos = 0;
+	}
+	if ((_currentPos + _linesPerPage) >= (int)_linesArray.size()) {
+		_currentPos = _linesArray.size() - _linesPerPage;
+	}
+
+	drawDialog(kDrawLayerForeground);
+}
+
+
+} // End of namespace GUI
diff --git a/gui/textviewer.h b/gui/textviewer.h
new file mode 100644
index 00000000000..d12acee8099
--- /dev/null
+++ b/gui/textviewer.h
@@ -0,0 +1,75 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef TEXTVIEWER_DIALOG_H
+#define TEXTVIEWER_DIALOG_H
+
+#include "common/array.h"
+#include "common/str.h"
+
+#include "gui/dialog.h"
+
+namespace Graphics {
+class Font;
+}
+
+namespace GUI {
+
+class ScrollBarWidget;
+
+class TextViewerDialog : public Dialog {
+private:
+	int	_lineWidth;
+	int	_linesPerPage;
+	int	_currentPos;
+	int	_scrollLine;
+
+	int _scrollbarWidth;
+	int _charWidth;
+	int _lineHeight;
+	int _padX, _padY;
+
+	Common::StringArray _linesArray;
+
+	ScrollBarWidget *_scrollBar;
+
+	Common::String _fname;
+	const Graphics::Font *_font = nullptr;
+
+	bool loadFile(Common::String &fname);
+	void reflowLayout();
+
+public:
+	TextViewerDialog(Common::String fname);
+	~TextViewerDialog();
+
+	void destroy();
+	void open();
+	void drawDialog(DrawLayer layerToDraw);
+
+	void handleMouseWheel(int x, int y, int direction);
+	void handleKeyDown(Common::KeyState state);
+	void handleCommand(CommandSender *sender, uint32 cmd, uint32 data);
+};
+
+} // End of namespace GUI
+
+#endif
diff --git a/gui/themes/common/highres_layout.stx b/gui/themes/common/highres_layout.stx
index 688b8b2da73..178ec5bbb0b 100644
--- a/gui/themes/common/highres_layout.stx
+++ b/gui/themes/common/highres_layout.stx
@@ -893,6 +893,12 @@
 				/>
 			</layout>
 			<widget name = 'ConfigPath' height = 'Globals.Line.Height' />
+			<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' align = 'center'>
+				<widget name = 'LogPath' height = 'Globals.Line.Height' />
+				<widget name = 'ViewButton'
+						type = 'Button'
+				/>
+			</layout>
 			<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' align = 'center'>
 				<widget name = 'BrowserPath'
 						height = 'Globals.Line.Height'
diff --git a/gui/themes/common/lowres_layout.stx b/gui/themes/common/lowres_layout.stx
index 6c23c5890a0..b51a91759ad 100644
--- a/gui/themes/common/lowres_layout.stx
+++ b/gui/themes/common/lowres_layout.stx
@@ -746,6 +746,12 @@
 				/>
 			</layout>
 			<widget name = 'ConfigPath' height = 'Globals.Line.Height' />
+			<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '16' align = 'center'>
+				<widget name = 'LogPath' height = 'Globals.Line.Height' />
+				<widget name = 'ViewButton'
+						type = 'Button'
+				/>
+			</layout>
 			<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '16' align = 'center'>
 				<widget name = 'BrowserPath'
 						height = 'Globals.Line.Height'
diff --git a/gui/themes/scummclassic/classic_layout.stx b/gui/themes/scummclassic/classic_layout.stx
index 889d2133964..66722cba528 100644
--- a/gui/themes/scummclassic/classic_layout.stx
+++ b/gui/themes/scummclassic/classic_layout.stx
@@ -661,6 +661,12 @@
 				/>
 			</layout>
 			<widget name = 'ConfigPath' height = 'Globals.Line.Height' />
+			<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' align = 'center'>
+				<widget name = 'LogPath' height = 'Globals.Line.Height' />
+				<widget name = 'ViewButton'
+						type = 'Button'
+				/>
+			</layout>
 			<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' align = 'center'>
 				<widget name = 'BrowserPath'
 						height = 'Globals.Line.Height'
diff --git a/gui/themes/scummclassic/classic_layout_lowres.stx b/gui/themes/scummclassic/classic_layout_lowres.stx
index 0f9cc6498f3..379ea93ec4e 100644
--- a/gui/themes/scummclassic/classic_layout_lowres.stx
+++ b/gui/themes/scummclassic/classic_layout_lowres.stx
@@ -668,6 +668,12 @@
 				/>
 			</layout>
 			<widget name = 'ConfigPath' height = 'Globals.Line.Height' />
+			<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '16'>
+				<widget name = 'LogPath' height = 'Globals.Line.Height' />
+				<widget name = 'ViewButton'
+						type = 'Button'
+				/>
+			</layout>
 			<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '16'>
 				<widget name = 'BrowserPath'
 						height = 'Globals.Line.Height'


Commit: bf293a878cb01405bdaf86725bfc2e84f0866839
    https://github.com/scummvm/scummvm/commit/bf293a878cb01405bdaf86725bfc2e84f0866839
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-03-25T17:18:12+01:00

Commit Message:
GUI: Expose Debug Level int the GUI (Misc tab), bump theme version

Changed paths:
    gui/ThemeEngine.h
    gui/options.cpp
    gui/options.h
    gui/themes/common/highres_layout.stx
    gui/themes/common/lowres_layout.stx
    gui/themes/default.inc
    gui/themes/residualvm/THEMERC
    gui/themes/scummclassic/THEMERC
    gui/themes/scummclassic/classic_layout.stx
    gui/themes/scummclassic/classic_layout_lowres.stx
    gui/themes/scummmodern/THEMERC
    gui/themes/scummremastered/THEMERC


diff --git a/gui/ThemeEngine.h b/gui/ThemeEngine.h
index dd4fbf5e92d..93d068b29be 100644
--- a/gui/ThemeEngine.h
+++ b/gui/ThemeEngine.h
@@ -36,7 +36,7 @@
 #include "graphics/pixelformat.h"
 
 
-#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.9.8"
+#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.9.10"
 
 class OSystem;
 
diff --git a/gui/options.cpp b/gui/options.cpp
index eba91849c36..f75abff2003 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -2400,6 +2400,8 @@ void GlobalOptionsDialog::build() {
 			_autosavePeriodPopUp->setSelected(i);
 	}
 
+	_debugLevelPopUp->setSelected(gDebugLevel + 1);
+
 	ThemeEngine::GraphicsMode mode = ThemeEngine::findMode(ConfMan.get("gui_renderer"));
 	if (mode == ThemeEngine::kGfxDisabled)
 		mode = ThemeEngine::_defaultRendererMode;
@@ -2620,6 +2622,16 @@ void GlobalOptionsDialog::addMiscControls(GuiObject *boss, const Common::String
 	_randomSeed = new EditTextWidget(boss, prefix + "RandomSeedEditText", seed, Common::U32String());
 	_randomSeedClearButton = addClearButton(boss, prefix + "RandomSeedClearButton", kRandomSeedClearCmd);
 
+	new StaticTextWidget(boss, prefix + "DebugLevelPopupDesc", _("Debug level:"));
+	_debugLevelPopUp = new PopUpWidget(boss, prefix + "DebugLevelPopup");
+
+	_debugLevelPopUp->appendEntry(_("None"), -1); // I18N: Debug level -1, no messages
+
+	for (int i = 0; i < 11; i++)
+		_debugLevelPopUp->appendEntry(Common::U32String::format("%d", i), i);
+
+	_debugLevelPopUp->appendEntry(_("11 (all)"), 11); // I18N: Debug level 11, all messages
+
 #ifdef USE_DISCORD
 	_discordRpcCheckbox = new CheckboxWidget(boss, prefix + "DiscordRpc",
 		_("Enable Discord integration"),
@@ -2914,6 +2926,12 @@ void GlobalOptionsDialog::apply() {
 	else
 		_autosavePeriodPopUp->setSelected(0);
 
+	if (gDebugLevel != _debugLevelPopUp->getSelectedTag()) {
+		gDebugLevel = _debugLevelPopUp->getSelectedTag();
+
+		warning("Debug level set to %d", gDebugLevel);
+	}
+
 #ifdef USE_UPDATES
 	if (g_system->getUpdateManager()) {
 		ConfMan.setInt("updates_check", _updatesPopUp->getSelectedTag());
diff --git a/gui/options.h b/gui/options.h
index 19fc5122190..25e5d46aa39 100644
--- a/gui/options.h
+++ b/gui/options.h
@@ -310,10 +310,11 @@ protected:
 	// Misc controls
 	//
 	StaticTextWidget *_autosavePeriodPopUpDesc;
-	PopUpWidget *_autosavePeriodPopUp;
+	PopUpWidget      *_autosavePeriodPopUp;
 	StaticTextWidget *_randomSeedDesc;
 	EditTextWidget   *_randomSeed;
 	ButtonWidget	 *_randomSeedClearButton;
+	PopUpWidget      *_debugLevelPopUp;
 
 #ifdef USE_UPDATES
 	StaticTextWidget *_updatesPopUpDesc;
diff --git a/gui/themes/common/highres_layout.stx b/gui/themes/common/highres_layout.stx
index 178ec5bbb0b..10c96bc13f2 100644
--- a/gui/themes/common/highres_layout.stx
+++ b/gui/themes/common/highres_layout.stx
@@ -1006,6 +1006,14 @@
 						width = 'Globals.Line.Height'
 				/>
 			</layout>
+			<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' align = 'center'>
+				<widget name = 'DebugLevelPopupDesc'
+						type = 'OptionsLabel'
+				/>
+				<widget name = 'DebugLevelPopup'
+						type = 'PopUp'
+				/>
+			</layout>
 			<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' align = 'center'>
 				<widget name = 'DiscordRpc'
 						type = 'Checkbox'
diff --git a/gui/themes/common/lowres_layout.stx b/gui/themes/common/lowres_layout.stx
index b51a91759ad..8c99697fd1f 100644
--- a/gui/themes/common/lowres_layout.stx
+++ b/gui/themes/common/lowres_layout.stx
@@ -869,6 +869,14 @@
 						width = 'Globals.Line.Height'
 				/>
 			</layout>
+			<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' align = 'center'>
+				<widget name = 'DebugLevelPopupDesc'
+						type = 'OptionsLabel'
+				/>
+				<widget name = 'DebugLevelPopup'
+						type = 'PopUp'
+				/>
+			</layout>
 			<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' align = 'center'>
 				<widget name = 'DiscordRpc'
 						type = 'Checkbox'
diff --git a/gui/themes/default.inc b/gui/themes/default.inc
index 6a59c1c5ac1..588835d8102 100644
--- a/gui/themes/default.inc
+++ b/gui/themes/default.inc
@@ -2054,6 +2054,12 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
 "</layout>"
 "<widget name='ConfigPath' height='Globals.Line.Height' />"
 "<layout type='horizontal' padding='0,0,0,0' spacing='10' align='center'>"
+"<widget name='LogPath' height='Globals.Line.Height' />"
+"<widget name='ViewButton' "
+"type='Button' "
+"/>"
+"</layout>"
+"<layout type='horizontal' padding='0,0,0,0' spacing='10' align='center'>"
 "<widget name='BrowserPath' "
 "height='Globals.Line.Height' "
 "/>"
@@ -2157,6 +2163,14 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
 "/>"
 "</layout>"
 "<layout type='horizontal' padding='0,0,0,0' spacing='10' align='center'>"
+"<widget name='DebugLevelPopupDesc' "
+"type='OptionsLabel' "
+"/>"
+"<widget name='DebugLevelPopup' "
+"type='PopUp' "
+"/>"
+"</layout>"
+"<layout type='horizontal' padding='0,0,0,0' spacing='10' align='center'>"
 "<widget name='DiscordRpc' "
 "type='Checkbox' "
 "/>"
@@ -4032,6 +4046,12 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
 "</layout>"
 "<widget name='ConfigPath' height='Globals.Line.Height' />"
 "<layout type='horizontal' padding='0,0,0,0' spacing='16'>"
+"<widget name='LogPath' height='Globals.Line.Height' />"
+"<widget name='ViewButton' "
+"type='Button' "
+"/>"
+"</layout>"
+"<layout type='horizontal' padding='0,0,0,0' spacing='16'>"
 "<widget name='BrowserPath' "
 "height='Globals.Line.Height' "
 "/>"
@@ -4145,6 +4165,14 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
 "/>"
 "</layout>"
 "<layout type='horizontal' padding='0,0,0,0' spacing='10' align='center'>"
+"<widget name='DebugLevelPopupDesc' "
+"type='OptionsLabel' "
+"/>"
+"<widget name='DebugLevelPopup' "
+"type='PopUp' "
+"/>"
+"</layout>"
+"<layout type='horizontal' padding='0,0,0,0' spacing='10' align='center'>"
 "<widget name='DiscordRpc' "
 "type='Checkbox' "
 "/>"
diff --git a/gui/themes/residualvm/THEMERC b/gui/themes/residualvm/THEMERC
index a654ab03677..730fdf85bc8 100644
--- a/gui/themes/residualvm/THEMERC
+++ b/gui/themes/residualvm/THEMERC
@@ -1,3 +1,3 @@
-[SCUMMVM_STX0.9.8:ResidualVM Modern Theme Remastered:No Author]
+[SCUMMVM_STX0.9.10:ResidualVM Modern Theme Remastered:No Author]
 %using ../common
 %using ../common-svg
diff --git a/gui/themes/scummclassic/THEMERC b/gui/themes/scummclassic/THEMERC
index d676d6143ee..2b664c02257 100644
--- a/gui/themes/scummclassic/THEMERC
+++ b/gui/themes/scummclassic/THEMERC
@@ -1 +1 @@
-[SCUMMVM_STX0.9.8:ScummVM Classic Theme:No Author]
+[SCUMMVM_STX0.9.10:ScummVM Classic Theme:No Author]
diff --git a/gui/themes/scummclassic/classic_layout.stx b/gui/themes/scummclassic/classic_layout.stx
index 66722cba528..759c21aa06a 100644
--- a/gui/themes/scummclassic/classic_layout.stx
+++ b/gui/themes/scummclassic/classic_layout.stx
@@ -774,6 +774,14 @@
 						width = 'Globals.Line.Height'
 				/>
 			</layout>
+			<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' align = 'center'>
+				<widget name = 'DebugLevelPopupDesc'
+						type = 'OptionsLabel'
+				/>
+				<widget name = 'DebugLevelPopup'
+						type = 'PopUp'
+				/>
+			</layout>
 			<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' align = 'center'>
 				<widget name = 'DiscordRpc'
 						type = 'Checkbox'
diff --git a/gui/themes/scummclassic/classic_layout_lowres.stx b/gui/themes/scummclassic/classic_layout_lowres.stx
index 379ea93ec4e..6b625c1caf6 100644
--- a/gui/themes/scummclassic/classic_layout_lowres.stx
+++ b/gui/themes/scummclassic/classic_layout_lowres.stx
@@ -791,6 +791,14 @@
 						width = 'Globals.Line.Height'
 				/>
 			</layout>
+			<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' align = 'center'>
+				<widget name = 'DebugLevelPopupDesc'
+						type = 'OptionsLabel'
+				/>
+				<widget name = 'DebugLevelPopup'
+						type = 'PopUp'
+				/>
+			</layout>
 			<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '10' align = 'center'>
 				<widget name = 'DiscordRpc'
 						type = 'Checkbox'
diff --git a/gui/themes/scummmodern/THEMERC b/gui/themes/scummmodern/THEMERC
index 033658a726e..59b6493f870 100644
--- a/gui/themes/scummmodern/THEMERC
+++ b/gui/themes/scummmodern/THEMERC
@@ -1,2 +1,2 @@
-[SCUMMVM_STX0.9.8:ScummVM Modern Theme:No Author]
+[SCUMMVM_STX0.9.10:ScummVM Modern Theme:No Author]
 %using ../common
diff --git a/gui/themes/scummremastered/THEMERC b/gui/themes/scummremastered/THEMERC
index 02def911816..c387a0b8340 100644
--- a/gui/themes/scummremastered/THEMERC
+++ b/gui/themes/scummremastered/THEMERC
@@ -1,3 +1,3 @@
-[SCUMMVM_STX0.9.8:ScummVM Modern Theme Remastered:No Author]
+[SCUMMVM_STX0.9.10:ScummVM Modern Theme Remastered:No Author]
 %using ../common
 %using ../common-svg


Commit: 50b2dbb1f416b908e7e53b33ccf5428c555e5cf3
    https://github.com/scummvm/scummvm/commit/50b2dbb1f416b908e7e53b33ccf5428c555e5cf3
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-03-25T17:20:34+01:00

Commit Message:
GUI: Regenerated theme files

Changed paths:
    gui/themes/residualvm.zip
    gui/themes/scummclassic.zip
    gui/themes/scummmodern.zip
    gui/themes/scummremastered.zip


diff --git a/gui/themes/residualvm.zip b/gui/themes/residualvm.zip
index 2859b2bae52..04c9c43b227 100644
Binary files a/gui/themes/residualvm.zip and b/gui/themes/residualvm.zip differ
diff --git a/gui/themes/scummclassic.zip b/gui/themes/scummclassic.zip
index ae53f2a91be..a4c87609d63 100644
Binary files a/gui/themes/scummclassic.zip and b/gui/themes/scummclassic.zip differ
diff --git a/gui/themes/scummmodern.zip b/gui/themes/scummmodern.zip
index ffa50fcbb65..385aa537c4e 100644
Binary files a/gui/themes/scummmodern.zip and b/gui/themes/scummmodern.zip differ
diff --git a/gui/themes/scummremastered.zip b/gui/themes/scummremastered.zip
index d42b2a14163..53c84a009c8 100644
Binary files a/gui/themes/scummremastered.zip and b/gui/themes/scummremastered.zip differ


Commit: 9b49bf0a881570a4db4cee81c950d5f6806b1509
    https://github.com/scummvm/scummvm/commit/9b49bf0a881570a4db4cee81c950d5f6806b1509
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-03-25T17:20:43+01:00

Commit Message:
NEWS: Mention new GUI additions

Changed paths:
    NEWS.md


diff --git a/NEWS.md b/NEWS.md
index ec9ed96dee9..d7416a28c58 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -5,6 +5,8 @@ For a more comprehensive changelog of the latest experimental code, see:
 
  General:
   - Fixed playback speed for Theora videos.
+  - Added scummvm.log file viewer.
+  - Exposed ScummVM debug level in the GUI (Misc tab).
 
  AGI:
    - Restored possibility to pick arbitrary render mode in Game Options.


Commit: e6d1ffd7fe1ae146a4ff8a855dff4a15bbaa31fc
    https://github.com/scummvm/scummvm/commit/e6d1ffd7fe1ae146a4ff8a855dff4a15bbaa31fc
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-03-25T17:30:51+01:00

Commit Message:
GUI: Fix crash in TextViewer

Changed paths:
    gui/textviewer.cpp


diff --git a/gui/textviewer.cpp b/gui/textviewer.cpp
index 6748ac401dc..c3a7b386c1b 100644
--- a/gui/textviewer.cpp
+++ b/gui/textviewer.cpp
@@ -157,6 +157,14 @@ void TextViewerDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 d
 	switch (cmd) {
 	case kSetPositionCmd:
 		_currentPos = _scrollBar->_currentPos;
+
+		if (_currentPos < 0) {
+			_currentPos = 0;
+		}
+		if ((_currentPos + _linesPerPage) >= (int)_linesArray.size()) {
+			_currentPos = MAX<int32>(_linesArray.size() - _linesPerPage, 0);
+		}
+
 		drawDialog(kDrawLayerForeground);
 		break;
 	default:
@@ -199,7 +207,7 @@ void TextViewerDialog::handleKeyDown(Common::KeyState state) {
 		_currentPos = 0;
 	}
 	if ((_currentPos + _linesPerPage) >= (int)_linesArray.size()) {
-		_currentPos = _linesArray.size() - _linesPerPage;
+		_currentPos = MAX<int32>(_linesArray.size() - _linesPerPage, 0);
 	}
 
 	drawDialog(kDrawLayerForeground);




More information about the Scummvm-git-logs mailing list