Ahora el programa y los modulos se pueden usar sin instalar

This commit is contained in:
Alejandro T. Colombini Gómez 2014-01-02 12:29:46 +01:00
parent 135d73fbc7
commit 2d850f41c8
22 changed files with 298 additions and 750 deletions

View File

@ -20,3 +20,5 @@ SUBDIRS = \
EXTRA_DIST = \ EXTRA_DIST = \
autogen.sh \ autogen.sh \
Makefile.decl Makefile.decl
DISTCLEANFILES = gschemas.compiled

View File

@ -9,8 +9,6 @@
<required-program>autoconf</required-program> <required-program>autoconf</required-program>
<required-program>make</required-program> <required-program>make</required-program>
<required-program>valac</required-program> <required-program>valac</required-program>
<required-program>hedera</required-program>
<required-package>hedera</required-package>
</project-wizard> </project-wizard>
<page name="basic" label="Basic information" description="General Project Information"> <page name="basic" label="Basic information" description="General Project Information">
@ -34,8 +32,6 @@
<property type="hidden" name="NameHLower" default='[+(string-substitute (string->c-name! (string-downcase (get "Name"))) " " "-")+]'/> <property type="hidden" name="NameHLower" default='[+(string-substitute (string->c-name! (string-downcase (get "Name"))) " " "-")+]'/>
<property type="hidden" name="ClassName" default='[+(string->camelcase (get "Name"))+]'/> <property type="hidden" name="ClassName" default='[+(string->camelcase (get "Name"))+]'/>
<property type="hidden" name="FormClassName" default='[+(string->camelcase (get "FormName"))+]'/> <property type="hidden" name="FormClassName" default='[+(string->camelcase (get "FormName"))+]'/>
<property type="hidden" name="HavePackage" default="1"/>
<property type="hidden" name="PackageModule1" default="hedera"/>
<property type="boolean" name="HaveI18n" default="0" label="Add internationalization:" description="Adds support for internationalization so that your project can have translations in different languages" default="1"></property> <property type="boolean" name="HaveI18n" default="0" label="Add internationalization:" description="Adds support for internationalization so that your project can have translations in different languages" default="1"></property>
<property type="boolean" name="HavePackageExtra" default="0" label="Configure external packages:" description="Add library support from other packages (GLib, Gtk+ and Hedera are already added)"></property> <property type="boolean" name="HavePackageExtra" default="0" label="Configure external packages:" description="Add library support from other packages (GLib, Gtk+ and Hedera are already added)"></property>
<property type="boolean" name="HavePackageExtra" default="0" label="Configurar paquetes externos:" description="Añade soporte para otros paquetes (GLib, Gtk+ y Hedera ya están añadidos)"xml:lang="es"></property> <property type="boolean" name="HavePackageExtra" default="0" label="Configurar paquetes externos:" description="Añade soporte para otros paquetes (GLib, Gtk+ y Hedera ya están añadidos)"xml:lang="es"></property>

View File

@ -20,11 +20,11 @@ Working directories=../../../[+Name+]%%%../../build
Environment variables=VN_MODULE_LIB_PATH=./build/src/.libs%%%VN_MODULE_DATA_PATH=./data%%%VN_MODULE_QUERY_PATH=./sql Environment variables=VN_MODULE_LIB_PATH=./build/src/.libs%%%VN_MODULE_DATA_PATH=./data%%%VN_MODULE_QUERY_PATH=./sql
[Build] [Build]
Configuration list=1:Default:build%%%1:Debug:build%%%1:Install:build%%%1:Optimized:build%%%1:Profiling:build Configuration list=1:Default:build%%%1:Debug:build%%%1:Uninstalled:build%%%1:Optimized:build%%%1:Profiling:build
Selected Configuration=Debug Selected Configuration=Debug
BuildArgs/Default= BuildArgs/Default=
BuildArgs/Debug=--enable-debug BuildArgs/Debug=--enable-debug
BuildArgs/Install=--prefix= BuildArgs/Uninstalled=UNINSTALLED_DIR=~/hedera --enable-uninstalled
BuildArgs/Optimized= BuildArgs/Optimized=
BuildArgs/Profiling= BuildArgs/Profiling=

View File

