From cb2bb8fac7356e5f8231f855a8aa26d32ea9befa Mon Sep 17 00:00:00 2001
From: Bastien Bouclet
Date: Sat, 4 Jan 2020 15:33:57 +0100
Subject: GUI: Add clear button for the plugins path

The other paths have one.
---
 gui/ThemeEngine.h                                  |   2 +-
 gui/options.cpp                                    |   9 +++++++++
 gui/options.h                                      |   1 +
 gui/themes/default.inc                             |   8 ++++++++
 gui/themes/scummclassic.zip                        | Bin 158832 -> 159080 bytes
 gui/themes/scummclassic/THEMERC                    |   2 +-
 gui/themes/scummclassic/classic_layout.stx         |   4 ++++
 gui/themes/scummclassic/classic_layout_lowres.stx  |   4 ++++
 gui/themes/scummmodern.zip                         | Bin 288886 -> 289134 bytes
 gui/themes/scummmodern/THEMERC                     |   2 +-
 gui/themes/scummmodern/scummmodern_layout.stx      |   4 ++++
 .../scummmodern/scummmodern_layout_lowres.stx      |   4 ++++
 gui/themes/scummremastered.zip                     | Bin 286934 -> 287182 bytes
 gui/themes/scummremastered/THEMERC                 |   2 +-
 gui/themes/scummremastered/remastered_layout.stx   |   4 ++++
 .../scummremastered/remastered_layout_lowres.stx   |   4 ++++
 16 files changed, 46 insertions(+), 4 deletions(-)

diff --git a/gui/ThemeEngine.h b/gui/ThemeEngine.h
index 23d920c4ad..85750b74d1 100644
--- a/gui/ThemeEngine.h
+++ b/gui/ThemeEngine.h
@@ -37,7 +37,7 @@
 #include "graphics/pixelformat.h"
 
 
-#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.8.29"
+#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.8.30"
 
 class OSystem;
 
