diff options
author | rbuj <[email protected]> | 2020-04-02 15:59:02 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2020-06-05 14:38:12 +0200 |
commit | c60e1cfb6c4296bcc9c4f05da3484f22e7f15770 (patch) | |
tree | 7eb0b2d21b9c589fa29fa6b30d6e9c41d7340352 /src/dlg-password.c | |
parent | 1cbdb4442b82a58576f16b664e647755ff964037 (diff) | |
download | engrampa-c60e1cfb6c4296bcc9c4f05da3484f22e7f15770.tar.bz2 engrampa-c60e1cfb6c4296bcc9c4f05da3484f22e7f15770.tar.xz |
gtk-utils: Remove _gtk_builder_get_widget
Diffstat (limited to 'src/dlg-password.c')
-rw-r--r-- | src/dlg-password.c | 14 |
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); |