@ -15,7 +15,7 @@ AM_SILENT_RULES([yes])
AC_PROG_CC AC_PROG_CC
dnl Check for vala. dnl Check for vala.
dnl You should change the version shown here manually to match with yours. dnl You should change the version manually to match with yours.
AM_PROG_VALAC([0.20.0]) AM_PROG_VALAC([0.20.0])
[+IF (=(get "HaveI18n") "1")+] [+IF (=(get "HaveI18n") "1")+]
dnl Internationalization dnl Internationalization
@ -27,11 +27,10 @@ AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [GETTEXT package name])
AM_GLIB_GNU_GETTEXT AM_GLIB_GNU_GETTEXT
AM_XGETTEXT_OPTION([-k_ -kQ_:1g -kN_ -kC_:1c,2 -kNC_:1c,2]) AM_XGETTEXT_OPTION([-k_ -kQ_:1g -kN_ -kC_:1c,2 -kNC_:1c,2])
[+ENDIF+] [+ENDIF+]
dnl Check for debug mode. AC_MSG_CHECKING([whether to build with debug information])
AC_MSG_CHECKING([whether to build with debug information...])
AC_ARG_ENABLE([debug], AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug], [AS_HELP_STRING([--enable-debug],
[Enable debug data generation (def=no)])], [Enable debug data generation [default = no]])],
[ENABLE_DEBUG="$enableval"], [ENABLE_DEBUG="$enableval"],
[ENABLE_DEBUG=no]) [ENABLE_DEBUG=no])
AC_MSG_RESULT([$ENABLE_DEBUG]) AC_MSG_RESULT([$ENABLE_DEBUG])
@ -44,11 +43,10 @@ else
VALAFLAGS= VALAFLAGS=
fi fi
dnl Check if the C warnings must be shown AC_MSG_CHECKING([whether C warnings will be shown])
AC_MSG_CHECKING([whether C warnings will be shown...])
AC_ARG_ENABLE([c-warnings], AC_ARG_ENABLE([c-warnings],
[AS_HELP_STRING([--enable-c-warnings], [AS_HELP_STRING([--enable-c-warnings],
[Enable C warnings to be shown (def=no)])], [Enable C warnings to be shown [default = no]])],
[C_WARNINGS="$enableval"], [C_WARNINGS="$enableval"],
[C_WARNINGS=no]) [C_WARNINGS=no])
AC_MSG_RESULT([$C_WARNINGS]) AC_MSG_RESULT([$C_WARNINGS])
@ -64,14 +62,45 @@ AC_SUBST([VALAFLAGS])
AC_SUBST([[+NameCLower+]_datadir], ['$(datadir)/hedera/module']) AC_SUBST([[+NameCLower+]_datadir], ['$(datadir)/hedera/module'])
LT_INIT 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+]]) AC_ARG_VAR([UNINSTALLED_DIR], [the directory of the uninstalled hedera project])
# Check if vala bindigns are installed and usable dnl This requires the user to specify the UNINSTALLED_DIR variable, with the
VALA_CHECK_PACKAGES([[+PackageModule1+] [+PackageModule2+]])[+ENDIF+] dnl path to the directory of the unsinstalled hedera project.
AC_MSG_CHECKING([use uninstalled Hedera])
AC_ARG_ENABLE([uninstalled],
[AS_HELP_STRING([--enable-uninstalled],
[Enable the use of uninstalled Hedera located in the UNINSTALLED_DIR
directory, which must be defined [default = no]])],
[UNINSTALLED="$enableval"],
[UNINSTALLED=no])
AC_MSG_RESULT([$UNINSTALLED])
PKG_PROG_PKG_CONFIG
if test x"$UNINSTALLED" = x"yes"; then
PKG_CHECK_MODULES([+NameCUpper+], [gtk+-3.0])
[+NameCUpper+]_CFLAGS+=-I$UNINSTALLED_DIR
[+NameCUpper+]_LIBS+=$UNINSTALLED_DIR/build/main/libhedera.la
VALA_CHECK_PACKAGES([gtk+-3.0 [+PackageModule2+]])
VALAFLAGS+='--pkg gtk+-3.0 \
--pkg gvn --pkg sql --pkg db --pkg vn \
--vapidir $(UNINSTALLED_DIR)/build/vapi '
AC_SUBST([+NameCLower+]_libdir, $libdir/hedera/module)
AC_SUBST([+NameCLower+]_datadir,$datadir/hedera/module)
AC_SUBST(querydir,$account_datadir/sql)
else
PKG_CHECK_MODULES([+NameCUpper+], [hedera])
VALA_CHECK_PACKAGES([hedera [+PackageModule2+]])
VALAFLAGS+='--pkg hedera '
PKG_CHECK_VAR([[+NameCLower+]_libdir], [hedera], [modulelibdir])
PKG_CHECK_VAR([[+NameCLower+]_datadir], [hedera], [moduledatadir])
PKG_CHECK_VAR([querydir], [hedera], [modulequerydir])
fi
[+IF (=(get "HaveGtkDoc") "1")+]GTK_DOC_CHECK([1.0])[+ENDIF+] [+IF (=(get "HaveGtkDoc") "1")+]GTK_DOC_CHECK([1.0])[+ENDIF+]
AC_OUTPUT([ AC_OUTPUT([
Makefile Makefile

View File

@ -31,13 +31,12 @@
[+(prefix_if_missing "NameCLower" "lib")+]_la_CPPFLAGS = \ [+(prefix_if_missing "NameCLower" "lib")+]_la_CPPFLAGS = \
-DPACKAGE_DATA_DIR=\"$([+NameCLower+]_datadir)\"[+IF (=(get "HaveI18n") "1")+] \ -DPACKAGE_DATA_DIR=\"$([+NameCLower+]_datadir)\"[+IF (=(get "HaveI18n") "1")+] \
-DPACKAGE_LOCALE_DIR=\"$(datadir)/locale\"[+ELSE+] \ -DPACKAGE_LOCALE_DIR=\"$(datadir)/locale\"[+ELSE+] \
-DGETTEXT_PACKAGE=\"hedera-[+Name+]\"[+ENDIF+][+IF (=(get "HavePackage") "1")+] \ -DGETTEXT_PACKAGE=\"hedera-[+Name+]\" [+ENDIF+] \
$([+NameCUpper+]_CFLAGS)[+ENDIF+] $([+NameCUpper+]_CFLAGS)
[+(prefix_if_missing "NameCLower" "lib")+]_la_CFLAGS = $(CFLAGS) [+(prefix_if_missing "NameCLower" "lib")+]_la_CFLAGS = $(CFLAGS)
[+(prefix_if_missing "NameCLower" "lib")+]_la_VALAFLAGS = [+IF (not (= (get "PackageModule2") ""))+]\ [+(prefix_if_missing "NameCLower" "lib")+]_la_VALAFLAGS = [+IF (not (= (get "PackageModule2") ""))+]\
--pkg [+(string-substitute (get "PackageModule2") " " " --pkg ")+] \ --pkg [+(string-substitute (get "PackageModule2") " " " --pkg ")+] \
[+ENDIF+]--pkg [+PackageModule1+] \ [+ENDIF+]\
$(VALAFLAGS) $(VALAFLAGS)
[+NameCLower+]_querydir = $(querydir)/[+NameHLower+] [+NameCLower+]_querydir = $(querydir)/[+NameHLower+]

View File

@ -72,6 +72,10 @@ GLIB_GSETTINGS
# Sets the default build options for Vn projects # Sets the default build options for Vn projects
VN_BUILD_OPTIONS VN_BUILD_OPTIONS
if test x"$ENABLE_INSTALL" != x"yes"; then
glib-compile-schemas --targetdir . ../vn/schema
fi
# Portability check disabled for GTK-DOC (can be changed if needed) # Portability check disabled for GTK-DOC (can be changed if needed)
AM_INIT_AUTOMAKE([-Wno-portability]) AM_INIT_AUTOMAKE([-Wno-portability])
AC_CONFIG_FILES([ AC_CONFIG_FILES([

View File

@ -29,11 +29,11 @@
* db_iterator_new() creates a new #DbIterator. * db_iterator_new() creates a new #DbIterator.
*/ */
static void db_iterator_model_holder_interface_init (DbModelHolderInterface * iface); static void db_iterator_model_holder_init (DbModelHolderInterface * iface);
G_DEFINE_TYPE_WITH_CODE (DbIterator, db_iterator, G_TYPE_OBJECT, G_DEFINE_TYPE_WITH_CODE (DbIterator, db_iterator, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (DB_TYPE_MODEL_HOLDER, G_IMPLEMENT_INTERFACE (DB_TYPE_MODEL_HOLDER,
db_iterator_model_holder_interface_init) db_iterator_model_holder_init)
); );
enum { enum {
@ -999,7 +999,7 @@ static void db_iterator_class_init (DbIteratorClass * klass)
)); ));
} }
static void db_iterator_model_holder_interface_init (DbModelHolderInterface * iface) static void db_iterator_model_holder_init (DbModelHolderInterface * iface)
{ {
iface->get_model = (DbModelHolderGetModelFunc) db_iterator_get_model; iface->get_model = (DbModelHolderGetModelFunc) db_iterator_get_model;
iface->set_model = (DbModelHolderSetModelFunc) db_iterator_set_model; iface->set_model = (DbModelHolderSetModelFunc) db_iterator_set_model;

2
debian/changelog vendored
View File

@ -1,4 +1,4 @@
libhedera (1.0-7) stable; urgency=low libhedera (1.0-8) stable; urgency=low
* Initial Release. * Initial Release.

View File

@ -69,8 +69,7 @@
</properties> </properties>
</glade-widget-class> </glade-widget-class>
<glade-widget-class name="VnGrid" generic-name="grid" title="Grid" icon-name="widget-gtk-treeview"> <glade-widget-class name="VnGrid" generic-name="grid" title="Grid" icon-name="widget-gtk-treeview"/>
</glade-widget-class>
<glade-widget-class name="VnColumnCheck" generic-name="column-check" title="Column Check" icon-name="widget-gtk-cellrenderertoggle"/> <glade-widget-class name="VnColumnCheck" generic-name="column-check" title="Column Check" icon-name="widget-gtk-cellrenderertoggle"/>
<glade-widget-class name="VnColumnEntry" generic-name="column-entry" title="Column Entry" icon-name="widget-gtk-cellrenderertext"/> <glade-widget-class name="VnColumnEntry" generic-name="column-entry" title="Column Entry" icon-name="widget-gtk-cellrenderertext"/>
@ -122,6 +121,7 @@
</property> </property>
<!-- This is used to avoid weird error about this unexisting property --> <!-- This is used to avoid weird error about this unexisting property -->
<property id="accelerator" disabled="True"/> <property id="accelerator" disabled="True"/>
<property id="glade-style-classes" disabled="True"/>
</properties> </properties>
<create-editor-property-function>glade_db_model_holder_create_eprop</create-editor-property-function> <create-editor-property-function>glade_db_model_holder_create_eprop</create-editor-property-function>
</glade-widget-class> </glade-widget-class>
@ -135,8 +135,9 @@
</parameter-spec> </parameter-spec>
</property> </property>
<property id="field" ignore="True"/> <property id="field" ignore="True"/>
<!-- This is used to avoid weird error about this unexisting property --> <!-- This is used to avoid a weird error about this unexisting properties -->
<property id="accelerator" disabled="True"/> <property id="accelerator" disabled="True"/>
<property id="glade-style-classes" disabled="True"/>
</properties> </properties>
<create-editor-property-function>glade_db_model_holder_create_eprop</create-editor-property-function> <create-editor-property-function>glade_db_model_holder_create_eprop</create-editor-property-function>
</glade-widget-class> </glade-widget-class>

View File

@ -16,19 +16,20 @@ hedera_bin_LDADD = \
libhedera_lib_LTLIBRARIES = libhedera.la libhedera_lib_LTLIBRARIES = libhedera.la
libhedera_includedir = $(hedera_includedir)
libhedera_include_HEADERS = hedera.h
libhedera_la_SOURCES = $(libhedera_include_HEADERS)
libhedera_la_LDFLAGS = -version-info $(VERSION_INFO)
libhedera_la_LIBADD = $(top_builddir)/vn/libvn.la
if ENABLE_INSTALL if ENABLE_INSTALL
libhedera_libdir = $(libdir) libhedera_libdir = $(libdir)
else else
libhedera_libdir = $(abs_top_builddir)/main libhedera_libdir = $(abs_top_builddir)/main
hedera_bin_CFLAGS = -D_SCHEMA_DIR=\"$(abs_top_builddir)\"
hedera_bin_LDFLAGS += -no-install
endif endif
libhedera_includedir = $(hedera_includedir)
libhedera_include_HEADERS = hedera.h
libhedera_la_SOURCES = $(libhedera_includedir_HEADERS)
libhedera_la_LDFLAGS = -version-info $(VERSION_INFO)
libhedera_la_LIBADD = $(top_builddir)/vn/libvn.la
SCRIPT = $(top_srcdir)/main/hedera.sh.in SCRIPT = $(top_srcdir)/main/hedera.sh.in
hedera_bin_SCRIPTS = hedera hedera_bin_SCRIPTS = hedera
$(hedera_bin_SCRIPTS): $(SCRIPT) $(hedera_bin_SCRIPTS): $(SCRIPT)
@ -36,10 +37,7 @@ $(hedera_bin_SCRIPTS): $(SCRIPT)
chmod +x $(hedera_bin_SCRIPTS) chmod +x $(hedera_bin_SCRIPTS)
pkgconfig_DATA = hedera.pc pkgconfig_DATA = hedera.pc
desktop_DATA = vn-hedera.desktop
desktop_DATA = \
vn-hedera.desktop
man_MANS = hedera.1 man_MANS = hedera.1
EXTRA_DIST = \ EXTRA_DIST = \
@ -49,5 +47,4 @@ EXTRA_DIST = \
DISTCLEANFILES = \ DISTCLEANFILES = \
$(hedera_bin_SCRIPTS) \ $(hedera_bin_SCRIPTS) \
hedera.pc \ hedera.pc \
vn-hedera.desktop \ vn-hedera.desktop
vn-hedera-debug.desktop

View File

@ -14,6 +14,6 @@ modulequerydir=${moduledatadir}/sql
Name: Hedera Name: Hedera
Description: Hedera database access library Description: Hedera database access library
Version: @VERSION@ Version: @VERSION@
Requires: gtk+-3.0 Requires: vn
Libs: -l@PACKAGE@ Libs: -l@PACKAGE@
Cflags: -I${includedir} Cflags: -I${includedir}

View File

@ -28,6 +28,10 @@ int main (int argc, char * argv[])
textdomain (GETTEXT_PACKAGE); textdomain (GETTEXT_PACKAGE);
#endif #endif
#ifdef _SCHEMA_DIR
g_setenv ("GSETTINGS_SCHEMA_DIR", _SCHEMA_DIR, TRUE);
#endif
gvn_type_init (); gvn_type_init ();
gtk_init (&argc, &argv); gtk_init (&argc, &argv);

View File

@ -30,6 +30,12 @@
</object> </object>
</child> </child>
</object> </object>
<object class="GtkListStore" id="model">
<columns>
<!-- column-name col -->
<column type="gchararray"/>
</columns>
</object>
<object class="GtkBox" id="main"> <object class="GtkBox" id="main">
<property name="height_request">300</property> <property name="height_request">300</property>
<property name="visible">True</property> <property name="visible">True</property>
@ -190,88 +196,19 @@
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="spacing">8</property> <property name="spacing">8</property>
<child> <child>
<object class="GtkHButtonBox" id="buttonbox"> <object class="GtkCheckButton" id="mode">
<property name="label" translatable="yes">Immediate changes</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="sensitive">False</property>
<property name="spacing">8</property> <property name="can_focus">True</property>
<property name="layout_style">start</property> <property name="receives_default">False</property>
<child> <property name="xalign">0</property>
<object class="GtkCheckButton" id="mode"> <property name="active">True</property>
<property name="label" translatable="yes">Immediate changes</property> <property name="draw_indicator">True</property>
<property name="visible">True</property> <signal name="toggled" handler="vn_consulter_mode_toggled" swapped="no"/>
<property name="sensitive">False</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="vn_consulter_mode_toggled" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="start">
<property name="label" translatable="yes">Start</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<signal name="clicked" handler="vn_consulter_start_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="commit">
<property name="label" translatable="yes">Commit</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<signal name="clicked" handler="vn_consulter_commit_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkButton" id="rollback">
<property name="label" translatable="yes">Rollback</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<signal name="clicked" handler="vn_consulter_rollback_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkButton" id="multisend">
<property name="label" translatable="yes">∞</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<signal name="clicked" handler="vn_consulter_multisend_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">4</property>
</packing>
</child>
</object> </object>
<packing> <packing>
<property name="expand">True</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">0</property> <property name="position">0</property>
</packing> </packing>
@ -280,11 +217,11 @@
<object class="VnHandler" id="handler"> <object class="VnHandler" id="handler">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="layout_style">start</property> <property name="layout_style">end</property>
<property name="show_flags">VN_HANDLER_SHOW_REFRESH | VN_HANDLER_SHOW_UNDO | VN_HANDLER_SHOW_SAVE | VN_HANDLER_SHOW_REMOVE | VN_HANDLER_SHOW_ADD</property> <property name="show_flags">VN_HANDLER_SHOW_REFRESH | VN_HANDLER_SHOW_UNDO | VN_HANDLER_SHOW_SAVE | VN_HANDLER_SHOW_REMOVE | VN_HANDLER_SHOW_ADD</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">True</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">1</property> <property name="position">1</property>
</packing> </packing>
@ -297,10 +234,4 @@
</packing> </packing>
</child> </child>
</object> </object>
<object class="GtkListStore" id="model">
<columns>
<!-- column-name col -->
<column type="gchararray"/>
</columns>
</object>
</interface> </interface>

View File

@ -29,53 +29,11 @@ void vn_consulter_clean_clicked (GtkButton * button, VnConsulter * obj)
gtk_list_store_clear (obj->model); gtk_list_store_clear (obj->model);
} }
static gboolean idle_sender (VnConsulter * obj)
{
static int a = 0;
if (a < 100)
{
db_model_refresh (vn_grid_get_model (obj->grid));
a++;
return TRUE;
}
a = 0;
obj->source = 0;
return FALSE;
}
void vn_consulter_multisend_clicked (GtkButton * button, VnConsulter * obj)
{
if (vn_grid_get_model (obj->grid))
{
if (!obj->source)
obj->source = g_timeout_add (50, (GSourceFunc) idle_sender, obj);
else if (g_source_remove (obj->source))
obj->source = 0;
}
}
void vn_consulter_start_clicked (GtkButton * button, VnConsulter * obj)
{
db_conn_start_transaction (VN_FORM (obj)->conn);
}
void vn_consulter_on_stop_clicked (GtkButton * button, VnConsulter * obj) void vn_consulter_on_stop_clicked (GtkButton * button, VnConsulter * obj)
{ {
db_conn_kill_query (VN_FORM (obj)->conn); db_conn_kill_query (VN_FORM (obj)->conn);
} }
void vn_consulter_commit_clicked (GtkButton * button, VnConsulter * obj)
{
db_conn_commit (VN_FORM (obj)->conn);
}
void vn_consulter_rollback_clicked (GtkButton * button, VnConsulter * obj)
{
db_conn_rollback (VN_FORM (obj)->conn);
}
static void vn_consulter_set_message (VnConsulter * obj, const gchar * msg) static void vn_consulter_set_message (VnConsulter * obj, const gchar * msg)
{ {
GtkTreePath * path; GtkTreePath * path;
@ -113,7 +71,7 @@ static void vn_consulter_model_status_changed (DbModel * model,
{ {
VnColumn * column; VnColumn * column;
GType col_type, type = db_model_get_column_type (model, i); GType col_type, type = db_model_get_column_type (model, i);
gboolean image = FALSE; gboolean image = FALSE;
if (type == G_TYPE_INT || type == G_TYPE_UINT if (type == G_TYPE_INT || type == G_TYPE_UINT
|| type == G_TYPE_FLOAT || type == G_TYPE_DOUBLE) || type == G_TYPE_FLOAT || type == G_TYPE_DOUBLE)
@ -122,13 +80,13 @@ gboolean image = FALSE;
col_type = VN_TYPE_COLUMN_IMAGE; col_type = VN_TYPE_COLUMN_IMAGE;
else if (type == G_TYPE_BOOLEAN) else if (type == G_TYPE_BOOLEAN)
col_type = VN_TYPE_COLUMN_CHECK; col_type = VN_TYPE_COLUMN_CHECK;
else else if (type == G_TYPE_STRING && !g_utf8_collate
if (type == G_TYPE_STRING (g_utf8_casefold (db_model_get_column_name (model, i), -1),
&& !g_strcmp0 (db_model_get_column_name (model, i), "image")) g_utf8_casefold ("image", -1)))
{ {
image = TRUE; image = TRUE;
col_type = VN_TYPE_COLUMN_IMAGE; col_type = VN_TYPE_COLUMN_IMAGE;
} }
else else
col_type = VN_TYPE_COLUMN_ENTRY; col_type = VN_TYPE_COLUMN_ENTRY;
@ -155,12 +113,12 @@ if (type == G_TYPE_STRING
"step-increment", 0.1, "step-increment", 0.1,
// "editable", FALSE, // "editable", FALSE,
NULL); NULL);
else if (image) else if (image)
g_object_set (column, g_object_set (column,
"host", "www.verdnatura.es", "host", "www.verdnatura.es",
"path", "image/cache/catalog/icon", "path", "image/cache/catalog/icon",
"tooltip-path", "../full", "tooltip-path", "../full",
NULL); NULL);
} }
break; break;
@ -262,19 +220,6 @@ static void vn_consulter_open (VnConsulter * obj)
for (i = 0; i < g_strv_length (queries); i++) for (i = 0; i < g_strv_length (queries); i++)
gtk_combo_box_text_prepend_text (obj->combo, 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 //+++++++++++++++++++++++++++++++++++++++++++++++++++ Class

196
po/ca.po
View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: hedera 1.0\n" "Project-Id-Version: hedera 1.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-12-13 10:07+0100\n" "POT-Creation-Date: 2013-12-31 13:28+0100\n"
"PO-Revision-Date: 2013-06-04 13:38+0200\n" "PO-Revision-Date: 2013-06-04 13:38+0200\n"
"Last-Translator: Alejandro T. Colombini Gómez <atcolombini@verdnatura.es>\n" "Last-Translator: Alejandro T. Colombini Gómez <atcolombini@verdnatura.es>\n"
"Language-Team: Catalan\n" "Language-Team: Catalan\n"
@ -213,7 +213,7 @@ msgstr ""
msgid "The value" msgid "The value"
msgstr "" msgstr ""
#: ../sql/sql-string.c:198 ../db/db-model.c:3456 ../db/db-request.c:461 #: ../sql/sql-string.c:198 ../db/db-model.c:3455 ../db/db-request.c:461
msgid "SQL" msgid "SQL"
msgstr "" msgstr ""
@ -239,60 +239,60 @@ msgstr "Recordar"
msgid "Wether to rememeber the selection when model is refreshed" msgid "Wether to rememeber the selection when model is refreshed"
msgstr "" msgstr ""
#: ../db/db-model.c:3430 ../db/db-request.c:454 ../vn/vn-gui.c:1564 #: ../db/db-model.c:3429 ../db/db-request.c:454 ../vn/vn-gui.c:1564
#: ../vn/vn-form.c:244 #: ../vn/vn-form.c:244
msgid "Connection" msgid "Connection"
msgstr "" msgstr ""
#: ../db/db-model.c:3431 #: ../db/db-model.c:3430
msgid "The DbConn that manages the connection to the database" msgid "The DbConn that manages the connection to the database"
msgstr "" msgstr ""
#: ../db/db-model.c:3438 ../db/db-request.c:468 #: ../db/db-model.c:3437 ../db/db-request.c:468
msgid "Statement" msgid "Statement"
msgstr "" msgstr ""
#: ../db/db-model.c:3439 #: ../db/db-model.c:3438
msgid "The statement which retrieves the data" msgid "The statement which retrieves the data"
msgstr "" msgstr ""
#: ../db/db-model.c:3446 #: ../db/db-model.c:3445
msgid "Use file" msgid "Use file"
msgstr "" msgstr ""
#: ../db/db-model.c:3447 #: ../db/db-model.c:3446
msgid "" msgid ""
"If this is set to TRUE, the \"sql\" property will hold the name of a file " "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" "containing a query, if set to FALSE, \"sql\" is used as an SQL string"
msgstr "" msgstr ""
#: ../db/db-model.c:3457 #: ../db/db-model.c:3456
msgid "" msgid ""
"Depending on the \"use-file\" property this will be the path to a file with " "Depending on the \"use-file\" property this will be the path to a file with "
"queries for the model or a SQL string" "queries for the model or a SQL string"
msgstr "" msgstr ""
#: ../db/db-model.c:3466 #: ../db/db-model.c:3465
msgid "Main Table" msgid "Main Table"
msgstr "" msgstr ""
#: ../db/db-model.c:3467 #: ../db/db-model.c:3466
msgid "The main table of the model" msgid "The main table of the model"
msgstr "" msgstr ""
#: ../db/db-model.c:3474 #: ../db/db-model.c:3473
msgid "Update flags" msgid "Update flags"
msgstr "" msgstr ""
#: ../db/db-model.c:3475 #: ../db/db-model.c:3474
msgid "The flags that indicate how a model can be modified" msgid "The flags that indicate how a model can be modified"
msgstr "" msgstr ""
#: ../db/db-model.c:3483 #: ../db/db-model.c:3482
msgid "Result position" msgid "Result position"
msgstr "" msgstr ""
#: ../db/db-model.c:3484 #: ../db/db-model.c:3483
msgid "" msgid ""
"The position where the query that will fill the model will be placed in a " "The position where the query that will fill the model will be placed in a "
"multi-query" "multi-query"
@ -411,7 +411,7 @@ msgstr ""
msgid "The host name to connect to" msgid "The host name to connect to"
msgstr "" msgstr ""
#: ../db/db-conn.c:1062 ../module/data/users.glade.h:2 #: ../db/db-conn.c:1062
msgid "User" msgid "User"
msgstr "Usuari" msgstr "Usuari"
@ -714,27 +714,27 @@ msgstr ""
msgid "The number of decimal places to display." msgid "The number of decimal places to display."
msgstr "" msgstr ""
#: ../vn/field/vn-combo.c:286 ../vn/column/vn-column-combo.c:326 #: ../vn/field/vn-combo.c:286 ../vn/column/vn-column-combo.c:361
msgid "Index column" msgid "Index column"
msgstr "" msgstr ""
#: ../vn/field/vn-combo.c:287 ../vn/column/vn-column-combo.c:327 #: ../vn/field/vn-combo.c:287 ../vn/column/vn-column-combo.c:362
msgid "The column index of the model" msgid "The column index of the model"
msgstr "" msgstr ""
#: ../vn/field/vn-combo.c:293 ../vn/column/vn-column-combo.c:333 #: ../vn/field/vn-combo.c:293 ../vn/column/vn-column-combo.c:368
msgid "Show column" msgid "Show column"
msgstr "" msgstr ""
#: ../vn/field/vn-combo.c:294 ../vn/column/vn-column-combo.c:334 #: ../vn/field/vn-combo.c:294 ../vn/column/vn-column-combo.c:369
msgid "The column of the model shown by combo" msgid "The column of the model shown by combo"
msgstr "" msgstr ""
#: ../vn/field/vn-completion.c:325 #: ../vn/field/vn-completion.c:328
msgid "Field" msgid "Field"
msgstr "" msgstr ""
#: ../vn/field/vn-completion.c:326 #: ../vn/field/vn-completion.c:329
msgid "The name of the field used for the search" msgid "The name of the field used for the search"
msgstr "" msgstr ""
@ -837,14 +837,22 @@ msgstr ""
msgid "The step increment of the adjustment" msgid "The step increment of the adjustment"
msgstr "" msgstr ""
#: ../vn/column/vn-column-combo.c:340 #: ../vn/column/vn-column-combo.c:375
msgid "Sort column" msgid "Sort column"
msgstr "" msgstr ""
#: ../vn/column/vn-column-combo.c:341 #: ../vn/column/vn-column-combo.c:376
msgid "The field number of the Grid model used to sort the column" msgid "The field number of the Grid model used to sort the column"
msgstr "" msgstr ""
#: ../vn/column/vn-column-combo.c:382
msgid "Filter field"
msgstr ""
#: ../vn/column/vn-column-combo.c:383
msgid "Name of the field to be used as query filter by the model"
msgstr ""
#: ../vn/column/vn-column-image.c:502 #: ../vn/column/vn-column-image.c:502
msgid "Base path from the host where the images will be downloaded" msgid "Base path from the host where the images will be downloaded"
msgstr "" msgstr ""
@ -908,7 +916,7 @@ msgstr "Accés"
msgid "User:" msgid "User:"
msgstr "Usuari:" msgstr "Usuari:"
#: ../vn/gui/login.glade.h:9 ../module/data/users.glade.h:6 #: ../vn/gui/login.glade.h:9
msgid "Password:" msgid "Password:"
msgstr "Contrasenya:" msgstr "Contrasenya:"
@ -1075,126 +1083,16 @@ msgid "Example"
msgstr "" msgstr ""
#: ../module/data/example.xml.h:2 #: ../module/data/example.xml.h:2
msgid "" msgid "Consulter"
"\n"
"\t\t\tExample\n"
"\t\t"
msgstr "" msgstr ""
#: ../module/data/example.xml.h:5 #: ../module/data/example.xml.h:3
msgid ""
"\n"
"\t\t\tConsulter\n"
"\t\t"
msgstr ""
#: ../module/data/example.xml.h:8
msgid ""
"\n"
"\t\t\tUsers\n"
"\t\t"
msgstr ""
#: ../module/data/example.xml.h:11
msgid "" msgid ""
"\n" "\n"
"\t\t\tCustomer\n" "\t\t\tCustomer\n"
"\t\t" "\t\t"
msgstr "" msgstr ""
#: ../module/data/users.glade.h:1
msgid "Identifier"
msgstr ""
#: ../module/data/users.glade.h:3
msgid "MySQL User"
msgstr ""
#: ../module/data/users.glade.h:4
msgid "Enabled"
msgstr ""
#: ../module/data/users.glade.h:5
msgid "Name:"
msgstr ""
#: ../module/data/users.glade.h:7
msgid "MySQL user:"
msgstr ""
#: ../module/data/users.glade.h:8
msgid "Enabled:"
msgstr ""
#: ../module/data/users.glade.h:9
msgid "Identifier:"
msgstr ""
#: ../module/data/users.glade.h:10
msgid "UID:"
msgstr ""
#: ../module/data/users.glade.h:11
msgid "Main group:"
msgstr ""
#: ../module/data/users.glade.h:12
msgid "Last change:"
msgstr ""
#: ../module/data/users.glade.h:13
msgid "Expires:"
msgstr ""
#: ../module/data/users.glade.h:14
msgid "Account"
msgstr ""
#: ../module/data/users.glade.h:15
msgid "Alias"
msgstr ""
#: ../module/data/users.glade.h:16
msgid "Mail alias"
msgstr ""
#: ../module/data/users.glade.h:17
msgid "Extension:"
msgstr ""
#: ../module/data/users.glade.h:18
msgid "Secret:"
msgstr ""
#: ../module/data/users.glade.h:19
msgid "Call group:"
msgstr ""
#: ../module/data/users.glade.h:20
msgid "SIP"
msgstr ""
#: ../module/data/users.glade.h:21
#, fuzzy
msgid "Change password"
msgstr "Repetir contrasenya:"
#: ../module/data/users.glade.h:22
msgid "Repeat password:"
msgstr "Repetir contrasenya:"
#: ../module/src/vn-users.c:60
msgid "The password is too weak."
msgstr ""
#: ../module/src/vn-users.c:75
msgid "The password can't be empty."
msgstr ""
#: ../module/src/vn-users.c:77
msgid "Passwords do not match."
msgstr ""
#: ../module/data/consulter.glade.h:1 #: ../module/data/consulter.glade.h:1
msgid "Send" msgid "Send"
msgstr "" msgstr ""
@ -1223,30 +1121,10 @@ msgstr ""
msgid "Immediate changes" msgid "Immediate changes"
msgstr "" msgstr ""
#: ../module/data/consulter.glade.h:8 #: ../module/src/vn-consulter.c:216
msgid "Start"
msgstr ""
#: ../module/data/consulter.glade.h:9
msgid "Commit"
msgstr ""
#: ../module/data/consulter.glade.h:10
msgid "Rollback"
msgstr ""
#: ../module/data/consulter.glade.h:11
msgid "∞"
msgstr ""
#: ../module/src/vn-consulter.c:258
msgid "Type or select a query" msgid "Type or select a query"
msgstr "" msgstr ""
#: ../module/src/vn-consulter.c:260 #: ../module/src/vn-consulter.c:218
msgid "Message" msgid "Message"
msgstr "" msgstr ""
#, fuzzy
#~ msgid "User name:"
#~ msgstr "Nom d'usuari"

209
po/es.po
View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: hedera 1.0\n" "Project-Id-Version: hedera 1.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-12-13 10:07+0100\n" "POT-Creation-Date: 2013-12-31 13:28+0100\n"
"PO-Revision-Date: 2013-06-04 13:36+0200\n" "PO-Revision-Date: 2013-06-04 13:36+0200\n"
"Last-Translator: Alejandro T. Colombini Gómez <atcolombini@verdnatura.es>\n" "Last-Translator: Alejandro T. Colombini Gómez <atcolombini@verdnatura.es>\n"
"Language-Team: Spanish\n" "Language-Team: Spanish\n"
@ -215,7 +215,7 @@ msgstr "El parametro al cual está vinculado"
msgid "The value" msgid "The value"
msgstr "Valor" msgstr "Valor"
#: ../sql/sql-string.c:198 ../db/db-model.c:3456 ../db/db-request.c:461 #: ../sql/sql-string.c:198 ../db/db-model.c:3455 ../db/db-request.c:461
msgid "SQL" msgid "SQL"
msgstr "SQL" msgstr "SQL"
@ -241,28 +241,28 @@ msgid "Wether to rememeber the selection when model is refreshed"
msgstr "" msgstr ""
"Si se recordará o no la fila seleccionado cuando se refresque el modelo" "Si se recordará o no la fila seleccionado cuando se refresque el modelo"
#: ../db/db-model.c:3430 ../db/db-request.c:454 ../vn/vn-gui.c:1564 #: ../db/db-model.c:3429 ../db/db-request.c:454 ../vn/vn-gui.c:1564
#: ../vn/vn-form.c:244 #: ../vn/vn-form.c:244
msgid "Connection" msgid "Connection"
msgstr "Conexión" msgstr "Conexión"
#: ../db/db-model.c:3431 #: ../db/db-model.c:3430
msgid "The DbConn that manages the connection to the database" msgid "The DbConn that manages the connection to the database"
msgstr "La DbConn que controla la conexión a la base de datos" msgstr "La DbConn que controla la conexión a la base de datos"
#: ../db/db-model.c:3438 ../db/db-request.c:468 #: ../db/db-model.c:3437 ../db/db-request.c:468
msgid "Statement" msgid "Statement"
msgstr "Consulta" msgstr "Consulta"
#: ../db/db-model.c:3439 #: ../db/db-model.c:3438
msgid "The statement which retrieves the data" msgid "The statement which retrieves the data"
msgstr "La consulta que recupera los datos" msgstr "La consulta que recupera los datos"
#: ../db/db-model.c:3446 #: ../db/db-model.c:3445
msgid "Use file" msgid "Use file"
msgstr "Usa fichero" msgstr "Usa fichero"
#: ../db/db-model.c:3447 #: ../db/db-model.c:3446
msgid "" msgid ""
"If this is set to TRUE, the \"sql\" property will hold the name of a file " "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" "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 " "Si es TRUE, la propiedad \"sql\" contiene el nombre de un archivo, si es "
"falso, \"sql\" se usa como una cadena SQL" "falso, \"sql\" se usa como una cadena SQL"
#: ../db/db-model.c:3457 #: ../db/db-model.c:3456
msgid "" msgid ""
"Depending on the \"use-file\" property this will be the path to a file with " "Depending on the \"use-file\" property this will be the path to a file with "
"queries for the model or a SQL string" "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 " "Dependiendo de la propiedad \"use-file\", esta propiedad será la ruta a un "
"fichero con consultas para el modelo o una cadena SQL" "fichero con consultas para el modelo o una cadena SQL"
#: ../db/db-model.c:3466 #: ../db/db-model.c:3465
msgid "Main Table" msgid "Main Table"
msgstr "Tabla principal" msgstr "Tabla principal"
#: ../db/db-model.c:3467 #: ../db/db-model.c:3466
msgid "The main table of the model" msgid "The main table of the model"
msgstr "La tabla principal del modelo" msgstr "La tabla principal del modelo"
#: ../db/db-model.c:3474 #: ../db/db-model.c:3473
msgid "Update flags" msgid "Update flags"
msgstr "Flags de actualización" msgstr "Flags de actualización"
#: ../db/db-model.c:3475 #: ../db/db-model.c:3474
msgid "The flags that indicate how a model can be modified" msgid "The flags that indicate how a model can be modified"
msgstr "Indican como se puede modificar el modelo" msgstr "Indican como se puede modificar el modelo"
#: ../db/db-model.c:3483 #: ../db/db-model.c:3482
msgid "Result position" msgid "Result position"
msgstr "Posición del resultado" msgstr "Posición del resultado"
#: ../db/db-model.c:3484 #: ../db/db-model.c:3483
msgid "" msgid ""
"The position where the query that will fill the model will be placed in a " "The position where the query that will fill the model will be placed in a "
"multi-query" "multi-query"
@ -421,7 +421,7 @@ msgstr "Host"
msgid "The host name to connect to" msgid "The host name to connect to"
msgstr "El nombre del host al que se conectará" msgstr "El nombre del host al que se conectará"
#: ../db/db-conn.c:1062 ../module/data/users.glade.h:2 #: ../db/db-conn.c:1062
msgid "User" msgid "User"
msgstr "Usuario" msgstr "Usuario"
@ -672,12 +672,12 @@ msgstr "El módulo"
#: ../vn/vn-login.c:291 ../vn/vn-login.c:293 #: ../vn/vn-login.c:291 ../vn/vn-login.c:293
msgid "Login error" msgid "Login error"
msgstr "Error de identificación" msgstr "Error de acceso"
#: ../vn/vn-login.c:349 #: ../vn/vn-login.c:349
#, c-format #, c-format
msgid "Bad connection settings, please check it." msgid "Bad connection settings, please check it."
msgstr "Conexión mal configurado, compruébelo por favor" msgstr "Los parámetros de la conexión son incorrectos, compruébelos por favor."
#: ../vn/vn-login.c:481 #: ../vn/vn-login.c:481
msgid "Application id" msgid "Application id"
@ -726,27 +726,27 @@ msgstr "Dígitos"
msgid "The number of decimal places to display." msgid "The number of decimal places to display."
msgstr "El número de posiciones decimales que se muestran" msgstr "El número de posiciones decimales que se muestran"
#: ../vn/field/vn-combo.c:286 ../vn/column/vn-column-combo.c:326 #: ../vn/field/vn-combo.c:286 ../vn/column/vn-column-combo.c:361
msgid "Index column" msgid "Index column"
msgstr "Columna índice" msgstr "Columna índice"
#: ../vn/field/vn-combo.c:287 ../vn/column/vn-column-combo.c:327 #: ../vn/field/vn-combo.c:287 ../vn/column/vn-column-combo.c:362
msgid "The column index of the model" msgid "The column index of the model"
msgstr "La columna índice del modelo" msgstr "La columna índice del modelo"
#: ../vn/field/vn-combo.c:293 ../vn/column/vn-column-combo.c:333 #: ../vn/field/vn-combo.c:293 ../vn/column/vn-column-combo.c:368
msgid "Show column" msgid "Show column"
msgstr "Columna visible" msgstr "Columna visible"
#: ../vn/field/vn-combo.c:294 ../vn/column/vn-column-combo.c:334 #: ../vn/field/vn-combo.c:294 ../vn/column/vn-column-combo.c:369
msgid "The column of the model shown by combo" msgid "The column of the model shown by combo"
msgstr "La columna del modelo que se mostrará en el combo" msgstr "La columna del modelo que se mostrará en el combo"
#: ../vn/field/vn-completion.c:325 #: ../vn/field/vn-completion.c:328
msgid "Field" msgid "Field"
msgstr "Campo" msgstr "Campo"
#: ../vn/field/vn-completion.c:326 #: ../vn/field/vn-completion.c:329
msgid "The name of the field used for the search" msgid "The name of the field used for the search"
msgstr "El nombre del campo usado para la búsqueda" msgstr "El nombre del campo usado para la búsqueda"
@ -849,15 +849,23 @@ msgstr "Incremento del paso"
msgid "The step increment of the adjustment" msgid "The step increment of the adjustment"
msgstr "El incremento del paso del ajuste" msgstr "El incremento del paso del ajuste"
#: ../vn/column/vn-column-combo.c:340 #: ../vn/column/vn-column-combo.c:375
msgid "Sort column" msgid "Sort column"
msgstr "Columna de ordenación" msgstr "Columna de ordenación"
#: ../vn/column/vn-column-combo.c:341 #: ../vn/column/vn-column-combo.c:376
msgid "The field number of the Grid model used to sort the column" msgid "The field number of the Grid model used to sort the column"
msgstr "" msgstr ""
"El número de campo del modelo del Grid que se usa para ordenar la columna" "El número de campo del modelo del Grid que se usa para ordenar la columna"
#: ../vn/column/vn-column-combo.c:382
msgid "Filter field"
msgstr "Campo de filtro"
#: ../vn/column/vn-column-combo.c:383
msgid "Name of the field to be used as query filter by the model"
msgstr "Nombre del campo que se usará como filtro en la consulta del modelo"
#: ../vn/column/vn-column-image.c:502 #: ../vn/column/vn-column-image.c:502
msgid "Base path from the host where the images will be downloaded" msgid "Base path from the host where the images will be downloaded"
msgstr "La ruta base del servidor desde donde se descargarán las imágenes." msgstr "La ruta base del servidor desde donde se descargarán las imágenes."
@ -926,7 +934,7 @@ msgstr "Acceso"
msgid "User:" msgid "User:"
msgstr "Usuario:" msgstr "Usuario:"
#: ../vn/gui/login.glade.h:9 ../module/data/users.glade.h:6 #: ../vn/gui/login.glade.h:9
msgid "Password:" msgid "Password:"
msgstr "Clave:" msgstr "Clave:"
@ -1107,36 +1115,10 @@ msgid "Example"
msgstr "Ejemplo" msgstr "Ejemplo"
#: ../module/data/example.xml.h:2 #: ../module/data/example.xml.h:2
msgid "" msgid "Consulter"
"\n" msgstr "Consultor"
"\t\t\tExample\n"
"\t\t"
msgstr ""
"\n"
"\t\t\tEjemplo\n"
"\t\t"
#: ../module/data/example.xml.h:5 #: ../module/data/example.xml.h:3
msgid ""
"\n"
"\t\t\tConsulter\n"
"\t\t"
msgstr ""
"\n"
"\t\t\tConsultor\n"
"\t\t"
#: ../module/data/example.xml.h:8
msgid ""
"\n"
"\t\t\tUsers\n"
"\t\t"
msgstr ""
"\n"
"\t\t\tUsuarios\n"
"\t\t"
#: ../module/data/example.xml.h:11
msgid "" msgid ""
"\n" "\n"
"\t\t\tCustomer\n" "\t\t\tCustomer\n"
@ -1146,98 +1128,6 @@ msgstr ""
"\t\t\tCliente\n" "\t\t\tCliente\n"
"\t\t" "\t\t"
#: ../module/data/users.glade.h:1
msgid "Identifier"
msgstr "Identificador"
#: ../module/data/users.glade.h:3
msgid "MySQL User"
msgstr "Usuario MySQL"
#: ../module/data/users.glade.h:4
msgid "Enabled"
msgstr "Habilitado"
#: ../module/data/users.glade.h:5
msgid "Name:"
msgstr "Nombre:"
#: ../module/data/users.glade.h:7
msgid "MySQL user:"
msgstr "Usuario MySQL:"
#: ../module/data/users.glade.h:8
msgid "Enabled:"
msgstr "Habilitado:"
#: ../module/data/users.glade.h:9
msgid "Identifier:"
msgstr "Identificador:"
#: ../module/data/users.glade.h:10
msgid "UID:"
msgstr "UID:"
#: ../module/data/users.glade.h:11
msgid "Main group:"
msgstr "Grupo principal:"
#: ../module/data/users.glade.h:12
msgid "Last change:"
msgstr "Último cambio:"
#: ../module/data/users.glade.h:13
msgid "Expires:"
msgstr "Expira:"
#: ../module/data/users.glade.h:14
msgid "Account"
msgstr "Cuenta"
#: ../module/data/users.glade.h:15
msgid "Alias"
msgstr "Alias"
#: ../module/data/users.glade.h:16
msgid "Mail alias"
msgstr "Alias de correo"
#: ../module/data/users.glade.h:17
msgid "Extension:"
msgstr "Extensión:"
#: ../module/data/users.glade.h:18
msgid "Secret:"
msgstr "Clave:"
#: ../module/data/users.glade.h:19
msgid "Call group:"
msgstr "Call group:"
#: ../module/data/users.glade.h:20
msgid "SIP"
msgstr "SIP"
#: ../module/data/users.glade.h:21
msgid "Change password"
msgstr "Cambiar contraseña"
#: ../module/data/users.glade.h:22
msgid "Repeat password:"
msgstr "Repetir contraseña:"
#: ../module/src/vn-users.c:60
msgid "The password is too weak."
msgstr "La contraseña es demasiado débil."
#: ../module/src/vn-users.c:75
msgid "The password can't be empty."
msgstr "La contraseña no puede estar vacía."
#: ../module/src/vn-users.c:77
msgid "Passwords do not match."
msgstr "Las contraseñas no coinciden."
#: ../module/data/consulter.glade.h:1 #: ../module/data/consulter.glade.h:1
msgid "Send" msgid "Send"
msgstr "Enviar" msgstr "Enviar"
@ -1266,29 +1156,10 @@ msgstr "Consulta:"
msgid "Immediate changes" msgid "Immediate changes"
msgstr "Cambios inmediatos" msgstr "Cambios inmediatos"
#: ../module/data/consulter.glade.h:8 #: ../module/src/vn-consulter.c:216
msgid "Start"
msgstr "Empezar"
#: ../module/data/consulter.glade.h:9
msgid "Commit"
msgstr "Efectuar"
#: ../module/data/consulter.glade.h:10
msgid "Rollback"
msgstr "Deshacer"
#: ../module/data/consulter.glade.h:11
msgid "∞"
msgstr "∞"
#: ../module/src/vn-consulter.c:258
msgid "Type or select a query" msgid "Type or select a query"
msgstr "Escribe o selecciona la consulta" msgstr "Escribe o selecciona la consulta"
#: ../module/src/vn-consulter.c:260 #: ../module/src/vn-consulter.c:218
msgid "Message" msgid "Message"
msgstr "Mensaje" msgstr "Mensaje"
#~ msgid "Generate params for %s"
#~ msgstr "Generar params para %s"

191
po/nl.po
View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: hedera 1.0\n" "Project-Id-Version: hedera 1.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-12-13 10:07+0100\n" "POT-Creation-Date: 2013-12-31 13:28+0100\n"
"PO-Revision-Date: 2012-10-09 11:38+0200\n" "PO-Revision-Date: 2012-10-09 11:38+0200\n"
"Last-Translator: Alejandro T. Colombini Gómez <atcolombini@verdnatura.es>\n" "Last-Translator: Alejandro T. Colombini Gómez <atcolombini@verdnatura.es>\n"
"Language-Team: Dutch\n" "Language-Team: Dutch\n"
@ -215,7 +215,7 @@ msgstr ""
msgid "The value" msgid "The value"
msgstr "" msgstr ""
#: ../sql/sql-string.c:198 ../db/db-model.c:3456 ../db/db-request.c:461 #: ../sql/sql-string.c:198 ../db/db-model.c:3455 ../db/db-request.c:461
msgid "SQL" msgid "SQL"
msgstr "" msgstr ""
@ -240,60 +240,60 @@ msgstr ""
msgid "Wether to rememeber the selection when model is refreshed" msgid "Wether to rememeber the selection when model is refreshed"
msgstr "" msgstr ""
#: ../db/db-model.c:3430 ../db/db-request.c:454 ../vn/vn-gui.c:1564 #: ../db/db-model.c:3429 ../db/db-request.c:454 ../vn/vn-gui.c:1564
#: ../vn/vn-form.c:244 #: ../vn/vn-form.c:244
msgid "Connection" msgid "Connection"
msgstr "" msgstr ""
#: ../db/db-model.c:3431 #: ../db/db-model.c:3430
msgid "The DbConn that manages the connection to the database" msgid "The DbConn that manages the connection to the database"
msgstr "" msgstr ""
#: ../db/db-model.c:3438 ../db/db-request.c:468 #: ../db/db-model.c:3437 ../db/db-request.c:468
msgid "Statement" msgid "Statement"
msgstr "" msgstr ""
#: ../db/db-model.c:3439 #: ../db/db-model.c:3438
msgid "The statement which retrieves the data" msgid "The statement which retrieves the data"
msgstr "" msgstr ""
#: ../db/db-model.c:3446 #: ../db/db-model.c:3445
msgid "Use file" msgid "Use file"
msgstr "" msgstr ""
#: ../db/db-model.c:3447 #: ../db/db-model.c:3446
msgid "" msgid ""
"If this is set to TRUE, the \"sql\" property will hold the name of a file " "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" "containing a query, if set to FALSE, \"sql\" is used as an SQL string"
msgstr "" msgstr ""
#: ../db/db-model.c:3457 #: ../db/db-model.c:3456
msgid "" msgid ""
"Depending on the \"use-file\" property this will be the path to a file with " "Depending on the \"use-file\" property this will be the path to a file with "
"queries for the model or a SQL string" "queries for the model or a SQL string"
msgstr "" msgstr ""
#: ../db/db-model.c:3466 #: ../db/db-model.c:3465
msgid "Main Table" msgid "Main Table"
msgstr "" msgstr ""
#: ../db/db-model.c:3467 #: ../db/db-model.c:3466
msgid "The main table of the model" msgid "The main table of the model"
msgstr "" msgstr ""
#: ../db/db-model.c:3474 #: ../db/db-model.c:3473
msgid "Update flags" msgid "Update flags"
msgstr "" msgstr ""
#: ../db/db-model.c:3475 #: ../db/db-model.c:3474
msgid "The flags that indicate how a model can be modified" msgid "The flags that indicate how a model can be modified"
msgstr "" msgstr ""
#: ../db/db-model.c:3483 #: ../db/db-model.c:3482
msgid "Result position" msgid "Result position"
msgstr "" msgstr ""
#: ../db/db-model.c:3484 #: ../db/db-model.c:3483
msgid "" msgid ""
"The position where the query that will fill the model will be placed in a " "The position where the query that will fill the model will be placed in a "
"multi-query" "multi-query"
@ -412,7 +412,7 @@ msgstr ""
msgid "The host name to connect to" msgid "The host name to connect to"
msgstr "" msgstr ""
#: ../db/db-conn.c:1062 ../module/data/users.glade.h:2 #: ../db/db-conn.c:1062
msgid "User" msgid "User"
msgstr "" msgstr ""
@ -715,27 +715,27 @@ msgstr ""
msgid "The number of decimal places to display." msgid "The number of decimal places to display."
msgstr "" msgstr ""
#: ../vn/field/vn-combo.c:286 ../vn/column/vn-column-combo.c:326 #: ../vn/field/vn-combo.c:286 ../vn/column/vn-column-combo.c:361
msgid "Index column" msgid "Index column"
msgstr "" msgstr ""
#: ../vn/field/vn-combo.c:287 ../vn/column/vn-column-combo.c:327 #: ../vn/field/vn-combo.c:287 ../vn/column/vn-column-combo.c:362
msgid "The column index of the model" msgid "The column index of the model"
msgstr "" msgstr ""
#: ../vn/field/vn-combo.c:293 ../vn/column/vn-column-combo.c:333 #: ../vn/field/vn-combo.c:293 ../vn/column/vn-column-combo.c:368
msgid "Show column" msgid "Show column"
msgstr "" msgstr ""
#: ../vn/field/vn-combo.c:294 ../vn/column/vn-column-combo.c:334 #: ../vn/field/vn-combo.c:294 ../vn/column/vn-column-combo.c:369
msgid "The column of the model shown by combo" msgid "The column of the model shown by combo"
msgstr "" msgstr ""
#: ../vn/field/vn-completion.c:325 #: ../vn/field/vn-completion.c:328
msgid "Field" msgid "Field"
msgstr "" msgstr ""
#: ../vn/field/vn-completion.c:326 #: ../vn/field/vn-completion.c:329
msgid "The name of the field used for the search" msgid "The name of the field used for the search"
msgstr "" msgstr ""
@ -838,14 +838,22 @@ msgstr ""
msgid "The step increment of the adjustment" msgid "The step increment of the adjustment"
msgstr "" msgstr ""
#: ../vn/column/vn-column-combo.c:340 #: ../vn/column/vn-column-combo.c:375
msgid "Sort column" msgid "Sort column"
msgstr "" msgstr ""
#: ../vn/column/vn-column-combo.c:341 #: ../vn/column/vn-column-combo.c:376
msgid "The field number of the Grid model used to sort the column" msgid "The field number of the Grid model used to sort the column"
msgstr "" msgstr ""
#: ../vn/column/vn-column-combo.c:382
msgid "Filter field"
msgstr ""
#: ../vn/column/vn-column-combo.c:383
msgid "Name of the field to be used as query filter by the model"
msgstr ""
#: ../vn/column/vn-column-image.c:502 #: ../vn/column/vn-column-image.c:502
msgid "Base path from the host where the images will be downloaded" msgid "Base path from the host where the images will be downloaded"
msgstr "" msgstr ""
@ -908,7 +916,7 @@ msgstr ""
msgid "User:" msgid "User:"
msgstr "" msgstr ""
#: ../vn/gui/login.glade.h:9 ../module/data/users.glade.h:6 #: ../vn/gui/login.glade.h:9
msgid "Password:" msgid "Password:"
msgstr "" msgstr ""
@ -1075,125 +1083,16 @@ msgid "Example"
msgstr "" msgstr ""
#: ../module/data/example.xml.h:2 #: ../module/data/example.xml.h:2
msgid "" msgid "Consulter"
"\n"
"\t\t\tExample\n"
"\t\t"
msgstr "" msgstr ""
#: ../module/data/example.xml.h:5 #: ../module/data/example.xml.h:3
msgid ""
"\n"
"\t\t\tConsulter\n"
"\t\t"
msgstr ""
#: ../module/data/example.xml.h:8
msgid ""
"\n"
"\t\t\tUsers\n"
"\t\t"
msgstr ""
#: ../module/data/example.xml.h:11
msgid "" msgid ""
"\n" "\n"
"\t\t\tCustomer\n" "\t\t\tCustomer\n"
"\t\t" "\t\t"
msgstr "" msgstr ""
#: ../module/data/users.glade.h:1
msgid "Identifier"
msgstr ""
#: ../module/data/users.glade.h:3
msgid "MySQL User"
msgstr ""
#: ../module/data/users.glade.h:4
msgid "Enabled"
msgstr ""
#: ../module/data/users.glade.h:5
msgid "Name:"
msgstr ""
#: ../module/data/users.glade.h:7
msgid "MySQL user:"
msgstr ""
#: ../module/data/users.glade.h:8
msgid "Enabled:"
msgstr ""
#: ../module/data/users.glade.h:9
msgid "Identifier:"
msgstr ""
#: ../module/data/users.glade.h:10
msgid "UID:"
msgstr ""
#: ../module/data/users.glade.h:11
msgid "Main group:"
msgstr ""
#: ../module/data/users.glade.h:12
msgid "Last change:"
msgstr ""
#: ../module/data/users.glade.h:13
msgid "Expires:"
msgstr ""
#: ../module/data/users.glade.h:14
msgid "Account"
msgstr ""
#: ../module/data/users.glade.h:15
msgid "Alias"
msgstr ""
#: ../module/data/users.glade.h:16
msgid "Mail alias"
msgstr ""
#: ../module/data/users.glade.h:17
msgid "Extension:"
msgstr ""
#: ../module/data/users.glade.h:18
msgid "Secret:"
msgstr ""
#: ../module/data/users.glade.h:19
msgid "Call group:"
msgstr ""
#: ../module/data/users.glade.h:20
msgid "SIP"
msgstr ""
#: ../module/data/users.glade.h:21
msgid "Change password"
msgstr ""
#: ../module/data/users.glade.h:22
msgid "Repeat password:"
msgstr ""
#: ../module/src/vn-users.c:60
msgid "The password is too weak."
msgstr ""
#: ../module/src/vn-users.c:75
msgid "The password can't be empty."
msgstr ""
#: ../module/src/vn-users.c:77
msgid "Passwords do not match."
msgstr ""
#: ../module/data/consulter.glade.h:1 #: ../module/data/consulter.glade.h:1
msgid "Send" msgid "Send"
msgstr "" msgstr ""
@ -1222,26 +1121,10 @@ msgstr ""
msgid "Immediate changes" msgid "Immediate changes"
msgstr "" msgstr ""
#: ../module/data/consulter.glade.h:8 #: ../module/src/vn-consulter.c:216
msgid "Start"
msgstr ""
#: ../module/data/consulter.glade.h:9
msgid "Commit"
msgstr ""
#: ../module/data/consulter.glade.h:10
msgid "Rollback"
msgstr ""
#: ../module/data/consulter.glade.h:11
msgid "∞"
msgstr ""
#: ../module/src/vn-consulter.c:258
msgid "Type or select a query" msgid "Type or select a query"
msgstr "" msgstr ""
#: ../module/src/vn-consulter.c:260 #: ../module/src/vn-consulter.c:218
msgid "Message" msgid "Message"
msgstr "" msgstr ""

View File

@ -8,10 +8,11 @@ vapi_DATA = \
vn.deps \ vn.deps \
hedera.deps \ hedera.deps \
hedera.vapi hedera.vapi
EXTRA_DIST = \ EXTRA_DIST = \
Db.metadata \ Db.metadata \
Gvn.metadata \ Gvn.metadata \
Sql.metadata \ Sql.metadata \
Vn.metadata \ Vn.metadata
$(vapi_DATA)
endif endif

View File

@ -18,59 +18,13 @@
#include "vn-column-combo.h" #include "vn-column-combo.h"
#include "../vn-model.h" #include "../vn-model.h"
static void vn_column_combo_model_holder_interface_init (DbModelHolderInterface * iface); static void vn_column_combo_model_holder_init (DbModelHolderInterface * iface);
G_DEFINE_TYPE_WITH_CODE (VnColumnCombo, vn_column_combo, VN_TYPE_COLUMN, G_DEFINE_TYPE_WITH_CODE (VnColumnCombo, vn_column_combo, VN_TYPE_COLUMN,
G_IMPLEMENT_INTERFACE (DB_TYPE_MODEL_HOLDER, G_IMPLEMENT_INTERFACE (DB_TYPE_MODEL_HOLDER,
vn_column_combo_model_holder_interface_init) vn_column_combo_model_holder_init)
); );
static void vn_column_combo_on_status_changed (DbModel * model,
DbModelStatus status, VnColumnCombo * obj)
{
if (status == DB_MODEL_STATUS_READY)
{
g_object_set (VN_COLUMN (obj)->cell, "model", obj->tree_model, NULL);
db_model_use_null_row (obj->model, VN_COLUMN (obj)->null);
}
else
g_object_set (VN_COLUMN (obj)->cell, "model", NULL, NULL);
}
static DbModel * vn_column_combo_model_holder_get_model (VnColumnCombo * obj)
{
return obj->model;
}
static void vn_column_combo_model_holder_set_model (VnColumnCombo * obj,
DbModel * model)
{
g_return_if_fail (!model || DB_IS_MODEL (model));
if (obj->model)
{
g_signal_handlers_disconnect_by_func (obj->model,
vn_column_combo_on_status_changed, obj);
g_clear_object (&obj->model);
g_clear_object (&obj->tree_model);
if (obj->completion_ready)
gtk_entry_completion_set_model (obj->completion, NULL);
}
if (model)
{
obj->model = g_object_ref (model);
obj->tree_model = GTK_TREE_MODEL (vn_model_new (model));
g_signal_connect (model, "status-changed",
G_CALLBACK (vn_column_combo_on_status_changed), obj);
if (obj->completion_ready)
gtk_entry_completion_set_model (obj->completion, obj->tree_model);
}
}
static void vn_column_combo_set_value (VnColumnCombo * obj, GtkTreeModel * model, static void vn_column_combo_set_value (VnColumnCombo * obj, GtkTreeModel * model,
GtkTreeIter * tree_iter, GObject * cell, const GValue * value) GtkTreeIter * tree_iter, GObject * cell, const GValue * value)
{ {
@ -127,6 +81,7 @@ static void vn_column_combo_on_editing_started (GtkCellRenderer * cell,
{ {
gtk_entry_completion_set_model (obj->completion, obj->tree_model); gtk_entry_completion_set_model (obj->completion, obj->tree_model);
gtk_entry_completion_set_text_column (obj->completion, obj->show_column); gtk_entry_completion_set_text_column (obj->completion, obj->show_column);
gtk_entry_completion_set_minimum_key_length (obj->completion, 1);
obj->completion_ready = TRUE; obj->completion_ready = TRUE;
g_signal_connect_swapped (cell_editable, "editing-done", g_signal_connect_swapped (cell_editable, "editing-done",
@ -146,10 +101,9 @@ static void vn_column_combo_on_editing_started (GtkCellRenderer * cell,
} }
/* /*
* When the text is edited using an entry, tries to set the corresponding * When the text is edited using an entry, tries to set its underlying value.
* underlying value.
*/ */
static void vn_column_combo_on_edited (GtkCellRendererText *renderer, static void vn_column_combo_on_edited (GtkCellRendererText * renderer,
gchar * path, gchar * new_text, VnColumnCombo * obj) gchar * path, gchar * new_text, VnColumnCombo * obj)
{ {
DbIter iter; DbIter iter;
@ -229,6 +183,53 @@ static void vn_column_combo_model_changed (VnColumnCombo * obj)
} }
} }
static void vn_column_combo_on_status_changed (DbModel * model,
DbModelStatus status, VnColumnCombo * obj)
{
if (status == DB_MODEL_STATUS_READY)
{
g_object_set (VN_COLUMN (obj)->cell, "model", obj->tree_model, NULL);
db_model_use_null_row (obj->model, VN_COLUMN (obj)->null);
}
else
g_object_set (VN_COLUMN (obj)->cell, "model", NULL, NULL);
}
//+++++++++++++++++++++++++++++++++++++++++++++++++ DbModelHolder implementation
static void vn_column_combo_set_model (VnColumnCombo * obj,
DbModel * model)
{
g_return_if_fail (!model || DB_IS_MODEL (model));
if (obj->model)
{
g_signal_handlers_disconnect_by_func (obj->model,
vn_column_combo_on_status_changed, obj);
g_clear_object (&obj->model);
g_clear_object (&obj->tree_model);
if (obj->completion_ready)
gtk_entry_completion_set_model (obj->completion, NULL);
}
if (model)
{
obj->model = model;
obj->tree_model = GTK_TREE_MODEL (vn_model_new (model));
g_signal_connect (model, "status-changed",
G_CALLBACK (vn_column_combo_on_status_changed), obj);
if (obj->completion_ready)
gtk_entry_completion_set_model (obj->completion, obj->tree_model);
}
}
static DbModel * vn_column_combo_get_model (VnColumnCombo * obj)
{
return obj->model;
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++ Properties //+++++++++++++++++++++++++++++++++++++++++++++++++++ Properties
enum enum
@ -256,7 +257,7 @@ static void vn_column_combo_set_property (VnColumnCombo * obj, guint id,
obj->sort_column = g_value_get_int (value); obj->sort_column = g_value_get_int (value);
break; break;
case PROP_MODEL: case PROP_MODEL:
vn_column_combo_model_holder_set_model (obj, g_value_get_object (value)); vn_column_combo_set_model (obj, g_value_dup_object (value));
break; break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, id, pspec);
@ -295,16 +296,18 @@ static void vn_column_combo_init (VnColumnCombo * obj)
obj->completion = NULL; obj->completion = NULL;
obj->completion_ready = FALSE; obj->completion_ready = FALSE;
obj->cell_editable = NULL; obj->cell_editable = NULL;
VN_COLUMN_GET_CLASS (obj)->set_renderer (VN_COLUMN (obj), cell); VN_COLUMN_GET_CLASS (obj)->set_renderer (VN_COLUMN (obj), cell);
} }
static void vn_column_combo_finalize (VnColumnCombo * obj) static void vn_column_combo_finalize (VnColumnCombo * obj)
{ {
vn_column_combo_model_holder_set_model (obj, NULL); vn_column_combo_set_model (obj, NULL);
if (obj->completion) if (obj->completion)
g_object_unref (obj->completion); g_object_unref (obj->completion);
G_OBJECT_CLASS (vn_column_combo_parent_class)->finalize (G_OBJECT (obj)); G_OBJECT_CLASS (vn_column_combo_parent_class)->finalize (G_OBJECT (obj));
} }
@ -344,8 +347,8 @@ static void vn_column_combo_class_init (VnColumnComboClass * klass)
)); ));
} }
static void vn_column_combo_model_holder_interface_init (DbModelHolderInterface * iface) static void vn_column_combo_model_holder_init (DbModelHolderInterface * iface)
{ {
iface->get_model = (DbModelHolderGetModelFunc) vn_column_combo_model_holder_get_model; iface->get_model = (DbModelHolderGetModelFunc) vn_column_combo_get_model;
iface->set_model = (DbModelHolderSetModelFunc) vn_column_combo_model_holder_set_model; iface->set_model = (DbModelHolderSetModelFunc) vn_column_combo_set_model;
} }

View File

@ -33,11 +33,11 @@
* retrieved from a database. * retrieved from a database.
*/ */
static void vn_completion_model_holder_interface_init (DbModelHolderInterface * iface); static void vn_completion_model_holder_init (DbModelHolderInterface * iface);
G_DEFINE_TYPE_WITH_CODE (VnCompletion, vn_completion, VN_TYPE_FIELD, G_DEFINE_TYPE_WITH_CODE (VnCompletion, vn_completion, VN_TYPE_FIELD,
G_IMPLEMENT_INTERFACE (DB_TYPE_MODEL_HOLDER, G_IMPLEMENT_INTERFACE (DB_TYPE_MODEL_HOLDER,
vn_completion_model_holder_interface_init) vn_completion_model_holder_init)
); );
/** /**
@ -57,7 +57,8 @@ VnField * vn_completion_new (DbModel * model, const gchar * field)
//+++++++++++++++++++++++++++++++++++++++++++++++++++ Private //+++++++++++++++++++++++++++++++++++++++++++++++++++ Private
static void vn_completion_cb_status_changed (DbModel * model, DbModelStatus status, VnCompletion * obj) static void vn_completion_cb_status_changed (DbModel * model,
DbModelStatus status, VnCompletion * obj)
{ {
const gchar * icon_name; const gchar * icon_name;
@ -74,10 +75,10 @@ static void vn_completion_cb_status_changed (DbModel * model, DbModelStatus stat
switch (status) switch (status)
{ {
case DB_MODEL_STATUS_LOADING: case DB_MODEL_STATUS_LOADING:
icon_name = "edit-find"; icon_name = "edit-find-symbolic";
break; break;
case DB_MODEL_STATUS_ERROR: case DB_MODEL_STATUS_ERROR:
icon_name = "edit-delete"; icon_name = "edit-delete-symbolic";
break; break;
default: default:
icon_name = NULL; icon_name = NULL;
@ -105,7 +106,7 @@ static void vn_completion_cb_changed (GtkEditable * entry, VnCompletion * obj)
gchar * pattern; gchar * pattern;
GValue value = {0}; GValue value = {0};
set_icon (obj, "edit-find"); set_icon (obj, "edit-find-symbolic");
g_free (obj->last_match); g_free (obj->last_match);
obj->last_match = g_strdup (text); obj->last_match = g_strdup (text);
@ -219,6 +220,8 @@ static void vn_completion_set_field (VnCompletion * obj, gchar * field)
vn_completion_substitute (obj); vn_completion_substitute (obj);
} }
//+++++++++++++++++++++++++++++++++++++++++++++++++ DbModelHolder implementation
static DbModel * vn_completion_get_model (VnCompletion * obj) static DbModel * vn_completion_get_model (VnCompletion * obj)
{ {
return obj->model; return obj->model;
@ -329,7 +332,7 @@ static void vn_completion_class_init (VnCompletionClass * klass)
)); ));
} }
static void vn_completion_model_holder_interface_init (DbModelHolderInterface * iface) static void vn_completion_model_holder_init (DbModelHolderInterface * iface)
{ {
iface->get_model = (DbModelHolderGetModelFunc) vn_completion_get_model; iface->get_model = (DbModelHolderGetModelFunc) vn_completion_get_model;
iface->set_model = (DbModelHolderSetModelFunc) vn_completion_set_model; iface->set_model = (DbModelHolderSetModelFunc) vn_completion_set_model;

View File

@ -33,6 +33,7 @@ typedef struct _VnCompletionClass VnCompletionClass;
struct _VnCompletion struct _VnCompletion
{ {
VnField parent; VnField parent;
/* <private> */
GtkEntry * entry; GtkEntry * entry;
GtkEntryCompletion * completion; GtkEntryCompletion * completion;
gboolean invalid; gboolean invalid;

View File

@ -1310,7 +1310,7 @@ VnForm * vn_gui_open_form_at_window (VnGui * obj, const gchar * form_name, VnWin
gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE); gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
gtk_box_pack_start (hbox, button, FALSE, FALSE, 0); gtk_box_pack_start (hbox, button, FALSE, FALSE, 0);
widget = gtk_image_new_from_icon_name ("window-close", GTK_ICON_SIZE_MENU); widget = gtk_image_new_from_icon_name ("window-close-symbolic", GTK_ICON_SIZE_MENU);
gtk_button_set_image (GTK_BUTTON (button), widget); gtk_button_set_image (GTK_BUTTON (button), widget);
if (!window) if (!window)