From f6a57e87b6f7a8d5b690b83878bc7a3036ca3b8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20T=2E=20Colombini=20G=C3=B3mez?= Date: Fri, 13 Dec 2013 10:07:52 +0100 Subject: [PATCH] =?UTF-8?q?Se=20ha=20mejorado=20el=20plugin=20de=20glade?= =?UTF-8?q?=20y=20se=20ha=20a=C3=B1adido=20al=20proyecto=20la=20plantilla?= =?UTF-8?q?=20de=20los=20m=C3=B3dulos=20para=20anjuta?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile.am | 3 +- anjuta/Makefile.am | 50 ++++ anjuta/hedera-logo.png | Bin 0 -> 1515 bytes anjuta/hedera.wiz | 134 +++++++++++ anjuta/hedera/AUTHORS.tpl | 2 + anjuta/hedera/Makefile.am.tpl | 42 ++++ anjuta/hedera/anjuta.session.tpl | 32 +++ anjuta/hedera/build/m4/pkg.m4 | 15 ++ anjuta/hedera/configure.ac.tpl | 80 +++++++ anjuta/hedera/data/Makefile.am.tpl | 11 + anjuta/hedera/data/mod.glade | 12 + anjuta/hedera/data/mod.ui.tpl | 10 + anjuta/hedera/data/mod.xml.tpl | 20 ++ anjuta/hedera/debian/changelog.tpl | 6 + anjuta/hedera/debian/compat | 1 + anjuta/hedera/debian/control.tpl | 14 ++ anjuta/hedera/debian/copyright.tpl | 29 +++ anjuta/hedera/debian/docs | 2 + anjuta/hedera/debian/rules | 20 ++ anjuta/hedera/debian/source/format | 1 + anjuta/hedera/po/POTFILES.in.tpl | 7 + anjuta/hedera/po/POTFILES.skip.tpl | 5 + anjuta/hedera/sql/mod/query.sql.tpl | 0 anjuta/hedera/src/Makefile.am.tpl | 48 ++++ anjuta/hedera/src/config.vapi | 12 + anjuta/hedera/src/form.vala | 22 ++ anjuta/hedera/src/mod.vala | 22 ++ anjuta/hedera/translation | 49 ++++ configure.ac | 1 + db/Makefile.am | 2 +- db/db-iterator.c | 4 +- db/db-model.c | 7 +- debian/libhedera-dev.dirs | 12 + debian/libhedera-dev.install | 10 + docs/reference/hedera/first-tutorial.xml | 49 +++- docs/reference/hedera/module-tutorial.xml | 3 + glade/Makefile.am | 3 +- glade/glade-db-iterator.c | 279 ++++++++++++++++++++++ glade/glade-db-model.c | 12 +- glade/glade-vn-batch.c | 4 +- glade/vn.xml | 37 ++- module/data/customer.glade | 10 +- module/src/vn-consulter.c | 59 ++++- po/POTFILES.in | 3 +- po/ca.po | 219 ++++++++++------- po/es.po | 222 ++++++++++------- po/nl.po | 219 ++++++++++------- sql/parser/gram.y | 22 +- sql/parser/scan.rl | 16 +- sql/sql-parser.h | 8 +- sql/sql-select.c | 39 +++ sql/sql-select.h | 1 + sql/sql.pc.in | 9 +- vn/Makefile.am | 4 +- vn/column/vn-column-spin.c | 117 +++++++-- vn/column/vn-column-spin.h | 1 + vn/glade/vn-iterator.c | 53 ++++ vn/glade/vn-iterator.h | 46 ++++ vn/gui/actions.glade | 3 +- vn/gui/menubar.ui | 4 + vn/vn-batch.c | 7 +- vn/vn-gui.c | 23 +- vn/vn-mod.c | 8 +- 63 files changed, 1806 insertions(+), 359 deletions(-) create mode 100644 anjuta/Makefile.am create mode 100644 anjuta/hedera-logo.png create mode 100644 anjuta/hedera.wiz create mode 100644 anjuta/hedera/AUTHORS.tpl create mode 100644 anjuta/hedera/Makefile.am.tpl create mode 100644 anjuta/hedera/anjuta.session.tpl create mode 100644 anjuta/hedera/build/m4/pkg.m4 create mode 100644 anjuta/hedera/configure.ac.tpl create mode 100644 anjuta/hedera/data/Makefile.am.tpl create mode 100644 anjuta/hedera/data/mod.glade create mode 100644 anjuta/hedera/data/mod.ui.tpl create mode 100644 anjuta/hedera/data/mod.xml.tpl create mode 100644 anjuta/hedera/debian/changelog.tpl create mode 100644 anjuta/hedera/debian/compat create mode 100644 anjuta/hedera/debian/control.tpl create mode 100644 anjuta/hedera/debian/copyright.tpl create mode 100644 anjuta/hedera/debian/docs create mode 100644 anjuta/hedera/debian/rules create mode 100644 anjuta/hedera/debian/source/format create mode 100644 anjuta/hedera/po/POTFILES.in.tpl create mode 100644 anjuta/hedera/po/POTFILES.skip.tpl create mode 100644 anjuta/hedera/sql/mod/query.sql.tpl create mode 100644 anjuta/hedera/src/Makefile.am.tpl create mode 100644 anjuta/hedera/src/config.vapi create mode 100644 anjuta/hedera/src/form.vala create mode 100644 anjuta/hedera/src/mod.vala create mode 100755 anjuta/hedera/translation create mode 100644 glade/glade-db-iterator.c create mode 100644 vn/glade/vn-iterator.c create mode 100644 vn/glade/vn-iterator.h diff --git a/Makefile.am b/Makefile.am index e0c247c..e11d07b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -14,7 +14,8 @@ SUBDIRS = \ po \ vapi \ glade \ - docs + docs \ + anjuta EXTRA_DIST = \ autogen.sh \ diff --git a/anjuta/Makefile.am b/anjuta/Makefile.am new file mode 100644 index 0000000..705ba4f --- /dev/null +++ b/anjuta/Makefile.am @@ -0,0 +1,50 @@ + +anjutadir = $(datadir)/anjuta/templates +anjuta_DATA = \ + hedera.wiz \ + hedera-logo.png + +templatedir = $(anjutadir)/hedera +template_DATA = \ + hedera/anjuta.session.tpl \ + hedera/AUTHORS.tpl \ + hedera/configure.ac.tpl \ + hedera/Makefile.am.tpl \ + hedera/translation + +anjuta_srcdir = $(templatedir)/src +anjuta_src_DATA = \ + hedera/src/config.vapi \ + hedera/src/form.vala \ + hedera/src/Makefile.am.tpl \ + hedera/src/mod.vala + +anjuta_datadir = $(templatedir)/data +anjuta_data_DATA = \ + hedera/data/Makefile.am.tpl \ + hedera/data/mod.glade \ + hedera/data/mod.ui.tpl \ + hedera/data/mod.xml.tpl + +anjuta_sqldir = $(templatedir)/sql/mod +anjuta_sql_DATA = hedera/sql/mod/query.sql.tpl + +anjuta_m4dir = $(templatedir)/build/m4 +anjuta_m4_DATA = hedera/build/m4/pkg.m4 + +anjuta_podir = $(templatedir)/po +anjuta_po_DATA = \ + hedera/po/POTFILES.in.tpl \ + hedera/po/POTFILES.skip.tpl + +anjuta_debiandir = $(templatedir)/debian +anjuta_debian_DATA = \ + hedera/debian/changelog.tpl \ + hedera/debian/compat \ + hedera/debian/control.tpl \ + hedera/debian/copyright.tpl \ + hedera/debian/docs \ + hedera/debian/rules + +anjuta_debian_sourcedir = $(anjuta_debiandir)/source +anjuta_debian_source_DATA = hedera/debian/source/format diff --git a/anjuta/hedera-logo.png b/anjuta/hedera-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..a0d90f606fd7074f96bab0f870041e07af702ebc GIT binary patch literal 1515 zcmV|6^PP|0bA346xU{( zG2@x0r@ls4I~M>HDTPB%VY5k?w06o=7MQK5dg^O5)o2NTT~A>(i2ekk;+U(awnlq1 zoi$|?0Vr-ay3T+pNcPt>W-CwXsjbme%h9ST*$SYvJ&@&kiaTB6A%GAAT-*W zu~l5+U9GR2Ki_lE{*WHM9JIB|I)DiiNDhr8S}$FVyVu!!^EX+o^_3F`T_v|~d4AE$ zL1SHS0@10Y8_jyD_EK}3pU)iTpuCJP?OnJ6b>Q(p#jV~1qN4R(KDCvcEiYlU zl+r!Wt^n-WZa;ARuE6b#1P_CtLh=)YKpw>g#1AfYBOQ0@4HZcez&fE89-&=Y{+CWv91sV(^hNIax&H zE-~g!o+7ftqeZ$HkmN{IReEe6Y<0W{kh@0gi;4eh8x=}lF{gk*_O-PdKq7=dN)Sj~ z4m*|AH#mN!m?AmCnfI{-{%`pF>;6|6wob{IC1xdNu+SWg$>Zs@35oQ0z(en@(~m?} zT;{-?o3eUbnuvLIqiLtv{P^=lN@QzmPxXx};`9$koL2))!0QsqSt0V{Ca`&I5;-O- zLB0q%?8w3bQf<}p&Vqb($NmnD?DN^H!^;n2h> zneK5e1lk;0OlZCF3@$f4;^AalM*Nt((Q)#zXS?&_glYgcD`MD!}rhizzqXdVI{@~&4 z##MfiZ9jc2UmK}j|GQDUAChqY9?c^SloBZfwe2mO`lEvHuNKSS|A_!c;!iS_;ChtY Rsowwq002ovPDHLkV1n + + + Hedera Module + Basic project for an Hedera Module. + hedera-logo.png + Vala + automake + autoconf + make + valac + hedera + hedera + + + + + + + + + + + + + + [+INCLUDE "licenses.tpl"+] + + + + + + + + + + + + + + + + + + [+IF (=(get "HavePackageExtra") "1")+] + + + + [+ENDIF+] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [+IF (=(get "DebianPackage") "1")+] + + + + + + + + + + + + + + + + + [+ENDIF+] + [+IF (=(get "HaveI18n") "1") +] + + + + + + [+ENDIF+] + + + + + + + + + + [+IF (=(get "HaveI18n") "1") +] + + [+ENDIF+] + + + diff --git a/anjuta/hedera/AUTHORS.tpl b/anjuta/hedera/AUTHORS.tpl new file mode 100644 index 0000000..1c13514 --- /dev/null +++ b/anjuta/hedera/AUTHORS.tpl @@ -0,0 +1,2 @@ +[+ autogen5 template +] +[+Author+] <[+Email+]> diff --git a/anjuta/hedera/Makefile.am.tpl b/anjuta/hedera/Makefile.am.tpl new file mode 100644 index 0000000..1b83a10 --- /dev/null +++ b/anjuta/hedera/Makefile.am.tpl @@ -0,0 +1,42 @@ +[+ autogen5 template +] +[+ +(define prefix_if_missing + (lambda + (name prefix) + (string-append + (if + (==* (get name) prefix) + "" + prefix + ) + (get name) + ) + ) +) ++]## Process this file with automake to produce Makefile.in +## Created by Anjuta + +ACLOCAL_AMFLAGS = -I build/m4 + +SUBDIRS = \ + src \ + data[+IF (=(get "HaveI18n") "1")+] \ + po + +translationsdir = +translations_DATA = \ + po/es.po +[+ENDIF+] +EXTRA_DIST = \ + README \ + COPYING \ + AUTHORS \ + ChangeLog \ + INSTALL \ + NEWS \ + Makefile.decl + +install-exec-hook: + rm -f $(DESTDIR)$(libdir)/hedera/module/[+(prefix_if_missing "Name" "lib")+].la + rm -f $(DESTDIR)$(libdir)/hedera/module/[+(prefix_if_missing "Name" "lib")+].a + diff --git a/anjuta/hedera/anjuta.session.tpl b/anjuta/hedera/anjuta.session.tpl new file mode 100644 index 0000000..15905d6 --- /dev/null +++ b/anjuta/hedera/anjuta.session.tpl @@ -0,0 +1,32 @@ +[+ autogen5 template +] +[Anjuta] +Maximized=1 +Geometry=1920x1021+0+27 + +[Project Manager] +Expand=[+Name+]%%%[+Name+]//data%%%[+Name+]//src + +[File Loader] +Files=../../src/[+FormName+].vala#30 + +[Document Manager] +bookmarks=\n\n + +[Execution] +Program arguments=-u +Program uri=file:///usr/bin/hedera-bin +Run in terminal=2 +Working directories=../../../[+Name+]%%%../../build +Environment variables=VN_MODULE_LIB_PATH=./build/src/.libs%%%VN_MODULE_DATA_PATH=./data%%%VN_MODULE_QUERY_PATH=./sql + +[Build] +Configuration list=1:Default:build%%%1:Debug:build%%%1:Install:build%%%1:Optimized:build%%%1:Profiling:build +Selected Configuration=Debug +BuildArgs/Default= +BuildArgs/Debug=--enable-debug +BuildArgs/Install=--prefix= +BuildArgs/Optimized= +BuildArgs/Profiling= + +[Debugger] +Stop at beginning=2 diff --git a/anjuta/hedera/build/m4/pkg.m4 b/anjuta/hedera/build/m4/pkg.m4 new file mode 100644 index 0000000..e85c1c5 --- /dev/null +++ b/anjuta/hedera/build/m4/pkg.m4 @@ -0,0 +1,15 @@ +# Retrieves the value of the pkg-config variable for the given module. +# Will be removed when pkg-config gets to version 0.28, where this belongs. + +# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, +# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# ------------------------------------------- +AC_DEFUN([PKG_CHECK_VAR], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl + +_PKG_CONFIG([$1], [variable="][$3]["], [$2]) +AS_VAR_COPY([$1], [pkg_cv_][$1]) + +AS_VAR_IF([$1], [""], [$5], [$4])dnl +])# PKG_CHECK_VAR diff --git a/anjuta/hedera/configure.ac.tpl b/anjuta/hedera/configure.ac.tpl new file mode 100644 index 0000000..021674f --- /dev/null +++ b/anjuta/hedera/configure.ac.tpl @@ -0,0 +1,80 @@ +[+ autogen5 template +] +dnl Process this file with autoconf to produce a configure script. +dnl Created by Anjuta application wizard. + +AC_INIT([+Name+], [+Version+]) + +AC_CONFIG_AUX_DIR([build]) +AC_CONFIG_MACRO_DIR([build/m4]) +AC_CONFIG_HEADERS([build/config.h]) + +AM_INIT_AUTOMAKE([-Wno-portability]) + +AM_SILENT_RULES([yes]) + +AC_PROG_CC + +dnl Check for vala. +dnl You should change the version shown here manually to match with yours. +AM_PROG_VALAC([0.20.0]) +[+IF (=(get "HaveI18n") "1")+] +dnl Internationalization +IT_PROG_INTLTOOL([0.35.0]) + +GETTEXT_PACKAGE=hedera-[+Name+] +AC_SUBST(GETTEXT_PACKAGE) +AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [GETTEXT package name]) +AM_GLIB_GNU_GETTEXT +AM_XGETTEXT_OPTION([-k_ -kQ_:1g -kN_ -kC_:1c,2 -kNC_:1c,2]) +[+ENDIF+] +dnl Check for debug mode. +AC_MSG_CHECKING([whether to build with debug information...]) +AC_ARG_ENABLE([debug], + [AS_HELP_STRING([--enable-debug], + [Enable debug data generation (def=no)])], + [ENABLE_DEBUG="$enableval"], + [ENABLE_DEBUG=no]) +AC_MSG_RESULT([$ENABLE_DEBUG]) + +if test x"$ENABLE_DEBUG" = x"yes"; then + CFLAGS=" -ggdb -O0 " + VALAFLAGS=" -g --save-temps " +else + CFLAGS=" -O2 " + VALAFLAGS= +fi + +dnl Check if the C warnings must be shown +AC_MSG_CHECKING([whether C warnings will be shown...]) +AC_ARG_ENABLE([c-warnings], + [AS_HELP_STRING([--enable-c-warnings], + [Enable C warnings to be shown (def=no)])], + [C_WARNINGS="$enableval"], + [C_WARNINGS=no]) +AC_MSG_RESULT([$C_WARNINGS]) + +if test x"$C_WARNINGS" = x"yes"; then + CFLAGS+=" -Wall " +else + CFLAGS+=" -w " +fi + +AC_SUBST([CFLAGS]) +AC_SUBST([VALAFLAGS]) +AC_SUBST([[+NameCLower+]_datadir], ['$(datadir)/hedera/module']) + +LT_INIT +[+IF (=(get "HavePackage") "1")+] +PKG_CHECK_VAR([[+NameCLower+]_libdir], [[+PackageModule1+]], [modulelibdir]) +PKG_CHECK_VAR([[+NameCLower+]_datadir], [[+PackageModule1+]], [moduledatadir]) +PKG_CHECK_VAR([querydir], [[+PackageModule1+]], [modulequerydir]) + +PKG_CHECK_MODULES([+NameCUpper+], [[+PackageModule1+] [+PackageModule2+]]) +# Check if vala bindigns are installed and usable +VALA_CHECK_PACKAGES([[+PackageModule1+] [+PackageModule2+]])[+ENDIF+] +[+IF (=(get "HaveGtkDoc") "1")+]GTK_DOC_CHECK([1.0])[+ENDIF+] +AC_OUTPUT([ + Makefile + src/Makefile + data/Makefile +[+IF (=(get "HaveI18n") "1")+] po/Makefile.in[+ENDIF+]]) diff --git a/anjuta/hedera/data/Makefile.am.tpl b/anjuta/hedera/data/Makefile.am.tpl new file mode 100644 index 0000000..8ec1d92 --- /dev/null +++ b/anjuta/hedera/data/Makefile.am.tpl @@ -0,0 +1,11 @@ +[+ autogen5 template +] +## Process this file with automake to produce Makefile.in +## Created by Anjuta + +[+NameCLower+]_data_DATA = \ + [+Name+].xml \ + [+Name+].ui \ + [+FormName+].glade + + +EXTRA_DIST = $([+NameCLower+]_data_DATA) diff --git a/anjuta/hedera/data/mod.glade b/anjuta/hedera/data/mod.glade new file mode 100644 index 0000000..3fcdf97 --- /dev/null +++ b/anjuta/hedera/data/mod.glade @@ -0,0 +1,12 @@ + + + + + True + False + vertical + + + + + diff --git a/anjuta/hedera/data/mod.ui.tpl b/anjuta/hedera/data/mod.ui.tpl new file mode 100644 index 0000000..401df87 --- /dev/null +++ b/anjuta/hedera/data/mod.ui.tpl @@ -0,0 +1,10 @@ +[+ autogen5 template +] + + + + + + + + + diff --git a/anjuta/hedera/data/mod.xml.tpl b/anjuta/hedera/data/mod.xml.tpl new file mode 100644 index 0000000..380fe8e --- /dev/null +++ b/anjuta/hedera/data/mod.xml.tpl @@ -0,0 +1,20 @@ +[+ autogen5 template +] + + [+ClassName+] + + + [+ClassName+] + + + +
+ [+FormClassName+] +
+
+
+ diff --git a/anjuta/hedera/debian/changelog.tpl b/anjuta/hedera/debian/changelog.tpl new file mode 100644 index 0000000..9f2cbd8 --- /dev/null +++ b/anjuta/hedera/debian/changelog.tpl @@ -0,0 +1,6 @@ +[+ autogen5 template +] +[+Name+] ([+Version+]) UNRELEASED; urgency=low + + * Initial Release. + + -- [+Author+] <[+Email+]> [+(shell "date -R")+] diff --git a/anjuta/hedera/debian/compat b/anjuta/hedera/debian/compat new file mode 100644 index 0000000..45a4fb7 --- /dev/null +++ b/anjuta/hedera/debian/compat @@ -0,0 +1 @@ +8 diff --git a/anjuta/hedera/debian/control.tpl b/anjuta/hedera/debian/control.tpl new file mode 100644 index 0000000..7b5899e --- /dev/null +++ b/anjuta/hedera/debian/control.tpl @@ -0,0 +1,14 @@ +[+ autogen5 template +] +Source: [+Name+] +Section: gnome +Priority: optional +Maintainer: [+Author+] <[+Email+]> +Build-Depends: debhelper (>= 8.0.0), autotools-dev, libhedera-dev +Standards-Version: 3.9.3 + +Package: hedera-[+Name+] +Architecture: amd64 +Depends: ${shlibs:Depends}, ${misc:Depends}, hedera +Description: Modules for Hedera + Description of the included modules will + be put here. diff --git a/anjuta/hedera/debian/copyright.tpl b/anjuta/hedera/debian/copyright.tpl new file mode 100644 index 0000000..aab777c --- /dev/null +++ b/anjuta/hedera/debian/copyright.tpl @@ -0,0 +1,29 @@ +[+ autogen5 template +] +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: [+Name+] +Source: http://www.verdnatura.es/ + +Files: * +Copyright: [+(shell "date +%Y")+] [+Author+] <[+Email+]> +License: GPL-3.0+ + +Files: debian/* +Copyright: [+(shell "date +%Y")+] [+Author+] <[+Email+]> +License: GPL-3.0+ + +License: GPL-3.0+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see . + . + On Debian systems, the complete text of the GNU General + Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". diff --git a/anjuta/hedera/debian/docs b/anjuta/hedera/debian/docs new file mode 100644 index 0000000..50bd824 --- /dev/null +++ b/anjuta/hedera/debian/docs @@ -0,0 +1,2 @@ +NEWS +README diff --git a/anjuta/hedera/debian/rules b/anjuta/hedera/debian/rules new file mode 100644 index 0000000..b01293a --- /dev/null +++ b/anjuta/hedera/debian/rules @@ -0,0 +1,20 @@ +[+ autogen5 template +] +#!/usr/bin/make -f + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +%: + dh $@ --with autotools-dev --builddirectory=debian/build + +override_dh_auto_configure: + dh_auto_configure -- $(shell dpkg-buildflags --export=configure) + +.PHONY: override_dh_shlibdeps +override_dh_shlibdeps: + dh_shlibdeps -O--builddirectory=debian/build \ + -l/usr/lib/x86_64-linux-gnu/hedera + +.PHONY: override_dh_makeshlibs +override_dh_makeshlibs: + dh_makeshlibs --noscripts \ No newline at end of file diff --git a/anjuta/hedera/debian/source/format b/anjuta/hedera/debian/source/format new file mode 100644 index 0000000..89ae9db --- /dev/null +++ b/anjuta/hedera/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/anjuta/hedera/po/POTFILES.in.tpl b/anjuta/hedera/po/POTFILES.in.tpl new file mode 100644 index 0000000..e531623 --- /dev/null +++ b/anjuta/hedera/po/POTFILES.in.tpl @@ -0,0 +1,7 @@ +[+ autogen5 template +] +# List of source files containing translatable strings. + +src/[+Name+].vala +src/[+FormName+].vala +data/[+FormName+].glade +[type: gettext/glade]data/[+Name+].xml diff --git a/anjuta/hedera/po/POTFILES.skip.tpl b/anjuta/hedera/po/POTFILES.skip.tpl new file mode 100644 index 0000000..b6dc3f9 --- /dev/null +++ b/anjuta/hedera/po/POTFILES.skip.tpl @@ -0,0 +1,5 @@ +[+ autogen5 template +] +# List of source files to skip from translation. + +src/[+Name+].c +src/[+FormName+].c diff --git a/anjuta/hedera/sql/mod/query.sql.tpl b/anjuta/hedera/sql/mod/query.sql.tpl new file mode 100644 index 0000000..e69de29 diff --git a/anjuta/hedera/src/Makefile.am.tpl b/anjuta/hedera/src/Makefile.am.tpl new file mode 100644 index 0000000..c95ca84 --- /dev/null +++ b/anjuta/hedera/src/Makefile.am.tpl @@ -0,0 +1,48 @@ +[+ autogen5 template +] +[+ +(define prefix_if_missing + (lambda + (name prefix) + (string-append + (if + (==* (get name) prefix) + "" + prefix + ) + (get name) + ) + ) +) ++]## Process this file with automake to produce Makefile.in +## Created by Anjuta + +[+NameCLower+]_lib_LTLIBRARIES = [+(prefix_if_missing "Name" "lib")+].la + +[+(prefix_if_missing "NameCLower" "lib")+]_la_SOURCES = \ + config.vapi \ + [+Name+].vala \ + [+FormName+].vala + +[+(prefix_if_missing "NameCLower" "lib")+]_la_LIBADD = $([+NameCUpper+]_LIBS) +[+(prefix_if_missing "NameCLower" "lib")+]_la_LDFLAGS = \ + -avoid-version \ + -Wl,--export-dynamic + +[+(prefix_if_missing "NameCLower" "lib")+]_la_CPPFLAGS = \ + -DPACKAGE_DATA_DIR=\"$([+NameCLower+]_datadir)\"[+IF (=(get "HaveI18n") "1")+] \ + -DPACKAGE_LOCALE_DIR=\"$(datadir)/locale\"[+ELSE+] \ + -DGETTEXT_PACKAGE=\"hedera-[+Name+]\"[+ENDIF+][+IF (=(get "HavePackage") "1")+] \ + $([+NameCUpper+]_CFLAGS)[+ENDIF+] +[+(prefix_if_missing "NameCLower" "lib")+]_la_CFLAGS = $(CFLAGS) + +[+(prefix_if_missing "NameCLower" "lib")+]_la_VALAFLAGS = [+IF (not (= (get "PackageModule2") ""))+]\ + --pkg [+(string-substitute (get "PackageModule2") " " " --pkg ")+] \ + [+ENDIF+]--pkg [+PackageModule1+] \ + $(VALAFLAGS) + +[+NameCLower+]_querydir = $(querydir)/[+NameHLower+] +[+NameCLower+]_query_DATA = + +uninstall-local: + rm -f $(DESTDIR)$(libdir)/hedera/module/[+(prefix_if_missing "Name" "lib")+].so + diff --git a/anjuta/hedera/src/config.vapi b/anjuta/hedera/src/config.vapi new file mode 100644 index 0000000..7ba8c2d --- /dev/null +++ b/anjuta/hedera/src/config.vapi @@ -0,0 +1,12 @@ +[CCode (cprefix = "", lower_case_cprefix = "", cheader_filename = "config.h")] +namespace Config +{ + public const string GETTEXT_PACKAGE; + public const string SPRITE_DIR; + public const string BACKGROUND_DIR; + public const string PACKAGE_DATA_DIR; + public const string PACKAGE_LOCALE_DIR; + public const string PACKAGE_NAME; + public const string PACKAGE_VERSION; + public const string VERSION; +} diff --git a/anjuta/hedera/src/form.vala b/anjuta/hedera/src/form.vala new file mode 100644 index 0000000..f3eccfa --- /dev/null +++ b/anjuta/hedera/src/form.vala @@ -0,0 +1,22 @@ +[+ autogen5 template +] +[+INCLUDE (string-append "licenses/" (get "License") ".tpl") \+] +/* -*- Mode: vala; tab-width: 4; intend-tabs-mode: t -*- */ +/* + * Copyright (C) [+(shell "date +%Y")+] [+Author+] <[+Email+]> + * +[+INVOKE LICENSE-DESCRIPTION PFX=" * " PROGRAM=(get "Name") OWNER=(get "Author") \+] + */ + +public class Vn.[+FormClassName+] : Vn.Form +{ + public [+FormClassName+] () + { + + } + + // Main routine of the [+FormClassName+] Form. + public override void open (Gtk.Builder builder) + { + + } +} diff --git a/anjuta/hedera/src/mod.vala b/anjuta/hedera/src/mod.vala new file mode 100644 index 0000000..1db86d8 --- /dev/null +++ b/anjuta/hedera/src/mod.vala @@ -0,0 +1,22 @@ +[+ autogen5 template +] +[+INCLUDE (string-append "licenses/" (get "License") ".tpl") \+] +/* -*- Mode: vala; tab-width: 4; intend-tabs-mode: t -*- */ +/* + * Copyright (C) [+(shell "date +%Y")+] [+Author+] <[+Email+]> + * +[+INVOKE LICENSE-DESCRIPTION PFX=" * " PROGRAM=(get "Name") OWNER=(get "Author") \+] + */ + +public class Vn.[+ClassName+] : Vn.Mod +{ + public [+ClassName+] () + { + + } + + // Main routine of the [+ClassName+] Module. + public override void activate () + { + + } +} diff --git a/anjuta/hedera/translation b/anjuta/hedera/translation new file mode 100755 index 0000000..e4b9ac0 --- /dev/null +++ b/anjuta/hedera/translation @@ -0,0 +1,49 @@ +#!/bin/bash + +getopt -Q \ + -o "hua:" \ + -l "help,update,add:" \ + -n "./translation" \ + -- $@ + +case "$1" in + -u|--update|'') + cd ./po + intltool-update -r + cd .. + ;; + + -a|--add) + arg=$2 + + if [ -z $arg ]; then + exit 1; + elif [ ${#arg} -lt 2 ]; then + echo "./translation: language codes are at least two characters long." > /dev/stderr + exit 1; + fi + + msginit -i po/*.pot -o po/$arg.po -l $arg.utf8 + echo $arg >> po/LINGUAS + #sort po/LINGUAS -o po/LINGUAS + ;; + + -h|--help) + echo -e \ +"Translation helper script. + Note that only the first option is used. If no option is +passed the '\033[1m-u\033[0m' option is used by default. + Options: + \033[1m-u, --update\033[0m + Update the currently existing translations and + the translations template. Also reports the current + status of the translations. + \033[1m-a, --add\033[0m \033[4mlang\033[0m + Add a new translation for the \033[4mlang\033[0m language + (using the gettext language and country codes), the + charset will automatically be set to UTF-8. You will + be asked to select your e-mail from a list. + \033[1m-h, --help\033[0m + Print this help text and exit." + ;; +esac diff --git a/configure.ac b/configure.ac index 5c7a77c..cbda022 100644 --- a/configure.ac +++ b/configure.ac @@ -102,6 +102,7 @@ AC_CONFIG_FILES([ docs/reference/Makefile docs/reference/hedera/Makefile po/Makefile.in + anjuta/Makefile ]) AC_SUBST([uVERSION], [${VERSION//./_}]) diff --git a/db/Makefile.am b/db/Makefile.am index 480e18a..6a03152 100644 --- a/db/Makefile.am +++ b/db/Makefile.am @@ -9,9 +9,9 @@ db_include_HEADERS = \ db-param.h \ db-request.h \ db-conn.h \ - db-row.h \ db-result.h \ db-result-set.h \ + db-row.h \ db-model.h \ db-model-holder.h \ db-file-loader.h \ diff --git a/db/db-iterator.c b/db/db-iterator.c index d984a93..be49552 100644 --- a/db/db-iterator.c +++ b/db/db-iterator.c @@ -637,7 +637,7 @@ void db_iterator_add_param (DbIterator * obj, DbParam * param) * Return value: (transfer none): a #GvnParam **/ GvnParam * db_iterator_get_param (DbIterator * obj, const gchar * column) -{ +{ GList * n; GvnParam * param; @@ -669,6 +669,8 @@ GvnParam * db_iterator_get_param (DbIterator * obj, const gchar * column) **/ GList * db_iterator_get_params (DbIterator * obj) { + g_return_val_if_fail (DB_IS_ITERATOR (obj), NULL); + return g_list_copy (obj->params); } diff --git a/db/db-model.c b/db/db-model.c index 48a70db..567de60 100644 --- a/db/db-model.c +++ b/db/db-model.c @@ -17,7 +17,6 @@ * along with this program. If not, see . */ -#include #include "db-model.h" #include "db-row.h" @@ -928,7 +927,8 @@ static void db_model_post_process_query (DbModel * obj) // TODO When parser gets fully functional, these 3 lines won't be needed, // because obj>priv->stmt will be a parsed stmt: gchar * rend = db_conn_render (obj->priv->conn, obj->priv->stmt, NULL); - SqlObject * stmt = sql_parser_parse (rend); + SqlObject * stmt = sql_parser_parse (rend, NULL); +//Uncomment to print de resulting stmt rendered: /*gchar * rend2 = NULL; if (stmt && (rend2 = db_conn_render (obj->priv->conn, stmt, NULL))) g_message ("SQL + Parser + Render =\n %s", rend2); @@ -1999,7 +1999,8 @@ const GValue * db_model_get_value (DbModel * obj, DbIter * iter, gint col, GErro * @iter: a #DbIter pointing to the row to be set * @col: the column of the field to be set * @value: new value for the field pointed to by @iter and @col - * @err: (out) (allow-none): a #GError or %NULL to ignore errors + * @err: (out) (allow-none): a return location for a #GError or %NULL to ignore + * errors * * Sets the value of a single field to @value on @obj as well as on the database. * If the database update fails, the model is not updated and err is set diff --git a/debian/libhedera-dev.dirs b/debian/libhedera-dev.dirs index 95d73ee..894d505 100644 --- a/debian/libhedera-dev.dirs +++ b/debian/libhedera-dev.dirs @@ -14,3 +14,15 @@ usr/share/gir-1.0 usr/share/glade/catalogs usr/share/vala-0.20/vapi usr/share/gtk-doc/html/hedera + +usr/share/anjuta/templates +usr/share/anjuta/templates/hedera +usr/share/anjuta/templates/hedera/build/ +usr/share/anjuta/templates/hedera/build/m4 +usr/share/anjuta/templates/hedera/data +usr/share/anjuta/templates/hedera/debian +usr/share/anjuta/templates/hedera/debian/source +usr/share/anjuta/templates/hedera/po +usr/share/anjuta/templates/hedera/sql +usr/share/anjuta/templates/hedera/sql/mod +usr/share/anjuta/templates/hedera/src diff --git a/debian/libhedera-dev.install b/debian/libhedera-dev.install index 82322f7..a79dd29 100644 --- a/debian/libhedera-dev.install +++ b/debian/libhedera-dev.install @@ -26,3 +26,13 @@ usr/share/gir-1.0/* usr/share/glade/catalogs/* usr/share/vala-0.20/vapi/* usr/share/gtk-doc/html/hedera/* + +usr/share/anjuta/templates/* +usr/share/anjuta/templates/hedera/* +usr/share/anjuta/templates/hedera/build/m4/* +usr/share/anjuta/templates/hedera/data/* +usr/share/anjuta/templates/hedera/debian/* +usr/share/anjuta/templates/hedera/debian/source/* +usr/share/anjuta/templates/hedera/po/* +usr/share/anjuta/templates/hedera/sql/mod/* +usr/share/anjuta/templates/hedera/src/* diff --git a/docs/reference/hedera/first-tutorial.xml b/docs/reference/hedera/first-tutorial.xml index 98beb26..d778e5d 100644 --- a/docs/reference/hedera/first-tutorial.xml +++ b/docs/reference/hedera/first-tutorial.xml @@ -4,24 +4,55 @@ ]> - First Tutorial + First form 0 Hedera Library - First simple tutorial + First form - A simple tutorial to get started + In this first tutorial you will learn how to create a simple + form - - - The first tutorial + + Defining a form - In this first tutorial you will learn how to create a simple - module with just one form using the Hedera library. + - + + Files needed to create a form + + The most basic form is made up of a class that inherits from Vn.Form + and a Gtk.Builder file, which defines the UI of the form. This UI + file is expected to use the ".galde" extension and named after the + form that will use it. This .glade file must + contain a toplevel Gtk.Box with the name "main", that will be + recognized by the library as the content of the Gtk.Notebook used by + the runtime and will be autamtically inserted in a page of that + notebook while opening the form, integrating as a part of the + application. + + + The .glade file for a form may also contain a Vn.Batch named + "models" which the library will recognize as a group of models used + by the form, and will set the application connection to these + automatically. + + + Additionally, the form can add menus to the main application + by adding a Gtk.ActionGroup named "actions" in the .glade file, and + using another file named also after the form, with the extension + ".ui". This file will be used to define the strcuture of the menus + and will link the options to the actions defined in the previously + mentioned "actions" Gtk.ActionGroup. + + + There is also the possibility to define SQL files, to set and edit + the SQL queries apart from the other parts of the module. + + + diff --git a/docs/reference/hedera/module-tutorial.xml b/docs/reference/hedera/module-tutorial.xml index 124c153..29c349d 100644 --- a/docs/reference/hedera/module-tutorial.xml +++ b/docs/reference/hedera/module-tutorial.xml @@ -71,4 +71,7 @@ do some things that will be described here but are not written yet. + + + diff --git a/glade/Makefile.am b/glade/Makefile.am index 37540dd..0c07c5b 100644 --- a/glade/Makefile.am +++ b/glade/Makefile.am @@ -17,7 +17,8 @@ libgladevn_la_SOURCES = \ glade-vn.c \ glade-vn-batch.c \ glade-db-sql.c \ - glade-db-model.c + glade-db-model.c \ + glade-db-iterator.c gladevn_data_DATA = vn.xml diff --git a/glade/glade-db-iterator.c b/glade/glade-db-iterator.c new file mode 100644 index 0000000..c3c18c1 --- /dev/null +++ b/glade/glade-db-iterator.c @@ -0,0 +1,279 @@ + /* + * Copyright (C) 2013 - Juan Ferrer Toribio + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "glade-vn.h" +#include + +static void glade_db_iterator_on_name_changed (GladeProject * project, + GladeWidget * widget) +{ + const gchar * new_name; + gchar * prefix, * old_name; + GList * n, * list; + + if (G_OBJECT_TYPE (glade_widget_get_object (widget)) != VN_TYPE_ITERATOR) + return; + + old_name = g_object_get_data (G_OBJECT (widget), "old-name"); + prefix = g_strconcat (old_name, "-", NULL); + new_name = glade_widget_get_name (widget); + g_object_set_data_full (G_OBJECT (widget), "old-name", + g_strdup (new_name), (GDestroyNotify) g_free); + + list = db_iterator_get_params (DB_ITERATOR (glade_widget_get_object (widget))); + + for (n = list; n; n = n->next) + { + GladeWidget * param = glade_widget_get_from_gobject (G_OBJECT (n->data)); + const gchar * child_name = glade_widget_get_name (param); + + if (g_str_has_prefix (child_name, prefix)) + { + glong offset = g_utf8_strlen (prefix, -1); + gchar * new_child_name = g_strconcat (new_name, "-", child_name + offset, NULL); + glade_project_set_widget_name (project, param, new_child_name); + g_free (new_child_name); + } + } + + g_list_free (list); + g_free (prefix); +} + +void glade_db_iterator_post_create (GladeWidgetAdaptor * adaptor, + DbIterator * iterator, GladeCreateReason * reason) +{ + static gboolean connected = FALSE; + GladeWidget * widget = glade_widget_get_from_gobject (G_OBJECT (iterator)); + GladeProject * project = glade_widget_get_project (widget); + + g_object_set_data_full (G_OBJECT (widget), "old-name", + g_strdup (glade_widget_get_name (widget)), (GDestroyNotify) g_free); + + if (!connected) + { + g_signal_connect (project, "widget-name-changed", + G_CALLBACK (glade_db_iterator_on_name_changed), NULL); + connected = TRUE; + } +} + +static void glade_db_iterator_on_column_name_changed (GladeProperty * property, + GValue * old, GValue * new, GladeWidget * param) +{ + const gchar * parent_name; + gchar * prefix; + GladeWidget * parent = glade_widget_get_parent (param); + + if (!parent + || G_OBJECT_TYPE (glade_widget_get_object (parent)) != VN_TYPE_ITERATOR) + return; + + parent_name = glade_widget_get_name (parent); + prefix = g_strconcat (parent_name, "-", NULL); + + if (g_str_has_prefix (glade_widget_get_name (param), prefix)) + { + GladeProject * project = glade_widget_get_project (param); + gchar * new_name = g_strconcat (prefix, g_value_get_string (new), NULL); + glade_project_set_widget_name (project, param, new_name); + } + + g_free (prefix); +} + +void glade_db_iterator_add_child (GladeWidgetAdaptor * adaptor, + DbIterator * parent, DbParam * child) +{ + gchar * new_name; + const gchar * param_name, * parent_name; + GladeWidget * param = glade_widget_get_from_gobject (G_OBJECT (child)); + GladeProperty * name_prop = glade_widget_get_property (param, "column-name"); + + param_name = glade_widget_get_name (param); + parent_name = glade_widget_get_name (glade_widget_get_from_gobject (G_OBJECT (parent))); + new_name = g_strconcat (parent_name, "-",param_name, NULL); + glade_project_set_widget_name (glade_widget_get_project (param), param, new_name); + g_free (new_name); + + g_signal_connect (name_prop, "value-changed", + G_CALLBACK (glade_db_iterator_on_column_name_changed), param); + + db_iterator_add_param (parent, child); +} + +void glade_db_iterator_remove_child (GladeWidgetAdaptor * adaptor, + DbIterator * parent, DbParam * child) +{ +// db_iterator_remove_param (parent, child); +} + +void glade_db_iterator_replace_child (GladeWidgetAdaptor * adaptor, + DbIterator * container, DbParam * current, DbParam * new) +{ + glade_db_iterator_remove_child (adaptor, container, current); + glade_db_iterator_add_child (adaptor, container, new); +} + +gboolean glade_db_iterator_add_verify (GladeWidgetAdaptor * adaptor, + DbIterator * container, DbParam * child, gboolean user_feedback) +{ + if (DB_IS_PARAM (child)) + return TRUE; + + if (user_feedback) + { + GladeWidgetAdaptor * object_adaptor = + glade_widget_adaptor_get_by_type (DB_TYPE_PARAM); + + glade_util_ui_message (glade_app_get_window () + ,GLADE_UI_INFO + ,NULL + ,"Only objects of type %s can be added to objects of type %s." + ,glade_widget_adaptor_get_title (object_adaptor) + ,glade_widget_adaptor_get_title (adaptor) + ); + } + + return FALSE; +} + +GList * glade_db_iterator_get_children (GladeWidgetAdaptor * adaptor, + DbIterator * parent) +{ + return db_iterator_get_params (parent); +} + +static void glade_db_iterator_child_selected (GladeBaseEditor * editor, + GladeWidget * child, gpointer data) +{ + glade_base_editor_add_label (editor, _("Parameter")); + glade_base_editor_add_default_properties (editor, child); + glade_base_editor_add_label (editor, _("Properties")); + glade_base_editor_add_editable (editor, child, GLADE_PAGE_GENERAL); +} + +static gboolean glade_db_iterator_move_child (GladeBaseEditor * editor, + GladeWidget * parent, GladeWidget * child, gpointer data) +{ + return FALSE; +} + +static void glade_db_iterator_launch_editor (GObject * iterator) +{ + GladeBaseEditor * editor; + GladeEditable * param_editor; + GtkWidget * window; + GladeWidget * widget = glade_widget_get_from_gobject (iterator); + GladeWidgetAdaptor * adaptor = glade_widget_get_adaptor (widget); + + widget = glade_widget_get_toplevel (widget); + param_editor = glade_widget_adaptor_create_editable (adaptor, GLADE_PAGE_GENERAL); + editor = glade_base_editor_new (glade_widget_get_object (widget), + param_editor, _("Parameter"), DB_TYPE_PARAM, NULL); + + g_signal_connect (editor, "child-selected", G_CALLBACK (glade_db_iterator_child_selected), NULL); + g_signal_connect (editor, "move-child", G_CALLBACK (glade_db_iterator_move_child), NULL); + + gtk_widget_show (GTK_WIDGET (editor)); + window = glade_base_editor_pack_new_window (editor, _("Iterator Editor"), NULL); + gtk_widget_show (window); +} + +static void glade_db_iterator_generate_params (GladeWidget * iterator) +{ + gboolean use_file = TRUE; + gchar * sql = NULL; + gchar * message = _("The model must have \"SQL\" set and \"Use file\" set to 'No'."); + const gchar * name = glade_widget_get_name (iterator); + SqlSelect * select; + GladeWidget * model_w; + DbModel * model = NULL; + + GList * params = db_iterator_get_params (DB_ITERATOR (glade_widget_get_object (iterator))); + + if (params) + { + glade_util_ui_message (glade_app_get_window (), GLADE_UI_INFO, NULL, + _("%s can't have children before automatic generation."), name); + g_list_free (params); + return; + } + g_list_free (params); + + glade_widget_property_get (iterator, "model", &model, NULL); + + if (!model) + { + glade_util_ui_message (glade_app_get_window (), GLADE_UI_INFO, NULL, + _("%s must have \"Model\" set. %s"), name, message); + return; + } + + model_w = glade_widget_get_from_gobject (model); + glade_widget_property_get (model_w, "use-file", &use_file); + glade_widget_property_get (model_w, "sql", &sql); + + if (use_file || !sql) + { + glade_util_ui_message (glade_app_get_window (), GLADE_UI_INFO, NULL, message); + return; + } + + select = SQL_SELECT (sql_parser_parse (sql, NULL)); + + if (select && SQL_IS_SELECT (select)) + { +//TODO Cambios cuando se use g_object_get (select, "fields", &fields, NULL) + GSList * l, * fields = select->expr; + GladeProject * project = glade_widget_get_project (iterator); + + for (l = fields; l; l = l->next) + { + gchar * column_name; + gchar * param_name, * param_new_name = NULL; + GladeWidget * param; + + param = glade_command_create (glade_widget_adaptor_get_by_type (DB_TYPE_PARAM), + iterator, NULL, project); + + column_name = sql_select_get_column_name (select, SQL_EXPR (l->data)); + param_name = g_strconcat (name, "-" + ,column_name ? column_name : "param" + ,NULL); + + if (!glade_project_available_widget_name (project, param, param_name)) + param_new_name = glade_project_new_widget_name (project, param, param_name); + + glade_project_set_widget_name (project, param, param_new_name ? param_new_name : param_name); + glade_widget_property_set (param, "column-name", column_name); + + g_free (column_name); + g_free (param_new_name); + g_free (param_name); + } + } +} + +void glade_db_iterator_action_activate (GladeWidgetAdaptor * adaptor, + GObject * object, const gchar * action_path) +{ + if (!g_strcmp0 (action_path, "launch-editor")) + glade_db_iterator_launch_editor (object); + else if (!g_strcmp0 (action_path, "generate-params")) + glade_db_iterator_generate_params (glade_widget_get_from_gobject (object)); +} diff --git a/glade/glade-db-model.c b/glade/glade-db-model.c index e223c5d..7ddbf9b 100644 --- a/glade/glade-db-model.c +++ b/glade/glade-db-model.c @@ -41,11 +41,8 @@ GLADE_MAKE_EPROP (GladeEPropModel, glade_eprop_model) static void glade_eprop_model_name_changed (GladeProject * project, GladeWidget * widget, GladeEPropModel * obj) { - if (widget && obj->widget) - { - gtk_entry_set_text (GTK_ENTRY (obj->entry), - glade_widget_get_name (widget)); - } + if (widget == obj->widget) + gtk_entry_set_text (GTK_ENTRY (obj->entry), glade_widget_get_name (widget)); } static GladeWidget * glade_model_create (GladeProperty * prop) @@ -74,8 +71,13 @@ static GladeWidget * glade_model_create (GladeProperty * prop) } if (!use) + { batch_w = glade_command_create (glade_widget_adaptor_get_by_type (VN_TYPE_BATCH), NULL, NULL, project); + glade_widget_set_name (batch_w, + glade_project_new_widget_name (project, batch_w, "models")); + } + else batch_w = glade_widget_get_from_gobject (batch); diff --git a/glade/glade-vn-batch.c b/glade/glade-vn-batch.c index 25f82a3..803c215 100644 --- a/glade/glade-vn-batch.c +++ b/glade/glade-vn-batch.c @@ -32,8 +32,8 @@ gboolean glade_vn_batch_add_verify (GladeWidgetAdaptor * adaptor, ,GLADE_UI_INFO ,NULL ,"Only objects of type %s can be added to objects of type %s." - ,glade_widget_adaptor_get_title (object_adaptor) - ,glade_widget_adaptor_get_title (adaptor) + ,glade_widget_adaptor_get_name (object_adaptor) + ,glade_widget_adaptor_get_name (adaptor) ); } diff --git a/glade/vn.xml b/glade/vn.xml index 0a4ac99..dc1a1a7 100644 --- a/glade/vn.xml +++ b/glade/vn.xml @@ -6,7 +6,7 @@ - + @@ -21,14 +21,14 @@ - + glade_db_model_action_activate glade_db_sql_create_eprop glade_db_model_write_widget - + @@ -38,12 +38,24 @@ glade_db_model_holder_create_eprop + + + + + glade_db_iterator_action_activate + glade_db_iterator_post_create + glade_db_iterator_add_verify + glade_db_iterator_add_child + glade_db_iterator_remove_child + glade_db_iterator_replace_child + glade_db_iterator_get_children - + - - + + + @@ -63,10 +75,13 @@ - + - - + + + + + @@ -144,8 +159,8 @@ glade_vn_batch_add_verify glade_vn_batch_add_child glade_vn_batch_remove_child - glade_vn_batch_get_children glade_vn_batch_replace_child + glade_vn_batch_get_children @@ -153,7 +168,7 @@ - + diff --git a/module/data/customer.glade b/module/data/customer.glade index 0c0cb4c..03aa2b4 100644 --- a/module/data/customer.glade +++ b/module/data/customer.glade @@ -3,12 +3,8 @@ - - SELECT id, street, pc, city, province, ok FROM user_address WHERE #p ORDER BY id - - - SELECT id, name, credit, active, born, photo, object_id FROM "user" ORDER BY id - + + True False @@ -56,7 +52,6 @@ True False - SELECT id, #p FROM article WHERE #p name @@ -170,7 +165,6 @@ False info object_id - SELECT id, object FROM object 1 diff --git a/module/src/vn-consulter.c b/module/src/vn-consulter.c index 6f27476..4e7651c 100644 --- a/module/src/vn-consulter.c +++ b/module/src/vn-consulter.c @@ -113,32 +113,54 @@ static void vn_consulter_model_status_changed (DbModel * model, { VnColumn * column; GType col_type, type = db_model_get_column_type (model, i); +gboolean image = FALSE; - if (type == G_TYPE_BYTES) + if (type == G_TYPE_INT || type == G_TYPE_UINT + || type == G_TYPE_FLOAT || type == G_TYPE_DOUBLE) + col_type = VN_TYPE_COLUMN_SPIN; + else if (type == G_TYPE_BYTES) col_type = VN_TYPE_COLUMN_IMAGE; else if (type == G_TYPE_BOOLEAN) col_type = VN_TYPE_COLUMN_CHECK; else +if (type == G_TYPE_STRING +&& !g_strcmp0 (db_model_get_column_name (model, i), "image")) +{ + image = TRUE; + col_type = VN_TYPE_COLUMN_IMAGE; +} + else col_type = VN_TYPE_COLUMN_ENTRY; -if (i == 7) -col_type = VN_TYPE_COLUMN_IMAGE; - column = vn_grid_append_column (obj->grid, i ,db_model_get_column_name (model, i) ,col_type ,TRUE, FALSE ); -if (i == 7) -g_object_set (column, + if (type == G_TYPE_INT) + g_object_set (column, + "lower", (gdouble)G_MININT, + "upper", (gdouble)G_MAXINT, + NULL); + else if (type == G_TYPE_UINT) + g_object_set (column, + "upper", (gdouble)G_MAXUINT, + NULL); + else if (type == G_TYPE_FLOAT || type == G_TYPE_DOUBLE) + g_object_set (column, + "digits", 2, + "lower", 0.0, + "upper", 1000.0, + "step-increment", 0.1, +// "editable", FALSE, + NULL); +else if (image) + g_object_set (column, "host", "www.verdnatura.es", "path", "image/cache/catalog/icon", "tooltip-path", "../full", NULL); - - if (type == G_TYPE_FLOAT || type == G_TYPE_DOUBLE) - g_object_set (column, "digits", 3, NULL); } break; @@ -167,7 +189,7 @@ void vn_consulter_mode_toggled (GtkToggleButton * mode, VnConsulter * obj) void vn_consulter_send (GtkButton * button, VnConsulter * obj) { DbIterator * iterator; - DbModel * model; + DbModel * model; gchar * sql; sql = gtk_combo_box_text_get_active_text (obj->combo); @@ -221,6 +243,8 @@ static void vn_consulter_open (VnConsulter * obj) ,obj->file ,"/*pg*/ SELECT id1, id2, name, ok, date, number, floating, image " "FROM prueben" + ,"/*pg*/ SELECT id1, id2, floating " + "FROM prueben" ,NULL }; @@ -233,11 +257,24 @@ static void vn_consulter_open (VnConsulter * obj) gtk_entry_set_placeholder_text (vn_form_get (form, "combo-entry"), _("Type or select a query")); - gtk_tree_view_insert_column_with_attributes (obj->tv, -1, "Mensaje", + gtk_tree_view_insert_column_with_attributes (obj->tv, -1, _("Message"), gtk_cell_renderer_text_new (), "text", 0, NULL); for (i = 0; i < g_strv_length (queries); i++) gtk_combo_box_text_prepend_text (obj->combo, queries[i]); + +// XXX+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ TEST VnIterator +/* + DbIterator * test_iterator = vn_form_get (form, "test-iterator"); + GList * n, * params = db_iterator_get_params (test_iterator); + g_message ("DbIterator at %p",test_iterator); + for (n = params; n; n = n->next) + { + gpointer ptr; + g_object_get (n->data, "iterator", &ptr, NULL); + g_message ("DbParam %s from DbIterator at %p.",db_param_get_column_name (DB_PARAM (n->data)), ptr); + } +*/ } //+++++++++++++++++++++++++++++++++++++++++++++++++++ Class diff --git a/po/POTFILES.in b/po/POTFILES.in index 47822f5..6480a17 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -45,8 +45,9 @@ vn/gui/main.glade vn/gui/child-window.glade vn/gui/actions.glade -glade/glade-db-model.c glade/glade-db-sql.c +glade/glade-db-model.c +glade/glade-db-iterator.c [type: gettext/glade]module/data/example.xml module/data/users.glade diff --git a/po/ca.po b/po/ca.po index 9b5b4b8..c9053b5 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: 2013-11-18 16:11+0100\n" +"POT-Creation-Date: 2013-12-13 10:07+0100\n" "PO-Revision-Date: 2013-06-04 13:38+0200\n" "Last-Translator: Alejandro T. Colombini Gómez \n" "Language-Team: Catalan\n" @@ -132,7 +132,7 @@ msgstr "" msgid "The master GvnParam of this parameter" msgstr "" -#: ../gvn/gvn-param.c:457 ../db/db-iterator.c:985 +#: ../gvn/gvn-param.c:457 ../db/db-iterator.c:987 msgid "Mode" msgstr "" @@ -213,7 +213,7 @@ msgstr "" msgid "The value" msgstr "" -#: ../sql/sql-string.c:198 ../db/db-model.c:3455 ../db/db-request.c:461 +#: ../sql/sql-string.c:198 ../db/db-model.c:3456 ../db/db-request.c:461 msgid "SQL" msgstr "" @@ -226,73 +226,73 @@ msgstr "" msgid "Can't allocate the needed memory" msgstr "" -#: ../db/db-iterator.c:986 +#: ../db/db-iterator.c:988 msgid "The mode in which the iterator is working" msgstr "" -#: ../db/db-iterator.c:993 +#: ../db/db-iterator.c:995 #, fuzzy msgid "Remember selection" msgstr "Recordar" -#: ../db/db-iterator.c:994 +#: ../db/db-iterator.c:996 msgid "Wether to rememeber the selection when model is refreshed" msgstr "" -#: ../db/db-model.c:3429 ../db/db-request.c:454 ../vn/vn-gui.c:1554 +#: ../db/db-model.c:3430 ../db/db-request.c:454 ../vn/vn-gui.c:1564 #: ../vn/vn-form.c:244 msgid "Connection" msgstr "" -#: ../db/db-model.c:3430 +#: ../db/db-model.c:3431 msgid "The DbConn that manages the connection to the database" msgstr "" -#: ../db/db-model.c:3437 ../db/db-request.c:468 +#: ../db/db-model.c:3438 ../db/db-request.c:468 msgid "Statement" msgstr "" -#: ../db/db-model.c:3438 +#: ../db/db-model.c:3439 msgid "The statement which retrieves the data" msgstr "" -#: ../db/db-model.c:3445 +#: ../db/db-model.c:3446 msgid "Use file" msgstr "" -#: ../db/db-model.c:3446 +#: ../db/db-model.c:3447 msgid "" "If this is set to TRUE, the \"sql\" property will hold the name of a file " "containing a query, if set to FALSE, \"sql\" is used as an SQL string" msgstr "" -#: ../db/db-model.c:3456 +#: ../db/db-model.c:3457 msgid "" "Depending on the \"use-file\" property this will be the path to a file with " "queries for the model or a SQL string" msgstr "" -#: ../db/db-model.c:3465 +#: ../db/db-model.c:3466 msgid "Main Table" msgstr "" -#: ../db/db-model.c:3466 +#: ../db/db-model.c:3467 msgid "The main table of the model" msgstr "" -#: ../db/db-model.c:3473 +#: ../db/db-model.c:3474 msgid "Update flags" msgstr "" -#: ../db/db-model.c:3474 +#: ../db/db-model.c:3475 msgid "The flags that indicate how a model can be modified" msgstr "" -#: ../db/db-model.c:3482 +#: ../db/db-model.c:3483 msgid "Result position" msgstr "" -#: ../db/db-model.c:3483 +#: ../db/db-model.c:3484 msgid "" "The position where the query that will fill the model will be placed in a " "multi-query" @@ -386,44 +386,44 @@ msgstr "" msgid "The query is empty." msgstr "" -#: ../db/db-conn.c:1037 +#: ../db/db-conn.c:1041 msgid "Plugin" msgstr "" -#: ../db/db-conn.c:1038 +#: ../db/db-conn.c:1042 msgid "The name of the plugin" msgstr "" -#: ../db/db-conn.c:1044 +#: ../db/db-conn.c:1048 msgid "Query path" msgstr "" -#: ../db/db-conn.c:1045 +#: ../db/db-conn.c:1049 msgid "The path where query files are located" msgstr "" -#: ../db/db-conn.c:1051 ../db/db-file-loader.c:715 +#: ../db/db-conn.c:1055 ../db/db-file-loader.c:715 #: ../vn/column/vn-column-image.c:493 msgid "Host" msgstr "" -#: ../db/db-conn.c:1052 +#: ../db/db-conn.c:1056 msgid "The host name to connect to" msgstr "" -#: ../db/db-conn.c:1058 ../module/data/users.glade.h:2 +#: ../db/db-conn.c:1062 ../module/data/users.glade.h:2 msgid "User" msgstr "Usuari" -#: ../db/db-conn.c:1059 +#: ../db/db-conn.c:1063 msgid "The user name" msgstr "Nom d'usuari" -#: ../db/db-conn.c:1065 +#: ../db/db-conn.c:1069 msgid "DB name" msgstr "" -#: ../db/db-conn.c:1066 +#: ../db/db-conn.c:1070 msgid "The default schema" msgstr "" @@ -500,59 +500,59 @@ msgstr "" msgid "The maximal size for the contents of the cache directory" msgstr "" -#: ../vn/vn-gui.c:643 +#: ../vn/vn-gui.c:642 msgid "Connection has been lost. Do you want to reconnect?" msgstr "" -#: ../vn/vn-gui.c:650 +#: ../vn/vn-gui.c:649 msgid "An error occurred in the connection." msgstr "" -#: ../vn/vn-gui.c:653 +#: ../vn/vn-gui.c:652 msgid "Database error" msgstr "" -#: ../vn/vn-gui.c:660 +#: ../vn/vn-gui.c:659 msgid "Unknown error" msgstr "" -#: ../vn/vn-gui.c:1000 +#: ../vn/vn-gui.c:999 msgid "Closing connection" msgstr "" -#: ../vn/vn-gui.c:1002 +#: ../vn/vn-gui.c:1001 msgid "Transaction started" msgstr "" -#: ../vn/vn-gui.c:1004 +#: ../vn/vn-gui.c:1003 msgid "Connecting" msgstr "" -#: ../vn/vn-gui.c:1006 +#: ../vn/vn-gui.c:1005 msgid "Connection lost" msgstr "" -#: ../vn/vn-gui.c:1008 +#: ../vn/vn-gui.c:1007 msgid "Connection closed" msgstr "" -#: ../vn/vn-gui.c:1010 ../vn/field/vn-http-image.c:116 +#: ../vn/vn-gui.c:1009 ../vn/field/vn-http-image.c:116 msgid "Loading" msgstr "" -#: ../vn/vn-gui.c:1012 ../vn/gui/main.glade.h:19 +#: ../vn/vn-gui.c:1011 ../vn/gui/main.glade.h:19 msgid "Ready" msgstr "" -#: ../vn/vn-gui.c:1555 +#: ../vn/vn-gui.c:1565 msgid "The connection used by Gui" msgstr "" -#: ../vn/vn-gui.c:1561 +#: ../vn/vn-gui.c:1571 msgid "Application" msgstr "" -#: ../vn/vn-gui.c:1562 +#: ../vn/vn-gui.c:1572 msgid "The application handler for the entire program" msgstr "" @@ -679,7 +679,8 @@ msgstr "" msgid "The current value of the field" msgstr "" -#: ../vn/vn-field.c:525 +#: ../vn/vn-field.c:525 ../glade/glade-db-iterator.c:164 +#: ../glade/glade-db-iterator.c:187 msgid "Parameter" msgstr "" @@ -704,12 +705,12 @@ msgid "Whether the field value can be of type GVN_TYPE_NULL" msgstr "" #: ../vn/field/vn-entry.c:153 ../vn/field/vn-spin.c:172 -#: ../vn/column/vn-column-entry.c:119 ../vn/column/vn-column-spin.c:138 +#: ../vn/column/vn-column-entry.c:119 ../vn/column/vn-column-spin.c:179 msgid "Digits" msgstr "" #: ../vn/field/vn-entry.c:154 ../vn/field/vn-spin.c:173 -#: ../vn/column/vn-column-entry.c:120 ../vn/column/vn-column-spin.c:139 +#: ../vn/column/vn-column-entry.c:120 ../vn/column/vn-column-spin.c:180 msgid "The number of decimal places to display." msgstr "" @@ -804,14 +805,38 @@ msgstr "" msgid "Order in which the tab selects the columns for edition" msgstr "" -#: ../vn/column/vn-column-spin.c:130 +#: ../vn/column/vn-column-spin.c:171 msgid "Climb rate" msgstr "" -#: ../vn/column/vn-column-spin.c:131 +#: ../vn/column/vn-column-spin.c:172 msgid "The acceleration rate when you hold down a button." msgstr "" +#: ../vn/column/vn-column-spin.c:187 +msgid "Minimum value" +msgstr "" + +#: ../vn/column/vn-column-spin.c:188 +msgid "The minimum value of the adjustment." +msgstr "" + +#: ../vn/column/vn-column-spin.c:195 +msgid "Maximum value" +msgstr "" + +#: ../vn/column/vn-column-spin.c:196 +msgid "The maximum value of the adjustment." +msgstr "" + +#: ../vn/column/vn-column-spin.c:203 +msgid "Step Increment" +msgstr "" + +#: ../vn/column/vn-column-spin.c:204 +msgid "The step increment of the adjustment" +msgstr "" + #: ../vn/column/vn-column-combo.c:340 msgid "Sort column" msgstr "" @@ -942,71 +967,51 @@ msgid "_Quit" msgstr "" #: ../vn/gui/actions.glade.h:4 -msgid "_About" +msgid "Quit" msgstr "" #: ../vn/gui/actions.glade.h:5 -msgid "_File" +msgid "_About" msgstr "" #: ../vn/gui/actions.glade.h:6 -msgid "_Help" +msgid "_File" msgstr "" #: ../vn/gui/actions.glade.h:7 -msgid "_Reconnect" +msgid "_Help" msgstr "" #: ../vn/gui/actions.glade.h:8 -msgid "Reconnect" +msgid "_Reconnect" msgstr "" #: ../vn/gui/actions.glade.h:9 -msgid "_Close" +msgid "Reconnect" msgstr "" #: ../vn/gui/actions.glade.h:10 -msgid "_View" +msgid "_Close" msgstr "" #: ../vn/gui/actions.glade.h:11 +msgid "_View" +msgstr "" + +#: ../vn/gui/actions.glade.h:12 msgctxt "View menu option" msgid "Dynamic _Tabs" msgstr "" -#: ../vn/gui/actions.glade.h:12 +#: ../vn/gui/actions.glade.h:13 msgid "Don't show tabs if there is only one tab open" msgstr "" -#: ../vn/gui/actions.glade.h:13 +#: ../vn/gui/actions.glade.h:14 msgctxt "View menu option" msgid "Tool_bar" msgstr "" -#: ../glade/glade-db-model.c:121 -msgid "Create and set a model for a DbModelHolder" -msgstr "" - -#: ../glade/glade-db-model.c:153 -msgid "Model configuration" -msgstr "" - -#: ../glade/glade-db-model.c:153 -msgid "DbModel properties configuration" -msgstr "" - -#: ../glade/glade-db-model.c:238 -msgid "Select a DbModel for the property" -msgstr "" - -#: ../glade/glade-db-model.c:259 ../glade/glade-db-model.c:306 -msgid "New Model" -msgstr "" - -#: ../glade/glade-db-model.c:301 -msgid "Edit Model" -msgstr "" - #: ../glade/glade-db-sql.c:27 msgid "New SQL statement" msgstr "" @@ -1019,6 +1024,52 @@ msgstr "" msgid "Open the SQL Editor" msgstr "" +#: ../glade/glade-db-model.c:123 +msgid "Create and set a model for a DbModelHolder" +msgstr "" + +#: ../glade/glade-db-model.c:155 +msgid "Model configuration" +msgstr "" + +#: ../glade/glade-db-model.c:155 +msgid "DbModel properties configuration" +msgstr "" + +#: ../glade/glade-db-model.c:240 +msgid "Select a DbModel for the property" +msgstr "" + +#: ../glade/glade-db-model.c:261 ../glade/glade-db-model.c:308 +msgid "New Model" +msgstr "" + +#: ../glade/glade-db-model.c:303 +msgid "Edit Model" +msgstr "" + +#: ../glade/glade-db-iterator.c:166 +msgid "Properties" +msgstr "" + +#: ../glade/glade-db-iterator.c:193 +msgid "Iterator Editor" +msgstr "" + +#: ../glade/glade-db-iterator.c:201 +msgid "The model must have \"SQL\" set and \"Use file\" set to 'No'." +msgstr "" + +#: ../glade/glade-db-iterator.c:212 +#, c-format +msgid "%s can't have children before automatic generation." +msgstr "" + +#: ../glade/glade-db-iterator.c:223 +#, c-format +msgid "%s must have \"Model\" set. %s" +msgstr "" + #: ../module/data/example.xml.h:1 msgid "Example" msgstr "" @@ -1188,10 +1239,14 @@ msgstr "" msgid "∞" msgstr "" -#: ../module/src/vn-consulter.c:234 +#: ../module/src/vn-consulter.c:258 msgid "Type or select a query" msgstr "" +#: ../module/src/vn-consulter.c:260 +msgid "Message" +msgstr "" + #, fuzzy #~ msgid "User name:" #~ msgstr "Nom d'usuari" diff --git a/po/es.po b/po/es.po index 7fc6f63..c224d2f 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: 2013-11-18 16:11+0100\n" +"POT-Creation-Date: 2013-12-13 10:07+0100\n" "PO-Revision-Date: 2013-06-04 13:36+0200\n" "Last-Translator: Alejandro T. Colombini Gómez \n" "Language-Team: Spanish\n" @@ -134,7 +134,7 @@ msgstr "Maestro" msgid "The master GvnParam of this parameter" msgstr "El GvnParam maestro de este parámetro" -#: ../gvn/gvn-param.c:457 ../db/db-iterator.c:985 +#: ../gvn/gvn-param.c:457 ../db/db-iterator.c:987 msgid "Mode" msgstr "Modo" @@ -215,7 +215,7 @@ msgstr "El parametro al cual está vinculado" msgid "The value" msgstr "Valor" -#: ../sql/sql-string.c:198 ../db/db-model.c:3455 ../db/db-request.c:461 +#: ../sql/sql-string.c:198 ../db/db-model.c:3456 ../db/db-request.c:461 msgid "SQL" msgstr "SQL" @@ -228,41 +228,41 @@ msgstr "Una cadena SQL arbitraria" msgid "Can't allocate the needed memory" msgstr "No es posible asignar la memoria necesaria" -#: ../db/db-iterator.c:986 +#: ../db/db-iterator.c:988 msgid "The mode in which the iterator is working" msgstr "El modo en el que está trabajando el Iterator" -#: ../db/db-iterator.c:993 +#: ../db/db-iterator.c:995 msgid "Remember selection" msgstr "Recordar fila seleccionada" -#: ../db/db-iterator.c:994 +#: ../db/db-iterator.c:996 msgid "Wether to rememeber the selection when model is refreshed" msgstr "" "Si se recordará o no la fila seleccionado cuando se refresque el modelo" -#: ../db/db-model.c:3429 ../db/db-request.c:454 ../vn/vn-gui.c:1554 +#: ../db/db-model.c:3430 ../db/db-request.c:454 ../vn/vn-gui.c:1564 #: ../vn/vn-form.c:244 msgid "Connection" msgstr "Conexión" -#: ../db/db-model.c:3430 +#: ../db/db-model.c:3431 msgid "The DbConn that manages the connection to the database" msgstr "La DbConn que controla la conexión a la base de datos" -#: ../db/db-model.c:3437 ../db/db-request.c:468 +#: ../db/db-model.c:3438 ../db/db-request.c:468 msgid "Statement" msgstr "Consulta" -#: ../db/db-model.c:3438 +#: ../db/db-model.c:3439 msgid "The statement which retrieves the data" msgstr "La consulta que recupera los datos" -#: ../db/db-model.c:3445 +#: ../db/db-model.c:3446 msgid "Use file" msgstr "Usa fichero" -#: ../db/db-model.c:3446 +#: ../db/db-model.c:3447 msgid "" "If this is set to TRUE, the \"sql\" property will hold the name of a file " "containing a query, if set to FALSE, \"sql\" is used as an SQL string" @@ -270,7 +270,7 @@ msgstr "" "Si es TRUE, la propiedad \"sql\" contiene el nombre de un archivo, si es " "falso, \"sql\" se usa como una cadena SQL" -#: ../db/db-model.c:3456 +#: ../db/db-model.c:3457 msgid "" "Depending on the \"use-file\" property this will be the path to a file with " "queries for the model or a SQL string" @@ -278,27 +278,27 @@ msgstr "" "Dependiendo de la propiedad \"use-file\", esta propiedad será la ruta a un " "fichero con consultas para el modelo o una cadena SQL" -#: ../db/db-model.c:3465 +#: ../db/db-model.c:3466 msgid "Main Table" msgstr "Tabla principal" -#: ../db/db-model.c:3466 +#: ../db/db-model.c:3467 msgid "The main table of the model" msgstr "La tabla principal del modelo" -#: ../db/db-model.c:3473 +#: ../db/db-model.c:3474 msgid "Update flags" msgstr "Flags de actualización" -#: ../db/db-model.c:3474 +#: ../db/db-model.c:3475 msgid "The flags that indicate how a model can be modified" msgstr "Indican como se puede modificar el modelo" -#: ../db/db-model.c:3482 +#: ../db/db-model.c:3483 msgid "Result position" msgstr "Posición del resultado" -#: ../db/db-model.c:3483 +#: ../db/db-model.c:3484 msgid "" "The position where the query that will fill the model will be placed in a " "multi-query" @@ -396,44 +396,44 @@ msgstr "No se puede abrir una nueva conexión, ya está abierta" msgid "The query is empty." msgstr "La consulta está vacía." -#: ../db/db-conn.c:1037 +#: ../db/db-conn.c:1041 msgid "Plugin" msgstr "Plugin" -#: ../db/db-conn.c:1038 +#: ../db/db-conn.c:1042 msgid "The name of the plugin" msgstr "El nombre del plugin" -#: ../db/db-conn.c:1044 +#: ../db/db-conn.c:1048 msgid "Query path" msgstr "Ruta de consultas" -#: ../db/db-conn.c:1045 +#: ../db/db-conn.c:1049 msgid "The path where query files are located" msgstr "La ruta donde se encuentran los archivos de consultas" -#: ../db/db-conn.c:1051 ../db/db-file-loader.c:715 +#: ../db/db-conn.c:1055 ../db/db-file-loader.c:715 #: ../vn/column/vn-column-image.c:493 msgid "Host" msgstr "Host" -#: ../db/db-conn.c:1052 +#: ../db/db-conn.c:1056 msgid "The host name to connect to" msgstr "El nombre del host al que se conectará" -#: ../db/db-conn.c:1058 ../module/data/users.glade.h:2 +#: ../db/db-conn.c:1062 ../module/data/users.glade.h:2 msgid "User" msgstr "Usuario" -#: ../db/db-conn.c:1059 +#: ../db/db-conn.c:1063 msgid "The user name" msgstr "El nombre de usuario" -#: ../db/db-conn.c:1065 +#: ../db/db-conn.c:1069 msgid "DB name" msgstr "Nombre de la BD" -#: ../db/db-conn.c:1066 +#: ../db/db-conn.c:1070 msgid "The default schema" msgstr "El esquema por defecto" @@ -512,59 +512,59 @@ msgstr "Tamaño máximo de la caché" msgid "The maximal size for the contents of the cache directory" msgstr "El tamaño máximo para los contenidos del directorio de caché" -#: ../vn/vn-gui.c:643 +#: ../vn/vn-gui.c:642 msgid "Connection has been lost. Do you want to reconnect?" msgstr "Se ha perdido la conexión. ¿Quieres reconectar?" -#: ../vn/vn-gui.c:650 +#: ../vn/vn-gui.c:649 msgid "An error occurred in the connection." msgstr "Ha habido un error en la conexión." -#: ../vn/vn-gui.c:653 +#: ../vn/vn-gui.c:652 msgid "Database error" msgstr "Error en la base de datos" -#: ../vn/vn-gui.c:660 +#: ../vn/vn-gui.c:659 msgid "Unknown error" msgstr "Error desconocido" -#: ../vn/vn-gui.c:1000 +#: ../vn/vn-gui.c:999 msgid "Closing connection" msgstr "Cerrando conexión" -#: ../vn/vn-gui.c:1002 +#: ../vn/vn-gui.c:1001 msgid "Transaction started" msgstr "Transacción iniciada" -#: ../vn/vn-gui.c:1004 +#: ../vn/vn-gui.c:1003 msgid "Connecting" msgstr "Conectando" -#: ../vn/vn-gui.c:1006 +#: ../vn/vn-gui.c:1005 msgid "Connection lost" msgstr "Conexión perdida" -#: ../vn/vn-gui.c:1008 +#: ../vn/vn-gui.c:1007 msgid "Connection closed" msgstr "Conexión cerrada" -#: ../vn/vn-gui.c:1010 ../vn/field/vn-http-image.c:116 +#: ../vn/vn-gui.c:1009 ../vn/field/vn-http-image.c:116 msgid "Loading" msgstr "Cargando" -#: ../vn/vn-gui.c:1012 ../vn/gui/main.glade.h:19 +#: ../vn/vn-gui.c:1011 ../vn/gui/main.glade.h:19 msgid "Ready" msgstr "Listo" -#: ../vn/vn-gui.c:1555 +#: ../vn/vn-gui.c:1565 msgid "The connection used by Gui" msgstr "La conexión empleada por Gui" -#: ../vn/vn-gui.c:1561 +#: ../vn/vn-gui.c:1571 msgid "Application" msgstr "Aplicación" -#: ../vn/vn-gui.c:1562 +#: ../vn/vn-gui.c:1572 msgid "The application handler for the entire program" msgstr "El manejador de la aplicación para todo el programa" @@ -691,7 +691,8 @@ msgstr "El identificador de la aplicación" msgid "The current value of the field" msgstr "El valor actual del campo" -#: ../vn/vn-field.c:525 +#: ../vn/vn-field.c:525 ../glade/glade-db-iterator.c:164 +#: ../glade/glade-db-iterator.c:187 msgid "Parameter" msgstr "Parámetro" @@ -716,12 +717,12 @@ msgid "Whether the field value can be of type GVN_TYPE_NULL" msgstr "Si el campo puede ser del tipo GVN_TYPE_NULL" #: ../vn/field/vn-entry.c:153 ../vn/field/vn-spin.c:172 -#: ../vn/column/vn-column-entry.c:119 ../vn/column/vn-column-spin.c:138 +#: ../vn/column/vn-column-entry.c:119 ../vn/column/vn-column-spin.c:179 msgid "Digits" msgstr "Dígitos" #: ../vn/field/vn-entry.c:154 ../vn/field/vn-spin.c:173 -#: ../vn/column/vn-column-entry.c:120 ../vn/column/vn-column-spin.c:139 +#: ../vn/column/vn-column-entry.c:120 ../vn/column/vn-column-spin.c:180 msgid "The number of decimal places to display." msgstr "El número de posiciones decimales que se muestran" @@ -816,14 +817,38 @@ msgstr "Tab index" msgid "Order in which the tab selects the columns for edition" msgstr "Orden en el cual el tabulador selecciona las columnas para editar" -#: ../vn/column/vn-column-spin.c:130 +#: ../vn/column/vn-column-spin.c:171 msgid "Climb rate" msgstr "Tasa de subida" -#: ../vn/column/vn-column-spin.c:131 +#: ../vn/column/vn-column-spin.c:172 msgid "The acceleration rate when you hold down a button." msgstr "La tasa de aceleración cuando se mantiene apretado el botón." +#: ../vn/column/vn-column-spin.c:187 +msgid "Minimum value" +msgstr "Valor mínimo" + +#: ../vn/column/vn-column-spin.c:188 +msgid "The minimum value of the adjustment." +msgstr "Valor mínimo del ajuste." + +#: ../vn/column/vn-column-spin.c:195 +msgid "Maximum value" +msgstr "Valor máximo" + +#: ../vn/column/vn-column-spin.c:196 +msgid "The maximum value of the adjustment." +msgstr "Valor máximo del ajuste" + +#: ../vn/column/vn-column-spin.c:203 +msgid "Step Increment" +msgstr "Incremento del paso" + +#: ../vn/column/vn-column-spin.c:204 +msgid "The step increment of the adjustment" +msgstr "El incremento del paso del ajuste" + #: ../vn/column/vn-column-combo.c:340 msgid "Sort column" msgstr "Columna de ordenación" @@ -974,71 +999,51 @@ msgid "_Quit" msgstr "_Salir" #: ../vn/gui/actions.glade.h:4 +msgid "Quit" +msgstr "Salir" + +#: ../vn/gui/actions.glade.h:5 msgid "_About" msgstr "_Acerca de" -#: ../vn/gui/actions.glade.h:5 +#: ../vn/gui/actions.glade.h:6 msgid "_File" msgstr "_Archivo" -#: ../vn/gui/actions.glade.h:6 +#: ../vn/gui/actions.glade.h:7 msgid "_Help" msgstr "Ay_uda" -#: ../vn/gui/actions.glade.h:7 +#: ../vn/gui/actions.glade.h:8 msgid "_Reconnect" msgstr "_Reconectar" -#: ../vn/gui/actions.glade.h:8 +#: ../vn/gui/actions.glade.h:9 msgid "Reconnect" msgstr "Reconectar" -#: ../vn/gui/actions.glade.h:9 +#: ../vn/gui/actions.glade.h:10 msgid "_Close" msgstr "_Cerrar" -#: ../vn/gui/actions.glade.h:10 +#: ../vn/gui/actions.glade.h:11 msgid "_View" msgstr "_Ver" -#: ../vn/gui/actions.glade.h:11 +#: ../vn/gui/actions.glade.h:12 msgctxt "View menu option" msgid "Dynamic _Tabs" msgstr "_Pestañas dinámicas" -#: ../vn/gui/actions.glade.h:12 +#: ../vn/gui/actions.glade.h:13 msgid "Don't show tabs if there is only one tab open" msgstr "No mostrar las pestañas si solo hay una abierta" -#: ../vn/gui/actions.glade.h:13 +#: ../vn/gui/actions.glade.h:14 msgctxt "View menu option" msgid "Tool_bar" msgstr "_Barra de herramientas" -#: ../glade/glade-db-model.c:121 -msgid "Create and set a model for a DbModelHolder" -msgstr "Crear y configurar un modelo para un DbModelHolder" - -#: ../glade/glade-db-model.c:153 -msgid "Model configuration" -msgstr "Configuración del Model" - -#: ../glade/glade-db-model.c:153 -msgid "DbModel properties configuration" -msgstr "Configuración de propiedades de DbModelo" - -#: ../glade/glade-db-model.c:238 -msgid "Select a DbModel for the property" -msgstr "Selecciona un DbModel para la propiedad" - -#: ../glade/glade-db-model.c:259 ../glade/glade-db-model.c:306 -msgid "New Model" -msgstr "Nuevo Modelo" - -#: ../glade/glade-db-model.c:301 -msgid "Edit Model" -msgstr "Editar Modelo" - #: ../glade/glade-db-sql.c:27 msgid "New SQL statement" msgstr "Nueva consulta SQL" @@ -1051,6 +1056,52 @@ msgstr "Editor SQL" msgid "Open the SQL Editor" msgstr "Abrir el Editor SQL" +#: ../glade/glade-db-model.c:123 +msgid "Create and set a model for a DbModelHolder" +msgstr "Crear y configurar un modelo para un DbModelHolder" + +#: ../glade/glade-db-model.c:155 +msgid "Model configuration" +msgstr "Configuración del Model" + +#: ../glade/glade-db-model.c:155 +msgid "DbModel properties configuration" +msgstr "Configuración de propiedades de DbModelo" + +#: ../glade/glade-db-model.c:240 +msgid "Select a DbModel for the property" +msgstr "Selecciona un DbModel para la propiedad" + +#: ../glade/glade-db-model.c:261 ../glade/glade-db-model.c:308 +msgid "New Model" +msgstr "Nuevo Modelo" + +#: ../glade/glade-db-model.c:303 +msgid "Edit Model" +msgstr "Editar Modelo" + +#: ../glade/glade-db-iterator.c:166 +msgid "Properties" +msgstr "Propiedades" + +#: ../glade/glade-db-iterator.c:193 +msgid "Iterator Editor" +msgstr "Editor del Iterator" + +#: ../glade/glade-db-iterator.c:201 +msgid "The model must have \"SQL\" set and \"Use file\" set to 'No'." +msgstr "El modelo debe tener \"SQL\" asignado y \"Usa fichero\" puesto a 'No'." + +#: ../glade/glade-db-iterator.c:212 +#, c-format +msgid "%s can't have children before automatic generation." +msgstr "%s no puede tener hijos antes de la generación automatica." + +#: ../glade/glade-db-iterator.c:223 +#, c-format +msgid "%s must have \"Model\" set. %s" +msgstr "%s debe tener \"Modelo\" asignado. %s" + #: ../module/data/example.xml.h:1 msgid "Example" msgstr "Ejemplo" @@ -1231,6 +1282,13 @@ msgstr "Deshacer" msgid "∞" msgstr "∞" -#: ../module/src/vn-consulter.c:234 +#: ../module/src/vn-consulter.c:258 msgid "Type or select a query" msgstr "Escribe o selecciona la consulta" + +#: ../module/src/vn-consulter.c:260 +msgid "Message" +msgstr "Mensaje" + +#~ msgid "Generate params for %s" +#~ msgstr "Generar params para %s" diff --git a/po/nl.po b/po/nl.po index 8888d1d..79dcdc5 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: 2013-11-18 16:11+0100\n" +"POT-Creation-Date: 2013-12-13 10:07+0100\n" "PO-Revision-Date: 2012-10-09 11:38+0200\n" "Last-Translator: Alejandro T. Colombini Gómez \n" "Language-Team: Dutch\n" @@ -134,7 +134,7 @@ msgstr "" msgid "The master GvnParam of this parameter" msgstr "" -#: ../gvn/gvn-param.c:457 ../db/db-iterator.c:985 +#: ../gvn/gvn-param.c:457 ../db/db-iterator.c:987 msgid "Mode" msgstr "" @@ -215,7 +215,7 @@ msgstr "" msgid "The value" msgstr "" -#: ../sql/sql-string.c:198 ../db/db-model.c:3455 ../db/db-request.c:461 +#: ../sql/sql-string.c:198 ../db/db-model.c:3456 ../db/db-request.c:461 msgid "SQL" msgstr "" @@ -228,72 +228,72 @@ msgstr "" msgid "Can't allocate the needed memory" msgstr "" -#: ../db/db-iterator.c:986 +#: ../db/db-iterator.c:988 msgid "The mode in which the iterator is working" msgstr "" -#: ../db/db-iterator.c:993 +#: ../db/db-iterator.c:995 msgid "Remember selection" msgstr "" -#: ../db/db-iterator.c:994 +#: ../db/db-iterator.c:996 msgid "Wether to rememeber the selection when model is refreshed" msgstr "" -#: ../db/db-model.c:3429 ../db/db-request.c:454 ../vn/vn-gui.c:1554 +#: ../db/db-model.c:3430 ../db/db-request.c:454 ../vn/vn-gui.c:1564 #: ../vn/vn-form.c:244 msgid "Connection" msgstr "" -#: ../db/db-model.c:3430 +#: ../db/db-model.c:3431 msgid "The DbConn that manages the connection to the database" msgstr "" -#: ../db/db-model.c:3437 ../db/db-request.c:468 +#: ../db/db-model.c:3438 ../db/db-request.c:468 msgid "Statement" msgstr "" -#: ../db/db-model.c:3438 +#: ../db/db-model.c:3439 msgid "The statement which retrieves the data" msgstr "" -#: ../db/db-model.c:3445 +#: ../db/db-model.c:3446 msgid "Use file" msgstr "" -#: ../db/db-model.c:3446 +#: ../db/db-model.c:3447 msgid "" "If this is set to TRUE, the \"sql\" property will hold the name of a file " "containing a query, if set to FALSE, \"sql\" is used as an SQL string" msgstr "" -#: ../db/db-model.c:3456 +#: ../db/db-model.c:3457 msgid "" "Depending on the \"use-file\" property this will be the path to a file with " "queries for the model or a SQL string" msgstr "" -#: ../db/db-model.c:3465 +#: ../db/db-model.c:3466 msgid "Main Table" msgstr "" -#: ../db/db-model.c:3466 +#: ../db/db-model.c:3467 msgid "The main table of the model" msgstr "" -#: ../db/db-model.c:3473 +#: ../db/db-model.c:3474 msgid "Update flags" msgstr "" -#: ../db/db-model.c:3474 +#: ../db/db-model.c:3475 msgid "The flags that indicate how a model can be modified" msgstr "" -#: ../db/db-model.c:3482 +#: ../db/db-model.c:3483 msgid "Result position" msgstr "" -#: ../db/db-model.c:3483 +#: ../db/db-model.c:3484 msgid "" "The position where the query that will fill the model will be placed in a " "multi-query" @@ -387,44 +387,44 @@ msgstr "" msgid "The query is empty." msgstr "" -#: ../db/db-conn.c:1037 +#: ../db/db-conn.c:1041 msgid "Plugin" msgstr "" -#: ../db/db-conn.c:1038 +#: ../db/db-conn.c:1042 msgid "The name of the plugin" msgstr "" -#: ../db/db-conn.c:1044 +#: ../db/db-conn.c:1048 msgid "Query path" msgstr "" -#: ../db/db-conn.c:1045 +#: ../db/db-conn.c:1049 msgid "The path where query files are located" msgstr "" -#: ../db/db-conn.c:1051 ../db/db-file-loader.c:715 +#: ../db/db-conn.c:1055 ../db/db-file-loader.c:715 #: ../vn/column/vn-column-image.c:493 msgid "Host" msgstr "" -#: ../db/db-conn.c:1052 +#: ../db/db-conn.c:1056 msgid "The host name to connect to" msgstr "" -#: ../db/db-conn.c:1058 ../module/data/users.glade.h:2 +#: ../db/db-conn.c:1062 ../module/data/users.glade.h:2 msgid "User" msgstr "" -#: ../db/db-conn.c:1059 +#: ../db/db-conn.c:1063 msgid "The user name" msgstr "" -#: ../db/db-conn.c:1065 +#: ../db/db-conn.c:1069 msgid "DB name" msgstr "" -#: ../db/db-conn.c:1066 +#: ../db/db-conn.c:1070 msgid "The default schema" msgstr "" @@ -501,59 +501,59 @@ msgstr "" msgid "The maximal size for the contents of the cache directory" msgstr "" -#: ../vn/vn-gui.c:643 +#: ../vn/vn-gui.c:642 msgid "Connection has been lost. Do you want to reconnect?" msgstr "" -#: ../vn/vn-gui.c:650 +#: ../vn/vn-gui.c:649 msgid "An error occurred in the connection." msgstr "" -#: ../vn/vn-gui.c:653 +#: ../vn/vn-gui.c:652 msgid "Database error" msgstr "" -#: ../vn/vn-gui.c:660 +#: ../vn/vn-gui.c:659 msgid "Unknown error" msgstr "" -#: ../vn/vn-gui.c:1000 +#: ../vn/vn-gui.c:999 msgid "Closing connection" msgstr "" -#: ../vn/vn-gui.c:1002 +#: ../vn/vn-gui.c:1001 msgid "Transaction started" msgstr "" -#: ../vn/vn-gui.c:1004 +#: ../vn/vn-gui.c:1003 msgid "Connecting" msgstr "" -#: ../vn/vn-gui.c:1006 +#: ../vn/vn-gui.c:1005 msgid "Connection lost" msgstr "" -#: ../vn/vn-gui.c:1008 +#: ../vn/vn-gui.c:1007 msgid "Connection closed" msgstr "" -#: ../vn/vn-gui.c:1010 ../vn/field/vn-http-image.c:116 +#: ../vn/vn-gui.c:1009 ../vn/field/vn-http-image.c:116 msgid "Loading" msgstr "" -#: ../vn/vn-gui.c:1012 ../vn/gui/main.glade.h:19 +#: ../vn/vn-gui.c:1011 ../vn/gui/main.glade.h:19 msgid "Ready" msgstr "" -#: ../vn/vn-gui.c:1555 +#: ../vn/vn-gui.c:1565 msgid "The connection used by Gui" msgstr "" -#: ../vn/vn-gui.c:1561 +#: ../vn/vn-gui.c:1571 msgid "Application" msgstr "" -#: ../vn/vn-gui.c:1562 +#: ../vn/vn-gui.c:1572 msgid "The application handler for the entire program" msgstr "" @@ -680,7 +680,8 @@ msgstr "" msgid "The current value of the field" msgstr "" -#: ../vn/vn-field.c:525 +#: ../vn/vn-field.c:525 ../glade/glade-db-iterator.c:164 +#: ../glade/glade-db-iterator.c:187 msgid "Parameter" msgstr "" @@ -705,12 +706,12 @@ msgid "Whether the field value can be of type GVN_TYPE_NULL" msgstr "" #: ../vn/field/vn-entry.c:153 ../vn/field/vn-spin.c:172 -#: ../vn/column/vn-column-entry.c:119 ../vn/column/vn-column-spin.c:138 +#: ../vn/column/vn-column-entry.c:119 ../vn/column/vn-column-spin.c:179 msgid "Digits" msgstr "" #: ../vn/field/vn-entry.c:154 ../vn/field/vn-spin.c:173 -#: ../vn/column/vn-column-entry.c:120 ../vn/column/vn-column-spin.c:139 +#: ../vn/column/vn-column-entry.c:120 ../vn/column/vn-column-spin.c:180 msgid "The number of decimal places to display." msgstr "" @@ -805,14 +806,38 @@ msgstr "" msgid "Order in which the tab selects the columns for edition" msgstr "" -#: ../vn/column/vn-column-spin.c:130 +#: ../vn/column/vn-column-spin.c:171 msgid "Climb rate" msgstr "" -#: ../vn/column/vn-column-spin.c:131 +#: ../vn/column/vn-column-spin.c:172 msgid "The acceleration rate when you hold down a button." msgstr "" +#: ../vn/column/vn-column-spin.c:187 +msgid "Minimum value" +msgstr "" + +#: ../vn/column/vn-column-spin.c:188 +msgid "The minimum value of the adjustment." +msgstr "" + +#: ../vn/column/vn-column-spin.c:195 +msgid "Maximum value" +msgstr "" + +#: ../vn/column/vn-column-spin.c:196 +msgid "The maximum value of the adjustment." +msgstr "" + +#: ../vn/column/vn-column-spin.c:203 +msgid "Step Increment" +msgstr "" + +#: ../vn/column/vn-column-spin.c:204 +msgid "The step increment of the adjustment" +msgstr "" + #: ../vn/column/vn-column-combo.c:340 msgid "Sort column" msgstr "" @@ -942,71 +967,51 @@ msgid "_Quit" msgstr "" #: ../vn/gui/actions.glade.h:4 -msgid "_About" +msgid "Quit" msgstr "" #: ../vn/gui/actions.glade.h:5 -msgid "_File" +msgid "_About" msgstr "" #: ../vn/gui/actions.glade.h:6 -msgid "_Help" +msgid "_File" msgstr "" #: ../vn/gui/actions.glade.h:7 -msgid "_Reconnect" +msgid "_Help" msgstr "" #: ../vn/gui/actions.glade.h:8 -msgid "Reconnect" +msgid "_Reconnect" msgstr "" #: ../vn/gui/actions.glade.h:9 -msgid "_Close" +msgid "Reconnect" msgstr "" #: ../vn/gui/actions.glade.h:10 -msgid "_View" +msgid "_Close" msgstr "" #: ../vn/gui/actions.glade.h:11 +msgid "_View" +msgstr "" + +#: ../vn/gui/actions.glade.h:12 msgctxt "View menu option" msgid "Dynamic _Tabs" msgstr "" -#: ../vn/gui/actions.glade.h:12 +#: ../vn/gui/actions.glade.h:13 msgid "Don't show tabs if there is only one tab open" msgstr "" -#: ../vn/gui/actions.glade.h:13 +#: ../vn/gui/actions.glade.h:14 msgctxt "View menu option" msgid "Tool_bar" msgstr "" -#: ../glade/glade-db-model.c:121 -msgid "Create and set a model for a DbModelHolder" -msgstr "" - -#: ../glade/glade-db-model.c:153 -msgid "Model configuration" -msgstr "" - -#: ../glade/glade-db-model.c:153 -msgid "DbModel properties configuration" -msgstr "" - -#: ../glade/glade-db-model.c:238 -msgid "Select a DbModel for the property" -msgstr "" - -#: ../glade/glade-db-model.c:259 ../glade/glade-db-model.c:306 -msgid "New Model" -msgstr "" - -#: ../glade/glade-db-model.c:301 -msgid "Edit Model" -msgstr "" - #: ../glade/glade-db-sql.c:27 msgid "New SQL statement" msgstr "" @@ -1019,6 +1024,52 @@ msgstr "" msgid "Open the SQL Editor" msgstr "" +#: ../glade/glade-db-model.c:123 +msgid "Create and set a model for a DbModelHolder" +msgstr "" + +#: ../glade/glade-db-model.c:155 +msgid "Model configuration" +msgstr "" + +#: ../glade/glade-db-model.c:155 +msgid "DbModel properties configuration" +msgstr "" + +#: ../glade/glade-db-model.c:240 +msgid "Select a DbModel for the property" +msgstr "" + +#: ../glade/glade-db-model.c:261 ../glade/glade-db-model.c:308 +msgid "New Model" +msgstr "" + +#: ../glade/glade-db-model.c:303 +msgid "Edit Model" +msgstr "" + +#: ../glade/glade-db-iterator.c:166 +msgid "Properties" +msgstr "" + +#: ../glade/glade-db-iterator.c:193 +msgid "Iterator Editor" +msgstr "" + +#: ../glade/glade-db-iterator.c:201 +msgid "The model must have \"SQL\" set and \"Use file\" set to 'No'." +msgstr "" + +#: ../glade/glade-db-iterator.c:212 +#, c-format +msgid "%s can't have children before automatic generation." +msgstr "" + +#: ../glade/glade-db-iterator.c:223 +#, c-format +msgid "%s must have \"Model\" set. %s" +msgstr "" + #: ../module/data/example.xml.h:1 msgid "Example" msgstr "" @@ -1187,6 +1238,10 @@ msgstr "" msgid "∞" msgstr "" -#: ../module/src/vn-consulter.c:234 +#: ../module/src/vn-consulter.c:258 msgid "Type or select a query" msgstr "" + +#: ../module/src/vn-consulter.c:260 +msgid "Message" +msgstr "" diff --git a/sql/parser/gram.y b/sql/parser/gram.y index 87c9f26..d540e96 100644 --- a/sql/parser/gram.y +++ b/sql/parser/gram.y @@ -27,9 +27,18 @@ typedef struct SqlObject * object; gchar * string; gchar * current; - gboolean error; + gboolean failed; + GError ** error; } ParseState; + +typedef enum +{ + SQL_PARSER_ERROR_EMPTY_QUERY = 1 << 0, + SQL_PARSER_ERROR_PARSING = 1 << 1, + SQL_PARSER_ERROR_STACK_OVERFLOW = 1 << 2, +} +SqlParserError; } %token_type { gchar * } @@ -51,17 +60,16 @@ ParseState; pref = err_str == state->string ? " near: " : " near: [...]"; } - g_log (g_quark_to_string (SQL_PARSER_LOG_DOMAIN), G_LOG_LEVEL_WARNING, + g_set_error (state->error, SQL_PARSER_LOG_DOMAIN, SQL_PARSER_ERROR_PARSING, "Parsing error%s%s", pref, err_str); - - state->error = TRUE; + state->failed = TRUE; } %stack_overflow { - g_log (g_quark_to_string (SQL_PARSER_LOG_DOMAIN) - ,G_LOG_LEVEL_WARNING - ,"Parser stack overflow. Parsing terminated.\n"); + g_set_error (state->error, SQL_PARSER_LOG_DOMAIN, SQL_PARSER_ERROR_STACK_OVERFLOW, + "Parser stack overflow. Parsing terminated.\n"); + state->failed = TRUE; } %parse_accept {} diff --git a/sql/parser/scan.rl b/sql/parser/scan.rl index 57fb961..5306ae0 100644 --- a/sql/parser/scan.rl +++ b/sql/parser/scan.rl @@ -218,25 +218,28 @@ static gchar * get_token (const gchar * ts, const gchar * te) }%% %% write data; -SqlObject * sql_parser_parse (gchar * sql) +SqlObject * sql_parser_parse (const gchar * sql, GError ** err) { gint cs, act; gchar * p, * pe, * ts, * te; gpointer eof, parser; ParseState * state; SqlObject * object; + gchar * query; if (!sql) { - g_log (g_quark_to_string (SQL_PARSER_LOG_DOMAIN) - ,G_LOG_LEVEL_WARNING ,"Empty query!\n"); + g_set_error (err, SQL_PARSER_LOG_DOMAIN, + SQL_PARSER_ERROR_EMPTY_QUERY, "Empty query!\n"); return NULL; } + query = g_strdup (sql); + state = g_new (ParseState, 1); state->object = NULL; - state->error = FALSE; - state->string = state->current = p = sql; + state->error = err; + state->string = state->current = p = query; pe = p + strlen (p) + 1; eof = pe; @@ -248,7 +251,7 @@ SqlObject * sql_parser_parse (gchar * sql) Parse (parser, 0, 0, state); ParseFree (parser, g_free); - if (state->error) + if (state->failed) { if (state->object && G_IS_OBJECT (state->object)) g_object_unref (state->object); @@ -258,6 +261,7 @@ SqlObject * sql_parser_parse (gchar * sql) object = g_object_ref_sink (state->object); g_free (state); + g_free (query); return object; } diff --git a/sql/sql-parser.h b/sql/sql-parser.h index 9c68dd2..52f77fa 100644 --- a/sql/sql-parser.h +++ b/sql/sql-parser.h @@ -24,12 +24,14 @@ /** * sql_parser_parse: - * @sql: An string containing an SQL query. + * @sql: An string containing an SQL query + * @err: (out) (allow-none): a return location of a #GError or %NULL to ignore + * errors * * Parses @sql and makes an #SqlObject from the query on it. * - * Return value: (transfer full): an #SqlObject. + * Return value: (transfer full): an #SqlObject */ -SqlObject * sql_parser_parse (gchar * sql) G_GNUC_WARN_UNUSED_RESULT; +SqlObject * sql_parser_parse (const gchar * sql, GError ** err) G_GNUC_WARN_UNUSED_RESULT; #endif \ No newline at end of file diff --git a/sql/sql-select.c b/sql/sql-select.c index 7bd1719..a59d280 100644 --- a/sql/sql-select.c +++ b/sql/sql-select.c @@ -16,6 +16,7 @@ */ #include "sql-select.h" +#include "sql-field.h" /** * SECTION: sql-select @@ -150,6 +151,44 @@ void sql_select_set_alias (SqlSelect * obj, SqlExpr * expr, const gchar * alias) } } +/* + * Return the alias of a field and if it's an unaliased SqlField, its name, + * otherwise returns NULL (uses include of sql-field.h) + */ +gchar * sql_select_get_column_name (SqlSelect * obj, SqlExpr * expr) +{ + gboolean listed = FALSE; + GSList * n; + + g_return_val_if_fail (SQL_IS_SELECT (obj), NULL); + g_return_val_if_fail (SQL_IS_EXPR (expr), NULL); + + for (n = obj->expr; n; n = n->next) + if (expr == n->data) + { + listed = TRUE; + break; + } + + if (listed) + for (n = obj->alias; n; n = n->next) + { + SqlSelectAlias * as = n->data; + + if (expr == as->expr) + return g_strdup (as->alias); + } + + if (SQL_IS_FIELD (expr)) + { + gchar * name; + g_object_get (expr, "name", &name, NULL); + return name; + } + + return NULL; +} + void sql_select_add_group (SqlSelect * obj, SqlExpr * expr) { g_return_if_fail (SQL_IS_SELECT (obj)); diff --git a/sql/sql-select.h b/sql/sql-select.h index 55120fe..3059b06 100644 --- a/sql/sql-select.h +++ b/sql/sql-select.h @@ -83,6 +83,7 @@ SqlSelect * sql_select_new (); void sql_select_set_distinct (SqlSelect * obj, gboolean distinct); void sql_select_add_expr (SqlSelect * obj, SqlExpr * expr); void sql_select_set_alias (SqlSelect * obj, SqlExpr * expr, const gchar * alias); +gchar * sql_select_get_column_name (SqlSelect * obj, SqlExpr * expr); void sql_select_add_group (SqlSelect * obj, SqlExpr * expr); void sql_select_set_having (SqlSelect * obj, SqlExpr * expr); void sql_select_add_order (SqlSelect * obj, SqlExpr * expr, SqlOrderWay way); diff --git a/sql/sql.pc.in b/sql/sql.pc.in index ad446c8..7392163 100644 --- a/sql/sql.pc.in +++ b/sql/sql.pc.in @@ -1,11 +1,10 @@ prefix=@prefix@ exec_prefix=@exec_prefix@ -libdir=@libdir@/hedera -includedir=@includedir@/hedera +libdir=@libdir@/@PACKAGE@ +includedir=@includedir@/@PACKAGE@ Name: Sql Description: Sql Classes Module for Hedera Library Version: @VERSION@ -Requires: gvn glib-2.0 gobject-2.0 -Libs: -L${libdir} -lsql -Cflags: -I${includedir}/sql +Requires: gvn +Libs: -lsql diff --git a/vn/Makefile.am b/vn/Makefile.am index ba2a430..c6ef633 100644 --- a/vn/Makefile.am +++ b/vn/Makefile.am @@ -42,7 +42,9 @@ libvn_la_SOURCES = \ vn-model.c \ vn-grid.c \ vn-handler.c \ - vn-batch.c + vn-batch.c \ + $(top_srcdir)/vn/glade/vn-iterator.h \ + $(top_srcdir)/vn/glade/vn-iterator.c pkgconfig_DATA = vn.pc diff --git a/vn/column/vn-column-spin.c b/vn/column/vn-column-spin.c index dcf05bf..67f9c11 100644 --- a/vn/column/vn-column-spin.c +++ b/vn/column/vn-column-spin.c @@ -19,15 +19,32 @@ G_DEFINE_TYPE (VnColumnSpin, vn_column_spin, VN_TYPE_COLUMN); -static void vn_column_entry_cb_edited (GtkCellRendererText * cell, +static void vn_column_spin_on_edited (GtkCellRendererSpin * cell, const gchar * path, gchar * text, VnColumnSpin * obj) { GValue value = {0}; - + if (g_strcmp0 (text, "")) { - g_value_init (&value, G_TYPE_STRING); - g_value_set_string (&value, text); + gchar * err; + gdouble min, max; + gdouble val = g_strtod (text, &err); + + if (!err || *err == '\0') + { + g_object_get (obj->adjustment, "lower", &min, "upper", &max, NULL); + + if (val < min) + val = min; + else if (val > max) + val = max; + + g_value_init (&value, G_TYPE_DOUBLE); + g_value_set_double (&value, val); + g_object_set (obj->adjustment, "value", val, NULL); + } + else + return; } else g_value_init (&value, GVN_TYPE_NULL); @@ -42,15 +59,22 @@ static void vn_column_spin_set_editable (VnColumn * obj, gboolean editable) if (editable) g_signal_connect (obj->cell, "edited", - G_CALLBACK (vn_column_entry_cb_edited), obj); + G_CALLBACK (vn_column_spin_on_edited), obj); else g_signal_handlers_disconnect_by_func (obj->cell, - vn_column_entry_cb_edited, obj); + vn_column_spin_on_edited, obj); } static void vn_column_spin_set_value (VnColumnSpin * obj, GtkTreeModel * model, - GtkTreeIter * iter, GtkCellRenderer * cell, const GValue * value) + GtkTreeIter * iter, GObject * cell, const GValue * value) { + gint digits; + GValue new_value = {0}; + + g_object_get (cell, "digits", &digits, NULL); + gvn_value_to_format_string (value, digits, &new_value); + g_object_set_property (cell, "text", &new_value); + g_value_unset (&new_value); } //+++++++++++++++++++++++++++++++++++++++++++++++++++ Class @@ -59,7 +83,9 @@ enum { PROP_CLIMB_RATE = 1 ,PROP_DIGITS - ,PROP_VALUE_TYPE + ,PROP_LOWER + ,PROP_UPPER + ,PROP_STEP }; static void vn_column_spin_set_property (VnColumnSpin * obj, guint id, @@ -68,37 +94,49 @@ static void vn_column_spin_set_property (VnColumnSpin * obj, guint id, switch (id) { case PROP_CLIMB_RATE: - g_object_set (VN_COLUMN (obj)->cell, - "climb-rate", g_value_get_double (value), NULL); + g_object_set (VN_COLUMN (obj)->cell, "climb-rate", g_value_get_double (value), NULL); break; case PROP_DIGITS: - g_object_set (VN_COLUMN (obj)->cell, - "digits", g_value_get_uint (value), NULL); + g_object_set (VN_COLUMN (obj)->cell, "digits", g_value_get_uint (value), NULL); + break; + case PROP_LOWER: + g_object_set (obj->adjustment, "lower", g_value_get_double (value), NULL); + break; + case PROP_UPPER: + g_object_set (obj->adjustment, "upper", g_value_get_double (value), NULL); + break; + case PROP_STEP: + g_object_set (obj->adjustment, + "step-increment", g_value_get_double (value), + "page-increment", g_value_get_double (value) * 10, + NULL); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, id, pspec); } } + static void vn_column_spin_get_property (VnColumnSpin * obj, guint id, GValue * value, GParamSpec * pspec) { switch (id) { case PROP_CLIMB_RATE: - { - gdouble climb_rate; - g_object_get (value, "climb-rate", &climb_rate, NULL); - g_value_set_double (value, climb_rate); + g_object_get_property (G_OBJECT (VN_COLUMN (obj)->cell), "climb-rate", value); break; - } case PROP_DIGITS: - { - guint digits; - g_object_get (VN_COLUMN (obj)->cell, "digits", &digits, NULL); - g_value_set_uint (value, digits); + g_object_get_property (G_OBJECT (VN_COLUMN (obj)->cell), "digits", value); break; - } - default: + case PROP_LOWER: + g_object_get_property (G_OBJECT (obj->adjustment), "lower", value); + break; + case PROP_UPPER: + g_object_get_property (G_OBJECT (obj->adjustment), "upper", value); + break; + case PROP_STEP: + g_object_get_property (G_OBJECT (obj->adjustment), "step-increment", value); + break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, id, pspec); } } @@ -106,8 +144,11 @@ static void vn_column_spin_get_property (VnColumnSpin * obj, guint id, static void vn_column_spin_init (VnColumnSpin * obj) { GtkCellRenderer * cell = gtk_cell_renderer_spin_new (); - VN_COLUMN_GET_CLASS (obj)->set_renderer (VN_COLUMN (obj), cell); -//??g_object_bind_property (obj, "digits", VN_COLUMN (obj)->cell, "digits"); + + obj->adjustment = gtk_adjustment_new (0.0, G_MININT, G_MAXINT, 0.0, 1.0, 0.0); + g_object_set (cell, "adjustment", obj->adjustment, NULL); + + VN_COLUMN_GET_CLASS (obj)->set_renderer (VN_COLUMN (obj), cell); } static void vn_column_spin_finalize (VnColumnSpin * obj) @@ -129,7 +170,7 @@ static void vn_column_spin_class_init (VnColumnSpinClass * klass) g_param_spec_double ("climb-rate" ,_("Climb rate") ,_("The acceleration rate when you hold down a button.") - ,0 ,0 ,0 + ,0.0 ,G_MAXDOUBLE ,0.0 ,G_PARAM_CONSTRUCT | G_PARAM_READWRITE )); @@ -140,4 +181,28 @@ static void vn_column_spin_class_init (VnColumnSpinClass * klass) ,0 ,20 ,0 ,G_PARAM_CONSTRUCT | G_PARAM_READWRITE )); + + g_object_class_install_property (k, PROP_LOWER, + g_param_spec_double ("lower" + ,_("Minimum value") + ,_("The minimum value of the adjustment.") + ,-G_MAXDOUBLE ,G_MAXDOUBLE ,0.0 + ,G_PARAM_CONSTRUCT | G_PARAM_READWRITE + )); + + g_object_class_install_property (k, PROP_UPPER, + g_param_spec_double ("upper" + ,_("Maximum value") + ,_("The maximum value of the adjustment.") + ,-G_MAXDOUBLE ,G_MAXDOUBLE , G_MAXDOUBLE + ,G_PARAM_CONSTRUCT | G_PARAM_READWRITE + )); + + g_object_class_install_property (k, PROP_STEP, + g_param_spec_double ("step-increment" + ,_("Step Increment") + ,_("The step increment of the adjustment") + ,0.00000000000000000001 ,10000000000.0 ,1.0 + ,G_PARAM_CONSTRUCT | G_PARAM_READWRITE + )); } diff --git a/vn/column/vn-column-spin.h b/vn/column/vn-column-spin.h index fab80ef..31270ec 100644 --- a/vn/column/vn-column-spin.h +++ b/vn/column/vn-column-spin.h @@ -33,6 +33,7 @@ typedef struct _VnColumnSpinClass VnColumnSpinClass; struct _VnColumnSpin { VnColumn parent; + GtkAdjustment * adjustment; }; struct _VnColumnSpinClass diff --git a/vn/glade/vn-iterator.c b/vn/glade/vn-iterator.c new file mode 100644 index 0000000..d5c8cb1 --- /dev/null +++ b/vn/glade/vn-iterator.c @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2012 - Juan Ferrer Toribio + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "vn-iterator.h" + +//+++++++++++++++++++++++++++++++++++++++++++++++++++ GtkBuildable + +static void vn_iterator_buildable_add_child (GtkBuildable * obj, + GtkBuilder * builder, GObject * child, const gchar * type) +{ + db_iterator_add_param (DB_ITERATOR (obj), DB_PARAM (child)); +} + +//+++++++++++++++++++++++++++++++++++++++++++++++++++ Class + +static void vn_iterator_finalize (VnIterator * obj) +{ + GObjectClass * parent = g_type_class_peek_parent (VN_ITERATOR_GET_CLASS (obj)); + parent->finalize (G_OBJECT (obj)); +} + +static void vn_iterator_class_init (VnIteratorClass * klass) +{ + GObjectClass * k = G_OBJECT_CLASS (klass); + k->finalize = (GObjectFinalizeFunc) vn_iterator_finalize; +} + +static void vn_iterator_buildable_interface_init (GtkBuildableIface * iface) +{ + iface->add_child = vn_iterator_buildable_add_child; +} + +static void vn_iterator_init (VnIterator * obj) +{} + +G_DEFINE_TYPE_WITH_CODE (VnIterator, vn_iterator, DB_TYPE_ITERATOR, + G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE, + vn_iterator_buildable_interface_init) +); diff --git a/vn/glade/vn-iterator.h b/vn/glade/vn-iterator.h new file mode 100644 index 0000000..1182c56 --- /dev/null +++ b/vn/glade/vn-iterator.h @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2012 - Juan Ferrer Toribio + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef VN_ITERATOR_H +#define VN_ITERATOR_H + +#include +#include + +#define VN_TYPE_ITERATOR (vn_iterator_get_type ()) +#define VN_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST (obj, VN_TYPE_ITERATOR, VnIterator)) +#define VN_IS_ITERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, VN_TYPE_ITERATOR)) +#define VN_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST (klass, VN_TYPE_ITERATOR, VnIteratorClass)) +#define VN_IS_ITERATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE (klass, VN_TYPE_ITERATOR)) +#define VN_ITERATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS (obj, VN_TYPE_ITERATOR, VnIteratorClass)) + +typedef struct _VnIterator VnIterator; +typedef struct _VnIteratorClass VnIteratorClass; + +struct _VnIterator +{ + DbIterator iterator; +}; + +struct _VnIteratorClass +{ + DbIteratorClass parent; +}; + +GType vn_iterator_get_type (); + +#endif diff --git a/vn/gui/actions.glade b/vn/gui/actions.glade index 8178cc0..833142a 100644 --- a/vn/gui/actions.glade +++ b/vn/gui/actions.glade @@ -15,7 +15,8 @@ _Quit - application-exit + Quit + window-close diff --git a/vn/gui/menubar.ui b/vn/gui/menubar.ui index 755cc18..d376749 100644 --- a/vn/gui/menubar.ui +++ b/vn/gui/menubar.ui @@ -24,5 +24,9 @@ + diff --git a/vn/vn-batch.c b/vn/vn-batch.c index 95d621c..acc2cd5 100644 --- a/vn/vn-batch.c +++ b/vn/vn-batch.c @@ -62,7 +62,9 @@ void vn_batch_remove (VnBatch * obj, GObject * child) * vn_batch_get_objects_list: * @obj: a #VnBatch * - * Returns all the #GObjects in @obj, copying the list. + * Returns all the #GObjects in @obj, copying the list. This method is + * mainly for internal use, use vn_batch_get_objects() instead if you don't need + * to do further use of the list of objects. * * Return value: (transfer container) (element-type GObject): a #GList with all * the objects, that must be freed with #g_list_free @@ -121,8 +123,7 @@ static void vn_batch_init (VnBatch * obj) static void vn_batch_finalize (VnBatch * obj) { - GObjectClass * parent; - parent = g_type_class_peek_parent (VN_BATCH_GET_CLASS (obj)); + GObjectClass * parent = g_type_class_peek_parent (VN_BATCH_GET_CLASS (obj)); g_list_free (obj->objects); diff --git a/vn/vn-gui.c b/vn/vn-gui.c index 74cc57e..3ac6a72 100644 --- a/vn/vn-gui.c +++ b/vn/vn-gui.c @@ -53,6 +53,7 @@ struct _VnWindow GtkToggleAction * dynamic_tabs; GtkToggleAction * view_toolbar; guint merge_id; + gboolean maximized; }; typedef struct @@ -234,6 +235,7 @@ static void vn_gui_load_module (VnGui * obj, const gchar * dir, const gchar * fi { gint n; gchar * mod_title_strip, * mod_name; + const gchar * text_dom = NULL; GModule * module = NULL; VnMod * mod = NULL; GdomeException e; @@ -340,7 +342,6 @@ static void vn_gui_load_module (VnGui * obj, const gchar * dir, const gchar * fi GdomeDOMString * accel; GdomeDOMString * title; gchar * symbol_name; - const gchar * text_dom; GtkTreeIter parent_iter; GtkTreeIter * iter; VnFormGetTypeFunc mod_get_type_func; @@ -460,7 +461,7 @@ static void vn_gui_load_module (VnGui * obj, const gchar * dir, const gchar * fi node = gdome_el_firstChild (el, &e); title = gdome_n_nodeValue (node, &e); - title_strip = g_strstrip (g_strdup (title->str)); + title_strip = g_strstrip (g_strdup (g_dgettext (text_dom, title->str))); gdome_el_unref (el, &e); gdome_n_unref (node, &e); @@ -532,7 +533,6 @@ static VnWindow * vn_gui_add_window (VnGui * obj, GtkWindow * widget, GtkNoteboo obj->windows = g_slist_prepend (obj->windows, window); gtk_application_add_window (obj->app, widget); - gtk_notebook_set_group_name (notebook, g_application_get_application_id (G_APPLICATION (obj->app))); @@ -572,7 +572,6 @@ static VnWindow * vn_gui_add_window (VnGui * obj, GtkWindow * widget, GtkNoteboo GTK_STYLE_CLASS_PRIMARY_TOOLBAR); gtk_window_add_accel_group (widget, gtk_ui_manager_get_accel_group (window->manager)); - window->toolbar = toolbar; } else @@ -704,7 +703,7 @@ static gboolean vn_gui_reconnect_idle (GuiData * gui_data) } /* - * Thread function that tryes to reopen the connection asynchronously. + * Thread function that tries to reopen the connection asynchronously. */ static void vn_gui_reconnect_thread (GuiData * gui_data) { @@ -1076,6 +1075,7 @@ void vn_gui_open (VnGui * obj) gsize len; gint x, y; gint width, height; + gboolean maximized; gchar ** windows; gchar ** forms; VnWindow * window; @@ -1088,6 +1088,7 @@ void vn_gui_open (VnGui * obj) y = g_key_file_get_integer (config, windows[m], "y", NULL); width = g_key_file_get_integer (config, windows[m], "width", NULL); height = g_key_file_get_integer (config, windows[m], "height", NULL); + maximized = g_key_file_get_boolean (config, windows[m], "maximized", NULL); if (g_key_file_get_boolean (config, windows[m], "main", NULL)) { @@ -1098,7 +1099,10 @@ void vn_gui_open (VnGui * obj) window = vn_gui_create_window (obj, x, y); gtk_window_resize (window->widget, width, height); - + + if (maximized) + gtk_window_maximize (window->widget); + forms = g_key_file_get_string_list (config, windows[m], "forms", NULL, NULL); @@ -1145,6 +1149,8 @@ void vn_gui_save (VnGui * obj) GList * nb_pages, * n; VnWindow * window; gint x, y, width, height; + GdkWindow * win; + gboolean maximized; GKeyFile * config; g_return_if_fail (VN_IS_GUI (obj)); @@ -1169,6 +1175,11 @@ void vn_gui_save (VnGui * obj) g_key_file_set_integer (config, group, "width", width); g_key_file_set_integer (config, group, "height", height); + g_object_get (window->widget, "window", &win, NULL); + maximized = (gdk_window_get_state (win) & GDK_WINDOW_STATE_MAXIMIZED); + g_object_unref (win); + g_key_file_set_boolean (config, group, "maximized", maximized); + // Saving the forms opened at window if (window == obj->main_window) diff --git a/vn/vn-mod.c b/vn/vn-mod.c index fe94bd2..c7d80f7 100644 --- a/vn/vn-mod.c +++ b/vn/vn-mod.c @@ -98,7 +98,13 @@ static void vn_mod_set_property (VnMod * obj, guint id, { case PROP_NAME: obj->priv->name = g_value_dup_string (value); - obj->priv->text_domain = g_strdup_printf ("hedera-%s", obj->priv->name); + + //XXX Remove when the "example" mod gets removed from the project + if (g_strcmp0 (obj->priv->name, "example")) + obj->priv->text_domain = g_strdup_printf ("%s-%s", GETTEXT_PACKAGE, obj->priv->name); + else + obj->priv->text_domain = g_strdup (GETTEXT_PACKAGE); + bindtextdomain (obj->priv->text_domain, _HEDERA_LOCALE_DIR); break; case PROP_DATA_DIR: