]> err.no Git - mapper/commitdiff
Don't set clicked signal for hardware key button if it's not used.
authorKaj-Michael Lang <milang@onion.tal.org>
Thu, 2 Aug 2007 10:10:59 +0000 (13:10 +0300)
committerKaj-Michael Lang <milang@onion.tal.org>
Thu, 2 Aug 2007 10:10:59 +0000 (13:10 +0300)
src/settings-gui.c

index dee904a1b5a86cd82cc9c5c2a0e919b3b23b5be0..4f3959be74ba4c0dedefc07fac1bcdc386f817fb 100644 (file)
@@ -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);