summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSND\ckain_cp <SND\ckain_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2013-02-24 00:57:23 +0000
committerSND\ckain_cp <SND\ckain_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2013-02-24 00:57:23 +0000
commita0c49bddfad957d260bdb2c26b4cf21b86f63bdf (patch)
treed30df8a9f30f29f51ad0296553f4c32545ca22fc
parent56fc32e977409e38b09bf4820244b3699f1e3b4c (diff)
downloadpcsxr-a0c49bddfad957d260bdb2c26b4cf21b86f63bdf.tar.gz
Check if the selected combobox value is actually a valid plugin. Also there is no need to call ConfigurePlugins() from on_configure_plugin() and on_about_plugin(). Thanks Solis.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@83111 e17a0e51-4ae3-4d35-97c3-1a29b211df97
-rwxr-xr-xgui/ConfDlg.c90
1 files changed, 44 insertions, 46 deletions
diff --git a/gui/ConfDlg.c b/gui/ConfDlg.c
index 57c188d1..13236726 100755
--- a/gui/ConfDlg.c
+++ b/gui/ConfDlg.c
@@ -385,19 +385,21 @@ static int all_config_set() {
gchar *filename; \
\
GetComboText(confs.Combo, confs.plist, plugin); \
- filename = g_build_filename (getenv("HOME"), PLUGINS_DIR, plugin, NULL); \
- /*printf("Configuring plugin %s\n", filename);*/ \
- drv = SysLoadLibrary(filename); \
- if (drv == NULL) {printf("Error with file %s\n", filename);return; } \
+ if (strlen(plugin) > 0) { \
+ filename = g_build_filename (getenv("HOME"), PLUGINS_DIR, plugin, NULL); \
+ /*printf("Configuring plugin %s\n", filename);*/ \
+ drv = SysLoadLibrary(filename); \
+ if (drv == NULL) {printf("Error with file %s\n", filename);return; } \
\
- while (gtk_events_pending()) gtk_main_iteration(); \
- conf = (src) SysLoadSym(drv, name); \
- if (conf) { \
- conf(); \
- } else \
- SysInfoMessage (_("No configuration required"), _("This plugin doesn't need to be configured.")); \
- SysCloseLibrary(drv); \
- g_free (filename); \
+ while (gtk_events_pending()) gtk_main_iteration(); \
+ conf = (src) SysLoadSym(drv, name); \
+ if (conf) { \
+ conf(); \
+ } else \
+ SysInfoMessage (_("No configuration required"), _("This plugin doesn't need to be configured.")); \
+ SysCloseLibrary(drv); \
+ g_free (filename); \
+ } else SysInfoMessage (name, _("Please select a plugin.")); \
}
static void on_configure_plugin(GtkWidget *widget, gpointer user_data) {
@@ -405,25 +407,23 @@ static void on_configure_plugin(GtkWidget *widget, gpointer user_data) {
while (gtk_events_pending())
gtk_main_iteration();
- if (all_config_set() == TRUE) {
- switch (plugin_type) {
- case PSE_LT_GPU:
- ConfPlugin(GPUconfigure, GpuConfS, Config.Gpu, "GPUconfigure", ConfDlg);
- break;
- case PSE_LT_SPU:
- ConfPlugin(SPUconfigure, SpuConfS, Config.Spu, "SPUconfigure", ConfDlg);
- break;
- case PSE_LT_CDR:
- ConfPlugin(CDRconfigure, CdrConfS, Config.Cdr, "CDRconfigure", ConfDlg);
- break;
+
+ switch (plugin_type) {
+ case PSE_LT_GPU:
+ ConfPlugin(GPUconfigure, GpuConfS, Config.Gpu, "GPUconfigure", ConfDlg);
+ break;
+ case PSE_LT_SPU:
+ ConfPlugin(SPUconfigure, SpuConfS, Config.Spu, "SPUconfigure", ConfDlg);
+ break;
+ case PSE_LT_CDR:
+ ConfPlugin(CDRconfigure, CdrConfS, Config.Cdr, "CDRconfigure", ConfDlg);
+ break;
#ifdef ENABLE_SIO1API
- case PSE_LT_SIO1:
- ConfPlugin(SIO1configure, Sio1ConfS, Config.Sio1, "SIO1configure", ConfDlg);
- break;
+ case PSE_LT_SIO1:
+ ConfPlugin(SIO1configure, Sio1ConfS, Config.Sio1, "SIO1configure", ConfDlg);
+ break;
#endif
- }
- } else
- ConfigurePlugins();
+ }
}
static void on_about_plugin(GtkWidget *widget, gpointer user_data) {
@@ -431,25 +431,23 @@ static void on_about_plugin(GtkWidget *widget, gpointer user_data) {
while (gtk_events_pending())
gtk_main_iteration();
- if (all_config_set() == TRUE) {
- switch (plugin_type) {
- case PSE_LT_GPU:
- ConfPlugin(GPUconfigure, GpuConfS, Config.Gpu, "GPUabout", ConfDlg);
- break;
- case PSE_LT_SPU:
- ConfPlugin(SPUconfigure, SpuConfS, Config.Spu, "SPUabout", ConfDlg);
- break;
- case PSE_LT_CDR:
- ConfPlugin(CDRconfigure, CdrConfS, Config.Cdr, "CDRabout", ConfDlg);
- break;
+
+ switch (plugin_type) {
+ case PSE_LT_GPU:
+ ConfPlugin(GPUconfigure, GpuConfS, Config.Gpu, "GPUabout", ConfDlg);
+ break;
+ case PSE_LT_SPU:
+ ConfPlugin(SPUconfigure, SpuConfS, Config.Spu, "SPUabout", ConfDlg);
+ break;
+ case PSE_LT_CDR:
+ ConfPlugin(CDRconfigure, CdrConfS, Config.Cdr, "CDRabout", ConfDlg);
+ break;
#ifdef ENABLE_SIO1API
- case PSE_LT_SIO1:
- ConfPlugin(SIO1configure, Sio1ConfS, Config.Sio1, "SIO1about", ConfDlg);
- break;
+ case PSE_LT_SIO1:
+ ConfPlugin(SIO1configure, Sio1ConfS, Config.Sio1, "SIO1about", ConfDlg);
+ break;
#endif
- }
- } else
- ConfigurePlugins();
+ }
}
static void OnConfConf_Pad1About(GtkWidget *widget, gpointer user_data) {