summaryrefslogtreecommitdiff
path: root/src/dlg-update.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dlg-update.c')
-rw-r--r--src/dlg-update.c37
1 files changed, 16 insertions, 21 deletions
diff --git a/src/dlg-update.c b/src/dlg-update.c
index 80bee40..41d3115 100644
--- a/src/dlg-update.c
+++ b/src/dlg-update.c
@@ -30,6 +30,7 @@
#include "fr-init.h"
#include "fr-window.h"
+#define GET_WIDGET(x) (GTK_WIDGET (gtk_builder_get_object (builder, (x))))
enum {
IS_SELECTED_COLUMN,
@@ -40,7 +41,6 @@ enum {
typedef struct {
FrWindow *window;
- GtkBuilder *builder;
GtkWidget *update_file_dialog;
GtkWidget *update_file_primary_text_label;
@@ -63,7 +63,6 @@ dlg_update__destroy_cb (GtkWidget *widget,
DialogData *data)
{
fr_window_update_dialog_closed (data->window);
- g_object_unref (G_OBJECT (data->builder));
if (data->file_list != NULL)
g_list_free (data->file_list);
g_free (data);
@@ -276,33 +275,27 @@ is_selected_toggled (GtkCellRendererToggle *cell,
gpointer
dlg_update (FrWindow *window)
{
+ GtkBuilder *builder;
DialogData *data;
- GtkWidget *update_file_ok_button;
- GtkWidget *update_file_cancel_button;
- GtkWidget *update_files_cancel_button;
GtkCellRenderer *renderer;
GtkTreeViewColumn *column;
data = g_new0 (DialogData, 1);
- data->builder = gtk_builder_new_from_resource (ENGRAMPA_RESOURCE_UI_PATH G_DIR_SEPARATOR_S "update.ui");
+ builder = gtk_builder_new_from_resource (ENGRAMPA_RESOURCE_UI_PATH G_DIR_SEPARATOR_S "update.ui");
data->file_list = NULL;
data->window = window;
/* Get the widgets. */
- data->update_file_dialog = _gtk_builder_get_widget (data->builder, "update_file_dialog");
- data->update_file_primary_text_label = _gtk_builder_get_widget (data->builder, "update_file_primary_text_label");
- data->update_file_secondary_text_label = _gtk_builder_get_widget (data->builder, "update_file_secondary_text_label");
+ data->update_file_dialog = GET_WIDGET ("update_file_dialog");
+ data->update_file_primary_text_label = GET_WIDGET ("update_file_primary_text_label");
+ data->update_file_secondary_text_label = GET_WIDGET ("update_file_secondary_text_label");
- update_file_ok_button = _gtk_builder_get_widget (data->builder, "update_file_ok_button");
- update_file_cancel_button = _gtk_builder_get_widget (data->builder, "update_file_cancel_button");
-
- data->update_files_dialog = _gtk_builder_get_widget (data->builder, "update_files_dialog");
- data->update_files_primary_text_label = _gtk_builder_get_widget (data->builder, "update_files_primary_text_label");
- data->update_files_secondary_text_label = _gtk_builder_get_widget (data->builder, "update_files_secondary_text_label");
- data->update_files_treeview = _gtk_builder_get_widget (data->builder, "update_files_treeview");
- data->update_files_ok_button = _gtk_builder_get_widget (data->builder, "update_files_ok_button");
- update_files_cancel_button = _gtk_builder_get_widget (data->builder, "update_files_cancel_button");
+ data->update_files_dialog = GET_WIDGET ("update_files_dialog");
+ data->update_files_primary_text_label = GET_WIDGET ("update_files_primary_text_label");
+ data->update_files_secondary_text_label = GET_WIDGET ("update_files_secondary_text_label");
+ data->update_files_treeview = GET_WIDGET ("update_files_treeview");
+ data->update_files_ok_button = GET_WIDGET ("update_files_ok_button");
/* Set the signals handlers. */
@@ -310,11 +303,11 @@ dlg_update (FrWindow *window)
"destroy",
G_CALLBACK (dlg_update__destroy_cb),
data);
- g_signal_connect (G_OBJECT (update_file_ok_button),
+ g_signal_connect (gtk_builder_get_object (builder, "update_file_ok_button"),
"clicked",
G_CALLBACK (update_cb),
data);
- g_signal_connect_swapped (G_OBJECT (update_file_cancel_button),
+ 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));
@@ -326,11 +319,13 @@ dlg_update (FrWindow *window)
"clicked",
G_CALLBACK (update_cb),
data);
- g_signal_connect_swapped (G_OBJECT (update_files_cancel_button),
+ g_signal_connect_swapped (gtk_builder_get_object (builder, "update_files_cancel_button"),
"clicked",
G_CALLBACK (gtk_widget_destroy),
G_OBJECT (data->update_files_dialog));
+ g_object_unref (builder);
+
/* Set dialog data. */
data->list_model = GTK_TREE_MODEL (gtk_list_store_new (N_COLUMNS,