From 642c9bb8079a2f2fe1c2fd540bf5b62d65979557 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20T=2E=20Colombini=20G=C3=B3mez?= Date: Wed, 23 Oct 2013 10:58:06 +0200 Subject: [PATCH] =?UTF-8?q?Arreglados=20algunos=20problemas=20con=20los=20?= =?UTF-8?q?ficheros=20de=20consultas=20Documentaci=C3=B3n=20sobre=20los=20?= =?UTF-8?q?m=C3=B3dulos=20ampliada?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- autogen.sh | 10 +++-- db/db-conn.c | 2 +- db/db-file-loader.c | 47 +++++++++------------- debian/hedera.links | 1 - docs/reference/hedera/adding-modules.xml | 48 +++++++++++++++++------ glade/vn.xml | 4 +- main/cacert.pem | 25 ------------ module/data/consulter.glade | 40 ++++++++++--------- module/src/vn-consulter.c | 50 ++++++++++++++++++++---- module/src/vn-consulter.h | 2 + po/ca.po | 18 ++++----- po/es.po | 20 +++++----- po/nl.po | 18 ++++----- vn/column/vn-column-combo.c | 2 +- vn/column/vn-column-image.c | 37 ++++++++++++------ vn/column/vn-column-image.h | 5 +-- vn/vn-form.c | 2 +- 17 files changed, 186 insertions(+), 145 deletions(-) delete mode 100644 debian/hedera.links delete mode 100644 main/cacert.pem diff --git a/autogen.sh b/autogen.sh index 7242e70..1bd54ee 100755 --- a/autogen.sh +++ b/autogen.sh @@ -7,7 +7,9 @@ builddir=`pwd` mkdir -p $builddir/m4 cd $srcdir -gtkdocize --copy || exit $? -autoreconf -fi || exit $? -glib-gettextize --copy --force || exit $? -intltoolize --copy --force --automake || exit $? \ No newline at end of file +gtkdocize --copy && +autoreconf -fi && +glib-gettextize --copy --force && +intltoolize --copy --force --automake + +exit $? \ No newline at end of file diff --git a/db/db-conn.c b/db/db-conn.c index b481f1a..39c7d13 100644 --- a/db/db-conn.c +++ b/db/db-conn.c @@ -896,7 +896,7 @@ SqlString * db_conn_create_stmt_from_file (DbConn * obj, const gchar * query_fil file = g_strconcat (query_file, ".sql", NULL); if (obj->query_dirs) - for (i = 0; obj->query_dirs[i] && !stmt; i++) + for (i = 0; obj->query_dirs[i] != NULL && !stmt; i++) { gchar * buffer; gchar * path = g_build_filename (obj->query_dirs[i], file, NULL); diff --git a/db/db-file-loader.c b/db/db-file-loader.c index 0bf4cf3..ae70f20 100644 --- a/db/db-file-loader.c +++ b/db/db-file-loader.c @@ -221,7 +221,8 @@ static gboolean db_file_loader_callback (File * file) return FALSE; } -static gboolean db_file_loader_resolve_host (DbFileLoader * obj, GCancellable * cancel, GError ** error) +static gboolean db_file_loader_resolve_host (DbFileLoader * obj, + GCancellable * cancel, GError ** error) { gboolean ret = FALSE; GResolver * r = g_resolver_get_default (); @@ -245,7 +246,6 @@ static GIOStream * db_file_loader_connect (DbFileLoader * obj, GCancellable * ca GSocketClient * client = g_socket_client_new (); GIOStream * connection = G_IO_STREAM (g_socket_client_connect (client, G_SOCKET_CONNECTABLE (obj->priv->addr), cancel, error)); - g_object_unref (client); return connection; } @@ -303,11 +303,8 @@ static gchar * db_file_loader_create_request (DbFileLoader * obj, const gchar * return request; } -static gboolean db_file_loader_store (DbFileLoader * obj - ,const gchar * subpath - ,const gchar * data - ,gsize len - ,GError ** error) +static gboolean db_file_loader_store (DbFileLoader * obj, + const gchar * subpath, const gchar * data, gsize len, GError ** error) { gsize dir_len; gboolean ret = FALSE; @@ -340,10 +337,8 @@ static gboolean db_file_loader_store (DbFileLoader * obj return ret; } -static gchar * db_file_loader_load_from_cache (DbFileLoader * obj - ,const gchar * subpath - ,gsize * len - ,GError ** error) +static gchar * db_file_loader_load_from_cache (DbFileLoader * obj, + const gchar * subpath, gsize * len, GError ** error) { gchar * data; GFile * file = db_file_loader_get_cache_file (obj, subpath); @@ -354,7 +349,7 @@ static gchar * db_file_loader_load_from_cache (DbFileLoader * obj return data; } -static void db_file_loader_job_download (File * file, DbFileLoader * obj) +static void db_file_loader_thread_download (File * file, DbFileLoader * obj) { gsize len; gchar ** split; @@ -362,10 +357,10 @@ static void db_file_loader_job_download (File * file, DbFileLoader * obj) gchar * request = NULL; gchar * data = NULL; GError * error = NULL; - GCancellable * cancel = file->cancel; GIOStream * connection = NULL; - GOutputStream * send_stream; GDataInputStream * receive_stream = NULL; + GOutputStream * send_stream; + GCancellable * cancel = file->cancel; g_mutex_lock (obj->priv->mutex); @@ -494,10 +489,8 @@ final: * Downloads a file from @file, which is a relative path to the file from the * base URL of the #DbFileLoader. The result will be availble in @func. **/ -void db_file_loader_download (DbFileLoader * obj - ,const gchar * path - ,DbFileLoaderCallbackFunc func - ,gpointer user_data) +void db_file_loader_download (DbFileLoader * obj, + const gchar * path, DbFileLoaderCallbackFunc func, gpointer user_data) { File * file; @@ -505,8 +498,8 @@ void db_file_loader_download (DbFileLoader * obj g_return_if_fail (path); if (!obj->priv->pool) - obj->priv->pool = g_thread_pool_new ((GFunc) db_file_loader_job_download, - obj, -1, FALSE, NULL); + obj->priv->pool = g_thread_pool_new ((GFunc) db_file_loader_thread_download, + obj, 5, FALSE, NULL); file = file_new (obj, path, NULL, func, user_data, TRUE); g_hash_table_add (obj->priv->downloading, file); @@ -514,7 +507,7 @@ void db_file_loader_download (DbFileLoader * obj g_thread_pool_push (obj->priv->pool, file, NULL); } -static void db_file_loader_job_upload (DbFileLoader * obj, File * file) +static void db_file_loader_thread_upload (DbFileLoader * obj, File * file) { g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, (GSourceFunc) db_file_loader_callback, file, @@ -534,11 +527,9 @@ static void db_file_loader_job_upload (DbFileLoader * obj, File * file) * URL of the #DbFileLoader. To retrieve the result, connect to the * "downloaded" signal and to the "error" signal to manage errors. **/ -void db_file_loader_upload (DbFileLoader * obj - ,GBytes * data - ,const gchar * path - ,DbFileLoaderCallbackFunc func - ,gpointer user_data) +void db_file_loader_upload (DbFileLoader * obj, + GBytes * data, const gchar * path, + DbFileLoaderCallbackFunc func, gpointer user_data) { File * file; @@ -547,8 +538,8 @@ void db_file_loader_upload (DbFileLoader * obj g_return_if_fail (path); //TODO? create a pool only for uploads if (!obj->priv->pool) - obj->priv->pool = g_thread_pool_new ((GFunc) db_file_loader_job_upload, - obj, -1, TRUE, NULL); + obj->priv->pool = g_thread_pool_new ((GFunc) db_file_loader_thread_upload, + obj, 3, TRUE, NULL); file = file_new (obj, path, data, func, user_data, TRUE); diff --git a/debian/hedera.links b/debian/hedera.links deleted file mode 100644 index 374fd1f..0000000 --- a/debian/hedera.links +++ /dev/null @@ -1 +0,0 @@ -usr/share/ca-certificates/verdnatura.es/cacert.pem etc/ssl/certs/verdnatura.es.pem \ No newline at end of file diff --git a/docs/reference/hedera/adding-modules.xml b/docs/reference/hedera/adding-modules.xml index 07b7d87..283d1db 100644 --- a/docs/reference/hedera/adding-modules.xml +++ b/docs/reference/hedera/adding-modules.xml @@ -33,12 +33,12 @@ At this point, you should have a compiled module, this consisting in a folder with the data (images, UI definitions, etc.) of the - module along with the dynamic library (a .so file) that the - Hedera execution environment (or Hedera application) will link - in runtime to load the module. It can also be the single - .so, due to that may be the module developer has coded - the UI creation or may be beacuse both the module and its data were - compiled in a single file. + module along with the dynamic library (a .so + file) that the Hedera execution environment (or Hedera application) + will link in runtime to load the module. It can also be the single + .so, due to that may be the module developer + has coded the UI creation or may be beacuse both the module and its + data were compiled in a single file. To run the module in the hedera runtime you must set the environment @@ -50,13 +50,10 @@ VN_MODULE_QUERY_PATH that points to .sql files. Once these variables are set you'll have to run the Hedera application normally, and it will look for the - values on the variables and load the module. In the future there - will be another variable that when set to "yes" the module will - install and when set to "no" (or not set) the module will just be - used as now in the hedera runtime. Note that if you use the Anjuta - IDE with the project created by the wizzard, as you run in Anjuta - the variables will be automatically set pointing to your project - files. + values on the variables and load the module. Note that if you use + the Anjuta IDE with the project created by the wizzard, as you run + in Anjuta the variables will be automatically set pointing to your + project files. If you want to install the module you have to install the @@ -66,4 +63,29 @@ + + Expected form definition + + Each module can have any number of forms, that will be compiled + inside the same file. Independently from the form funtionality, each + form needs to offer some things necesary for Hedera to recognize and + load it as expected. + + + The main of these requirements is to list the form in the + .xml file of the module. Also, the interface + description file has to have the ".glade" extension and contain a + GtkContainer with the identifier "main" as the base widget, this + widget will be loaded inside a GtkNotebook and will be the first + thing the user will see when the form gets loaded. This glade file + may also contain a VnBatch with all the models needed by the form + and with the identifier "models", every model inside this batch will + get its connection set and a GtkActionGroup idenfitied by "actions" + containing the actions that will be used in the toolbar and the menu + of the main application. To actually get these actions in the + toolbar and menu of the application the programmer must provide a + file with the extension ".ui" containing a GtkUIManager definition + using the actions in the "actions" group. + + diff --git a/glade/vn.xml b/glade/vn.xml index 9b6fef2..49dae27 100644 --- a/glade/vn.xml +++ b/glade/vn.xml @@ -72,8 +72,8 @@ - - + + GParamObject diff --git a/main/cacert.pem b/main/cacert.pem deleted file mode 100644 index f7bd939..0000000 --- a/main/cacert.pem +++ /dev/null @@ -1,25 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIEQzCCAyugAwIBAgIJAJimL+J4jUaQMA0GCSqGSIb3DQEBBQUAMIG2MQswCQYD -VQQGEwJFUzEdMBsGA1UECAwUQ29tdW5pZGFkIFZhbGVuY2lhbmExETAPBgNVBAcM -CFZhbGVuY2lhMR4wHAYDVQQKDBVWZXJkbmF0dXJhIExldmFudGUgU0wxFDASBgNV -BAsMC0luZm9ybWF0aWNhMRYwFAYDVQQDDA12ZXJkbmF0dXJhLmVzMScwJQYJKoZI -hvcNAQkBFhhob3N0bWFzdGVyQHZlcmRuYXR1cmEuZXMwIBcNMTMwNjExMTE1MjQ1 -WhgPMjA2MzA1MzAxMTUyNDVaMIG2MQswCQYDVQQGEwJFUzEdMBsGA1UECAwUQ29t -dW5pZGFkIFZhbGVuY2lhbmExETAPBgNVBAcMCFZhbGVuY2lhMR4wHAYDVQQKDBVW -ZXJkbmF0dXJhIExldmFudGUgU0wxFDASBgNVBAsMC0luZm9ybWF0aWNhMRYwFAYD -VQQDDA12ZXJkbmF0dXJhLmVzMScwJQYJKoZIhvcNAQkBFhhob3N0bWFzdGVyQHZl -cmRuYXR1cmEuZXMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCsqq+h -1kUfZE19Inm3M2XF1ytIqXeIsXsiZ5T9aVdedQrF2xcVOr4dvJyE5zp9g7NNxy9T -FyAHPXiPWKSoX3w0uoQfLW9Hm19QZYu40hBD5oRrJy5m6l4JU3Gj0tnkvYc4m8Fl -2uEUT3ain0FE2I1XjKpL6eQi9TKjhgmWNRgDJUbllAB3lsQLkNfB6EFo2QJykiKl -aRi4UaHdSkd3zkUJyYRdcG7IxCFvsViKpwr3JF+TLXSN/oronLFgG8cKedrn+sMW -pBm2FZQKAh8hLT3QQQqQgGpQ2y4t2EVJkYVdcGBXCyWYDKegMXgJR10WunICFCaD -kM0P3pYQdtbgr7e9AgMBAAGjUDBOMB0GA1UdDgQWBBQ9+iZdf7pLNQItxs4o43dN -FZD0CTAfBgNVHSMEGDAWgBQ9+iZdf7pLNQItxs4o43dNFZD0CTAMBgNVHRMEBTAD -AQH/MA0GCSqGSIb3DQEBBQUAA4IBAQAcFzJhm3jjuexZf9tTgQfzwtsafLLsYkrm -EZOTkhvZFJYbBd8UngL5UPF1M3buSEV1VqsWCALLrFkxzbmjk5uM8cswZR/3J6un -7GFYWTEllVgkD8KmNA2b6j5uSuGCQmOccsR4069vwNjrvTbtQpEpEAAnDf6d5/N4 -MXuDozHq3iEYi7qyGf++5mp4D+82y2ONSUsiLgxqnMT5JX/yhDKI1IiX1ndyt+6r -ie2i2fzdOgovlAILuTM4hoUjPYFOxwmUwpxU2EAjPqo9Bi7bQiH+fv0QBzbpQ9on -DRHo7NuXaDG49nvatJjuf4DiDELBCTMeKBOk5hG7kyWCIwp5wr+w ------END CERTIFICATE----- diff --git a/module/data/consulter.glade b/module/data/consulter.glade index b2638a9..c7ff59b 100644 --- a/module/data/consulter.glade +++ b/module/data/consulter.glade @@ -1,7 +1,7 @@ - + @@ -30,12 +30,6 @@ - - - - - - 300 True @@ -89,7 +83,6 @@ True True True - send False @@ -103,7 +96,6 @@ True True True - clean False @@ -114,11 +106,9 @@ gtk-stop - False True True True - False True @@ -208,12 +198,10 @@ Immediate changes - False True False True False - False 0 True True @@ -228,11 +216,9 @@ Start - False True True True - False @@ -244,11 +230,9 @@ Commit - False True True True - False @@ -260,11 +244,9 @@ Rollback - False True True True - False @@ -273,6 +255,20 @@ 3 + + + + True + True + True + + + + False + True + 4 + + True @@ -301,4 +297,10 @@ + + + + + + diff --git a/module/src/vn-consulter.c b/module/src/vn-consulter.c index 3697c6f..c786da9 100644 --- a/module/src/vn-consulter.c +++ b/module/src/vn-consulter.c @@ -29,6 +29,33 @@ void vn_consulter_clean_clicked (GtkButton * button, VnConsulter * obj) 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 (100, (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); @@ -94,7 +121,8 @@ static void vn_consulter_model_status_changed (DbModel * model, else col_type = VN_TYPE_COLUMN_ENTRY; -if (i == 7) col_type = VN_TYPE_COLUMN_IMAGE; +if (i == 7) +col_type = VN_TYPE_COLUMN_IMAGE; column = vn_grid_append_column (obj->grid, i ,db_model_get_column_name (model, i) @@ -102,6 +130,13 @@ if (i == 7) col_type = VN_TYPE_COLUMN_IMAGE; ,TRUE, FALSE ); +if (i == 7) +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); } @@ -140,12 +175,8 @@ void vn_consulter_send (GtkButton * button, VnConsulter * obj) vn_consulter_set_message (obj, sql); if (g_str_has_prefix (sql, FILE_KW)) - { - const gchar * filename = sql + g_utf8_strlen (FILE_KW, -1); - db_conn_set_query_path (VN_FORM (obj)->conn, _QUERY_PATH); - model = db_model_new_with_file (VN_FORM (obj)->conn, filename); - g_message ("VnConsulter: query loaded from \"%s/%s.sql\"", _QUERY_PATH, filename); - } + model = db_model_new_with_file (VN_FORM (obj)->conn, + sql + g_utf8_strlen (FILE_KW, -1)); else model = db_model_new_with_sql (VN_FORM (obj)->conn, sql); @@ -207,7 +238,10 @@ static void vn_consulter_open (VnConsulter * obj) //+++++++++++++++++++++++++++++++++++++++++++++++++++ Class -static void vn_consulter_init (VnConsulter * obj) {} +static void vn_consulter_init (VnConsulter * obj) +{ + obj->source = 0; +} static void vn_consulter_class_init (VnConsulterClass * k) { diff --git a/module/src/vn-consulter.h b/module/src/vn-consulter.h index 5bcf5c1..ba96c57 100644 --- a/module/src/vn-consulter.h +++ b/module/src/vn-consulter.h @@ -36,6 +36,8 @@ struct _VnConsulter GtkTreeView * tv; VnGrid * grid; VnHandler * handler; + + guint source; }; struct _VnConsulterClass diff --git a/po/ca.po b/po/ca.po index 00692ea..b352d02 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-10-18 12:59+0200\n" +"POT-Creation-Date: 2013-10-21 09:24+0200\n" "PO-Revision-Date: 2013-06-04 13:38+0200\n" "Last-Translator: Alejandro T. Colombini Gómez \n" "Language-Team: Catalan\n" @@ -713,19 +713,19 @@ msgstr "" msgid "The number of decimal places to display." msgstr "" -#: ../vn/field/vn-combo.c:286 ../vn/column/vn-column-combo.c:320 +#: ../vn/field/vn-combo.c:286 ../vn/column/vn-column-combo.c:313 msgid "Index column" msgstr "" -#: ../vn/field/vn-combo.c:287 ../vn/column/vn-column-combo.c:321 +#: ../vn/field/vn-combo.c:287 ../vn/column/vn-column-combo.c:314 msgid "The column index of the model" msgstr "" -#: ../vn/field/vn-combo.c:293 ../vn/column/vn-column-combo.c:327 +#: ../vn/field/vn-combo.c:293 ../vn/column/vn-column-combo.c:320 msgid "Show column" msgstr "" -#: ../vn/field/vn-combo.c:294 ../vn/column/vn-column-combo.c:328 +#: ../vn/field/vn-combo.c:294 ../vn/column/vn-column-combo.c:321 msgid "The column of the model shown by combo" msgstr "" @@ -804,12 +804,12 @@ msgstr "" msgid "The acceleration rate when you hold down a button." msgstr "" -#: ../vn/column/vn-column-combo.c:313 +#: ../vn/column/vn-column-combo.c:327 msgid "Sort column" msgstr "" -#: ../vn/column/vn-column-combo.c:314 -msgid "The column of the Grid model used to sort the column in the Grid" +#: ../vn/column/vn-column-combo.c:328 +msgid "The field number of the Grid model used to sort the column" msgstr "" #: ../vn/column/vn-column-image.c:486 @@ -1140,7 +1140,7 @@ msgstr "" msgid "Rollback" msgstr "" -#: ../module/src/vn-consulter.c:199 +#: ../module/src/vn-consulter.c:207 msgid "Type or select a query" msgstr "" diff --git a/po/es.po b/po/es.po index a01b841..1c182c5 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-10-18 12:59+0200\n" +"POT-Creation-Date: 2013-10-21 09:24+0200\n" "PO-Revision-Date: 2013-06-04 13:36+0200\n" "Last-Translator: Alejandro T. Colombini Gómez \n" "Language-Team: Spanish\n" @@ -725,19 +725,19 @@ msgstr "Dígitos" msgid "The number of decimal places to display." msgstr "El número de posiciones decimales que se muestran" -#: ../vn/field/vn-combo.c:286 ../vn/column/vn-column-combo.c:320 +#: ../vn/field/vn-combo.c:286 ../vn/column/vn-column-combo.c:313 msgid "Index column" msgstr "Columna índice" -#: ../vn/field/vn-combo.c:287 ../vn/column/vn-column-combo.c:321 +#: ../vn/field/vn-combo.c:287 ../vn/column/vn-column-combo.c:314 msgid "The column index of the model" msgstr "La columna índice del modelo" -#: ../vn/field/vn-combo.c:293 ../vn/column/vn-column-combo.c:327 +#: ../vn/field/vn-combo.c:293 ../vn/column/vn-column-combo.c:320 msgid "Show column" msgstr "Columna visible" -#: ../vn/field/vn-combo.c:294 ../vn/column/vn-column-combo.c:328 +#: ../vn/field/vn-combo.c:294 ../vn/column/vn-column-combo.c:321 msgid "The column of the model shown by combo" msgstr "La columna del modelo que se mostrará en el combo" @@ -816,14 +816,14 @@ msgstr "Tasa de subida" 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-combo.c:313 +#: ../vn/column/vn-column-combo.c:327 msgid "Sort column" msgstr "Columna de ordenación" -#: ../vn/column/vn-column-combo.c:314 -msgid "The column of the Grid model used to sort the column in the Grid" +#: ../vn/column/vn-column-combo.c:328 +msgid "The field number of the Grid model used to sort the column" msgstr "" -"El número de campo del modelo del Grid que se usará para ordenar la columna" +"El número de campo del modelo del Grid que se usa para ordenar la columna" #: ../vn/column/vn-column-image.c:486 msgid "Base path from the host where the images will be downloaded" @@ -1171,6 +1171,6 @@ msgstr "Efectuar" msgid "Rollback" msgstr "Deshacer" -#: ../module/src/vn-consulter.c:199 +#: ../module/src/vn-consulter.c:207 msgid "Type or select a query" msgstr "Escribe o selecciona la consulta" diff --git a/po/nl.po b/po/nl.po index 3a45785..c5f3704 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-10-18 12:59+0200\n" +"POT-Creation-Date: 2013-10-21 09:24+0200\n" "PO-Revision-Date: 2012-10-09 11:38+0200\n" "Last-Translator: Alejandro T. Colombini Gómez \n" "Language-Team: Dutch\n" @@ -714,19 +714,19 @@ msgstr "" msgid "The number of decimal places to display." msgstr "" -#: ../vn/field/vn-combo.c:286 ../vn/column/vn-column-combo.c:320 +#: ../vn/field/vn-combo.c:286 ../vn/column/vn-column-combo.c:313 msgid "Index column" msgstr "" -#: ../vn/field/vn-combo.c:287 ../vn/column/vn-column-combo.c:321 +#: ../vn/field/vn-combo.c:287 ../vn/column/vn-column-combo.c:314 msgid "The column index of the model" msgstr "" -#: ../vn/field/vn-combo.c:293 ../vn/column/vn-column-combo.c:327 +#: ../vn/field/vn-combo.c:293 ../vn/column/vn-column-combo.c:320 msgid "Show column" msgstr "" -#: ../vn/field/vn-combo.c:294 ../vn/column/vn-column-combo.c:328 +#: ../vn/field/vn-combo.c:294 ../vn/column/vn-column-combo.c:321 msgid "The column of the model shown by combo" msgstr "" @@ -805,12 +805,12 @@ msgstr "" msgid "The acceleration rate when you hold down a button." msgstr "" -#: ../vn/column/vn-column-combo.c:313 +#: ../vn/column/vn-column-combo.c:327 msgid "Sort column" msgstr "" -#: ../vn/column/vn-column-combo.c:314 -msgid "The column of the Grid model used to sort the column in the Grid" +#: ../vn/column/vn-column-combo.c:328 +msgid "The field number of the Grid model used to sort the column" msgstr "" #: ../vn/column/vn-column-image.c:486 @@ -1139,6 +1139,6 @@ msgstr "" msgid "Rollback" msgstr "" -#: ../module/src/vn-consulter.c:199 +#: ../module/src/vn-consulter.c:207 msgid "Type or select a query" msgstr "" diff --git a/vn/column/vn-column-combo.c b/vn/column/vn-column-combo.c index 4e38d5e..604378d 100644 --- a/vn/column/vn-column-combo.c +++ b/vn/column/vn-column-combo.c @@ -325,7 +325,7 @@ static void vn_column_combo_class_init (VnColumnComboClass * klass) g_object_class_install_property (k, PROP_SORT_COLUMN, g_param_spec_int ("sort-column" ,_("Sort column") - ,_("The column number of the Grid model used to sort the column") + ,_("The field number of the Grid model used to sort the column") ,-1, 255, -1 ,G_PARAM_CONSTRUCT | G_PARAM_READWRITE )); diff --git a/vn/column/vn-column-image.c b/vn/column/vn-column-image.c index 3657fd3..2302060 100644 --- a/vn/column/vn-column-image.c +++ b/vn/column/vn-column-image.c @@ -142,8 +142,8 @@ static gboolean vn_column_image_on_query_tooltip (GtkTreeView * view, GtkTreeIter iter; GtkTreePath * path = NULL; - if (obj && VN_IS_COLUMN_IMAGE (obj) && !k - && gtk_tree_view_get_tooltip_context (view, &x, &y, k, NULL, &path, &iter)) + if (//&& obj && VN_IS_COLUMN_IMAGE (obj) + gtk_tree_view_get_tooltip_context (view, &x, &y, k, NULL, &path, &iter)) { gint wx, wy; GdkRectangle rect; @@ -265,7 +265,7 @@ static void vn_column_image_set_value (VnColumnImage * obj, GtkTreeModel * model gchar * name = g_value_dup_string (value); GtkTreeView * view = GTK_TREE_VIEW (gtk_tree_view_column_get_tree_view (GTK_TREE_VIEW_COLUMN (obj))); - + if (obj->loaded) { if (g_hash_table_contains (obj->loaded, name)) @@ -290,7 +290,6 @@ static void vn_column_image_set_value (VnColumnImage * obj, GtkTreeModel * model } g_free (name); - return; } else @@ -376,6 +375,7 @@ enum ,PROP_PATH ,PROP_TOOLTIP_PATH ,PROP_TOOLTIP_SIZE + ,PROP_FILE_LOADER }; static void vn_column_image_set_property (VnColumnImage * obj, guint id, @@ -398,6 +398,9 @@ static void vn_column_image_set_property (VnColumnImage * obj, guint id, case PROP_TOOLTIP_SIZE: obj->tooltip_size = g_value_get_int (value); break; +/* case PROP_FILE_LOADER: + obj->loader = g_value_get_object (value); + break;*/ default: G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, id, pspec); } @@ -420,6 +423,9 @@ static void vn_column_image_get_property (VnColumnImage * obj, guint id, case PROP_TOOLTIP_SIZE: g_value_set_int (value, obj->tooltip_size); break; +/* case PROP_FILE_LOADER: + g_value_set_object (value, obj->loader); + break;*/ default: G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, id, pspec); } @@ -476,7 +482,7 @@ static void vn_column_image_class_init (VnColumnImageClass * klass) g_param_spec_string ("host" ,_("Host") ,_("The host web server name to get the images") - ,"www.verdnatura.es"//XXX NULL + ,NULL ,G_PARAM_CONSTRUCT | G_PARAM_READWRITE )); @@ -484,7 +490,7 @@ static void vn_column_image_class_init (VnColumnImageClass * klass) g_param_spec_string ("path" ,_("Path") ,_("Base path from the host where the images will be downloaded") - ,"image/cache/catalog/icon"//XXX NULL + ,NULL ,G_PARAM_CONSTRUCT | G_PARAM_READWRITE )); @@ -492,20 +498,29 @@ static void vn_column_image_class_init (VnColumnImageClass * klass) g_param_spec_string ("tooltip-path" ,_("Tooltip path") ,_("Prefix for the path of the images to be shown in the tooltip. " - "Starting after the path of the column and appending the name on " - "each cell") - ,"../full"//XXX NULL + "Starting after the path of the column and appending the name " + "on each cell") + ,NULL ,G_PARAM_CONSTRUCT | G_PARAM_READWRITE )); g_object_class_install_property (k, PROP_TOOLTIP_SIZE, g_param_spec_int ("tooltip-size" ,_("Tooltip size") - ,_("Size of the bigger side of the tooltip images, the another side " - "will be scaled accordingly and smaller images won't be scaled") + ,_("Size of the bigger side of the tooltip images, the another " + "side will be scaled accordingly and smaller images won't be " + "scaled") ,-1 ,G_MAXINT ,300 ,G_PARAM_CONSTRUCT | G_PARAM_READWRITE )); +/* + g_object_class_install_property (k, PROP_FILE_LOADER, + g_param_spec_object ("file-loader" + ,_("File loader") + ,_("An optional file loader, if it's NULL the column will create one") + ,DB_TYPE_FILE_LOADER + ,G_PARAM_CONSTRUCT | G_PARAM_READWRITE + ));*/ } diff --git a/vn/column/vn-column-image.h b/vn/column/vn-column-image.h index 47ee0f8..6c12ac3 100644 --- a/vn/column/vn-column-image.h +++ b/vn/column/vn-column-image.h @@ -39,12 +39,11 @@ struct _VnColumnImage VnColumn parent; gchar * host; gchar * path; - DbFileLoader * loader; - GHashTable * loaded; gchar * tooltip_path; gint tooltip_size; + DbFileLoader * loader; + GHashTable * loaded; GHashTable * tooltips; - }; struct _VnColumnImageClass diff --git a/vn/vn-form.c b/vn/vn-form.c index e60eba0..a2cfdfe 100644 --- a/vn/vn-form.c +++ b/vn/vn-form.c @@ -43,10 +43,10 @@ void vn_form_open (VnForm * obj) if (gtk_builder_add_from_file (obj->builder, file, &err)) { - // Get the VnBatch "models" containing the models needing a connection const GList * m; VnBatch * models = VN_BATCH (gtk_builder_get_object (obj->builder, "models")); + if (models) for (m = vn_batch_get_objects (models); m; m = m->next) db_model_set_conn (m->data, obj->conn);