Do not show joystick configuration dialog when the emulator is running.

This commit is contained in:
evilynux 2007-01-14 21:57:07 +00:00
parent 1cc22a5528
commit 0d2732fa89
1 changed files with 16 additions and 8 deletions

View File

@ -195,27 +195,35 @@ user_data)
{
GtkDialog * dlg;
GtkDialog * msgbox;
char * text;
if(nbr_joy>0) /* At least one joystick */
{
dlg = (GtkDialog*)glade_xml_get_widget(xml, "wJoyConfDlg");
init_joy_labels();
gtk_dialog_run(dlg);
}
else
/* At least one joystick connected?
Can't configure joystick if SDL Event loop is already running. */
if( (nbr_joy < 1) || desmume_running() )
{
if( nbr_joy < 1 )
text = "You don't have any joystick!";
else
text = "Can't configure joystick while the game is running!";
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!"
text
);
g_signal_connect(G_OBJECT(msgbox), "response", G_CALLBACK(gtk_widget_destroy), NULL);
gtk_dialog_run( msgbox );
}
else
{
dlg = (GtkDialog*)glade_xml_get_widget(xml, "wJoyConfDlg");
init_joy_labels();
gtk_dialog_run(dlg);
}
}
void on_menu_audio_on_activate (GtkMenuItem *menuitem, gpointer user_data) {