diff --git a/gui/options.cpp b/gui/options.cpp
index 137494f211..239c88bdd4 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -78,6 +78,7 @@ enum {
 	kChooseExtraDirCmd		= 'chex',
 	kExtraPathClearCmd		= 'clex',
 	kChoosePluginsDirCmd	= 'chpl',
+	kPluginsPathClearCmd	= 'clpl',
 	kChooseThemeCmd			= 'chtf',
 	kUpdatesCheckCmd		= 'updc',
 	kKbdMouseSpeedChanged	= 'kmsc',
@@ -1465,6 +1466,7 @@ GlobalOptionsDialog::GlobalOptionsDialog(LauncherDialog *launcher)
 	_extraPathClearButton = 0;
 #ifdef DYNAMIC_MODULES
 	_pluginsPath = 0;
+	_pluginsPathClearButton = 0;
 #endif
 	_curTheme = 0;
 	_rendererPopUpDesc = 0;
@@ -1649,6 +1651,8 @@ void GlobalOptionsDialog::build() {
 	else
 		new ButtonWidget(tab, "GlobalOptions_Paths.PluginsButton", _c("Plugins Path:", "lowres"), 0, kChoosePluginsDirCmd);
 	_pluginsPath = new StaticTextWidget(tab, "GlobalOptions_Paths.PluginsPath", _c("None", "path"));
+
+	_pluginsPathClearButton = addClearButton(tab, "GlobalOptions_Paths.PluginsPathClearButton", kPluginsPathClearCmd);
 #endif
 #endif
 
@@ -2271,6 +2275,11 @@ void GlobalOptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
 	case kSavePathClearCmd:
 		_savePath->setLabel(_("Default"));
 		break;
+#ifdef DYNAMIC_MODULES
+	case kPluginsPathClearCmd:
+		_pluginsPath->setLabel(_c("None", "path"));
+		break;
+#endif
 #ifdef USE_CLOUD
 #ifdef USE_SDL_NET
 	case kRootPathClearCmd:
diff --git a/gui/options.h b/gui/options.h
index 559ecbecde..4674177277 100644
--- a/gui/options.h
+++ b/gui/options.h
@@ -269,6 +269,7 @@ protected:
 	ButtonWidget	 *_extraPathClearButton;
 #ifdef DYNAMIC_MODULES
 	StaticTextWidget *_pluginsPath;
+	ButtonWidget	 *_pluginsPathClearButton;
 #endif
 
 	//
diff --git a/gui/themes/default.inc b/gui/themes/default.inc
index affbcb9b4d..251126bba7 100644
--- a/gui/themes/default.inc
+++ b/gui/themes/default.inc
@@ -1409,6 +1409,10 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
 "<widget name='PluginsPath' "
 "height='Globals.Line.Height' "
 "/>"
+"<widget name='PluginsPathClearButton' "
+"height='Globals.Line.Height' "
+"width='Globals.Line.Height' "
+"/>"
 "</layout>"
 "</layout>"
 "</dialog>"
@@ -3155,6 +3159,10 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
 "<widget name='PluginsPath' "
 "height='Globals.Line.Height' "
 "/>"
+"<widget name='PluginsPathClearButton' "
+"height='Globals.Line.Height' "
+"width='Globals.Line.Height' "
+"/>"
 "</layout>"
 "</layout>"
 "</dialog>"
diff --git a/gui/themes/scummclassic.zip b/gui/themes/scummclassic.zip
index 4b8a77ca9d..4d5ad8d113 100644
Binary files a/gui/themes/scummclassic.zip and b/gui/themes/scummclassic.zip differ
diff --git a/gui/themes/scummclassic/THEMERC b/gui/themes/scummclassic/THEMERC
index 4134f2bb8a..63a24a100e 100644
--- a/gui/themes/scummclassic/THEMERC
+++ b/gui/themes/scummclassic/THEMERC
@@ -1 +1 @@
-[SCUMMVM_STX0.8.29:ScummVM Classic Theme:No Author]
+[SCUMMVM_STX0.8.30:ScummVM Classic Theme:No Author]
diff --git a/gui/themes/scummclassic/classic_layout.stx b/gui/themes/scummclassic/classic_layout.stx
index 0cbe043da9..de2d686439 100644
--- a/gui/themes/scummclassic/classic_layout.stx
+++ b/gui/themes/scummclassic/classic_layout.stx
@@ -540,6 +540,10 @@
 				<widget name = 'PluginsPath'
 						height = 'Globals.Line.Height'
 				/>
+				<widget name = 'PluginsPathClearButton'
+						height = 'Globals.Line.Height'
+						width = 'Globals.Line.Height'
+				/>
 			</layout>
 		</layout>
 	</dialog>
diff --git a/gui/themes/scummclassic/classic_layout_lowres.stx b/gui/themes/scummclassic/classic_layout_lowres.stx
index f735acb93c..a89a511fad 100644
--- a/gui/themes/scummclassic/classic_layout_lowres.stx
+++ b/gui/themes/scummclassic/classic_layout_lowres.stx
@@ -536,6 +536,10 @@
 				<widget name = 'PluginsPath'
 						height = 'Globals.Line.Height'
 				/>
+				<widget name = 'PluginsPathClearButton'
+						height = 'Globals.Line.Height'
+						width = 'Globals.Line.Height'
+				/>
 			</layout>
 		</layout>
 	</dialog>
diff --git a/gui/themes/scummmodern.zip b/gui/themes/scummmodern.zip
index 771182d7e0..054fbe7aee 100644
Binary files a/gui/themes/scummmodern.zip and b/gui/themes/scummmodern.zip differ
diff --git a/gui/themes/scummmodern/THEMERC b/gui/themes/scummmodern/THEMERC
index a1f5ca09bc..1071753f08 100644
--- a/gui/themes/scummmodern/THEMERC
+++ b/gui/themes/scummmodern/THEMERC
@@ -1 +1 @@
-[SCUMMVM_STX0.8.29:ScummVM Modern Theme:No Author]
+[SCUMMVM_STX0.8.30:ScummVM Modern Theme:No Author]
diff --git a/gui/themes/scummmodern/scummmodern_layout.stx b/gui/themes/scummmodern/scummmodern_layout.stx
index 537368f6db..a90ed893ba 100644
--- a/gui/themes/scummmodern/scummmodern_layout.stx
+++ b/gui/themes/scummmodern/scummmodern_layout.stx
@@ -554,6 +554,10 @@
 				<widget name = 'PluginsPath'
 						height = 'Globals.Line.Height'
 				/>
+				<widget name = 'PluginsPathClearButton'
+						height = 'Globals.Line.Height'
+						width = 'Globals.Line.Height'
+				/>
 			</layout>
 		</layout>
 	</dialog>
diff --git a/gui/themes/scummmodern/scummmodern_layout_lowres.stx b/gui/themes/scummmodern/scummmodern_layout_lowres.stx
index 6d26505e56..4ea4606fcd 100644
--- a/gui/themes/scummmodern/scummmodern_layout_lowres.stx
+++ b/gui/themes/scummmodern/scummmodern_layout_lowres.stx
@@ -534,6 +534,10 @@
 				<widget name = 'PluginsPath'
 						height = 'Globals.Line.Height'
 				/>
+				<widget name = 'PluginsPathClearButton'
+						height = 'Globals.Line.Height'
+						width = 'Globals.Line.Height'
+				/>
 			</layout>
 		</layout>
 	</dialog>
diff --git a/gui/themes/scummremastered.zip b/gui/themes/scummremastered.zip
index ffe16bde33..9d666c2383 100644
Binary files a/gui/themes/scummremastered.zip and b/gui/themes/scummremastered.zip differ
diff --git a/gui/themes/scummremastered/THEMERC b/gui/themes/scummremastered/THEMERC
index c2ce0ef1fd..e2d57b1398 100644
--- a/gui/themes/scummremastered/THEMERC
+++ b/gui/themes/scummremastered/THEMERC
@@ -1 +1 @@
-[SCUMMVM_STX0.8.29:ScummVM Modern Theme Remastered:No Author]
+[SCUMMVM_STX0.8.30:ScummVM Modern Theme Remastered:No Author]
diff --git a/gui/themes/scummremastered/remastered_layout.stx b/gui/themes/scummremastered/remastered_layout.stx
index 895b0b9e4c..782c2b14ba 100644
--- a/gui/themes/scummremastered/remastered_layout.stx
+++ b/gui/themes/scummremastered/remastered_layout.stx
@@ -554,6 +554,10 @@
 				<widget name = 'PluginsPath'
 						height = 'Globals.Line.Height'
 				/>
+				<widget name = 'PluginsPathClearButton'
+						height = 'Globals.Line.Height'
+						width = 'Globals.Line.Height'
+				/>
 			</layout>
 		</layout>
 	</dialog>
diff --git a/gui/themes/scummremastered/remastered_layout_lowres.stx b/gui/themes/scummremastered/remastered_layout_lowres.stx
index 6d26505e56..4ea4606fcd 100644
--- a/gui/themes/scummremastered/remastered_layout_lowres.stx
+++ b/gui/themes/scummremastered/remastered_layout_lowres.stx
@@ -534,6 +534,10 @@
 				<widget name = 'PluginsPath'
 						height = 'Globals.Line.Height'
 				/>
+				<widget name = 'PluginsPathClearButton'
+						height = 'Globals.Line.Height'
+						width = 'Globals.Line.Height'
+				/>
 			</layout>
 		</layout>
 	</dialog>
-- 
cgit v1.2.3