Implementado Tab Index para la navegación por VnGrid

This commit is contained in:
Alejandro T. Colombini Gómez 2013-11-05 10:22:53 +01:00
parent cfb0bcea3f
commit cee7dc52b3
9 changed files with 258 additions and 178 deletions

View File

@ -180,7 +180,8 @@ void vn_consulter_send (GtkButton * button, VnConsulter * obj)
else
model = db_model_new_with_sql (VN_FORM (obj)->conn, sql);
g_signal_connect (model, "status-changed",
// Get sure to connect after the columns do, to destroy them.
g_signal_connect_after (model, "status-changed",
G_CALLBACK (vn_consulter_model_status_changed), obj);
iterator = db_iterator_new (model);

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-21 09:24+0200\n"
"POT-Creation-Date: 2013-11-05 10:03+0100\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"
@ -164,7 +164,7 @@ msgstr ""
msgid "The type of the value"
msgstr ""
#: ../gvn/gvn-param.c:485 ../vn/vn-field.c:553 ../vn/vn-column.c:401
#: ../gvn/gvn-param.c:485 ../vn/vn-field.c:553 ../vn/vn-column.c:440
msgid "Editable"
msgstr ""
@ -172,7 +172,7 @@ msgstr ""
msgid "Whether the param value can be modified"
msgstr ""
#: ../gvn/gvn-param.c:492 ../vn/vn-field.c:560 ../vn/vn-column.c:408
#: ../gvn/gvn-param.c:492 ../vn/vn-field.c:560 ../vn/vn-column.c:447
msgid "Null"
msgstr ""
@ -342,7 +342,7 @@ msgstr ""
msgid "A column to apply the operations over it"
msgstr ""
#: ../db/db-param.c:251 ../vn/vn-grid.c:357 ../vn/vn-field.c:532
#: ../db/db-param.c:251 ../vn/vn-grid.c:470 ../vn/vn-field.c:532
msgid "Iterator"
msgstr ""
@ -350,7 +350,7 @@ msgstr ""
msgid "The iterator owner of param"
msgstr ""
#: ../db/db-param.c:258 ../vn/vn-column.c:387
#: ../db/db-param.c:258 ../vn/vn-column.c:426
msgid "Column index"
msgstr ""
@ -358,11 +358,11 @@ msgstr ""
msgid "The referenced column index"
msgstr ""
#: ../db/db-param.c:265 ../vn/vn-field.c:539 ../vn/vn-column.c:394
#: ../db/db-param.c:265 ../vn/vn-field.c:539 ../vn/vn-column.c:433
msgid "Column name"
msgstr "Nom de la columna"
#: ../db/db-param.c:266 ../vn/vn-column.c:395
#: ../db/db-param.c:266 ../vn/vn-column.c:434
msgid "The referenced column name"
msgstr "Nom de la columna referenciada"
@ -402,8 +402,8 @@ msgstr ""
msgid "The path where query files are located"
msgstr ""
#: ../db/db-conn.c:1051 ../db/db-file-loader.c:724
#: ../vn/column/vn-column-image.c:477
#: ../db/db-conn.c:1051 ../db/db-file-loader.c:715
#: ../vn/column/vn-column-image.c:489
msgid "Host"
msgstr ""
@ -460,43 +460,43 @@ msgstr ""
msgid "The GError, if an error ocurred"
msgstr ""
#: ../db/db-file-loader.c:333
#: ../db/db-file-loader.c:330
#, c-format
msgid "%s not cached"
msgstr ""
#: ../db/db-file-loader.c:431
#: ../db/db-file-loader.c:426
#, c-format
msgid "Unknown content length of file %s"
msgstr ""
#: ../db/db-file-loader.c:725 ../vn/column/vn-column-image.c:478
#: ../db/db-file-loader.c:716 ../vn/column/vn-column-image.c:490
msgid "The host web server name to get the images"
msgstr ""
#: ../db/db-file-loader.c:732 ../vn/column/vn-column-image.c:485
#: ../db/db-file-loader.c:723 ../vn/column/vn-column-image.c:497
msgid "Path"
msgstr ""
#: ../db/db-file-loader.c:733
#: ../db/db-file-loader.c:724
msgid "The path of the directory to interact with"
msgstr ""
#: ../db/db-file-loader.c:740
#: ../db/db-file-loader.c:731
msgid "Cache directory"
msgstr ""
#: ../db/db-file-loader.c:741
#: ../db/db-file-loader.c:732
msgid ""
"The local directory where the downloaded files will be stored. The default "
"cache directory is 'hedera', under g_get_user_cache_dir()."
msgstr ""
#: ../db/db-file-loader.c:749
#: ../db/db-file-loader.c:740
msgid "Maximal cache size"
msgstr ""
#: ../db/db-file-loader.c:750
#: ../db/db-file-loader.c:741
msgid "The maximal size for the contents of the cache directory"
msgstr ""
@ -566,7 +566,7 @@ msgstr "Funció vn_model_set_sort_func no implementada"
msgid "Function vn_model_set_default_sort_func not implemented"
msgstr "Funció vn_model_set_default_sort_func no implementada"
#: ../vn/vn-grid.c:358
#: ../vn/vn-grid.c:471
msgid "The iterator used by VnGrid"
msgstr ""
@ -699,7 +699,7 @@ msgstr ""
msgid "Whether the field value is user editable"
msgstr ""
#: ../vn/vn-field.c:561 ../vn/vn-column.c:409
#: ../vn/vn-field.c:561 ../vn/vn-column.c:448
msgid "Whether the field value can be of type GVN_TYPE_NULL"
msgstr ""
@ -788,14 +788,22 @@ msgstr ""
msgid "A GBytes structure with the image data"
msgstr ""
#: ../vn/vn-column.c:388
#: ../vn/vn-column.c:427
msgid "The column index in the model"
msgstr ""
#: ../vn/vn-column.c:402
#: ../vn/vn-column.c:441
msgid "Whether the column values are editable"
msgstr ""
#: ../vn/vn-column.c:454
msgid "Tab index"
msgstr ""
#: ../vn/vn-column.c:455
msgid "Order in which the tab selects the columns for edition"
msgstr ""
#: ../vn/column/vn-column-spin.c:130
msgid "Climb rate"
msgstr ""
@ -812,25 +820,25 @@ msgstr ""
msgid "The field number of the Grid model used to sort the column"
msgstr ""
#: ../vn/column/vn-column-image.c:486
#: ../vn/column/vn-column-image.c:498
msgid "Base path from the host where the images will be downloaded"
msgstr ""
#: ../vn/column/vn-column-image.c:493
#: ../vn/column/vn-column-image.c:505
msgid "Tooltip path"
msgstr ""
#: ../vn/column/vn-column-image.c:494
#: ../vn/column/vn-column-image.c:506
msgid ""
"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"
msgstr ""
#: ../vn/column/vn-column-image.c:503
#: ../vn/column/vn-column-image.c:515
msgid "Tooltip size"
msgstr ""
#: ../vn/column/vn-column-image.c:504
#: ../vn/column/vn-column-image.c:516
msgid ""
"Size of the bigger side of the tooltip images, the another side will be "
"scaled accordingly and smaller images won't be scaled"
@ -1140,7 +1148,11 @@ msgstr ""
msgid "Rollback"
msgstr ""
#: ../module/src/vn-consulter.c:207
#: ../module/data/consulter.glade.h:11
msgid "∞"
msgstr ""
#: ../module/src/vn-consulter.c:234
msgid "Type or select a query"
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-21 09:24+0200\n"
"POT-Creation-Date: 2013-11-05 10:03+0100\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"
@ -166,7 +166,7 @@ msgstr "Tipo Glib"
msgid "The type of the value"
msgstr "El tipo del valor"
#: ../gvn/gvn-param.c:485 ../vn/vn-field.c:553 ../vn/vn-column.c:401
#: ../gvn/gvn-param.c:485 ../vn/vn-field.c:553 ../vn/vn-column.c:440
msgid "Editable"
msgstr "Editable"
@ -174,7 +174,7 @@ msgstr "Editable"
msgid "Whether the param value can be modified"
msgstr "Indica si el parámetro puede modificarse"
#: ../gvn/gvn-param.c:492 ../vn/vn-field.c:560 ../vn/vn-column.c:408
#: ../gvn/gvn-param.c:492 ../vn/vn-field.c:560 ../vn/vn-column.c:447
msgid "Null"
msgstr "Nulo"
@ -350,7 +350,7 @@ msgstr "Columna"
msgid "A column to apply the operations over it"
msgstr "Una columna sobre la que se aplicarán las operaciones"
#: ../db/db-param.c:251 ../vn/vn-grid.c:357 ../vn/vn-field.c:532
#: ../db/db-param.c:251 ../vn/vn-grid.c:470 ../vn/vn-field.c:532
msgid "Iterator"
msgstr "Iterator"
@ -358,7 +358,7 @@ msgstr "Iterator"
msgid "The iterator owner of param"
msgstr "El Iterator dueño del parámetro"
#: ../db/db-param.c:258 ../vn/vn-column.c:387
#: ../db/db-param.c:258 ../vn/vn-column.c:426
msgid "Column index"
msgstr "Posición"
@ -366,11 +366,11 @@ msgstr "Posición"
msgid "The referenced column index"
msgstr "La posición de la columna en el Grid"
#: ../db/db-param.c:265 ../vn/vn-field.c:539 ../vn/vn-column.c:394
#: ../db/db-param.c:265 ../vn/vn-field.c:539 ../vn/vn-column.c:433
msgid "Column name"
msgstr "Nombre de la columna"
#: ../db/db-param.c:266 ../vn/vn-column.c:395
#: ../db/db-param.c:266 ../vn/vn-column.c:434
msgid "The referenced column name"
msgstr ""
"El nombre del campo en el Iterator vinculado al Grid al que pretenece la "
@ -412,8 +412,8 @@ msgstr "Ruta de consultas"
msgid "The path where query files are located"
msgstr "La ruta donde se encuentran los archivos de consultas"
#: ../db/db-conn.c:1051 ../db/db-file-loader.c:724
#: ../vn/column/vn-column-image.c:477
#: ../db/db-conn.c:1051 ../db/db-file-loader.c:715
#: ../vn/column/vn-column-image.c:489
msgid "Host"
msgstr "Host"
@ -470,33 +470,33 @@ msgstr "Error"
msgid "The GError, if an error ocurred"
msgstr "El GError, si ha habido algún error"
#: ../db/db-file-loader.c:333
#: ../db/db-file-loader.c:330
#, c-format
msgid "%s not cached"
msgstr "No se ha guardado %s en la cache"
#: ../db/db-file-loader.c:431
#: ../db/db-file-loader.c:426
#, c-format
msgid "Unknown content length of file %s"
msgstr "Longitud del contenido del archivo %s desconocida"
#: ../db/db-file-loader.c:725 ../vn/column/vn-column-image.c:478
#: ../db/db-file-loader.c:716 ../vn/column/vn-column-image.c:490
msgid "The host web server name to get the images"
msgstr "El nombre del servidor web al que se conectará"
#: ../db/db-file-loader.c:732 ../vn/column/vn-column-image.c:485
#: ../db/db-file-loader.c:723 ../vn/column/vn-column-image.c:497
msgid "Path"
msgstr "Ruta"
#: ../db/db-file-loader.c:733
#: ../db/db-file-loader.c:724
msgid "The path of the directory to interact with"
msgstr "La ruta del directorio con el que se interactuará"
#: ../db/db-file-loader.c:740
#: ../db/db-file-loader.c:731
msgid "Cache directory"
msgstr "Directorio de caché"
#: ../db/db-file-loader.c:741
#: ../db/db-file-loader.c:732
msgid ""
"The local directory where the downloaded files will be stored. The default "
"cache directory is 'hedera', under g_get_user_cache_dir()."
@ -504,11 +504,11 @@ msgstr ""
"El directorio local en el cual se guardarán los archivos descargados.El "
"directorio por defecto es 'hedera', debajo de g_get_user_cache_dir()."
#: ../db/db-file-loader.c:749
#: ../db/db-file-loader.c:740
msgid "Maximal cache size"
msgstr "Tamaño máximo de la caché"
#: ../db/db-file-loader.c:750
#: ../db/db-file-loader.c:741
msgid "The maximal size for the contents of the cache directory"
msgstr "El tamaño máximo para los contenidos del directorio de caché"
@ -578,7 +578,7 @@ msgstr "Función vn_model_set_sort_func no implementada"
msgid "Function vn_model_set_default_sort_func not implemented"
msgstr "Función vn_model_set_default_sort_func no implementada"
#: ../vn/vn-grid.c:358
#: ../vn/vn-grid.c:471
msgid "The iterator used by VnGrid"
msgstr "El Iterator empleado por VnGrid"
@ -711,7 +711,7 @@ msgstr "El nombre de la columna en el Iterator"
msgid "Whether the field value is user editable"
msgstr "Si el valor de campo puede ser editado por el usuario"
#: ../vn/vn-field.c:561 ../vn/vn-column.c:409
#: ../vn/vn-field.c:561 ../vn/vn-column.c:448
msgid "Whether the field value can be of type GVN_TYPE_NULL"
msgstr "Si el campo puede ser del tipo GVN_TYPE_NULL"
@ -800,14 +800,22 @@ msgstr "Bytes"
msgid "A GBytes structure with the image data"
msgstr "Una estructura GBytes con los datos de la imágen"
#: ../vn/vn-column.c:388
#: ../vn/vn-column.c:427
msgid "The column index in the model"
msgstr "El índice de la columna en el modelo"
#: ../vn/vn-column.c:402
#: ../vn/vn-column.c:441
msgid "Whether the column values are editable"
msgstr "Si el valor de campo puede ser editado por el usuario"
#: ../vn/vn-column.c:454
msgid "Tab index"
msgstr "Tab index"
#: ../vn/vn-column.c:455
msgid "Order in which the tab selects the columns for edition"
msgstr "Orden en el cual el tabulador selecciona las columnas para editar"
#: ../vn/column/vn-column-spin.c:130
msgid "Climb rate"
msgstr "Tasa de subida"
@ -825,15 +833,15 @@ 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 usa para ordenar la columna"
#: ../vn/column/vn-column-image.c:486
#: ../vn/column/vn-column-image.c:498
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."
#: ../vn/column/vn-column-image.c:493
#: ../vn/column/vn-column-image.c:505
msgid "Tooltip path"
msgstr "Ruta del tooltip"
#: ../vn/column/vn-column-image.c:494
#: ../vn/column/vn-column-image.c:506
msgid ""
"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"
@ -842,11 +850,11 @@ msgstr ""
"Empezando desde la ruta de la columna y añadiendo después el nombre de cada "
"celda"
#: ../vn/column/vn-column-image.c:503
#: ../vn/column/vn-column-image.c:515
msgid "Tooltip size"
msgstr "Tamaño del tooltip"
#: ../vn/column/vn-column-image.c:504
#: ../vn/column/vn-column-image.c:516
msgid ""
"Size of the bigger side of the tooltip images, the another side will be "
"scaled accordingly and smaller images won't be scaled"
@ -1171,6 +1179,10 @@ msgstr "Efectuar"
msgid "Rollback"
msgstr "Deshacer"
#: ../module/src/vn-consulter.c:207
#: ../module/data/consulter.glade.h:11
msgid "∞"
msgstr "∞"
#: ../module/src/vn-consulter.c:234
msgid "Type or select a query"
msgstr "Escribe o selecciona la consulta"

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-21 09:24+0200\n"
"POT-Creation-Date: 2013-11-05 10:03+0100\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"
@ -166,7 +166,7 @@ msgstr ""
msgid "The type of the value"
msgstr ""
#: ../gvn/gvn-param.c:485 ../vn/vn-field.c:553 ../vn/vn-column.c:401
#: ../gvn/gvn-param.c:485 ../vn/vn-field.c:553 ../vn/vn-column.c:440
msgid "Editable"
msgstr ""
@ -174,7 +174,7 @@ msgstr ""
msgid "Whether the param value can be modified"
msgstr ""
#: ../gvn/gvn-param.c:492 ../vn/vn-field.c:560 ../vn/vn-column.c:408
#: ../gvn/gvn-param.c:492 ../vn/vn-field.c:560 ../vn/vn-column.c:447
msgid "Null"
msgstr ""
@ -343,7 +343,7 @@ msgstr ""
msgid "A column to apply the operations over it"
msgstr ""
#: ../db/db-param.c:251 ../vn/vn-grid.c:357 ../vn/vn-field.c:532
#: ../db/db-param.c:251 ../vn/vn-grid.c:470 ../vn/vn-field.c:532
msgid "Iterator"
msgstr ""
@ -351,7 +351,7 @@ msgstr ""
msgid "The iterator owner of param"
msgstr ""
#: ../db/db-param.c:258 ../vn/vn-column.c:387
#: ../db/db-param.c:258 ../vn/vn-column.c:426
msgid "Column index"
msgstr ""
@ -359,11 +359,11 @@ msgstr ""
msgid "The referenced column index"
msgstr ""
#: ../db/db-param.c:265 ../vn/vn-field.c:539 ../vn/vn-column.c:394
#: ../db/db-param.c:265 ../vn/vn-field.c:539 ../vn/vn-column.c:433
msgid "Column name"
msgstr ""
#: ../db/db-param.c:266 ../vn/vn-column.c:395
#: ../db/db-param.c:266 ../vn/vn-column.c:434
msgid "The referenced column name"
msgstr ""
@ -403,8 +403,8 @@ msgstr ""
msgid "The path where query files are located"
msgstr ""
#: ../db/db-conn.c:1051 ../db/db-file-loader.c:724
#: ../vn/column/vn-column-image.c:477
#: ../db/db-conn.c:1051 ../db/db-file-loader.c:715
#: ../vn/column/vn-column-image.c:489
msgid "Host"
msgstr ""
@ -461,43 +461,43 @@ msgstr ""
msgid "The GError, if an error ocurred"
msgstr ""
#: ../db/db-file-loader.c:333
#: ../db/db-file-loader.c:330
#, c-format
msgid "%s not cached"
msgstr ""
#: ../db/db-file-loader.c:431
#: ../db/db-file-loader.c:426
#, c-format
msgid "Unknown content length of file %s"
msgstr ""
#: ../db/db-file-loader.c:725 ../vn/column/vn-column-image.c:478
#: ../db/db-file-loader.c:716 ../vn/column/vn-column-image.c:490
msgid "The host web server name to get the images"
msgstr ""
#: ../db/db-file-loader.c:732 ../vn/column/vn-column-image.c:485
#: ../db/db-file-loader.c:723 ../vn/column/vn-column-image.c:497
msgid "Path"
msgstr ""
#: ../db/db-file-loader.c:733
#: ../db/db-file-loader.c:724
msgid "The path of the directory to interact with"
msgstr ""
#: ../db/db-file-loader.c:740
#: ../db/db-file-loader.c:731
msgid "Cache directory"
msgstr ""
#: ../db/db-file-loader.c:741
#: ../db/db-file-loader.c:732
msgid ""
"The local directory where the downloaded files will be stored. The default "
"cache directory is 'hedera', under g_get_user_cache_dir()."
msgstr ""
#: ../db/db-file-loader.c:749
#: ../db/db-file-loader.c:740
msgid "Maximal cache size"
msgstr ""
#: ../db/db-file-loader.c:750
#: ../db/db-file-loader.c:741
msgid "The maximal size for the contents of the cache directory"
msgstr ""
@ -567,7 +567,7 @@ msgstr ""
msgid "Function vn_model_set_default_sort_func not implemented"
msgstr ""
#: ../vn/vn-grid.c:358
#: ../vn/vn-grid.c:471
msgid "The iterator used by VnGrid"
msgstr ""
@ -700,7 +700,7 @@ msgstr ""
msgid "Whether the field value is user editable"
msgstr ""
#: ../vn/vn-field.c:561 ../vn/vn-column.c:409
#: ../vn/vn-field.c:561 ../vn/vn-column.c:448
msgid "Whether the field value can be of type GVN_TYPE_NULL"
msgstr ""
@ -789,14 +789,22 @@ msgstr ""
msgid "A GBytes structure with the image data"
msgstr ""
#: ../vn/vn-column.c:388
#: ../vn/vn-column.c:427
msgid "The column index in the model"
msgstr ""
#: ../vn/vn-column.c:402
#: ../vn/vn-column.c:441
msgid "Whether the column values are editable"
msgstr ""
#: ../vn/vn-column.c:454
msgid "Tab index"
msgstr ""
#: ../vn/vn-column.c:455
msgid "Order in which the tab selects the columns for edition"
msgstr ""
#: ../vn/column/vn-column-spin.c:130
msgid "Climb rate"
msgstr ""
@ -813,25 +821,25 @@ msgstr ""
msgid "The field number of the Grid model used to sort the column"
msgstr ""
#: ../vn/column/vn-column-image.c:486
#: ../vn/column/vn-column-image.c:498
msgid "Base path from the host where the images will be downloaded"
msgstr ""
#: ../vn/column/vn-column-image.c:493
#: ../vn/column/vn-column-image.c:505
msgid "Tooltip path"
msgstr ""
#: ../vn/column/vn-column-image.c:494
#: ../vn/column/vn-column-image.c:506
msgid ""
"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"
msgstr ""
#: ../vn/column/vn-column-image.c:503
#: ../vn/column/vn-column-image.c:515
msgid "Tooltip size"
msgstr ""
#: ../vn/column/vn-column-image.c:504
#: ../vn/column/vn-column-image.c:516
msgid ""
"Size of the bigger side of the tooltip images, the another side will be "
"scaled accordingly and smaller images won't be scaled"
@ -1139,6 +1147,10 @@ msgstr ""
msgid "Rollback"
msgstr ""
#: ../module/src/vn-consulter.c:207
#: ../module/data/consulter.glade.h:11
msgid "∞"
msgstr ""
#: ../module/src/vn-consulter.c:234
msgid "Type or select a query"
msgstr ""

View File

@ -142,8 +142,7 @@ static gboolean vn_column_image_on_query_tooltip (GtkTreeView * view,
GtkTreeIter iter;
GtkTreePath * path = NULL;
if (//&& obj && VN_IS_COLUMN_IMAGE (obj)
gtk_tree_view_get_tooltip_context (view, &x, &y, k, NULL, &path, &iter))
if (gtk_tree_view_get_tooltip_context (view, &x, &y, k, NULL, &path, &iter))
{
gint wx, wy;
GdkRectangle rect;
@ -266,6 +265,18 @@ static void vn_column_image_set_value (VnColumnImage * obj, GtkTreeModel * model
GtkTreeView * view = GTK_TREE_VIEW
(gtk_tree_view_column_get_tree_view (GTK_TREE_VIEW_COLUMN (obj)));
if (view != obj->tree_view)
{
if (GTK_IS_TREE_VIEW (obj->tree_view))
g_signal_handlers_disconnect_by_func (obj->tree_view,
vn_column_image_on_query_tooltip, obj);
g_signal_connect (view, "query-tooltip",
G_CALLBACK (vn_column_image_on_query_tooltip), obj);
g_object_set (view, "has-tooltip", TRUE, NULL);
obj->tree_view = view;
}
if (obj->loaded)
{
if (g_hash_table_contains (obj->loaded, name))
@ -324,14 +335,9 @@ static void vn_column_image_set_value (VnColumnImage * obj, GtkTreeModel * model
obj->loader = db_file_loader_new (obj->host, obj->path);
if (obj->tooltip_path && !obj->tooltips)
{
obj->tooltips = g_hash_table_new_full
((GHashFunc) g_direct_hash, (GEqualFunc) g_direct_equal,
(GDestroyNotify) NULL, (GDestroyNotify) free_tooltip_data);
g_object_set (view, "has-tooltip", TRUE, NULL);
g_signal_connect (view, "query-tooltip",
G_CALLBACK (vn_column_image_on_query_tooltip), obj);
}
data = g_new (DownloadData, 1);
data->obj = g_object_ref (obj);
@ -354,12 +360,7 @@ static void vn_column_image_on_model_changed (VnColumnImage * obj)
g_hash_table_destroy (obj->loaded);
if (obj->tooltips)
{
g_hash_table_destroy (obj->tooltips);
g_signal_handlers_disconnect_by_func (GTK_TREE_VIEW
(gtk_tree_view_column_get_tree_view (GTK_TREE_VIEW_COLUMN (obj))),
vn_column_image_on_query_tooltip, obj);
}
obj->loaded = NULL;
obj->tooltips = NULL;
@ -444,6 +445,7 @@ static void vn_column_image_init (VnColumnImage * obj)
obj->loader = NULL;
obj->loaded = NULL;
obj->tooltips = NULL;
obj->tree_view = NULL;
}
static void vn_column_image_finalize (VnColumnImage * obj)
@ -455,7 +457,7 @@ static void vn_column_image_finalize (VnColumnImage * obj)
if (obj->loader)
{
db_file_loader_cancel_all (obj->loader);
g_object_unref (obj->loader);//XXX
g_object_unref (obj->loader);
}
if (obj->loaded)
@ -464,6 +466,10 @@ static void vn_column_image_finalize (VnColumnImage * obj)
if (obj->tooltips)
g_hash_table_destroy (obj->tooltips);
if (GTK_IS_TREE_VIEW (obj->tree_view))
g_signal_handlers_disconnect_by_func (obj->tree_view,
vn_column_image_on_query_tooltip, obj);
G_OBJECT_CLASS (vn_column_image_parent_class)->finalize (G_OBJECT (obj));
}

View File

@ -44,6 +44,7 @@ struct _VnColumnImage
DbFileLoader * loader;
GHashTable * loaded;
GHashTable * tooltips;
GtkTreeView * tree_view;
};
struct _VnColumnImageClass

View File

@ -223,6 +223,39 @@ void vn_column_set_null (VnColumn * obj, gboolean null)
VN_COLUMN_GET_CLASS (obj)->set_null (obj, null);
}
/**
* vn_column_get_tab_index
* @obj: the #VnColumn
*
* Sets the order in which the column will be selected while pressing Tab across
* the #VnGrid.
*
* Return value: the index of the column
**/
int vn_column_get_tab_index (VnColumn * obj)
{
g_return_if_fail (VN_IS_COLUMN (obj));
return obj->tab_index;
}
/**
* vn_column_set_tab_index
* @obj: the #VnColumn
* @tab_index: the index of the column
*
* Sets the order in which the column will be selected while pressing Tab across
* the #VnGrid. If the column is not editable, tab-index will be ignored bt the
* #VnGrid, as the column can't be edited (i.e. not accessible through pressing
* Tab).
**/
void vn_column_set_tab_index (VnColumn * obj, gint tab_index)
{
g_return_if_fail (VN_IS_COLUMN (obj));
obj->tab_index = tab_index;
}
/**
* vn_column_get_model:
* @obj: the #VnColumn
@ -309,6 +342,7 @@ enum
,PROP_COLUMN_NAME
,PROP_EDITABLE
,PROP_NULL
,PROP_TAB_INDEX
};
static void vn_column_set_property (VnColumn * obj, guint id,
@ -328,6 +362,9 @@ static void vn_column_set_property (VnColumn * obj, guint id,
case PROP_NULL:
vn_column_set_null (obj, g_value_get_boolean (value));
break;
case PROP_TAB_INDEX:
vn_column_set_tab_index (obj, g_value_get_int (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, id, pspec);
}
@ -350,6 +387,9 @@ static void vn_column_get_property (VnColumn * obj, guint id,
case PROP_NULL:
g_value_set_boolean (value, obj->null);
break;
case PROP_TAB_INDEX:
g_value_set_int (value, obj->tab_index);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, id, pspec);
}
@ -409,4 +449,11 @@ static void vn_column_class_init (VnColumnClass * klass)
,FALSE
,G_PARAM_CONSTRUCT | G_PARAM_READWRITE
));
g_object_class_install_property (k, PROP_TAB_INDEX,
g_param_spec_int ("tab-index"
,_("Tab index")
,_("Order in which the tab selects the columns for edition")
,-1, 255, 0
,G_PARAM_CONSTRUCT | G_PARAM_READWRITE
));
}

View File

@ -47,6 +47,7 @@ struct _VnColumn
gchar * column_name;
gboolean editable;
gboolean null;
gint tab_index;
VnColumnSetValueFunc set_value;
};
@ -70,6 +71,8 @@ gboolean vn_column_get_editable (VnColumn * obj);
void vn_column_set_editable (VnColumn * obj, gboolean editable);
gboolean vn_column_get_null (VnColumn * obj);
void vn_column_set_null (VnColumn * obj, gboolean null);
int vn_column_get_tab_index (VnColumn * obj);
void vn_column_set_tab_index (VnColumn * obj, gint tab_index);
DbModel * vn_column_get_model (VnColumn * obj);
gboolean vn_column_get_iter (VnColumn * obj, const gchar * path, DbIter * iter);
void vn_column_model_changed (VnColumn * obj);

View File

@ -121,123 +121,109 @@ static void vn_grid_on_status_changed (DbIterator * iterator, gboolean ready, Vn
static gboolean vn_grid_on_cursor_key_pressed (GtkTreeView * obj,
GdkEventKey * event, gpointer data)
{
guint count, i;
gboolean inverted;
gboolean passed = FALSE;
gint sel_tab_index;
VnColumn * first = NULL;
GList * n, * columns;
GtkTreePath * path;
GtkTreeViewColumn * col, * next_col = NULL;
GtkTreeViewColumn * col;
VnColumn * selected, * next = NULL;
GtkCellArea * area;
GtkCellEditable * editable;
if (!(event->type == GDK_KEY_PRESS
&& (event->keyval == GDK_KEY_Tab || event->keyval == GDK_KEY_ISO_Left_Tab)))
&& (event->keyval == GDK_KEY_Tab
|| event->keyval == GDK_KEY_ISO_Left_Tab
|| event->keyval == GDK_KEY_KP_Enter)))
return FALSE;
gtk_tree_view_get_cursor (obj, &path, &col);
selected = VN_COLUMN (col);
g_object_get (col, "cell-area", &area, NULL);
gtk_cell_editable_editing_done (gtk_cell_area_get_edit_widget (area));
editable = gtk_cell_area_get_edit_widget (area);
if (editable)
gtk_cell_editable_editing_done (editable);
g_object_unref (area);
columns = gtk_tree_view_get_columns (obj);
count = gtk_tree_view_get_n_columns (obj);
inverted = event->keyval == GDK_KEY_ISO_Left_Tab ? TRUE : FALSE;
sel_tab_index = vn_column_get_tab_index (selected);
first = NULL;
if (event->keyval == GDK_KEY_Tab)
for (n = columns; n; n = n->next)
{
i = 0;
gint cur_tab_index;
VnColumn * current = n->data;
for (n = columns; n; n = n->next, i++)
if (n->data == col)
if (current == selected)
passed = TRUE;
else if (VN_IS_COLUMN (current)
&& vn_column_get_editable (current)
&& (cur_tab_index = vn_column_get_tab_index (current)) != -1)
{
if (n->next && i + 1 < gtk_tree_view_get_n_columns (obj))
if (!inverted)
{
if (n->next->data && VN_IS_COLUMN (n->next->data)
&& !vn_column_get_editable ((VN_COLUMN (n->next->data))))
if (!first || cur_tab_index < vn_column_get_tab_index (first))
first = current;
if (cur_tab_index == sel_tab_index && passed)
{
col = n->next->data;
continue;
next = current;
break;
}
if ((!next || cur_tab_index < vn_column_get_tab_index (next))
&& cur_tab_index > sel_tab_index)
next = current;
}
else
next_col = n->next->data;
{
if (!first || cur_tab_index >= vn_column_get_tab_index (first))
first = current;
if ((cur_tab_index == sel_tab_index && !passed)
|| (cur_tab_index < sel_tab_index
&& (!next || cur_tab_index >= vn_column_get_tab_index (next))))
next = current;
}
}
}
if (!next)
{
gboolean leave = FALSE;
next = first ? first : selected;
if (inverted)
leave = !gtk_tree_path_prev (path);
else
{
gtk_tree_path_next (path);
if (VN_IS_COLUMN (columns->data)
&& !vn_column_get_editable ((VN_COLUMN (columns->data))))
if (gtk_tree_path_get_indices (path)[0] >=
db_model_get_nrows (VN_GRID (obj)->model))
{
for (n = columns->next; n; n = n->next)
if (n->data && VN_IS_COLUMN (n->data)
&& vn_column_get_editable ((VN_COLUMN (n->data))))
{
next_col = n->data;
break;
}
}
if (db_model_get_update_flags (VN_GRID (obj)->model) &
DB_MODEL_INSERT)
db_iterator_insert (VN_GRID (obj)->iterator);
else
next_col = columns->data;
leave = TRUE;
}
}
if (gtk_tree_path_get_indices (path)[0] >= db_model_get_nrows
(VN_GRID (obj)->model))
if (leave)
{
gtk_tree_path_free (path);
return FALSE;
}
}
break;
}
}
else // Shift + Tab pressed
{
GList * inv_columns = g_list_last (columns);
i = count - 1;
for (n = inv_columns; n; n = n->prev, i--)
if (n->data == col)
{
if (n->prev && i > 0)
{
if (n->prev->data && VN_IS_COLUMN (n->prev->data)
&& !vn_column_get_editable ((VN_COLUMN (n->prev->data))))
{
col = n->prev->data;
continue;
}
else
next_col = n->prev->data;
}
else
{
gint current = gtk_tree_path_get_indices (path)[0];
gtk_tree_path_prev (path);
if (VN_IS_COLUMN (inv_columns->data)
&& !vn_column_get_editable ((VN_COLUMN (inv_columns->data))))
{
for (n = inv_columns->prev; n; n = n->prev)
if (n->data && VN_IS_COLUMN (n->data)
&& vn_column_get_editable ((VN_COLUMN (n->data))))
{
next_col = n->data;
break;
}
}
else
next_col = inv_columns->data;
if (current == 0 && gtk_tree_path_get_indices (path)[0] == 0)
{
gtk_tree_path_free (path);
return FALSE;
}
}
break;
}
}
g_list_free (columns);
gtk_tree_view_set_cursor (obj, path, next_col, TRUE);
gtk_tree_view_set_cursor (obj, path, GTK_TREE_VIEW_COLUMN (next), TRUE);
gtk_tree_path_free (path);
return TRUE;