Se ha añadido la posibilidad de ordenar bien las VnColumnCombo

This commit is contained in:
Alejandro T. Colombini Gómez 2013-10-18 13:57:29 +02:00
parent ca84b97711
commit 81e5baf780
10 changed files with 170 additions and 122 deletions

View File

@ -72,6 +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="model" ignore="True">
<parameter-spec>
<type>GParamObject</type>

View File

@ -9,7 +9,7 @@ do
UPDATE=0
;;
\?|:)
echo "Usage: $0 [-u]"
echo "Usage: hedera [-u]"
exit 1
;;
esac

View File

@ -1,5 +1,5 @@
[Desktop Entry]
Name=Hedera (Development)
Name=Development Hedera
GenericName=Office Tool
Comment=Runtime for the Hedera system (Development)
Exec=hedera -u

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: hedera 1.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-10-08 09:59+0200\n"
"POT-Creation-Date: 2013-10-18 12:59+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"
@ -213,7 +213,7 @@ msgstr ""
msgid "The value"
msgstr ""
#: ../sql/sql-string.c:198 ../db/db-model.c:3459 ../db/db-request.c:461
#: ../sql/sql-string.c:198 ../db/db-model.c:3472 ../db/db-request.c:461
msgid "SQL"
msgstr ""
@ -239,60 +239,60 @@ msgstr "Recordar"
msgid "Wether to rememeber the selection when model is refreshed"
msgstr ""
#: ../db/db-model.c:3443 ../db/db-request.c:454 ../vn/vn-gui.c:1531
#: ../vn/vn-form.c:235
#: ../db/db-model.c:3446 ../db/db-request.c:454 ../vn/vn-gui.c:1531
#: ../vn/vn-form.c:244
msgid "Connection"
msgstr ""
#: ../db/db-model.c:3444
#: ../db/db-model.c:3447
msgid "The DbConn that manages the connection to the database"
msgstr ""
#: ../db/db-model.c:3451 ../db/db-request.c:468
#: ../db/db-model.c:3454 ../db/db-request.c:468
msgid "Statement"
msgstr ""
#: ../db/db-model.c:3452
#: ../db/db-model.c:3455
msgid "The statement which retrieves the data"
msgstr ""
#: ../db/db-model.c:3460
msgid ""
"Depending on the \"use-file\" property this will be the path to a file with "
"queries for the model or a SQL string"
msgstr ""
#: ../db/db-model.c:3469
#: ../db/db-model.c:3462
msgid "Use file"
msgstr ""
#: ../db/db-model.c:3470
#: ../db/db-model.c:3463
msgid ""
"If this is set to TRUE, the \"sql\" property will hold the name of a file "
"containing a query, if set to FALSE, \"sql\" is used as an SQL string"
msgstr ""
#: ../db/db-model.c:3479
#: ../db/db-model.c:3473
msgid ""
"Depending on the \"use-file\" property this will be the path to a file with "
"queries for the model or a SQL string"
msgstr ""
#: ../db/db-model.c:3482
msgid "Main Table"
msgstr ""
#: ../db/db-model.c:3480
#: ../db/db-model.c:3483
msgid "The main table of the model"
msgstr ""
#: ../db/db-model.c:3487
#: ../db/db-model.c:3490
msgid "Update flags"
msgstr ""
#: ../db/db-model.c:3488
#: ../db/db-model.c:3491
msgid "The flags that indicate how a model can be modified"
msgstr ""
#: ../db/db-model.c:3496
#: ../db/db-model.c:3499
msgid "Result position"
msgstr ""
#: ../db/db-model.c:3497
#: ../db/db-model.c:3500
msgid ""
"The position where the query that will fill the model will be placed in a "
"multi-query"
@ -630,48 +630,48 @@ msgstr ""
msgid "Sets if it is used to handle a iterator with a single record"
msgstr ""
#: ../vn/vn-form.c:221
#: ../vn/vn-form.c:230
msgid "Name"
msgstr ""
#: ../vn/vn-form.c:222
#: ../vn/vn-form.c:231
msgid "The form name"
msgstr ""
#: ../vn/vn-form.c:228
#: ../vn/vn-form.c:237
msgid "Gui"
msgstr ""
#: ../vn/vn-form.c:229
#: ../vn/vn-form.c:238
msgid "The Gui object"
msgstr ""
#: ../vn/vn-form.c:236
#: ../vn/vn-form.c:245
msgid "The connection used by the module"
msgstr ""
#: ../vn/vn-form.c:242
#: ../vn/vn-form.c:251
msgid "Module"
msgstr ""
#: ../vn/vn-form.c:243
#: ../vn/vn-form.c:252
msgid "The module"
msgstr ""
#: ../vn/vn-login.c:290 ../vn/vn-login.c:292
#: ../vn/vn-login.c:291 ../vn/vn-login.c:293
msgid "Login error"
msgstr ""
#: ../vn/vn-login.c:348
#: ../vn/vn-login.c:349
#, c-format
msgid "Bad connection settings, please check it."
msgstr ""
#: ../vn/vn-login.c:477
#: ../vn/vn-login.c:481
msgid "Application id"
msgstr ""
#: ../vn/vn-login.c:478
#: ../vn/vn-login.c:482
msgid "The application identifier"
msgstr ""
@ -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:300
#: ../vn/field/vn-combo.c:286 ../vn/column/vn-column-combo.c:320
msgid "Index column"
msgstr ""
#: ../vn/field/vn-combo.c:287 ../vn/column/vn-column-combo.c:301
#: ../vn/field/vn-combo.c:287 ../vn/column/vn-column-combo.c:321
msgid "The column index of the model"
msgstr ""
#: ../vn/field/vn-combo.c:293 ../vn/column/vn-column-combo.c:307
#: ../vn/field/vn-combo.c:293 ../vn/column/vn-column-combo.c:327
msgid "Show column"
msgstr ""
#: ../vn/field/vn-combo.c:294 ../vn/column/vn-column-combo.c:308
#: ../vn/field/vn-combo.c:294 ../vn/column/vn-column-combo.c:328
msgid "The column of the model shown by combo"
msgstr ""
@ -804,6 +804,14 @@ msgstr ""
msgid "The acceleration rate when you hold down a button."
msgstr ""
#: ../vn/column/vn-column-combo.c:313
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"
msgstr ""
#: ../vn/column/vn-column-image.c:486
msgid "Base path from the host where the images will be downloaded"
msgstr ""
@ -995,7 +1003,7 @@ msgstr ""
msgid "SQL Editor"
msgstr ""
#: ../glade/glade-db-sql.c:174
#: ../glade/glade-db-sql.c:180
msgid "Open the SQL Editor"
msgstr ""

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: hedera 1.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-10-08 09:59+0200\n"
"POT-Creation-Date: 2013-10-18 12:59+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"
@ -215,7 +215,7 @@ msgstr "El parametro al cual está vinculado"
msgid "The value"
msgstr "Valor"
#: ../sql/sql-string.c:198 ../db/db-model.c:3459 ../db/db-request.c:461
#: ../sql/sql-string.c:198 ../db/db-model.c:3472 ../db/db-request.c:461
msgid "SQL"
msgstr "SQL"
@ -241,36 +241,28 @@ msgid "Wether to rememeber the selection when model is refreshed"
msgstr ""
"Si se recordará o no la fila seleccionado cuando se refresque el modelo"
#: ../db/db-model.c:3443 ../db/db-request.c:454 ../vn/vn-gui.c:1531
#: ../vn/vn-form.c:235
#: ../db/db-model.c:3446 ../db/db-request.c:454 ../vn/vn-gui.c:1531
#: ../vn/vn-form.c:244
msgid "Connection"
msgstr "Conexión"
#: ../db/db-model.c:3444
#: ../db/db-model.c:3447
msgid "The DbConn that manages the connection to the database"
msgstr "La DbConn que controla la conexión a la base de datos"
#: ../db/db-model.c:3451 ../db/db-request.c:468
#: ../db/db-model.c:3454 ../db/db-request.c:468
msgid "Statement"
msgstr "Consulta"
#: ../db/db-model.c:3452
#: ../db/db-model.c:3455
msgid "The statement which retrieves the data"
msgstr "La consulta que recupera los datos"
#: ../db/db-model.c:3460
msgid ""
"Depending on the \"use-file\" property this will be the path to a file with "
"queries for the model or a SQL string"
msgstr ""
"Dependiendo de la propiedad \"use-file\", esta propiedad será la ruta a un "
"fichero con consultas para el modelo o una cadena SQL"
#: ../db/db-model.c:3469
#: ../db/db-model.c:3462
msgid "Use file"
msgstr "Usa fichero"
#: ../db/db-model.c:3470
#: ../db/db-model.c:3463
msgid ""
"If this is set to TRUE, the \"sql\" property will hold the name of a file "
"containing a query, if set to FALSE, \"sql\" is used as an SQL string"
@ -278,27 +270,35 @@ msgstr ""
"Si es TRUE, la propiedad \"sql\" contiene el nombre de un archivo, si es "
"falso, \"sql\" se usa como una cadena SQL"
#: ../db/db-model.c:3479
#: ../db/db-model.c:3473
msgid ""
"Depending on the \"use-file\" property this will be the path to a file with "
"queries for the model or a SQL string"
msgstr ""
"Dependiendo de la propiedad \"use-file\", esta propiedad será la ruta a un "
"fichero con consultas para el modelo o una cadena SQL"
#: ../db/db-model.c:3482
msgid "Main Table"
msgstr "Tabla principal"
#: ../db/db-model.c:3480
#: ../db/db-model.c:3483
msgid "The main table of the model"
msgstr "La tabla principal del modelo"
#: ../db/db-model.c:3487
#: ../db/db-model.c:3490
msgid "Update flags"
msgstr "Flags de actualización"
#: ../db/db-model.c:3488
#: ../db/db-model.c:3491
msgid "The flags that indicate how a model can be modified"
msgstr "Indican como se puede modificar el modelo"
#: ../db/db-model.c:3496
#: ../db/db-model.c:3499
msgid "Result position"
msgstr "Posición del resultado"
#: ../db/db-model.c:3497
#: ../db/db-model.c:3500
msgid ""
"The position where the query that will fill the model will be placed in a "
"multi-query"
@ -642,48 +642,48 @@ msgstr "Registro simple"
msgid "Sets if it is used to handle a iterator with a single record"
msgstr "Indica si se utiliza para manejar solo un registro"
#: ../vn/vn-form.c:221
#: ../vn/vn-form.c:230
msgid "Name"
msgstr "Nombre"
#: ../vn/vn-form.c:222
#: ../vn/vn-form.c:231
msgid "The form name"
msgstr "El nombre del form"
#: ../vn/vn-form.c:228
#: ../vn/vn-form.c:237
msgid "Gui"
msgstr "Gui"
#: ../vn/vn-form.c:229
#: ../vn/vn-form.c:238
msgid "The Gui object"
msgstr "El objeto Gui"
#: ../vn/vn-form.c:236
#: ../vn/vn-form.c:245
msgid "The connection used by the module"
msgstr "La conexión empleada por el módulo"
#: ../vn/vn-form.c:242
#: ../vn/vn-form.c:251
msgid "Module"
msgstr "Módulo"
#: ../vn/vn-form.c:243
#: ../vn/vn-form.c:252
msgid "The module"
msgstr "El módulo"
#: ../vn/vn-login.c:290 ../vn/vn-login.c:292
#: ../vn/vn-login.c:291 ../vn/vn-login.c:293
msgid "Login error"
msgstr "Error de identificación"
#: ../vn/vn-login.c:348
#: ../vn/vn-login.c:349
#, c-format
msgid "Bad connection settings, please check it."
msgstr "Conexión mal configurado, compruébelo por favor"
#: ../vn/vn-login.c:477
#: ../vn/vn-login.c:481
msgid "Application id"
msgstr "Id de la aplicación"
#: ../vn/vn-login.c:478
#: ../vn/vn-login.c:482
msgid "The application identifier"
msgstr "El identificador de la aplicació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:300
#: ../vn/field/vn-combo.c:286 ../vn/column/vn-column-combo.c:320
msgid "Index column"
msgstr "Columna índice"
#: ../vn/field/vn-combo.c:287 ../vn/column/vn-column-combo.c:301
#: ../vn/field/vn-combo.c:287 ../vn/column/vn-column-combo.c:321
msgid "The column index of the model"
msgstr "El índice de columna del modelo"
msgstr "La columna índice del modelo"
#: ../vn/field/vn-combo.c:293 ../vn/column/vn-column-combo.c:307
#: ../vn/field/vn-combo.c:293 ../vn/column/vn-column-combo.c:327
msgid "Show column"
msgstr "Mostrar columna"
msgstr "Columna visible"
#: ../vn/field/vn-combo.c:294 ../vn/column/vn-column-combo.c:308
#: ../vn/field/vn-combo.c:294 ../vn/column/vn-column-combo.c:328
msgid "The column of the model shown by combo"
msgstr "La columna del modelo que se mostrará en el combo"
@ -816,6 +816,15 @@ 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
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"
msgstr ""
"El número de campo del modelo del Grid que se usará para ordenar la columna"
#: ../vn/column/vn-column-image.c:486
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."
@ -1026,7 +1035,7 @@ msgstr "Nueva consulta SQL"
msgid "SQL Editor"
msgstr "Editor SQL"
#: ../glade/glade-db-sql.c:174
#: ../glade/glade-db-sql.c:180
msgid "Open the SQL Editor"
msgstr "Abrir el Editor SQL"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: hedera 1.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-10-08 09:59+0200\n"
"POT-Creation-Date: 2013-10-18 12:59+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"
@ -215,7 +215,7 @@ msgstr ""
msgid "The value"
msgstr ""
#: ../sql/sql-string.c:198 ../db/db-model.c:3459 ../db/db-request.c:461
#: ../sql/sql-string.c:198 ../db/db-model.c:3472 ../db/db-request.c:461
msgid "SQL"
msgstr ""
@ -240,60 +240,60 @@ msgstr ""
msgid "Wether to rememeber the selection when model is refreshed"
msgstr ""
#: ../db/db-model.c:3443 ../db/db-request.c:454 ../vn/vn-gui.c:1531
#: ../vn/vn-form.c:235
#: ../db/db-model.c:3446 ../db/db-request.c:454 ../vn/vn-gui.c:1531
#: ../vn/vn-form.c:244
msgid "Connection"
msgstr ""
#: ../db/db-model.c:3444
#: ../db/db-model.c:3447
msgid "The DbConn that manages the connection to the database"
msgstr ""
#: ../db/db-model.c:3451 ../db/db-request.c:468
#: ../db/db-model.c:3454 ../db/db-request.c:468
msgid "Statement"
msgstr ""
#: ../db/db-model.c:3452
#: ../db/db-model.c:3455
msgid "The statement which retrieves the data"
msgstr ""
#: ../db/db-model.c:3460
msgid ""
"Depending on the \"use-file\" property this will be the path to a file with "
"queries for the model or a SQL string"
msgstr ""
#: ../db/db-model.c:3469
#: ../db/db-model.c:3462
msgid "Use file"
msgstr ""
#: ../db/db-model.c:3470
#: ../db/db-model.c:3463
msgid ""
"If this is set to TRUE, the \"sql\" property will hold the name of a file "
"containing a query, if set to FALSE, \"sql\" is used as an SQL string"
msgstr ""
#: ../db/db-model.c:3479
#: ../db/db-model.c:3473
msgid ""
"Depending on the \"use-file\" property this will be the path to a file with "
"queries for the model or a SQL string"
msgstr ""
#: ../db/db-model.c:3482
msgid "Main Table"
msgstr ""
#: ../db/db-model.c:3480
#: ../db/db-model.c:3483
msgid "The main table of the model"
msgstr ""
#: ../db/db-model.c:3487
#: ../db/db-model.c:3490
msgid "Update flags"
msgstr ""
#: ../db/db-model.c:3488
#: ../db/db-model.c:3491
msgid "The flags that indicate how a model can be modified"
msgstr ""
#: ../db/db-model.c:3496
#: ../db/db-model.c:3499
msgid "Result position"
msgstr ""
#: ../db/db-model.c:3497
#: ../db/db-model.c:3500
msgid ""
"The position where the query that will fill the model will be placed in a "
"multi-query"
@ -631,48 +631,48 @@ msgstr ""
msgid "Sets if it is used to handle a iterator with a single record"
msgstr ""
#: ../vn/vn-form.c:221
#: ../vn/vn-form.c:230
msgid "Name"
msgstr ""
#: ../vn/vn-form.c:222
#: ../vn/vn-form.c:231
msgid "The form name"
msgstr ""
#: ../vn/vn-form.c:228
#: ../vn/vn-form.c:237
msgid "Gui"
msgstr ""
#: ../vn/vn-form.c:229
#: ../vn/vn-form.c:238
msgid "The Gui object"
msgstr ""
#: ../vn/vn-form.c:236
#: ../vn/vn-form.c:245
msgid "The connection used by the module"
msgstr ""
#: ../vn/vn-form.c:242
#: ../vn/vn-form.c:251
msgid "Module"
msgstr ""
#: ../vn/vn-form.c:243
#: ../vn/vn-form.c:252
msgid "The module"
msgstr ""
#: ../vn/vn-login.c:290 ../vn/vn-login.c:292
#: ../vn/vn-login.c:291 ../vn/vn-login.c:293
msgid "Login error"
msgstr ""
#: ../vn/vn-login.c:348
#: ../vn/vn-login.c:349
#, c-format
msgid "Bad connection settings, please check it."
msgstr ""
#: ../vn/vn-login.c:477
#: ../vn/vn-login.c:481
msgid "Application id"
msgstr ""
#: ../vn/vn-login.c:478
#: ../vn/vn-login.c:482
msgid "The application identifier"
msgstr ""
@ -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:300
#: ../vn/field/vn-combo.c:286 ../vn/column/vn-column-combo.c:320
msgid "Index column"
msgstr ""
#: ../vn/field/vn-combo.c:287 ../vn/column/vn-column-combo.c:301
#: ../vn/field/vn-combo.c:287 ../vn/column/vn-column-combo.c:321
msgid "The column index of the model"
msgstr ""
#: ../vn/field/vn-combo.c:293 ../vn/column/vn-column-combo.c:307
#: ../vn/field/vn-combo.c:293 ../vn/column/vn-column-combo.c:327
msgid "Show column"
msgstr ""
#: ../vn/field/vn-combo.c:294 ../vn/column/vn-column-combo.c:308
#: ../vn/field/vn-combo.c:294 ../vn/column/vn-column-combo.c:328
msgid "The column of the model shown by combo"
msgstr ""
@ -805,6 +805,14 @@ msgstr ""
msgid "The acceleration rate when you hold down a button."
msgstr ""
#: ../vn/column/vn-column-combo.c:313
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"
msgstr ""
#: ../vn/column/vn-column-image.c:486
msgid "Base path from the host where the images will be downloaded"
msgstr ""
@ -995,7 +1003,7 @@ msgstr ""
msgid "SQL Editor"
msgstr ""
#: ../glade/glade-db-sql.c:174
#: ../glade/glade-db-sql.c:180
msgid "Open the SQL Editor"
msgstr ""

