summaryrefslogtreecommitdiff
path: root/src/dlg-password.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dlg-password.c')
-rw-r--r--src/dlg-password.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/dlg-password.c b/src/dlg-password.c
index 4d7a52e..7f237e6 100644
--- a/src/dlg-password.c
+++ b/src/dlg-password.c
@@ -28,9 +28,9 @@
#include "preferences.h"
#include "dlg-password.h"
+#define GET_WIDGET(x) (GTK_WIDGET (gtk_builder_get_object (builder, (x))))
typedef struct {
- GtkBuilder *builder;
FrWindow *window;
GtkWidget *dialog;
GtkWidget *pw_password_entry;
@@ -43,7 +43,6 @@ static void
destroy_cb (GtkWidget *widget,
DialogData *data)
{
- g_object_unref (data->builder);
g_free (data);
}
@@ -84,18 +83,19 @@ void
dlg_password (GtkWidget *widget,
gpointer callback_data)
{
+ GtkBuilder *builder;
FrWindow *window = callback_data;
DialogData *data;
data = g_new0 (DialogData, 1);
- data->builder = gtk_builder_new_from_resource (ENGRAMPA_RESOURCE_UI_PATH G_DIR_SEPARATOR_S "password.ui");
+ builder = gtk_builder_new_from_resource (ENGRAMPA_RESOURCE_UI_PATH G_DIR_SEPARATOR_S "password.ui");
data->window = window;
/* Get the widgets. */
- data->dialog = _gtk_builder_get_widget (data->builder, "password_dialog");
- data->pw_password_entry = _gtk_builder_get_widget (data->builder, "pw_password_entry");
- data->pw_encrypt_header_checkbutton = _gtk_builder_get_widget (data->builder, "pw_encrypt_header_checkbutton");
+ data->dialog = GET_WIDGET ("password_dialog");
+ data->pw_password_entry = GET_WIDGET ("pw_password_entry");
+ data->pw_encrypt_header_checkbutton = GET_WIDGET ("pw_encrypt_header_checkbutton");
/* Set widgets data. */
@@ -114,6 +114,8 @@ dlg_password (GtkWidget *widget,
G_CALLBACK (response_cb),
data);
+ g_object_unref (builder);
+
/* Run dialog. */
gtk_widget_grab_focus (data->pw_password_entry);