Arreglados algunos problemas con los ficheros de consultas
Documentación sobre los módulos ampliada
This commit is contained in:
parent
81e5baf780
commit
642c9bb807
10
autogen.sh
10
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 $?
|
||||
gtkdocize --copy &&
|
||||
autoreconf -fi &&
|
||||
glib-gettextize --copy --force &&
|
||||
intltoolize --copy --force --automake
|
||||
|
||||
exit $?
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
usr/share/ca-certificates/verdnatura.es/cacert.pem etc/ssl/certs/verdnatura.es.pem
|
|
@ -33,12 +33,12 @@
|
|||
<para>
|
||||
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 <filename>
|
||||
.so</filename>, 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 <filename>.so</filename>
|
||||
file) that the Hedera execution environment (or Hedera application)
|
||||
will link in runtime to load the module. It can also be the single
|
||||
<filename>.so</filename>, 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.
|
||||
</para>
|
||||
<para>
|
||||
To run the module in the hedera runtime you must set the environment
|
||||
|
@ -50,13 +50,10 @@
|
|||
VN_MODULE_QUERY_PATH that points to <filename>.sql</filename>
|
||||
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.
|
||||
</para>
|
||||
<para>
|
||||
If you want to install the module you have to install the <filename>
|
||||
|
@ -66,4 +63,29 @@
|
|||
</para>
|
||||
</refsection>
|
||||
|
||||
<refsection id="forms">
|
||||
<title>Expected form definition</title>
|
||||
<para>
|
||||
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.
|
||||
</para>
|
||||
<para>
|
||||
The main of these requirements is to list the form in the
|
||||
<filename>.xml</filename> 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.
|
||||
</para>
|
||||
</refsection>
|
||||
</refentry>
|
||||
|
|
|
@ -72,8 +72,8 @@
|
|||
|
||||
<glade-widget-class name="VnColumnCombo" generic-name="column-combo" title="Column Combo" icon-name="widget-gtk-cellrenderercombo">
|
||||
<properties>
|
||||
<property id="show-column" weight="1.2">
|
||||
<property id="sort-column" weight="1.3">
|
||||
<property id="show-column" weight="1.2"/>
|
||||
<property id="sort-column" weight="1.3"/>
|
||||
<property id="model" ignore="True">
|
||||
<parameter-spec>
|
||||
<type>GParamObject</type>
|
||||
|
|
|
@ -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-----
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<!-- interface-requires vn 0.0 -->
|
||||
<!-- interface-requires gtk+ 3.0 -->
|
||||
<!-- interface-requires vn 0.0 -->
|
||||
<!-- interface-local-resource-path ../image -->
|
||||
<object class="GtkActionGroup" id="actions">
|
||||
<child>
|
||||
|
@ -30,12 +30,6 @@
|
|||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<object class="GtkListStore" id="model">
|
||||
<columns>
|
||||
<!-- column-name col -->
|
||||
<column type="gchararray"/>
|
||||
</columns>
|
||||
</object>
|
||||
<object class="GtkBox" id="main">
|
||||
<property name="height_request">300</property>
|
||||
<property name="visible">True</property>
|
||||
|
@ -89,7 +83,6 @@
|
|||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="related_action">send</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
|
@ -103,7 +96,6 @@
|
|||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="related_action">clean</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
|
@ -114,11 +106,9 @@
|
|||
<child>
|
||||
<object class="GtkButton" id="stop">
|
||||
<property name="label">gtk-stop</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="use_stock">True</property>
|
||||
<signal name="clicked" handler="vn_consulter_on_stop_clicked" swapped="no"/>
|
||||
</object>
|
||||
|
@ -208,12 +198,10 @@
|
|||
<child>
|
||||
<object class="GtkCheckButton" id="mode">
|
||||
<property name="label" translatable="yes">Immediate changes</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="active">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
|
@ -228,11 +216,9 @@
|
|||
<child>
|
||||
<object class="GtkButton" id="start">
|
||||
<property name="label" translatable="yes">Start</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<signal name="clicked" handler="vn_consulter_start_clicked" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
|
@ -244,11 +230,9 @@
|
|||
<child>
|
||||
<object class="GtkButton" id="commit">
|
||||
<property name="label" translatable="yes">Commit</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<signal name="clicked" handler="vn_consulter_commit_clicked" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
|
@ -260,11 +244,9 @@
|
|||
<child>
|
||||
<object class="GtkButton" id="rollback">
|
||||
<property name="label" translatable="yes">Rollback</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<signal name="clicked" handler="vn_consulter_rollback_clicked" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
|
@ -273,6 +255,20 @@
|
|||
<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>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
|
@ -301,4 +297,10 @@
|
|||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<object class="GtkListStore" id="model">
|
||||
<columns>
|
||||
<!-- column-name col -->
|
||||
<column type="gchararray"/>
|
||||
</columns>
|
||||
</object>
|
||||
</interface>
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -36,6 +36,8 @@ struct _VnConsulter
|
|||
GtkTreeView * tv;
|
||||
VnGrid * grid;
|
||||
VnHandler * handler;
|
||||
|
||||
guint source;
|
||||
};
|
||||
|
||||
struct _VnConsulterClass
|
||||
|
|
18
po/ca.po
18
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 <atcolombini@verdnatura.es>\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 ""
|
||||
|
||||
|
|
20
po/es.po
20
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 <atcolombini@verdnatura.es>\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"
|
||||
|
|
18
po/nl.po
18
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 <atcolombini@verdnatura.es>\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 ""
|
||||
|
|
|
@ -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
|
||||
));
|
||||
|
|
|
@ -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
|
||||
));*/
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Reference in New Issue