Added some idiot proof protection. Still needs improvements.
This commit is contained in:
parent
12b0460342
commit
d04010b342
|
@ -191,9 +191,29 @@ void on_menu_controls_activate (GtkMenuItem *menuitem, gpointer user_data)
|
|||
void on_menu_joy_controls_activate (GtkMenuItem *menuitem, gpointer
|
||||
user_data)
|
||||
{
|
||||
GtkDialog * dlg = (GtkDialog*)glade_xml_get_widget(xml, "wJoyConfDlg");
|
||||
GtkDialog * dlg;
|
||||
GtkDialog * msgbox;
|
||||
|
||||
if(nbr_joy>0) /* At least one joystick */
|
||||
{
|
||||
dlg = (GtkDialog*)glade_xml_get_widget(xml, "wJoyConfDlg");
|
||||
init_joy_labels();
|
||||
gtk_dialog_run(dlg);
|
||||
}
|
||||
else
|
||||
{
|
||||
dlg = (GtkDialog*)glade_xml_get_widget(xml, "wMainW");
|
||||
msgbox =
|
||||
gtk_message_dialog_new(dlg,
|
||||
GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_INFO,
|
||||
GTK_BUTTONS_CLOSE,
|
||||
"You don't have any joystick!"
|
||||
);
|
||||
g_signal_connect(G_OBJECT(msgbox), "response", G_CALLBACK(gtk_widget_destroy), NULL);
|
||||
|
||||
gtk_dialog_run( msgbox );
|
||||
}
|
||||
}
|
||||
|
||||
void on_menu_audio_on_activate (GtkMenuItem *menuitem, gpointer user_data) {
|
||||
|
|
Loading…
Reference in New Issue