From 1a61e96e9939f9b506b31efb3a039d4b3f0beccd Mon Sep 17 00:00:00 2001 From: rbuj Date: Fri, 7 Feb 2020 13:10:57 +0200 Subject: dlg-new: Adding many callbacks at once --- src/dlg-new.c | 40 ++++++++-------------------------------- src/ui/new.ui | 5 ++++- 2 files changed, 12 insertions(+), 33 deletions(-) diff --git a/src/dlg-new.c b/src/dlg-new.c index 4998d47..7412dfa 100644 --- a/src/dlg-new.c +++ b/src/dlg-new.c @@ -285,7 +285,7 @@ dlg_new_archive (FrWindow *window, /* Get the widgets. */ - data->dialog = GET_WIDGET ("filechooserdialog"); + data->dialog = GET_WIDGET ("dialog"); data->n_password_entry = GET_WIDGET ("n_password_entry"); data->n_password_label = GET_WIDGET ("n_password_label"); @@ -358,42 +358,18 @@ dlg_new_archive (FrWindow *window, /* Set the signals handlers. */ - /*g_signal_connect (G_OBJECT (data->dialog), - "response", - G_CALLBACK (new_file_response_cb), - data);*/ + gtk_builder_add_callback_symbols (data->builder, + "on_dialog_destroy", G_CALLBACK (destroy_cb), + "on_n_password_entry_changed", G_CALLBACK (password_entry_changed_cb), + "on_n_volume_checkbutton_toggled", G_CALLBACK (volume_toggled_cb), + NULL); + gtk_builder_connect_signals (data->builder, data); - g_signal_connect (G_OBJECT (data->dialog), - "destroy", - G_CALLBACK (destroy_cb), - data); - - /* - g_signal_connect_swapped (G_OBJECT (cancel_button), - "clicked", - G_CALLBACK (gtk_widget_destroy), - G_OBJECT (data->dialog)); - g_signal_connect (G_OBJECT (add_button), - "clicked", - G_CALLBACK (add_clicked_cb), - data);*/ - - /* FIXME g_signal_connect (G_OBJECT (data->n_archive_type_combo_box), - "changed", - G_CALLBACK (archive_type_combo_box_changed_cb), - data); */ - g_signal_connect (G_OBJECT (data->n_password_entry), - "changed", - G_CALLBACK (password_entry_changed_cb), - data); - g_signal_connect (G_OBJECT (data->n_volume_checkbutton), - "toggled", - G_CALLBACK (volume_toggled_cb), - data); g_signal_connect (G_OBJECT (data->format_chooser), "selection-changed", G_CALLBACK (format_chooser_selection_changed_cb), data); + g_signal_connect_after (GET_WIDGET ("other_oprtions_alignment"), "unmap", G_CALLBACK (options_expander_unmap_cb), diff --git a/src/ui/new.ui b/src/ui/new.ui index 8aa6eb5..391a3e2 100644 --- a/src/ui/new.ui +++ b/src/ui/new.ui @@ -77,6 +77,7 @@ True False + 1 @@ -142,6 +143,7 @@ False True True + False @@ -204,7 +206,7 @@ - + False 5 True @@ -213,6 +215,7 @@ save True extra_widget + -- cgit v1.2.1