summaryrefslogtreecommitdiff
path: root/src/dlg-delete.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dlg-delete.c')
-rw-r--r--src/dlg-delete.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/dlg-delete.c b/src/dlg-delete.c
index 824e2ec..803c9b2 100644
--- a/src/dlg-delete.c
+++ b/src/dlg-delete.c
@@ -27,11 +27,11 @@
#include "file-utils.h"
#include "dlg-delete.h"
+#define GET_WIDGET(x) (GTK_WIDGET (gtk_builder_get_object (builder, (x))))
typedef struct {
FrWindow *window;
GList *selected_files;
- GtkBuilder *builder;
GtkWidget *dialog;
GtkWidget *d_all_files_radio;
@@ -47,7 +47,6 @@ destroy_cb (GtkWidget *widget,
DialogData *data)
{
path_list_free (data->selected_files);
- g_object_unref (G_OBJECT (data->builder));
g_free (data);
}
@@ -107,25 +106,24 @@ static void
dlg_delete__common (FrWindow *window,
GList *selected_files)
{
+ GtkBuilder *builder;
DialogData *data;
- GtkWidget *cancel_button;
GtkWidget *ok_button;
data = g_new (DialogData, 1);
data->window = window;
data->selected_files = selected_files;
- data->builder = gtk_builder_new_from_resource (ENGRAMPA_RESOURCE_UI_PATH G_DIR_SEPARATOR_S "delete.ui");
+ builder = gtk_builder_new_from_resource (ENGRAMPA_RESOURCE_UI_PATH G_DIR_SEPARATOR_S "delete.ui");
/* Get the widgets. */
- data->dialog = _gtk_builder_get_widget (data->builder, "delete_dialog");
- data->d_all_files_radio = _gtk_builder_get_widget (data->builder, "d_all_files_radio");
- data->d_selected_files_radio = _gtk_builder_get_widget (data->builder, "d_selected_files_radio");
- data->d_files_radio = _gtk_builder_get_widget (data->builder, "d_files_radio");
- data->d_files_entry = _gtk_builder_get_widget (data->builder, "d_files_entry");
+ data->dialog = GET_WIDGET ("delete_dialog");
+ data->d_all_files_radio = GET_WIDGET ("d_all_files_radio");
+ data->d_selected_files_radio = GET_WIDGET ("d_selected_files_radio");
+ data->d_files_radio = GET_WIDGET ("d_files_radio");
+ data->d_files_entry = GET_WIDGET ("d_files_entry");
- ok_button = _gtk_builder_get_widget (data->builder, "d_ok_button");
- cancel_button = _gtk_builder_get_widget (data->builder, "d_cancel_button");
+ ok_button = GET_WIDGET ("d_ok_button");
/* Set widgets data. */
@@ -142,7 +140,7 @@ dlg_delete__common (FrWindow *window,
"destroy",
G_CALLBACK (destroy_cb),
data);
- g_signal_connect_swapped (G_OBJECT (cancel_button),
+ g_signal_connect_swapped (gtk_builder_get_object (builder, "d_cancel_button"),
"clicked",
G_CALLBACK (gtk_widget_destroy),
G_OBJECT (data->dialog));
@@ -155,6 +153,8 @@ dlg_delete__common (FrWindow *window,
G_CALLBACK (entry_changed_cb),
data);
+ g_object_unref (builder);
+
/* Run dialog. */
gtk_window_set_transient_for (GTK_WINDOW (data->dialog),