From ca84b97711ae6b331b602b1db9c1f80a9a8b62b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20T=2E=20Colombini=20G=C3=B3mez?= Date: Fri, 18 Oct 2013 09:02:33 +0200 Subject: [PATCH] VnBuilder eliminado 2 --- vn/Makefile.am | 2 -- vn/vn-login.c | 35 ++++++++++++++++++----------------- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/vn/Makefile.am b/vn/Makefile.am index f3dc62b..b3cbab4 100644 --- a/vn/Makefile.am +++ b/vn/Makefile.am @@ -7,7 +7,6 @@ SUBDIRS = \ vn_lib_LTLIBRARIES = libvn.la vn_include_HEADERS = \ vn.h \ - vn-builder.h \ vn-field.h \ vn-column.h \ vn-login.h \ @@ -34,7 +33,6 @@ libvn_la_LIBADD = \ $(top_builddir)/vn/column/libvncolumn.la libvn_la_SOURCES = \ $(vn_include_HEADERS) \ - vn-builder.c \ vn-field.c \ vn-column.c \ vn-login.c \ diff --git a/vn/vn-login.c b/vn/vn-login.c index d1536f8..2d86612 100644 --- a/vn/vn-login.c +++ b/vn/vn-login.c @@ -19,7 +19,8 @@ #define LOGIN_UI _GUI_DIR"/login.glade" -#define IS_DEFINED(string) (string && g_strcmp0 (string, "")) +#define IS_DEFINED(string) (string && g_strcmp0 (string, "")) +#define BUILDER_GET(obj, name) ((gpointer) gtk_builder_get_object (obj, name)) typedef struct { @@ -79,24 +80,24 @@ static void vn_login_show (VnLogin * obj) { gchar * user; gchar * pass; - VnBuilder * builder = vn_builder_new (); + GtkBuilder * builder = gtk_builder_new (); - if (gtk_builder_add_from_file (GTK_BUILDER (builder), LOGIN_UI, NULL)) + if (gtk_builder_add_from_file (builder, LOGIN_UI, NULL)) { - obj->window = vn_builder_get (builder, "window"); - obj->user = vn_builder_get (builder, "user"); - obj->pass = vn_builder_get (builder, "password"); - obj->remember = vn_builder_get (builder, "remember"); - obj->connect = vn_builder_get (builder, "connect"); - obj->stop = vn_builder_get (builder, "stop"); - obj->settings_button = vn_builder_get (builder, "settings"); - obj->spinner = vn_builder_get (builder, "spinner"); - obj->settings_dialog = vn_builder_get (builder, "settings-dialog"); - obj->plugin = vn_builder_get (builder, "plugin"); - obj->host = vn_builder_get (builder, "host"); - obj->schema = vn_builder_get (builder, "schema"); - obj->ssl_ca = vn_builder_get (builder, "ssl-ca"); - gtk_builder_connect_signals (GTK_BUILDER (builder), obj); + obj->window = BUILDER_GET (builder, "window"); + obj->user = BUILDER_GET (builder, "user"); + obj->pass = BUILDER_GET (builder, "password"); + obj->remember = BUILDER_GET (builder, "remember"); + obj->connect = BUILDER_GET (builder, "connect"); + obj->stop = BUILDER_GET (builder, "stop"); + obj->settings_button = BUILDER_GET (builder, "settings"); + obj->spinner = BUILDER_GET (builder, "spinner"); + obj->settings_dialog = BUILDER_GET (builder, "settings-dialog"); + obj->plugin = BUILDER_GET (builder, "plugin"); + obj->host = BUILDER_GET (builder, "host"); + obj->schema = BUILDER_GET (builder, "schema"); + obj->ssl_ca = BUILDER_GET (builder, "ssl-ca"); + gtk_builder_connect_signals (builder, obj); user = g_settings_get_string (obj->settings, "user"); pass = g_settings_get_string (obj->settings, "pass");