summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrbuj <[email protected]>2020-04-14 13:21:22 +0200
committerraveit65 <[email protected]>2020-06-05 14:38:12 +0200
commit4a0d9903b8f6b33b73b2e2bc578c9a237c67b4b3 (patch)
tree53bb6898ebb505c912c6c935a80288e95c2cc6f6 /src
parentc60e1cfb6c4296bcc9c4f05da3484f22e7f15770 (diff)
downloadengrampa-4a0d9903b8f6b33b73b2e2bc578c9a237c67b4b3.tar.bz2
engrampa-4a0d9903b8f6b33b73b2e2bc578c9a237c67b4b3.tar.xz
Use callback symbols defined in ui files
Diffstat (limited to 'src')
-rw-r--r--src/dlg-add-folder.c28
-rw-r--r--src/dlg-ask-password.c15
-rw-r--r--src/dlg-batch-add.c29
-rw-r--r--src/dlg-delete.c22
-rw-r--r--src/dlg-password.c14
-rw-r--r--src/dlg-prop.c17
-rw-r--r--src/dlg-update.c26
-rw-r--r--src/ui/add-options.ui7
-rw-r--r--src/ui/batch-add-files.ui6
-rw-r--r--src/ui/batch-password.ui5
-rw-r--r--src/ui/delete.ui6
-rw-r--r--src/ui/password.ui5
-rw-r--r--src/ui/properties.ui3
-rw-r--r--src/ui/update.ui10
14 files changed, 94 insertions, 99 deletions
diff --git a/src/dlg-add-folder.c b/src/dlg-add-folder.c
index 926da11..2f62986 100644
--- a/src/dlg-add-folder.c
+++ b/src/dlg-add-folder.c
@@ -657,8 +657,6 @@ load_options_cb (GtkWidget *w,
{
LoadOptionsDialogData *aod_data;
GtkBuilder *builder;
- GtkWidget *ok_button;
- GtkWidget *remove_button;
GtkCellRenderer *renderer;
GtkTreeViewColumn *column;
@@ -672,31 +670,19 @@ load_options_cb (GtkWidget *w,
aod_data->dialog = GET_WIDGET ("add_options_dialog");
aod_data->aod_treeview = GET_WIDGET ("aod_treeview");
- ok_button = GET_WIDGET ("aod_okbutton");
- remove_button = GET_WIDGET ("aod_remove_button");
-
/* Set the signals handlers. */
+ gtk_builder_add_callback_symbols (builder,
+ "on_add_options_dialog_destroy", G_CALLBACK (aod_destroy_cb),
+ "on_aod_treeview_row_activated", G_CALLBACK (aod_activated_cb),
+ "on_aod_okbutton_clicked", G_CALLBACK (aod_apply_cb),
+ "on_aod_cancelbutton_clicked", G_CALLBACK (aod_remove_cb),
+ NULL);
+ gtk_builder_connect_signals (builder, aod_data);
- g_signal_connect (G_OBJECT (aod_data->dialog),
- "destroy",
- G_CALLBACK (aod_destroy_cb),
- aod_data);
- g_signal_connect (G_OBJECT (aod_data->aod_treeview),
- "row_activated",
- G_CALLBACK (aod_activated_cb),
- aod_data);
g_signal_connect_swapped (gtk_builder_get_object (builder, "aod_cancelbutton"),
"clicked",
G_CALLBACK (gtk_widget_destroy),
G_OBJECT (aod_data->dialog));
- g_signal_connect (G_OBJECT (ok_button),
- "clicked",
- G_CALLBACK (aod_apply_cb),
- aod_data);
- g_signal_connect (G_OBJECT (remove_button),
- "clicked",
- G_CALLBACK (aod_remove_cb),
- aod_data);
g_object_unref (builder);
diff --git a/src/dlg-ask-password.c b/src/dlg-ask-password.c
index 9453376..7f628a2 100644
--- a/src/dlg-ask-password.c
+++ b/src/dlg-ask-password.c
@@ -123,15 +123,12 @@ dlg_ask_password__common (FrWindow *window,
/* Set the signals handlers. */
- g_signal_connect (G_OBJECT (data->dialog),
- "destroy",
- G_CALLBACK (destroy_cb),
- data);
-
- g_signal_connect (G_OBJECT (data->dialog),
- "response",
- G_CALLBACK (ask_password__response_cb),
- data);
+ gtk_builder_add_callback_symbols (builder,
+ "on_password_dialog_destroy", G_CALLBACK (destroy_cb),
+ "on_password_dialog_response", G_CALLBACK (ask_password__response_cb),
+ NULL);
+
+ gtk_builder_connect_signals (builder, data);
g_object_unref (builder);
diff --git a/src/dlg-batch-add.c b/src/dlg-batch-add.c
index 71f6060..e4891eb 100644
--- a/src/dlg-batch-add.c
+++ b/src/dlg-batch-add.c
@@ -545,22 +545,19 @@ dlg_batch_add_files (FrWindow *window,
/* Set the signals handlers. */
- g_signal_connect (G_OBJECT (GET_WIDGET ("dialog")),
- "destroy",
- G_CALLBACK (destroy_cb),
- data);
- g_signal_connect_swapped (GET_WIDGET ("a_cancel_button"),
+ gtk_builder_add_callback_symbols (data->builder,
+ "on_dialog_destroy", G_CALLBACK (destroy_cb),
+ "on_a_add_button_clicked", G_CALLBACK (add_clicked_cb),
+ "on_a_help_button_clicked", G_CALLBACK (help_clicked_cb),
+ "on_a_volume_checkbutton_toggled", G_CALLBACK (volume_toggled_cb),
+ NULL);
+
+ gtk_builder_connect_signals (data->builder, data);
+
+ g_signal_connect_swapped (gtk_builder_get_object (data->builder, "a_cancel_button"),
"clicked",
G_CALLBACK (gtk_widget_destroy),
- G_OBJECT (GET_WIDGET ("dialog")));
- g_signal_connect (G_OBJECT (GET_WIDGET ("a_add_button")),
- "clicked",
- G_CALLBACK (add_clicked_cb),
- data);
- g_signal_connect (G_OBJECT (GET_WIDGET ("a_help_button")),
- "clicked",
- G_CALLBACK (help_clicked_cb),
- data);
+ gtk_builder_get_object (data->builder, "dialog"));
g_signal_connect (G_OBJECT (data->archive_type_combo_box),
"changed",
G_CALLBACK (archive_type_combo_box_changed_cb),
@@ -569,10 +566,6 @@ dlg_batch_add_files (FrWindow *window,
"notify::text",
G_CALLBACK (password_entry_notify_text_cb),
data);
- g_signal_connect (GET_WIDGET ("a_volume_checkbutton"),
- "toggled",
- G_CALLBACK (volume_toggled_cb),
- data);
/* Run dialog. */
diff --git a/src/dlg-delete.c b/src/dlg-delete.c
index 803c9b2..39994ae 100644
--- a/src/dlg-delete.c
+++ b/src/dlg-delete.c
@@ -108,7 +108,6 @@ dlg_delete__common (FrWindow *window,
{
GtkBuilder *builder;
DialogData *data;
- GtkWidget *ok_button;
data = g_new (DialogData, 1);
data->window = window;
@@ -123,8 +122,6 @@ dlg_delete__common (FrWindow *window,
data->d_files_radio = GET_WIDGET ("d_files_radio");
data->d_files_entry = GET_WIDGET ("d_files_entry");
- ok_button = GET_WIDGET ("d_ok_button");
-
/* Set widgets data. */
if (data->selected_files != NULL)
@@ -135,23 +132,18 @@ dlg_delete__common (FrWindow *window,
}
/* Set the signals handlers. */
+ gtk_builder_add_callback_symbols (builder,
+ "on_delete_dialog_destroy", G_CALLBACK (destroy_cb),
+ "on_d_ok_button_clicked", G_CALLBACK (ok_clicked_cb),
+ "on_d_files_entry_changed", G_CALLBACK (entry_changed_cb),
+ NULL);
+
+ gtk_builder_connect_signals (builder, data);
- g_signal_connect (G_OBJECT (data->dialog),
- "destroy",
- G_CALLBACK (destroy_cb),
- data);
g_signal_connect_swapped (gtk_builder_get_object (builder, "d_cancel_button"),
"clicked",
G_CALLBACK (gtk_widget_destroy),
G_OBJECT (data->dialog));
- g_signal_connect (G_OBJECT (ok_button),
- "clicked",
- G_CALLBACK (ok_clicked_cb),
- data);
- g_signal_connect (G_OBJECT (data->d_files_entry),
- "changed",
- G_CALLBACK (entry_changed_cb),
- data);
g_object_unref (builder);
diff --git a/src/dlg-password.c b/src/dlg-password.c
index 7f237e6..02b8afa 100644
--- a/src/dlg-password.c
+++ b/src/dlg-password.c
@@ -104,16 +104,12 @@ dlg_password (GtkWidget *widget,
/* Set the signals handlers. */
- g_signal_connect (G_OBJECT (data->dialog),
- "destroy",
- G_CALLBACK (destroy_cb),
- data);
-
- g_signal_connect (G_OBJECT (data->dialog),
- "response",
- G_CALLBACK (response_cb),
- data);
+ gtk_builder_add_callback_symbols (builder,
+ "on_password_dialog_destroy", G_CALLBACK (destroy_cb),
+ "on_password_dialog_response", G_CALLBACK (response_cb),
+ NULL);
+ gtk_builder_connect_signals (builder, data);
g_object_unref (builder);
/* Run dialog. */
diff --git a/src/dlg-prop.c b/src/dlg-prop.c
index e604f5c..37376ad 100644
--- a/src/dlg-prop.c
+++ b/src/dlg-prop.c
@@ -60,7 +60,6 @@ dlg_prop (FrWindow *window)
{
GtkBuilder *builder;
DialogData *data;
- GtkWidget *help_button;
GFile *parent;
char *uri;
char *markup;
@@ -75,7 +74,6 @@ dlg_prop (FrWindow *window)
/* Get the widgets. */
- help_button = GET_WIDGET ("p_help_button");
data->dialog = GET_WIDGET ("prop_dialog");
/* Set widgets data. */
@@ -156,18 +154,17 @@ dlg_prop (FrWindow *window)
/* Set the signals handlers. */
- g_signal_connect (G_OBJECT (data->dialog),
- "destroy",
- G_CALLBACK (destroy_cb),
- data);
+ gtk_builder_add_callback_symbols (builder,
+ "on_prop_dialog_destroy", G_CALLBACK (destroy_cb),
+ "on_p_help_button_clicked", G_CALLBACK (help_cb),
+ NULL);
+
+ gtk_builder_connect_signals (builder, data);
+
g_signal_connect_swapped (gtk_builder_get_object (builder, "p_ok_button"),
"clicked",
G_CALLBACK (gtk_widget_destroy),
G_OBJECT (data->dialog));
- g_signal_connect (G_OBJECT (help_button),
- "clicked",
- G_CALLBACK (help_cb),
- data);
g_object_unref (builder);
diff --git a/src/dlg-update.c b/src/dlg-update.c
index 41d3115..50405ff 100644
--- a/src/dlg-update.c
+++ b/src/dlg-update.c
@@ -299,26 +299,20 @@ dlg_update (FrWindow *window)
/* Set the signals handlers. */
- g_signal_connect (G_OBJECT (data->update_file_dialog),
- "destroy",
- G_CALLBACK (dlg_update__destroy_cb),
- data);
- g_signal_connect (gtk_builder_get_object (builder, "update_file_ok_button"),
- "clicked",
- G_CALLBACK (update_cb),
- data);
+ gtk_builder_add_callback_symbols (builder,
+ "on_update_file_dialog_destroy", G_CALLBACK (dlg_update__destroy_cb),
+ "update_file_ok_button_clicked", G_CALLBACK (update_cb),
+ "on_update_files_dialog_destroy", G_CALLBACK (dlg_update__destroy_cb),
+ "update_file_ok_button_clicked", G_CALLBACK (update_cb),
+ NULL);
+
+ gtk_builder_connect_signals (builder, data);
+
g_signal_connect_swapped (gtk_builder_get_object (builder, "update_file_cancel_button"),
"clicked",
G_CALLBACK (gtk_widget_destroy),
G_OBJECT (data->update_file_dialog));
- g_signal_connect (G_OBJECT (data->update_files_dialog),
- "destroy",
- G_CALLBACK (dlg_update__destroy_cb),
- data);
- g_signal_connect (G_OBJECT (data->update_files_ok_button),
- "clicked",
- G_CALLBACK (update_cb),
- data);
+
g_signal_connect_swapped (gtk_builder_get_object (builder, "update_files_cancel_button"),
"clicked",
G_CALLBACK (gtk_widget_destroy),
diff --git a/src/ui/add-options.ui b/src/ui/add-options.ui
index 83e7510..6067613 100644
--- a/src/ui/add-options.ui
+++ b/src/ui/add-options.ui
@@ -8,6 +8,10 @@
<property name="title" translatable="yes">Load Options</property>
<property name="window_position">center-on-parent</property>
<property name="type_hint">dialog</property>
+ <signal name="destroy" handler="on_add_options_dialog_destroy" swapped="no"/>
+ <child type="titlebar">
+ <placeholder/>
+ </child>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox19">
<property name="visible">True</property>
@@ -27,6 +31,7 @@
<property name="can_default">True</property>
<property name="receives_default">False</property>
<property name="use_stock">True</property>
+ <signal name="clicked" handler="on_aod_cancelbutton_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
@@ -42,6 +47,7 @@
<property name="can_default">True</property>
<property name="receives_default">False</property>
<property name="use_stock">True</property>
+ <signal name="clicked" handler="on_aod_okbutton_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
@@ -108,6 +114,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">False</property>
+ <signal name="row-activated" handler="on_aod_treeview_row_activated" swapped="no"/>
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection1"/>
</child>
diff --git a/src/ui/batch-add-files.ui b/src/ui/batch-add-files.ui
index 476cb0c..391ad5f 100644
--- a/src/ui/batch-add-files.ui
+++ b/src/ui/batch-add-files.ui
@@ -21,6 +21,7 @@
<property name="resizable">False</property>
<property name="window_position">center</property>
<property name="type_hint">normal</property>
+ <signal name="destroy" handler="on_dialog_destroy" swapped="no"/>
<child type="titlebar">
<placeholder/>
</child>
@@ -60,6 +61,10 @@
<property name="receives_default">False</property>
<property name="image">image1</property>
<property name="use_underline">True</property>
+ <signal name="clicked" handler="on_a_add_button_clicked" swapped="no"/>
+ <child>
+ <placeholder/>
+ </child>
</object>
<packing>
<property name="expand">False</property>
@@ -254,6 +259,7 @@
<property name="halign">start</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
+ <signal name="toggled" handler="on_a_volume_checkbutton_toggled" swapped="no"/>
</object>
<packing>
<property name="left_attach">0</property>
diff --git a/src/ui/batch-password.ui b/src/ui/batch-password.ui
index a661f22..2b84191 100644
--- a/src/ui/batch-password.ui
+++ b/src/ui/batch-password.ui
@@ -8,6 +8,11 @@
<property name="resizable">False</property>
<property name="window_position">center-on-parent</property>
<property name="type_hint">dialog</property>
+ <signal name="destroy" handler="on_password_dialog_destroy" swapped="no"/>
+ <signal name="response" handler="on_password_dialog_response" swapped="no"/>
+ <child type="titlebar">
+ <placeholder/>
+ </child>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox15">
<property name="visible">True</property>
diff --git a/src/ui/delete.ui b/src/ui/delete.ui
index 6d989a5..08e7731 100644
--- a/src/ui/delete.ui
+++ b/src/ui/delete.ui
@@ -9,6 +9,10 @@
<property name="resizable">False</property>
<property name="window_position">center-on-parent</property>
<property name="type_hint">dialog</property>
+ <signal name="destroy" handler="on_delete_dialog_destroy" swapped="no"/>
+ <child type="titlebar">
+ <placeholder/>
+ </child>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox14">
<property name="visible">True</property>
@@ -43,6 +47,7 @@
<property name="has_default">True</property>
<property name="receives_default">False</property>
<property name="use_stock">True</property>
+ <signal name="clicked" handler="on_d_ok_button_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
@@ -105,6 +110,7 @@
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">example: *.txt; *.doc</property>
<property name="hexpand">True</property>
+ <signal name="changed" handler="on_d_files_entry_changed" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
diff --git a/src/ui/password.ui b/src/ui/password.ui
index af15b80..1a89ce4 100644
--- a/src/ui/password.ui
+++ b/src/ui/password.ui
@@ -9,6 +9,11 @@
<property name="resizable">False</property>
<property name="window_position">center-on-parent</property>
<property name="type_hint">dialog</property>
+ <signal name="destroy" handler="on_password_dialog_destroy" swapped="no"/>
+ <signal name="response" handler="on_password_dialog_response" swapped="no"/>
+ <child type="titlebar">
+ <placeholder/>
+ </child>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox15">
<property name="visible">True</property>
diff --git a/src/ui/properties.ui b/src/ui/properties.ui
index 9b5a94d..7740b3c 100644
--- a/src/ui/properties.ui
+++ b/src/ui/properties.ui
@@ -7,7 +7,8 @@
<property name="border_width">5</property>
<property name="window_position">center-on-parent</property>
<property name="type_hint">dialog</property>
- <child>
+ <signal name="destroy" handler="on_prop_dialog_destroy" swapped="no"/>
+ <child type="titlebar">
<placeholder/>
</child>
<child internal-child="vbox">
diff --git a/src/ui/update.ui b/src/ui/update.ui
index 30a1d54..1f0b579 100644
--- a/src/ui/update.ui
+++ b/src/ui/update.ui
@@ -6,6 +6,10 @@
<property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="type_hint">dialog</property>
+ <signal name="destroy" handler="on_update_file_dialog_destroy" swapped="no"/>
+ <child type="titlebar">
+ <placeholder/>
+ </child>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<property name="visible">True</property>
@@ -38,6 +42,7 @@
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
+ <signal name="clicked" handler="on_update_file_ok_button_clicked" swapped="no"/>
<child>
<object class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
@@ -183,6 +188,10 @@
<property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="type_hint">dialog</property>
+ <signal name="destroy" handler="on_update_files_dialog_destroy" swapped="no"/>
+ <child type="titlebar">
+ <placeholder/>
+ </child>
<child internal-child="vbox">
<object class="GtkBox" id="vbox5">
<property name="visible">True</property>
@@ -215,6 +224,7 @@
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="receives_default">False</property>
+ <signal name="clicked" handler="on_update_files_ok_button_clicked" swapped="no"/>
<child>
<object class="GtkAlignment" id="alignment2">
<property name="visible">True</property>