Stop pcsx2 from crashing in Linux if a plugin is missing.

git-svn-id: http://pcsx2-playground.googlecode.com/svn/trunk@427 a6443dda-0b58-4228-96e9-037be469359c
This commit is contained in:
arcum42 2008-12-13 08:31:00 +00:00 committed by Gregory Hainaut
parent 89e18b2aa2
commit 9f00a6ac66
2 changed files with 27 additions and 11 deletions

View File

@ -26,17 +26,20 @@ static void FindComboText(GtkWidget *combo, char plist[255][255], GList *list, c
} }
static void GetComboText(GtkWidget *combo, char plist[255][255], char *conf) static bool GetComboText(GtkWidget *combo, char plist[255][255], char *conf)
{ {
int i; int i;
char *tmp = (char*)gtk_combo_box_get_active_text(GTK_COMBO_BOX(combo)); char *tmp = (char*)gtk_combo_box_get_active_text(GTK_COMBO_BOX(combo));
if (tmp == NULL) return FALSE;
for (i=2;i<255;i+=2) { for (i=2;i<255;i+=2) {
if (!strcmp(tmp, plist[i-1])) { if (!strcmp(tmp, plist[i-1])) {
strcpy(conf, plist[i-2]); strcpy(conf, plist[i-2]);
break; break;
} }
} }
return TRUE;
} }
static void ConfPlugin(PluginConf confs, char* plugin, const char* name) static void ConfPlugin(PluginConf confs, char* plugin, const char* name)
@ -203,15 +206,26 @@ void SetActiveComboItem(GtkComboBox *widget,char plist[255][255], GList *list, c
} }
void OnConfConf_Ok(GtkButton *button, gpointer user_data) { void OnConfConf_Ok(GtkButton *button, gpointer user_data) {
GetComboText(GSConfS.Combo, GSConfS.plist, Config.GS); applychanges = TRUE;
GetComboText(PAD1ConfS.Combo, PAD1ConfS.plist, Config.PAD1);
GetComboText(PAD2ConfS.Combo, PAD2ConfS.plist, Config.PAD2); if (!GetComboText(GSConfS.Combo, GSConfS.plist, Config.GS))
GetComboText(SPU2ConfS.Combo, SPU2ConfS.plist, Config.SPU2); applychanges = FALSE;
GetComboText(CDVDConfS.Combo, CDVDConfS.plist, Config.CDVD); if (!GetComboText(PAD1ConfS.Combo, PAD1ConfS.plist, Config.PAD1))
GetComboText(DEV9ConfS.Combo, DEV9ConfS.plist, Config.DEV9); applychanges = FALSE;
GetComboText(USBConfS.Combo, USBConfS.plist, Config.USB); if (!GetComboText(PAD2ConfS.Combo, PAD2ConfS.plist, Config.PAD2))
GetComboText(FWConfS.Combo, FWConfS.plist, Config.FW); applychanges = FALSE;
GetComboText(BiosConfS.Combo, BiosConfS.plist, Config.Bios); if (!GetComboText(SPU2ConfS.Combo, SPU2ConfS.plist, Config.SPU2))
applychanges = FALSE;
if (!GetComboText(CDVDConfS.Combo, CDVDConfS.plist, Config.CDVD))
applychanges = FALSE;
if (!GetComboText(DEV9ConfS.Combo, DEV9ConfS.plist, Config.DEV9))
applychanges = FALSE;
if (!GetComboText(USBConfS.Combo, USBConfS.plist, Config.USB))
applychanges = FALSE;
if (!GetComboText(FWConfS.Combo, FWConfS.plist, Config.FW))
applychanges = FALSE;
if (!GetComboText(BiosConfS.Combo, BiosConfS.plist, Config.Bios))
applychanges = FALSE;
SaveConfig(); SaveConfig();
@ -224,7 +238,6 @@ void OnConfConf_Ok(GtkButton *button, gpointer user_data) {
gtk_widget_destroy(ConfDlg); gtk_widget_destroy(ConfDlg);
if (MainWindow) gtk_widget_set_sensitive(MainWindow, TRUE); if (MainWindow) gtk_widget_set_sensitive(MainWindow, TRUE);
gtk_main_quit(); gtk_main_quit();
applychanges = TRUE;
} }
void OnConfConf_GsConf(GtkButton *button, gpointer user_data) { void OnConfConf_GsConf(GtkButton *button, gpointer user_data) {

View File

@ -408,8 +408,11 @@ int SysInit()
while (LoadPlugins() == -1) { while (LoadPlugins() == -1) {
if (Pcsx2Configure() == FALSE) if (Pcsx2Configure() == FALSE)
{
SysMessage("Configuration failed. Exiting.");
exit(1); exit(1);
} }
}
sinit = 1; sinit = 1;
return 0; return 0;