View File

@ -1,8 +1,5 @@
Vn cheader_filename="vn/vn.h"
Builder.bind_fields skip=false
Builder.bind_columns skip=false
Grid.append_columns skip=false
Form.@get type="unowned GLib.Object"

View File

@ -211,7 +211,13 @@ static void vn_column_combo_set_null (VnColumnCombo * obj, gboolean null)
static void vn_column_combo_model_changed (VnColumnCombo * obj)
{
if (obj->model)
{
db_model_use_null_row (obj->model, VN_COLUMN (obj)->null);
if (obj->sort_column >= 0)
gtk_tree_view_column_set_sort_column_id (
GTK_TREE_VIEW_COLUMN (obj), obj->sort_column);
}
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++ Properties
@ -220,6 +226,7 @@ enum
{
PROP_INDEX_COLUMN = 1
,PROP_SHOW_COLUMN
,PROP_SORT_COLUMN
,PROP_MODEL
};
@ -236,6 +243,9 @@ static void vn_column_combo_set_property (VnColumnCombo * obj, guint id,
g_object_set (VN_COLUMN (obj)->cell, "text-column", obj->show_column,
NULL);
break;
case PROP_SORT_COLUMN:
obj->sort_column = g_value_get_int (value);
break;
case PROP_MODEL:
vn_column_combo_set_model (obj, g_value_get_object (value));
break;
@ -255,6 +265,9 @@ static void vn_column_combo_get_property (VnColumnCombo * obj, guint id,
case PROP_SHOW_COLUMN:
g_value_set_uint (value, obj->show_column);
break;
case PROP_SORT_COLUMN:
g_value_set_int (value, obj->sort_column);
break;
case PROP_MODEL:
g_value_set_object (value, obj->model);
break;
@ -309,6 +322,13 @@ static void vn_column_combo_class_init (VnColumnComboClass * klass)
,0, 255, 1
,G_PARAM_CONSTRUCT | G_PARAM_READWRITE
));
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")
,-1, 255, -1
,G_PARAM_CONSTRUCT | G_PARAM_READWRITE
));
}
static void vn_column_combo_model_holder_interface_init (DbModelHolderInterface * iface)

View File

@ -38,6 +38,7 @@ struct _VnColumnCombo
GtkTreeModel * tree_model;
guint index_column;
guint show_column;
gint sort_column;
GtkEntryCompletion * completion;
gboolean completion_ready;
GtkCellEditable * cell_editable;

View File

@ -378,6 +378,9 @@ void vn_login_cb_connect_clicked (GtkButton * button, VnLogin * obj)
(GThreadFunc) vn_login_thread, connect_data);
}
/*
* Stops trying to connect.
*/
void vn_login_cb_stop_clicked (GtkButton * button, VnLogin * obj)
{