From 986e748a8236362310cb4135d74dd80593c692bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20T=2E=20Colombini=20G=C3=B3mez?= Date: Tue, 22 Apr 2014 13:33:14 +0200 Subject: [PATCH] =?UTF-8?q?Ahora=20VnDateChooser=20tambi=C3=A9n=20modifica?= =?UTF-8?q?=20horas=20y=20usa=20GDateTime=20internamente?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- INSTALL | 4 +- anjuta/hedera/configure.ac.tpl | 17 +-- configure.ac | 1 - debian/libhedera-dev.dirs | 2 +- debian/libhedera-dev.install | 2 +- gvn/gvn-value.c | 2 +- plugin/pg/db-pg.c | 6 +- po/ca.po | 58 ++++---- po/es.po | 66 ++++----- po/nl.po | 58 ++++---- vn/Makefile.am | 1 + vn/field/Makefile.am | 1 + vn/field/vn-date-chooser.c | 260 ++++++++++++++++++++++++--------- vn/field/vn-date-chooser.h | 6 +- vn/glade/vn-model.c | 23 ++- vn/gui/date-chooser.glade | 187 ++++++++++++++++++++++++ vn/gui/login.glade | 16 +- vn/vn-login.c | 16 +- 18 files changed, 511 insertions(+), 215 deletions(-) create mode 100644 vn/gui/date-chooser.glade diff --git a/INSTALL b/INSTALL index 007e939..2099840 100644 --- a/INSTALL +++ b/INSTALL @@ -12,8 +12,8 @@ without warranty of any kind. Basic Installation ================== - Briefly, the shell commands `./configure; make; make install' should -configure, build, and install this package. The following + Briefly, the shell command `./configure && make && make install' +should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. Some packages provide this `INSTALL' file but do not implement all of the features documented diff --git a/anjuta/hedera/configure.ac.tpl b/anjuta/hedera/configure.ac.tpl index 03b6379..43620f6 100644 --- a/anjuta/hedera/configure.ac.tpl +++ b/anjuta/hedera/configure.ac.tpl @@ -59,7 +59,6 @@ fi AC_SUBST([CFLAGS]) AC_SUBST([VALAFLAGS]) -AC_SUBST([[+NameCLower+]_datadir], ['$(datadir)/hedera/module']) LT_INIT @@ -69,23 +68,19 @@ AC_ARG_VAR([UNINSTALLED_DIR], [the directory of the uninstalled hedera project]) PKG_PROG_PKG_CONFIG if test $UNINSTALLED_DIR; then - PKG_CHECK_MODULES([+NameCUpper+], [gtk+-3.0]) + VALA_CHECK_MODULES([+NameCUpper+], [gtk+-3.0 [+PackageModule2+]]) [+NameCUpper+]_CFLAGS+=-I$UNINSTALLED_DIR [+NameCUpper+]_LIBS+=$UNINSTALLED_DIR/build/main/libhedera.la - - VALA_CHECK_PACKAGES([gtk+-3.0 [+PackageModule2+]]) - VALAFLAGS+='--pkg gtk+-3.0 \ + VALAFLAGS+=$[+NameCUpper+]_VALAFLAGS '--pkg gtk+-3.0 \ --pkg gvn --pkg sql --pkg db --pkg vn \ --vapidir $(UNINSTALLED_DIR)/build/vapi ' AC_SUBST([+NameCLower+]_libdir, $libdir/hedera/module) - AC_SUBST([+NameCLower+]_datadir,$datadir/hedera/module) - AC_SUBST(querydir,$account_datadir/sql) + AC_SUBST([+NameCLower+]_datadir, $datadir/hedera/module) + AC_SUBST(querydir, $account_datadir/sql) else - PKG_CHECK_MODULES([+NameCUpper+], [hedera]) - - VALA_CHECK_PACKAGES([hedera [+PackageModule2+]]) - VALAFLAGS+='--pkg hedera ' + VALA_CHECK_MODULES([+NameCUpper+], [hedera [+PackageModule2+]]) + VALAFLAGS+=$[+NameCUpper+]_VALAFLAGS '--pkg hedera ' PKG_CHECK_VAR([[+NameCLower+]_libdir], [hedera], [modulelibdir]) PKG_CHECK_VAR([[+NameCLower+]_datadir], [hedera], [moduledatadir]) diff --git a/configure.ac b/configure.ac index 7c78a4b..5d3fe5e 100644 --- a/configure.ac +++ b/configure.ac @@ -43,7 +43,6 @@ if test x"$RAGEL" = x"no" ; then fi # Checks if Vala bindings should be generated -dnl TODO: Use AC_ARG_WITH to pick the Vala version? AC_MSG_CHECKING([wether to generate Vala bindings...]) AC_ARG_ENABLE([vala], [AS_HELP_STRING([--enable-vala], diff --git a/debian/libhedera-dev.dirs b/debian/libhedera-dev.dirs index 744c31e..03578de 100644 --- a/debian/libhedera-dev.dirs +++ b/debian/libhedera-dev.dirs @@ -10,7 +10,7 @@ usr/lib/x86_64-linux-gnu/hedera usr/lib/x86_64-linux-gnu/pkgconfig usr/lib/glade/modules #usr/lib/girepository-1.0 -usr/share/gir-1.0 +#usr/share/gir-1.0 usr/share/glade/catalogs usr/share/vala-0.22/vapi usr/share/gtk-doc/html/hedera diff --git a/debian/libhedera-dev.install b/debian/libhedera-dev.install index f10c8be..7338b40 100644 --- a/debian/libhedera-dev.install +++ b/debian/libhedera-dev.install @@ -22,7 +22,7 @@ usr/lib/x86_64-linux-gnu/hedera/libvncolumn.so usr/lib/x86_64-linux-gnu/pkgconfig/* usr/lib/glade/modules/libgladevn.so #usr/lib/girepository-1.0/* -usr/share/gir-1.0/* +#usr/share/gir-1.0/* usr/share/glade/catalogs/* usr/share/vala-0.22/vapi/* usr/share/gtk-doc/html/hedera/* diff --git a/gvn/gvn-value.c b/gvn/gvn-value.c index 27f082d..c5f7804 100644 --- a/gvn/gvn-value.c +++ b/gvn/gvn-value.c @@ -171,7 +171,7 @@ static void gvn_value_transform_date_to_date_time (const GValue * src, GValue * if (date) { - GDateTime * date_time = g_date_time_new_utc ( + GDateTime * date_time = g_date_time_new_local ( g_date_get_year (date) ,g_date_get_month (date) ,g_date_get_day (date) diff --git a/plugin/pg/db-pg.c b/plugin/pg/db-pg.c index bca3afc..7078a90 100644 --- a/plugin/pg/db-pg.c +++ b/plugin/pg/db-pg.c @@ -102,13 +102,13 @@ static gboolean db_pg_open (DbPlugin * obj, const gchar * host, ,user ,pass ); - + if (!pg->conn) { g_set_error (err ,DB_CONN_LOG_DOMAIN ,DB_CONN_ERROR_OPENING - ,_("Can't allocate the needed memory") + ,_("Can't allocate the needed memory") ); return FALSE; } @@ -171,8 +171,6 @@ static GType db_pg_get_g_type (Oid type) case CHAROID: case TEXTOID: case NAMEOID: -// case XMLOID: -// case CSTRINGOID: case BPCHAROID: case VARCHAROID: default: diff --git a/po/ca.po b/po/ca.po index 90cbe60..e96af6a 100644 --- a/po/ca.po +++ b/po/ca.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: hedera 1.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-04-15 10:53+0200\n" +"POT-Creation-Date: 2014-04-22 12:12+0200\n" "PO-Revision-Date: 2013-06-04 13:38+0200\n" "Last-Translator: Alejandro T. Colombini Gómez \n" "Language-Team: Catalan\n" @@ -31,7 +31,7 @@ msgstr "El parametre no pot ser nul" msgid "Incompatible type for this param" msgstr "Tipus incompatible per a aquest parametre" -#: ../gvn/gvn-param.c:443 ../sql/sql-value.c:235 ../vn/vn-field.c:529 +#: ../gvn/gvn-param.c:443 ../sql/sql-value.c:235 ../vn/vn-field.c:538 msgid "Value" msgstr "" @@ -71,15 +71,15 @@ msgstr "" msgid "The spec of the parameter" msgstr "" -#: ../gvn/gvn-param.c:478 ../vn/vn-field.c:557 +#: ../gvn/gvn-param.c:478 ../vn/vn-field.c:566 msgid "Glib Type" msgstr "" -#: ../gvn/gvn-param.c:479 ../vn/vn-field.c:558 +#: ../gvn/gvn-param.c:479 ../vn/vn-field.c:567 msgid "The type of the value" msgstr "" -#: ../gvn/gvn-param.c:485 ../vn/vn-field.c:564 ../vn/vn-column.c:467 +#: ../gvn/gvn-param.c:485 ../vn/vn-field.c:573 ../vn/vn-column.c:467 msgid "Editable" msgstr "" @@ -87,7 +87,7 @@ msgstr "" msgid "Whether the param value can be modified" msgstr "" -#: ../gvn/gvn-param.c:492 ../vn/vn-field.c:571 ../vn/vn-column.c:474 +#: ../gvn/gvn-param.c:492 ../vn/vn-field.c:580 ../vn/vn-column.c:474 msgid "Null" msgstr "" @@ -95,11 +95,11 @@ msgstr "" msgid "Whether the param value can be of type GVN_TYPE_NULL" msgstr "" -#: ../gvn/gvn-param.c:499 ../vn/vn-field.c:578 +#: ../gvn/gvn-param.c:499 ../vn/vn-field.c:587 msgid "Default Value" msgstr "" -#: ../gvn/gvn-param.c:500 ../vn/vn-field.c:579 +#: ../gvn/gvn-param.c:500 ../vn/vn-field.c:588 msgid "The default value" msgstr "" @@ -116,11 +116,11 @@ msgstr "" msgid "No" msgstr "" -#: ../sql/sql-render.c:420 +#: ../sql/sql-render.c:413 msgid "Delimiter" msgstr "" -#: ../sql/sql-render.c:421 +#: ../sql/sql-render.c:414 msgid "The character used for delimite the name of fields, tables..." msgstr "" @@ -265,7 +265,7 @@ msgstr "" msgid "A column to apply the operations over it" msgstr "" -#: ../db/db-param.c:251 ../vn/vn-grid.c:518 ../vn/vn-field.c:543 +#: ../db/db-param.c:251 ../vn/vn-grid.c:518 ../vn/vn-field.c:552 msgid "Iterator" msgstr "" @@ -281,7 +281,7 @@ msgstr "" msgid "The referenced column index" msgstr "" -#: ../db/db-param.c:265 ../vn/vn-field.c:550 ../vn/vn-column.c:460 +#: ../db/db-param.c:265 ../vn/vn-field.c:559 ../vn/vn-column.c:460 msgid "Column name" msgstr "Nom de la columna" @@ -588,45 +588,45 @@ msgstr "" msgid "The application identifier" msgstr "" -#: ../vn/vn-field.c:530 +#: ../vn/vn-field.c:539 msgid "The current value of the field" msgstr "" -#: ../vn/vn-field.c:536 ../glade/glade-db-iterator.c:71 +#: ../vn/vn-field.c:545 ../glade/glade-db-iterator.c:71 #: ../glade/glade-db-iterator.c:116 msgid "Parameter" msgstr "" -#: ../vn/vn-field.c:537 +#: ../vn/vn-field.c:546 msgid "The param where the field can read/write its value" msgstr "" -#: ../vn/vn-field.c:544 +#: ../vn/vn-field.c:553 msgid "The iterator used to get the field param" msgstr "" -#: ../vn/vn-field.c:551 +#: ../vn/vn-field.c:560 msgid "The column name on the iterator" msgstr "" -#: ../vn/vn-field.c:565 +#: ../vn/vn-field.c:574 msgid "Whether the field value is user editable" msgstr "" -#: ../vn/vn-field.c:572 ../vn/vn-column.c:475 +#: ../vn/vn-field.c:581 ../vn/vn-column.c:475 msgid "Whether the field value can be of type GVN_TYPE_NULL" msgstr "" -#: ../vn/vn-field.c:585 ../vn/vn-column.c:488 +#: ../vn/vn-field.c:594 ../vn/vn-column.c:488 msgid "Style function" msgstr "" -#: ../vn/vn-field.c:586 +#: ../vn/vn-field.c:595 msgid "" "A VnFieldStyleFunc to set the properties of each field depending on its value" msgstr "" -#: ../vn/field/vn-entry.c:156 ../vn/field/vn-date-chooser.c:363 +#: ../vn/field/vn-entry.c:156 ../vn/field/vn-date-chooser.c:461 #: ../vn/field/vn-label.c:114 ../vn/column/vn-column-entry.c:122 msgid "Format" msgstr "" @@ -668,34 +668,34 @@ msgstr "" msgid "The name of the field used for the search" msgstr "" -#: ../vn/field/vn-date-chooser.c:319 +#: ../vn/field/vn-date-chooser.c:407 msgid "Change date" msgstr "" -#: ../vn/field/vn-date-chooser.c:364 +#: ../vn/field/vn-date-chooser.c:462 msgid "The date format string describing the order of the elements." msgstr "" -#: ../vn/field/vn-date-chooser.c:365 +#: ../vn/field/vn-date-chooser.c:463 msgctxt "Default date format string" msgid "%a, %d %b %Y" msgstr "" -#: ../vn/field/vn-date-chooser.c:371 +#: ../vn/field/vn-date-chooser.c:469 msgid "Show time" msgstr "" -#: ../vn/field/vn-date-chooser.c:372 +#: ../vn/field/vn-date-chooser.c:470 msgid "" "Whether to show the hour, minute and second fields to set the time of the " "day in the popup." msgstr "" -#: ../vn/field/vn-date-chooser.c:380 +#: ../vn/field/vn-date-chooser.c:478 msgid "Show date" msgstr "" -#: ../vn/field/vn-date-chooser.c:381 +#: ../vn/field/vn-date-chooser.c:479 msgid "Whether to show the calendar to set the date in the popup." msgstr "" diff --git a/po/es.po b/po/es.po index bce16d8..6978b91 100644 --- a/po/es.po +++ b/po/es.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: hedera 1.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-04-15 10:53+0200\n" +"POT-Creation-Date: 2014-04-22 12:12+0200\n" "PO-Revision-Date: 2013-06-04 13:36+0200\n" "Last-Translator: Alejandro T. Colombini Gómez \n" "Language-Team: Spanish\n" @@ -33,7 +33,7 @@ msgstr "El parámetro no puede ser nulo" msgid "Incompatible type for this param" msgstr "Tipo incompatible para este parametro" -#: ../gvn/gvn-param.c:443 ../sql/sql-value.c:235 ../vn/vn-field.c:529 +#: ../gvn/gvn-param.c:443 ../sql/sql-value.c:235 ../vn/vn-field.c:538 msgid "Value" msgstr "Valor" @@ -73,15 +73,15 @@ msgstr "Spec" msgid "The spec of the parameter" msgstr "Datos específicos del parámetro" -#: ../gvn/gvn-param.c:478 ../vn/vn-field.c:557 +#: ../gvn/gvn-param.c:478 ../vn/vn-field.c:566 msgid "Glib Type" msgstr "Tipo Glib" -#: ../gvn/gvn-param.c:479 ../vn/vn-field.c:558 +#: ../gvn/gvn-param.c:479 ../vn/vn-field.c:567 msgid "The type of the value" msgstr "El tipo del valor" -#: ../gvn/gvn-param.c:485 ../vn/vn-field.c:564 ../vn/vn-column.c:467 +#: ../gvn/gvn-param.c:485 ../vn/vn-field.c:573 ../vn/vn-column.c:467 msgid "Editable" msgstr "Editable" @@ -89,7 +89,7 @@ msgstr "Editable" msgid "Whether the param value can be modified" msgstr "Indica si el parámetro puede modificarse" -#: ../gvn/gvn-param.c:492 ../vn/vn-field.c:571 ../vn/vn-column.c:474 +#: ../gvn/gvn-param.c:492 ../vn/vn-field.c:580 ../vn/vn-column.c:474 msgid "Null" msgstr "Nulo" @@ -97,11 +97,11 @@ msgstr "Nulo" msgid "Whether the param value can be of type GVN_TYPE_NULL" msgstr "Indica si el parámetro puede ser nulo" -#: ../gvn/gvn-param.c:499 ../vn/vn-field.c:578 +#: ../gvn/gvn-param.c:499 ../vn/vn-field.c:587 msgid "Default Value" msgstr "Valor por defecto" -#: ../gvn/gvn-param.c:500 ../vn/vn-field.c:579 +#: ../gvn/gvn-param.c:500 ../vn/vn-field.c:588 msgid "The default value" msgstr "El valor por defecto" @@ -118,11 +118,11 @@ msgstr "Sí" msgid "No" msgstr "No" -#: ../sql/sql-render.c:420 +#: ../sql/sql-render.c:413 msgid "Delimiter" msgstr "Delimitador" -#: ../sql/sql-render.c:421 +#: ../sql/sql-render.c:414 msgid "The character used for delimite the name of fields, tables..." msgstr "El carácter usado para delimitar los nombres de campos, tablas..." @@ -273,7 +273,7 @@ msgstr "Columna" msgid "A column to apply the operations over it" msgstr "Una columna sobre la que se aplicarán las operaciones" -#: ../db/db-param.c:251 ../vn/vn-grid.c:518 ../vn/vn-field.c:543 +#: ../db/db-param.c:251 ../vn/vn-grid.c:518 ../vn/vn-field.c:552 msgid "Iterator" msgstr "Iterator" @@ -289,7 +289,7 @@ msgstr "Posición" msgid "The referenced column index" msgstr "La posición de la columna en el Grid" -#: ../db/db-param.c:265 ../vn/vn-field.c:550 ../vn/vn-column.c:460 +#: ../db/db-param.c:265 ../vn/vn-field.c:559 ../vn/vn-column.c:460 msgid "Column name" msgstr "Nombre de la columna" @@ -600,47 +600,47 @@ msgstr "Id de la aplicación" msgid "The application identifier" msgstr "El identificador de la aplicación" -#: ../vn/vn-field.c:530 +#: ../vn/vn-field.c:539 msgid "The current value of the field" msgstr "El valor actual del campo" -#: ../vn/vn-field.c:536 ../glade/glade-db-iterator.c:71 +#: ../vn/vn-field.c:545 ../glade/glade-db-iterator.c:71 #: ../glade/glade-db-iterator.c:116 msgid "Parameter" msgstr "Parámetro" -#: ../vn/vn-field.c:537 +#: ../vn/vn-field.c:546 msgid "The param where the field can read/write its value" msgstr "El parámetro en el que el campo escribe/lee su valor" -#: ../vn/vn-field.c:544 +#: ../vn/vn-field.c:553 msgid "The iterator used to get the field param" msgstr "El Iterator con el que se obtiene el parámetro" -#: ../vn/vn-field.c:551 +#: ../vn/vn-field.c:560 msgid "The column name on the iterator" msgstr "El nombre de la columna en el Iterator" -#: ../vn/vn-field.c:565 +#: ../vn/vn-field.c:574 msgid "Whether the field value is user editable" msgstr "Si el valor de campo puede ser editado por el usuario" -#: ../vn/vn-field.c:572 ../vn/vn-column.c:475 +#: ../vn/vn-field.c:581 ../vn/vn-column.c:475 msgid "Whether the field value can be of type GVN_TYPE_NULL" msgstr "Si el campo puede ser del tipo GVN_TYPE_NULL" -#: ../vn/vn-field.c:585 ../vn/vn-column.c:488 +#: ../vn/vn-field.c:594 ../vn/vn-column.c:488 msgid "Style function" msgstr "Función de estilo" -#: ../vn/vn-field.c:586 +#: ../vn/vn-field.c:595 msgid "" "A VnFieldStyleFunc to set the properties of each field depending on its value" msgstr "" -"Una VnFieldStyleFunc para configurar las propiedades de cada campo dependiendo" -" de su valor" +"Una VnFieldStyleFunc para configurar las propiedades de cada campo " +"dependiendo de su valor" -#: ../vn/field/vn-entry.c:156 ../vn/field/vn-date-chooser.c:363 +#: ../vn/field/vn-entry.c:156 ../vn/field/vn-date-chooser.c:461 #: ../vn/field/vn-label.c:114 ../vn/column/vn-column-entry.c:122 msgid "Format" msgstr "Formato" @@ -682,25 +682,25 @@ msgstr "Campo" msgid "The name of the field used for the search" msgstr "El nombre del campo usado para la búsqueda" -#: ../vn/field/vn-date-chooser.c:319 +#: ../vn/field/vn-date-chooser.c:407 msgid "Change date" msgstr "Cambiar fecha" -#: ../vn/field/vn-date-chooser.c:364 +#: ../vn/field/vn-date-chooser.c:462 msgid "The date format string describing the order of the elements." msgstr "" "La cadena de formato de fechas que describe la salida del campo de texto." -#: ../vn/field/vn-date-chooser.c:365 +#: ../vn/field/vn-date-chooser.c:463 msgctxt "Default date format string" msgid "%a, %d %b %Y" msgstr "%a, %d %b %Y" -#: ../vn/field/vn-date-chooser.c:371 +#: ../vn/field/vn-date-chooser.c:469 msgid "Show time" msgstr "Mostrar tiempo" -#: ../vn/field/vn-date-chooser.c:372 +#: ../vn/field/vn-date-chooser.c:470 msgid "" "Whether to show the hour, minute and second fields to set the time of the " "day in the popup." @@ -708,11 +708,11 @@ msgstr "" "Si se muestran los campos para hora, minuto y segundo para indicar el " "instante del día en el emergente" -#: ../vn/field/vn-date-chooser.c:380 +#: ../vn/field/vn-date-chooser.c:478 msgid "Show date" msgstr "Mostrar fecha" -#: ../vn/field/vn-date-chooser.c:381 +#: ../vn/field/vn-date-chooser.c:479 msgid "Whether to show the calendar to set the date in the popup." msgstr "Si se debe mostrar el calendario para poner la fecha en el emergente." @@ -778,8 +778,8 @@ msgstr "Orden en el cual el tabulador selecciona las columnas para editar" msgid "" "A VnColumnStyleFunc to set the properties of each cell depending on its value" msgstr "" -"Una VnColumnStyleFunc para configurar las propiedadesde cada celda dependiendo" -" de su valor" +"Una VnColumnStyleFunc para configurar las propiedadesde cada celda " +"dependiendo de su valor" #: ../vn/column/vn-column-spin.c:238 msgid "Climb rate" diff --git a/po/nl.po b/po/nl.po index 921a6fd..338a05f 100644 --- a/po/nl.po +++ b/po/nl.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: hedera 1.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-04-15 10:53+0200\n" +"POT-Creation-Date: 2014-04-22 12:12+0200\n" "PO-Revision-Date: 2012-10-09 11:38+0200\n" "Last-Translator: Alejandro T. Colombini Gómez \n" "Language-Team: Dutch\n" @@ -33,7 +33,7 @@ msgstr "" msgid "Incompatible type for this param" msgstr "" -#: ../gvn/gvn-param.c:443 ../sql/sql-value.c:235 ../vn/vn-field.c:529 +#: ../gvn/gvn-param.c:443 ../sql/sql-value.c:235 ../vn/vn-field.c:538 msgid "Value" msgstr "" @@ -73,15 +73,15 @@ msgstr "" msgid "The spec of the parameter" msgstr "" -#: ../gvn/gvn-param.c:478 ../vn/vn-field.c:557 +#: ../gvn/gvn-param.c:478 ../vn/vn-field.c:566 msgid "Glib Type" msgstr "" -#: ../gvn/gvn-param.c:479 ../vn/vn-field.c:558 +#: ../gvn/gvn-param.c:479 ../vn/vn-field.c:567 msgid "The type of the value" msgstr "" -#: ../gvn/gvn-param.c:485 ../vn/vn-field.c:564 ../vn/vn-column.c:467 +#: ../gvn/gvn-param.c:485 ../vn/vn-field.c:573 ../vn/vn-column.c:467 msgid "Editable" msgstr "" @@ -89,7 +89,7 @@ msgstr "" msgid "Whether the param value can be modified" msgstr "" -#: ../gvn/gvn-param.c:492 ../vn/vn-field.c:571 ../vn/vn-column.c:474 +#: ../gvn/gvn-param.c:492 ../vn/vn-field.c:580 ../vn/vn-column.c:474 msgid "Null" msgstr "" @@ -97,11 +97,11 @@ msgstr "" msgid "Whether the param value can be of type GVN_TYPE_NULL" msgstr "" -#: ../gvn/gvn-param.c:499 ../vn/vn-field.c:578 +#: ../gvn/gvn-param.c:499 ../vn/vn-field.c:587 msgid "Default Value" msgstr "" -#: ../gvn/gvn-param.c:500 ../vn/vn-field.c:579 +#: ../gvn/gvn-param.c:500 ../vn/vn-field.c:588 msgid "The default value" msgstr "" @@ -118,11 +118,11 @@ msgstr "" msgid "No" msgstr "" -#: ../sql/sql-render.c:420 +#: ../sql/sql-render.c:413 msgid "Delimiter" msgstr "" -#: ../sql/sql-render.c:421 +#: ../sql/sql-render.c:414 msgid "The character used for delimite the name of fields, tables..." msgstr "" @@ -266,7 +266,7 @@ msgstr "" msgid "A column to apply the operations over it" msgstr "" -#: ../db/db-param.c:251 ../vn/vn-grid.c:518 ../vn/vn-field.c:543 +#: ../db/db-param.c:251 ../vn/vn-grid.c:518 ../vn/vn-field.c:552 msgid "Iterator" msgstr "" @@ -282,7 +282,7 @@ msgstr "" msgid "The referenced column index" msgstr "" -#: ../db/db-param.c:265 ../vn/vn-field.c:550 ../vn/vn-column.c:460 +#: ../db/db-param.c:265 ../vn/vn-field.c:559 ../vn/vn-column.c:460 msgid "Column name" msgstr "" @@ -589,45 +589,45 @@ msgstr "" msgid "The application identifier" msgstr "" -#: ../vn/vn-field.c:530 +#: ../vn/vn-field.c:539 msgid "The current value of the field" msgstr "" -#: ../vn/vn-field.c:536 ../glade/glade-db-iterator.c:71 +#: ../vn/vn-field.c:545 ../glade/glade-db-iterator.c:71 #: ../glade/glade-db-iterator.c:116 msgid "Parameter" msgstr "" -#: ../vn/vn-field.c:537 +#: ../vn/vn-field.c:546 msgid "The param where the field can read/write its value" msgstr "" -#: ../vn/vn-field.c:544 +#: ../vn/vn-field.c:553 msgid "The iterator used to get the field param" msgstr "" -#: ../vn/vn-field.c:551 +#: ../vn/vn-field.c:560 msgid "The column name on the iterator" msgstr "" -#: ../vn/vn-field.c:565 +#: ../vn/vn-field.c:574 msgid "Whether the field value is user editable" msgstr "" -#: ../vn/vn-field.c:572 ../vn/vn-column.c:475 +#: ../vn/vn-field.c:581 ../vn/vn-column.c:475 msgid "Whether the field value can be of type GVN_TYPE_NULL" msgstr "" -#: ../vn/vn-field.c:585 ../vn/vn-column.c:488 +#: ../vn/vn-field.c:594 ../vn/vn-column.c:488 msgid "Style function" msgstr "" -#: ../vn/vn-field.c:586 +#: ../vn/vn-field.c:595 msgid "" "A VnFieldStyleFunc to set the properties of each field depending on its value" msgstr "" -#: ../vn/field/vn-entry.c:156 ../vn/field/vn-date-chooser.c:363 +#: ../vn/field/vn-entry.c:156 ../vn/field/vn-date-chooser.c:461 #: ../vn/field/vn-label.c:114 ../vn/column/vn-column-entry.c:122 msgid "Format" msgstr "" @@ -669,34 +669,34 @@ msgstr "" msgid "The name of the field used for the search" msgstr "" -#: ../vn/field/vn-date-chooser.c:319 +#: ../vn/field/vn-date-chooser.c:407 msgid "Change date" msgstr "" -#: ../vn/field/vn-date-chooser.c:364 +#: ../vn/field/vn-date-chooser.c:462 msgid "The date format string describing the order of the elements." msgstr "" -#: ../vn/field/vn-date-chooser.c:365 +#: ../vn/field/vn-date-chooser.c:463 msgctxt "Default date format string" msgid "%a, %d %b %Y" msgstr "" -#: ../vn/field/vn-date-chooser.c:371 +#: ../vn/field/vn-date-chooser.c:469 msgid "Show time" msgstr "" -#: ../vn/field/vn-date-chooser.c:372 +#: ../vn/field/vn-date-chooser.c:470 msgid "" "Whether to show the hour, minute and second fields to set the time of the " "day in the popup." msgstr "" -#: ../vn/field/vn-date-chooser.c:380 +#: ../vn/field/vn-date-chooser.c:478 msgid "Show date" msgstr "" -#: ../vn/field/vn-date-chooser.c:381 +#: ../vn/field/vn-date-chooser.c:479 msgid "Whether to show the calendar to set the date in the popup." msgstr "" diff --git a/vn/Makefile.am b/vn/Makefile.am index e14b295..0328dfe 100644 --- a/vn/Makefile.am +++ b/vn/Makefile.am @@ -67,6 +67,7 @@ vn_gui_DATA = \ gui/main.glade \ gui/child-window.glade \ gui/actions.glade \ + gui/date-chooser.glade \ gui/menubar.ui gsettings_SCHEMAS = $(top_srcdir)/vn/schema/$(PACKAGE).gschema.xml diff --git a/vn/field/Makefile.am b/vn/field/Makefile.am index 9103eba..54076aa 100644 --- a/vn/field/Makefile.am +++ b/vn/field/Makefile.am @@ -15,6 +15,7 @@ field_include_HEADERS = \ vn-label.h AM_CPPFLAGS = \ + -D_GUI_DIR=\"$(vn_guidir)\" \ -D_IMAGE_DIR=\"$(vn_imagedir)\" \ -I$(top_srcdir) \ $(gtk_CFLAGS) diff --git a/vn/field/vn-date-chooser.c b/vn/field/vn-date-chooser.c index 42ba15c..7237754 100644 --- a/vn/field/vn-date-chooser.c +++ b/vn/field/vn-date-chooser.c @@ -18,7 +18,9 @@ #include "vn-date-chooser.h" #include -#define DATE_SIZE 50 +#define GUI_FILE _GUI_DIR"/date-chooser.glade" + +#define DATE_SIZE 50 /** * SECTION:vn-date-chooser @@ -59,13 +61,13 @@ static void vn_date_chooser_hide_popup (VnDateChooser * obj) static void vn_date_chooser_changed (VnDateChooser * obj) { - GDate * date = &obj->date; + GDateTime * datetime = obj->datetime; - if (g_date_valid (date)) + if (datetime) { - gchar str[DATE_SIZE]; - g_date_strftime (str, DATE_SIZE, obj->format, date); + gchar * str = g_date_time_format (datetime, obj->format); gtk_label_set_text (obj->label, str); + g_free (str); } else gtk_label_set_text (obj->label, ""); @@ -73,50 +75,76 @@ static void vn_date_chooser_changed (VnDateChooser * obj) static void vn_date_chooser_set_value (VnDateChooser * obj, const GValue * value) { - GDate * date = NULL; + GDateTime * datetime = NULL; - if (G_VALUE_TYPE (value) != G_TYPE_DATE) + if (gvn_value_is_null (value) + || G_VALUE_TYPE (value) == G_TYPE_DATE_TIME) + datetime = g_value_get_boxed (value); + else { GValue new_value = G_VALUE_INIT; - g_value_init (&new_value, G_TYPE_DATE); + g_value_init (&new_value, G_TYPE_DATE_TIME); g_value_transform (value, &new_value); - date = g_value_get_boxed (&new_value); + datetime = g_value_get_boxed (&new_value); } - else if (!gvn_value_is_null (value)) - date = g_value_get_boxed (value); - - if (date) - obj->date = *date; - else - g_date_clear (&obj->date, 1); - + + if (datetime) + { + if (gvn_value_is_null (datetime)) + obj->datetime = datetime; + else + obj->datetime = g_date_time_ref (datetime); + } + else if (obj->datetime) + { + g_date_time_unref (obj->datetime); + obj->datetime = NULL; + } + vn_date_chooser_changed (obj); } -static void vn_date_chooser_on_day_selected (GtkCalendar * calendar, VnDateChooser * obj) +static GDateTime * vn_date_chooser_get_datetime (VnDateChooser * obj) { - guint year; - guint month; - guint day; - GDate new_date; - GValue value = G_VALUE_INIT; + guint year, month, day, hour = 0, minute = 0; + gdouble second = 0.0; - gtk_calendar_get_date (calendar, &year, &month, &day); - month++; - - g_date_clear (&new_date, 1); - g_date_set_dmy (&new_date, day, month, year); - - if (!g_date_valid (&obj->date) || g_date_compare (&new_date, &obj->date)) + if (obj->show_date) { - g_date_set_julian (&obj->date, g_date_get_julian (&new_date)); - g_value_init (&value, G_TYPE_DATE); - g_value_set_boxed (&value, &obj->date); + gtk_calendar_get_date (obj->calendar, &year, &month, &day); + month++; + } + + if (obj->show_time) + { + hour = (guint) gtk_adjustment_get_value (obj->hour); + minute = (guint) gtk_adjustment_get_value (obj->minute); + second = gtk_adjustment_get_value (obj->second); + } + + return g_date_time_new_local (year, month, day, hour, minute, second); +} + +void vn_date_chooser_on_day_selected (GtkCalendar * calendar, VnDateChooser * obj) +{ + GValue value = G_VALUE_INIT; + GDateTime * datetime = vn_date_chooser_get_datetime (obj); + + if (!obj->datetime + || (obj->datetime && g_date_time_compare (datetime, obj->datetime))) + { + obj->datetime = datetime; + g_value_init (&value, G_TYPE_DATE_TIME); + g_value_set_boxed (&value, obj->datetime); } else { g_value_init (&value, GVN_TYPE_NULL); - g_date_clear (&obj->date, 1); + + if (obj->datetime) + g_date_time_unref (obj->datetime); + + obj->datetime = NULL; } VN_FIELD_GET_CLASS (obj)->value_changed (VN_FIELD (obj), &value); @@ -126,14 +154,70 @@ static void vn_date_chooser_on_day_selected (GtkCalendar * calendar, VnDateChoos vn_date_chooser_changed (obj); } +void vn_date_chooser_on_ok_clicked (GtkButton * button, VnDateChooser * obj) +{ + GDateTime * datetime = vn_date_chooser_get_datetime (obj); + + if (datetime) + { + GValue value = G_VALUE_INIT; + + if (obj->datetime) + g_date_time_unref (obj->datetime); + + obj->datetime = datetime; + g_value_init (&value, G_TYPE_DATE_TIME); + g_value_set_boxed (&value, datetime); + VN_FIELD_GET_CLASS (obj)->value_changed (VN_FIELD (obj), &value); + g_value_unset (&value); + } + + vn_date_chooser_hide_popup (obj); + vn_date_chooser_changed (obj); +} + +void vn_date_chooser_on_clear_clicked (GtkButton * button, VnDateChooser * obj) +{ + GValue value = G_VALUE_INIT; + g_value_init (&value, GVN_TYPE_NULL); + + if (obj->datetime) + g_date_time_unref (obj->datetime); + + obj->datetime = NULL; + VN_FIELD_GET_CLASS (obj)->value_changed (VN_FIELD (obj), &value); + g_value_unset (&value); + vn_date_chooser_hide_popup (obj); + vn_date_chooser_changed (obj); + + gtk_adjustment_set_value (obj->hour, 0); + gtk_adjustment_set_value (obj->minute, 0); + gtk_adjustment_set_value (obj->second, 0); +} + +void vn_date_chooser_on_now_clicked (GtkButton * button, VnDateChooser * obj) +{ + GValue value = G_VALUE_INIT; + + if (obj->datetime) + g_date_time_unref (obj->datetime); + + obj->datetime = g_date_time_new_now_local (); + g_value_init (&value, G_TYPE_DATE_TIME); + g_value_set_boxed (&value, obj->datetime); + VN_FIELD_GET_CLASS (obj)->value_changed (VN_FIELD (obj), &value); + g_value_unset (&value); + vn_date_chooser_hide_popup (obj); + vn_date_chooser_changed (obj); +} + static gboolean vn_date_chooser_on_button_press (GtkWidget * widget, GdkEventButton * event, VnDateChooser * obj) { gint x, y; GtkAllocation allocation; - gdk_window_get_origin ( - gtk_widget_get_window (obj->popup), &x, &y); + gdk_window_get_origin (gtk_widget_get_window (obj->popup), &x, &y); gtk_widget_get_allocation (obj->popup, &allocation); if (!( event->x_root >= x && event->x_root <= x + allocation.width @@ -169,27 +253,51 @@ static void vn_date_chooser_on_toggled (GtkToggleButton * button, VnDateChooser GdkRectangle monitor; GtkAllocation allocation; GtkWidget * widget = GTK_WIDGET (button); - + // Set the date on the calendar - - if (g_date_valid (&obj->date)) + + if (obj->datetime) { - gtk_calendar_select_month (obj->calendar - ,g_date_get_month (&obj->date) - 1 - ,g_date_get_year (&obj->date) - ); - gtk_calendar_select_day (obj->calendar, - g_date_get_day (&obj->date)); + if (obj->show_date) + { + gtk_calendar_select_month (obj->calendar + ,g_date_time_get_month (obj->datetime) - 1 + ,g_date_time_get_year (obj->datetime) + ); + gtk_calendar_select_day (obj->calendar, + g_date_time_get_day_of_month (obj->datetime)); + } + + if (obj->show_time) + { + gtk_adjustment_set_value (obj->hour, + g_date_time_get_hour (obj->datetime)); + gtk_adjustment_set_value (obj->minute, + g_date_time_get_minute (obj->datetime)); + gtk_adjustment_set_value (obj->second, + g_date_time_get_second (obj->datetime)); + gtk_widget_set_no_show_all (GTK_WIDGET (obj->time), obj->show_time); + } } else gtk_calendar_select_day (obj->calendar, 0); - + + // Set visibility + + if (!obj->show_date) + gtk_widget_hide (GTK_WIDGET (obj->calendar)); + if (!obj->show_time) + gtk_widget_hide (GTK_WIDGET (obj->time)); + + gtk_widget_set_no_show_all (GTK_WIDGET (obj->calendar), !obj->show_date); + gtk_widget_set_no_show_all (GTK_WIDGET (obj->time), !obj->show_time); + // Setting the position of the popup - + window = gtk_widget_get_window (widget); - + gtk_widget_get_allocation (widget, &allocation); - + gdk_window_get_origin (window, &x, &y); x += allocation.x; y += allocation.y; @@ -197,17 +305,17 @@ static void vn_date_chooser_on_toggled (GtkToggleButton * button, VnDateChooser screen = gtk_widget_get_screen (widget); gdk_screen_get_monitor_geometry (screen, gdk_screen_get_monitor_at_point (screen, x, y), &monitor); - + gtk_widget_show (GTK_WIDGET (obj->calendar)); gtk_widget_get_preferred_size (obj->popup, &req, NULL); - + if (y - monitor.y > monitor.height) y = monitor.y + monitor.height - req.height; else if ((y - monitor.y) + req.height + allocation.height > monitor.height) y -= req.height; else y += allocation.height; - + if ((x + allocation.width) - monitor.x > monitor.width) x = monitor.x + monitor.width - req.width; else if ((x - monitor.x) + req.width > monitor.width) @@ -216,7 +324,7 @@ static void vn_date_chooser_on_toggled (GtkToggleButton * button, VnDateChooser gtk_window_set_screen (GTK_WINDOW (obj->popup), screen); gtk_window_move (GTK_WINDOW (obj->popup), x, y); gtk_widget_show_all (obj->popup); - + // Grabbing the focus on the popup window obj->device = gtk_get_current_event_device (); @@ -239,7 +347,6 @@ static void vn_date_chooser_on_toggled (GtkToggleButton * button, VnDateChooser g_list_free (devices); } -// gtk_widget_grab_focus (obj->popup); gtk_device_grab_add (obj->popup, obj->device, TRUE); gdk_device_grab (obj->device ,gtk_widget_get_window (obj->popup) @@ -252,6 +359,16 @@ static void vn_date_chooser_on_toggled (GtkToggleButton * button, VnDateChooser vn_date_chooser_hide_popup (obj); } +gboolean vn_date_chooser_on_spin_output (GtkSpinButton * spin, VnDateChooser * obj) +{ + gchar * format; + GtkAdjustment * adj = gtk_spin_button_get_adjustment (spin); + format = g_strdup_printf ("%02d", (guint) gtk_adjustment_get_value (adj)); + gtk_entry_set_text (GTK_ENTRY (spin), format); + g_free (format); + return TRUE; +} + //+++++++++++++++++++++++++++++++++++++++++++++++++++ Properties enum @@ -304,12 +421,14 @@ static void vn_date_chooser_get_property (VnDateChooser * obj, guint id, static void vn_date_chooser_init (VnDateChooser * obj) { - GtkWidget * image; + GtkBuilder * builder; + obj->show_time = FALSE; + obj->show_date = TRUE; obj->format = NULL; obj->popup = NULL; obj->device = NULL; - g_date_clear (&obj->date, 1); + obj->datetime = NULL; obj->box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8); gtk_container_add (GTK_CONTAINER (obj), GTK_WIDGET (obj->box)); @@ -320,31 +439,38 @@ static void vn_date_chooser_init (VnDateChooser * obj) g_signal_connect (obj->button, "toggled", G_CALLBACK (vn_date_chooser_on_toggled), obj); gtk_box_pack_start (GTK_BOX (obj->box), - GTK_WIDGET (obj->button), FALSE, FALSE, 0); - - image = gtk_image_new_from_icon_name ("gtk-edit", GTK_ICON_SIZE_BUTTON); - gtk_button_set_image (GTK_BUTTON (obj->button), image); + GTK_WIDGET (obj->button), TRUE, TRUE, 0); + g_object_set (obj->button, "relief", GTK_RELIEF_HALF, NULL); obj->label = GTK_LABEL (gtk_label_new (NULL)); gtk_misc_set_alignment (GTK_MISC (obj->label), 0, 0.5); - gtk_box_pack_end (GTK_BOX (obj->box), - GTK_WIDGET (obj->label), TRUE, TRUE, 0); + gtk_container_add (GTK_CONTAINER (obj->button), GTK_WIDGET (obj->label)); - obj->popup = gtk_window_new (GTK_WINDOW_POPUP); + obj->popup = gtk_window_new (GTK_WINDOW_POPUP); g_object_connect (obj->popup ,"signal::button-press-event", vn_date_chooser_on_button_press, obj ,"signal::key-press-event", vn_date_chooser_on_key_press, obj ,NULL ); - obj->calendar = GTK_CALENDAR (gtk_calendar_new ()); - g_signal_connect (obj->calendar, "day-selected-double-click", - G_CALLBACK (vn_date_chooser_on_day_selected), obj); - gtk_container_add (GTK_CONTAINER (obj->popup), GTK_WIDGET (obj->calendar)); + builder = gtk_builder_new_from_file (GUI_FILE); + gtk_builder_connect_signals (builder, obj); + + obj->calendar = GTK_CALENDAR (gtk_builder_get_object (builder, "calendar")); + obj->hour = GTK_ADJUSTMENT (gtk_builder_get_object (builder, "hour")); + obj->minute = GTK_ADJUSTMENT (gtk_builder_get_object (builder, "minute")); + obj->second = GTK_ADJUSTMENT (gtk_builder_get_object (builder, "second")); + obj->time = GTK_WIDGET (gtk_builder_get_object (builder, "time")); + + gtk_container_add (GTK_CONTAINER (obj->popup), + GTK_WIDGET (gtk_builder_get_object (builder, "box"))); } static void vn_date_chooser_finalize (VnDateChooser * obj) { + if (obj->datetime) + g_date_time_unref (obj->datetime); + g_free (obj->format); gtk_widget_destroy (obj->popup); G_OBJECT_CLASS (vn_date_chooser_parent_class)->finalize (G_OBJECT (obj)); diff --git a/vn/field/vn-date-chooser.h b/vn/field/vn-date-chooser.h index 488c4b7..2f84d18 100644 --- a/vn/field/vn-date-chooser.h +++ b/vn/field/vn-date-chooser.h @@ -42,7 +42,11 @@ struct _VnDateChooser GtkWidget * button; GdkDevice * device; GtkCalendar * calendar; - GDate date; + GtkWidget * time; + GtkAdjustment * hour; + GtkAdjustment * minute; + GtkAdjustment * second; + GDateTime * datetime; }; struct _VnDateChooserClass diff --git a/vn/glade/vn-model.c b/vn/glade/vn-model.c index 50574ff..00edeaf 100644 --- a/vn/glade/vn-model.c +++ b/vn/glade/vn-model.c @@ -92,7 +92,7 @@ static const GMarkupParser vn_model_parser = vn_model_start_element ,vn_model_end_element }; -//FIXME: se pone la propiedad "sql" dos veces en el modelo (entre custom_tag_end y custom_finished) + static gboolean vn_model_buildable_custom_tag_start (GtkBuildable * buildable, GtkBuilder * builder, GObject * child, const gchar * tag, GMarkupParser * parser, gpointer * data) @@ -117,12 +117,23 @@ static gboolean vn_model_buildable_custom_tag_start (GtkBuildable * buildable, return FALSE; } -/*XXX TEST -static void vn_model_buildable_set_buildable_property (GtkBuildable *buildable, + +static void vn_model_buildable_set_buildable_property (GtkBuildable * buildable, GtkBuilder * builder, const gchar * name, const GValue * value) { - g_message ("set buildable property"); -}*/ + if (!g_strcmp0 (name, "sql")) + { + static gpointer old_object = NULL; + + if (old_object != buildable) + g_object_set_property (G_OBJECT (buildable), name, value); + + old_object = buildable; + } + else + g_object_set_property (G_OBJECT (buildable), name, value); +} + //+++++++++++++++++++++++++++++++++++++++++++++++++++ Class static void vn_model_finalize (VnModel * obj) @@ -139,7 +150,7 @@ static void vn_model_class_init (VnModelClass * klass) static void vn_model_buildable_init (GtkBuildableIface * iface) { iface->custom_tag_start = vn_model_buildable_custom_tag_start; -// iface->set_buildable_property = vn_model_buildable_set_buildable_property; + iface->set_buildable_property = vn_model_buildable_set_buildable_property; } static void vn_model_init (VnModel * obj) diff --git a/vn/gui/date-chooser.glade b/vn/gui/date-chooser.glade new file mode 100644 index 0000000..6792649 --- /dev/null +++ b/vn/gui/date-chooser.glade @@ -0,0 +1,187 @@ + + + + + 23 + 1 + 10 + + + True + False + 4 + vertical + 4 + + + True + False + True + expand + + + OK + True + True + True + + + + True + True + 0 + + + + + Clear + True + True + True + + + + False + True + 1 + + + + + Now + True + True + True + + + + False + True + 2 + + + + + False + True + 0 + + + + + True + True + 2014 + 2 + 24 + + + + False + True + 1 + + + + + True + False + 4 + top + + + True + True + + 0.5 + True + vertical + hour + True + + + + True + True + 0 + + + + + True + False + : + + + False + True + 1 + + + + + True + True + + 0.5 + True + vertical + minute + True + + + + True + True + 2 + + + + + True + False + : + + + False + True + 3 + + + + + True + True + + 0.5 + True + vertical + second + True + + + + True + True + 4 + + + + + False + True + 2 + + + + + 59 + 1 + 10 + + + 59 + 1 + 10 + + diff --git a/vn/gui/login.glade b/vn/gui/login.glade index 690fd1b..8e74a87 100644 --- a/vn/gui/login.glade +++ b/vn/gui/login.glade @@ -231,6 +231,7 @@ 25 False + True True @@ -386,21 +387,6 @@ 1 - - - gtk-cancel - True - True - True - True - - - - False - True - 2 - - False diff --git a/vn/vn-login.c b/vn/vn-login.c index 57fe54f..aaa58f6 100644 --- a/vn/vn-login.c +++ b/vn/vn-login.c @@ -89,7 +89,6 @@ static void vn_login_show (VnLogin * obj) 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"); @@ -122,11 +121,10 @@ static void vn_login_show (VnLogin * obj) g_object_unref (builder); } +// gtk_widget_show (GTK_WIDGET (obj->window)); gtk_widget_show_all (GTK_WIDGET (obj->window)); gtk_widget_grab_focus (GTK_WIDGET (obj->user)); - gtk_widget_hide (obj->spinner); - gtk_widget_hide (obj->stop); - + if (autologin) gtk_button_clicked (obj->connect); } @@ -145,13 +143,11 @@ static void vn_login_set_loading (VnLogin * obj, gboolean loading) if (loading) { gtk_widget_show (obj->spinner); - gtk_widget_show (obj->stop); gtk_widget_hide (GTK_WIDGET (obj->connect)); } else { gtk_widget_hide (obj->spinner); - gtk_widget_hide (obj->stop); gtk_widget_show (GTK_WIDGET (obj->connect)); } } @@ -378,14 +374,6 @@ void vn_login_cb_connect_clicked (GtkButton * button, VnLogin * obj) (GThreadFunc) vn_login_thread, connect_data); } -/* - * Stops trying to connect. - */ -void vn_login_cb_stop_clicked (GtkButton * button, VnLogin * obj) -{ - -} - /* * Closes the application when login window is destroyed. */