From 44c419d7e3633418fbbf2aa4c2997e129bf05d78 Mon Sep 17 00:00:00 2001 From: punkrockguy318 Date: Tue, 6 Mar 2012 22:05:21 +0000 Subject: [PATCH] gtk: added check for gtk 2.24 for the gamepad dialog --- src/drivers/sdl/gui.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/drivers/sdl/gui.cpp b/src/drivers/sdl/gui.cpp index b3387599..3577f406 100644 --- a/src/drivers/sdl/gui.cpp +++ b/src/drivers/sdl/gui.cpp @@ -53,7 +53,7 @@ GtkWidget* buttonMappings[10]; GtkRadioAction* stateSlot = NULL; // check to see if a particular GTK version is available -// 2.24 is required for most of the dialogs -- ie: checkGTKVersion(2,4); +// 2.24 is required for most of the dialogs -- ie: checkGTKVersion(2,24); bool checkGTKVersion(int major_required, int minor_required) { int major = GTK_MAJOR_VERSION; @@ -81,6 +81,12 @@ bool checkGTKVersion(int major_required, int minor_required) // This function configures a single button on a gamepad int configGamepadButton(GtkButton* button, gpointer p) { + // GTK 2.24 required for + if ( checkGTKVersion(2, 24) == false) + { + printf("GTK >= 2.24 required for this dialog. To set the gamepads, use \"--inputcfg\" from the command line (ie: \"fceux --inputcfg gamepad1\").\n"); + return 0; + } gint x = ((gint)(glong)(p)); //gint x = GPOINTER_TO_INT(p); int padNo = atoi(gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(padNoCombo))) - 1;