diff --git a/gnucash/gnome/dialog-find-account.c b/gnucash/gnome/dialog-find-account.c index 3269891de13..135d391dcb1 100644 --- a/gnucash/gnome/dialog-find-account.c +++ b/gnucash/gnome/dialog-find-account.c @@ -76,8 +76,7 @@ gnc_find_account_dialog_window_delete_event_cb (GtkWidget *widget, { FindAccountDialog *facc_dialog = user_data; // this cb allows the window size to be saved on closing with the X - gnc_save_window_size (GNC_PREFS_GROUP, - GTK_WINDOW(facc_dialog->window)); + gnc_save_window_size (GNC_PREFS_GROUP, GTK_WINDOW(widget)); return FALSE; } @@ -100,7 +99,7 @@ gnc_find_account_dialog_window_destroy_cb (GtkWidget *object, gpointer user_data if (facc_dialog->window) { -//FIXME gtk4 gtk_window_destroy (GTK_WINDOW(facc_dialog->window)); + gtk_window_destroy (GTK_WINDOW(facc_dialog->window)); facc_dialog->window = NULL; } g_free (facc_dialog); @@ -229,7 +228,7 @@ get_account_info (FindAccountDialog *facc_dialog, gboolean use_saved_filter) GtkTreeModel *model; /* Get the state of the root radio button */ - radio_root = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(facc_dialog->radio_root)); + radio_root = gtk_check_button_get_active (GTK_CHECK_BUTTON(facc_dialog->radio_root)); /* Get list of Accounts */ if ((facc_dialog->account == NULL) || (radio_root == TRUE)) @@ -354,14 +353,12 @@ gnc_find_account_dialog_create (GtkWidget *parent, FindAccountDialog *facc_dialo GtkWidget *window; GtkBuilder *builder; GtkTreeSelection *selection; - GtkTreeViewColumn *tree_column; GtkCellRenderer *cr; GtkWidget *button; ENTER(" "); builder = gtk_builder_new(); - gtk_builder_set_current_object (builder, G_OBJECT(facc_dialog)); gnc_builder_add_from_file (builder, "dialog-find-account.glade", "list-store"); gnc_builder_add_from_file (builder, "dialog-find-account.glade", "find_account_window"); @@ -382,31 +379,35 @@ gnc_find_account_dialog_create (GtkWidget *parent, FindAccountDialog *facc_dialo facc_dialog->radio_root = GTK_WIDGET(gtk_builder_get_object (builder, "radio-root")); facc_dialog->radio_subroot = GTK_WIDGET(gtk_builder_get_object (builder, "radio-subroot")); - g_signal_connect (facc_dialog->radio_root, "toggled", + g_signal_connect (G_OBJECT(facc_dialog->radio_root), "toggled", G_CALLBACK(list_type_selected_cb), (gpointer)facc_dialog); facc_dialog->filter_text_entry = GTK_WIDGET(gtk_builder_get_object (builder, "filter-text-entry")); facc_dialog->sub_label = GTK_WIDGET(gtk_builder_get_object (builder, "sub-label")); facc_dialog->radio_frame = GTK_WIDGET(gtk_builder_get_object (builder, "frame-radio")); facc_dialog->filter_button = GTK_WIDGET(gtk_builder_get_object (builder, "filter-button")); - g_signal_connect (facc_dialog->filter_button, "clicked", + g_signal_connect (G_OBJECT(facc_dialog->filter_button), "clicked", G_CALLBACK(filter_button_cb), (gpointer)facc_dialog); - g_signal_connect (facc_dialog->filter_text_entry, "activate", + g_signal_connect (G_OBJECT(facc_dialog->filter_text_entry), "activate", G_CALLBACK(filter_active_cb), (gpointer)facc_dialog); button = GTK_WIDGET(gtk_builder_get_object (builder, "jumpto_button")); - g_signal_connect(button, "clicked", G_CALLBACK(gnc_find_account_dialog_jump_button_cb), facc_dialog); + g_signal_connect (G_OBJECT(button), "clicked", + G_CALLBACK(gnc_find_account_dialog_jump_button_cb), facc_dialog); button = GTK_WIDGET(gtk_builder_get_object (builder, "check_button")); - g_signal_connect(button, "clicked", G_CALLBACK(gnc_find_account_dialog_check_button_cb), facc_dialog); + g_signal_connect (G_OBJECT(button), "toggled", + G_CALLBACK(gnc_find_account_dialog_check_button_cb), facc_dialog); button = GTK_WIDGET(gtk_builder_get_object (builder, "close_button")); - g_signal_connect(button, "clicked", G_CALLBACK(gnc_find_account_dialog_close_button_cb), facc_dialog); + g_signal_connect (G_OBJECT(button), "clicked", + G_CALLBACK(gnc_find_account_dialog_close_button_cb), facc_dialog); facc_dialog->view = GTK_WIDGET(gtk_builder_get_object (builder, "treeview")); - g_signal_connect (facc_dialog->view, "row-activated", - G_CALLBACK(row_double_clicked), (gpointer)facc_dialog); + g_signal_connect (G_OBJECT(facc_dialog->view), "row-activated", + G_CALLBACK(row_double_clicked), (gpointer)facc_dialog); // Set grid lines option to preference - gtk_tree_view_set_grid_lines (GTK_TREE_VIEW(facc_dialog->view), gnc_tree_view_get_grid_lines_pref ()); + gtk_tree_view_set_grid_lines (GTK_TREE_VIEW(facc_dialog->view), + gnc_tree_view_get_grid_lines_pref ()); selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(facc_dialog->view)); gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE); @@ -467,10 +468,10 @@ gnc_find_account_dialog_create (GtkWidget *parent, FindAccountDialog *facc_dialo gtk_tree_view_column_set_attributes (tree_column, cr, "icon-name", TAX, NULL); gtk_cell_renderer_set_alignment (cr, 0.5, 0.5); - g_signal_connect (facc_dialog->window, "destroy", + g_signal_connect (G_OBJECT(facc_dialog->window), "destroy", G_CALLBACK(gnc_find_account_dialog_window_destroy_cb), facc_dialog); - g_signal_connect (facc_dialog->window, "delete-event", + g_signal_connect (G_OBJECT(facc_dialog->window), "close-request", G_CALLBACK(gnc_find_account_dialog_window_delete_event_cb), facc_dialog); GtkEventController *event_controller = gtk_event_controller_key_new (); @@ -480,12 +481,13 @@ gnc_find_account_dialog_create (GtkWidget *parent, FindAccountDialog *facc_dialo G_CALLBACK(gnc_find_account_dialog_window_key_press_cb), facc_dialog); //FIXME gtk4 gtk_builder_connect_signals_full (builder, gnc_builder_connect_full_func, facc_dialog); +//not sure about this, something to do with GtkBuilderScope and templates g_object_unref (G_OBJECT(builder)); gnc_restore_window_size (GNC_PREFS_GROUP, GTK_WINDOW(facc_dialog->window), GTK_WINDOW(parent)); -//FIXME gtk4 gtk_widget_show_all (GTK_WIDGET(facc_dialog->window)); + gtk_widget_set_visible (GTK_WIDGET(facc_dialog->window), TRUE); if (facc_dialog->account != NULL) { @@ -524,7 +526,8 @@ close_handler (gpointer user_data) ENTER(" "); gnc_save_window_size (GNC_PREFS_GROUP, GTK_WINDOW(facc_dialog->window)); -//FIXME gtk4 gtk_window_destroy (GTK_WINDOW(facc_dialog->window)); + + gtk_window_destroy (GTK_WINDOW(facc_dialog->window)); LEAVE(" "); } diff --git a/gnucash/gtkbuilder/dialog-find-account.glade b/gnucash/gtkbuilder/dialog-find-account.glade index 208f4c19c12..11fc2806eff 100644 --- a/gnucash/gtkbuilder/dialog-find-account.glade +++ b/gnucash/gtkbuilder/dialog-find-account.glade @@ -1,185 +1,89 @@ - - + - - - - - - - - False - Search the Account List + Search the Account List 600 400 - + - False + 1 vertical - - - False - end - - - Close _on Jump - True - True - False - start - True - True - True - - - False - False - 0 - - - - - _Jump To - True - True - False - True - - - False - False - 1 - - - - - _Close - True - True - True - True - False - True - - - False - False - 2 - - - - - False - False - end - 0 - - - True - False + 1 + center 6 - Search the Account List + Search the Account List - + - - False - False - 0 - - True - False + 1 + center start 6 6 6 - 0 - in - + - True - False + 1 start - 5 vertical - True + 1 - - All _accounts - True - True - False + + 1 + center + All _accounts start - True - True - True + 1 + 1 - - False - False - 0 - - + + 1 + center Su_b-accounts of - True - True - False start - True - True + 1 radio-root - - False - False - 1 - - + - True - False - Search scope + 1 + Search scope - - False - False - 2 - - True - True - + 1 + 1 + 1 + - True - True + 1 + 1 list-store 0 @@ -187,8 +91,8 @@ - True - Account Full Name + 1 + Account Full Name @@ -198,110 +102,101 @@ - + - - True - True - 3 - - True - False + 1 + center 3 3 - Case insensitive searching is available on 'Account Full Name'. + Case insensitive searching is available on 'Account Full Name'. center - - False - False - 4 - - True - False + 1 + center - True - False + 1 + 1 - - True - True - 0 - - True - True - True - True - True + 1 + 1 + 1 - False - False + 0 + 0 - - True - True - 1 - - Sea_rch - True - True - True - True + 1 + Sea_rch + 1 + 1 + 1 - - False - True - 2 - - True - False + 1 + 1 - - True - True - 3 - - - False - False - 5 - - True - False + 1 + center 3 3 - Select a row and then press 'jump to' to jump to the account in the Account Tree, + Select a row and then press 'jump to' to jump to the account in the Account Tree, if account should not be shown, this will be temporarily overridden. center - - False - False - 6 - + + + + 1 + center + + + 1 + Close _on Jump + 1 + end + 1 + 1 + 1 + + + + + 1 + _Jump To + 1 + 1 + + + + + 1 + _Close + 1 + 1 + + + - +