From: Kaj-Michael Lang Date: Thu, 2 Aug 2007 10:10:59 +0000 (+0300) Subject: Don't set clicked signal for hardware key button if it's not used. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a6063971d77906137f13a528b50b899c34dfd03c;p=mapper Don't set clicked signal for hardware key button if it's not used. --- diff --git a/src/settings-gui.c b/src/settings-gui.c index dee904a..4f3959b 100644 --- a/src/settings-gui.c +++ b/src/settings-gui.c @@ -126,13 +126,11 @@ settings_dialog_hardkeys(GtkWidget * widget, GtkWidget * parent) GTK_RESPONSE_ACCEPT, NULL); gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->action_area), - btn_defaults = - gtk_button_new_with_label(_("Reset..."))); + btn_defaults = gtk_button_new_with_label(_("Reset..."))); g_signal_connect(G_OBJECT(btn_defaults), "clicked", G_CALLBACK(settings_dialog_hardkeys_reset), &bdi); - gtk_dialog_add_button(GTK_DIALOG(dialog), - GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT); + gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT); gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), table = gtk_table_new(2, 9, FALSE), TRUE, TRUE, 0); @@ -453,6 +451,7 @@ settings_dialog(void) gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->action_area), btn_buttons = gtk_button_new_with_label(_("Hardware Keys..."))); + g_signal_connect(G_OBJECT(btn_buttons), "clicked", G_CALLBACK(settings_dialog_hardkeys), dialog); #endif gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->action_area), @@ -731,22 +730,17 @@ settings_dialog(void) /* Connect signals. */ scan_info.settings_dialog = dialog; scan_info.txt_rcvr_mac = txt_rcvr_mac; - g_signal_connect(G_OBJECT(btn_scan), "clicked", - G_CALLBACK(scan_bluetooth), &scan_info); - g_signal_connect(G_OBJECT(btn_buttons), "clicked", - G_CALLBACK(settings_dialog_hardkeys), dialog); - g_signal_connect(G_OBJECT(btn_colors), "clicked", - G_CALLBACK(settings_dialog_colors), dialog); + g_signal_connect(G_OBJECT(btn_scan), "clicked", G_CALLBACK(scan_bluetooth), &scan_info); + g_signal_connect(G_OBJECT(btn_colors), "clicked", G_CALLBACK(settings_dialog_colors), dialog); browse_info.dialog = dialog; browse_info.txt = txt_mapper_db; - g_signal_connect(G_OBJECT(btn_browsedb), "clicked", - G_CALLBACK(settings_dialog_browse_forfile), - &browse_info); + g_signal_connect(G_OBJECT(btn_browsedb), "clicked", G_CALLBACK(settings_dialog_browse_forfile), &browse_info); /* Initialize fields. */ if (_rcvr_mac) gtk_entry_set_text(GTK_ENTRY(txt_rcvr_mac), _rcvr_mac); + if (_mapper_db) gtk_entry_set_text(GTK_ENTRY(txt_mapper_db), _mapper_db);