diff --git a/anjuta/Makefile.am b/anjuta/Makefile.am index 344a7be..8bc7e54 100644 --- a/anjuta/Makefile.am +++ b/anjuta/Makefile.am @@ -9,8 +9,7 @@ template_DATA = \ hedera/anjuta.session.tpl \ hedera/AUTHORS.tpl \ hedera/configure.ac.tpl \ - hedera/Makefile.am.tpl \ - hedera/translation + hedera/Makefile.am.tpl anjuta_srcdir = $(templatedir)/src anjuta_src_DATA = \ diff --git a/anjuta/hedera/Makefile.am.tpl b/anjuta/hedera/Makefile.am.tpl index 1b83a10..7450f69 100644 --- a/anjuta/hedera/Makefile.am.tpl +++ b/anjuta/hedera/Makefile.am.tpl @@ -25,7 +25,9 @@ SUBDIRS = \ translationsdir = translations_DATA = \ - po/es.po + po/es.po \ + po/POTFILES.in \ + po/POTFILES.skip [+ENDIF+] EXTRA_DIST = \ README \ diff --git a/anjuta/hedera/data/mod-menu.xml.tpl b/anjuta/hedera/data/mod-menu.xml.tpl index f0969ea..27dfca1 100644 --- a/anjuta/hedera/data/mod-menu.xml.tpl +++ b/anjuta/hedera/data/mod-menu.xml.tpl @@ -1,12 +1,12 @@ [+ autogen5 template +] - + - [+FormClassName+] - win.open-form - [+FormName+] - F1 + [+FormClassName+] + win.open-form + [+FormName+] + F1 diff --git a/anjuta/hedera/translation b/anjuta/hedera/translation deleted file mode 100755 index e4b9ac0..0000000 --- a/anjuta/hedera/translation +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash - -getopt -Q \ - -o "hua:" \ - -l "help,update,add:" \ - -n "./translation" \ - -- $@ - -case "$1" in - -u|--update|'') - cd ./po - intltool-update -r - cd .. - ;; - - -a|--add) - arg=$2 - - if [ -z $arg ]; then - exit 1; - elif [ ${#arg} -lt 2 ]; then - echo "./translation: language codes are at least two characters long." > /dev/stderr - exit 1; - fi - - msginit -i po/*.pot -o po/$arg.po -l $arg.utf8 - echo $arg >> po/LINGUAS - #sort po/LINGUAS -o po/LINGUAS - ;; - - -h|--help) - echo -e \ -"Translation helper script. - Note that only the first option is used. If no option is -passed the '\033[1m-u\033[0m' option is used by default. - Options: - \033[1m-u, --update\033[0m - Update the currently existing translations and - the translations template. Also reports the current - status of the translations. - \033[1m-a, --add\033[0m \033[4mlang\033[0m - Add a new translation for the \033[4mlang\033[0m language - (using the gettext language and country codes), the - charset will automatically be set to UTF-8. You will - be asked to select your e-mail from a list. - \033[1m-h, --help\033[0m - Print this help text and exit." - ;; -esac diff --git a/db/db-model-holder.c b/db/db-model-holder.c index f4a3c2a..599c62a 100644 --- a/db/db-model-holder.c +++ b/db/db-model-holder.c @@ -29,7 +29,7 @@ * db_model_holder_get_model() and db_model_holder_set_model() methods. **/ -G_DEFINE_INTERFACE (DbModelHolder, db_model_holder, G_TYPE_INVALID); +G_DEFINE_INTERFACE (DbModelHolder, db_model_holder, G_TYPE_OBJECT); /** * db_model_holder_get_model: diff --git a/glade/Makefile.am b/glade/Makefile.am index df17d6a..8263d1a 100644 --- a/glade/Makefile.am +++ b/glade/Makefile.am @@ -15,6 +15,7 @@ libgladevn_la_LDFLAGS = -avoid-version libgladevn_la_SOURCES = \ glade-vn.h \ glade-vn.c \ + glade-sql-batch.c \ glade-vn-set.c \ glade-db-model.c \ glade-db-model-editor.h \ diff --git a/glade/glade-db-model-editor.c b/glade/glade-db-model-editor.c index 8cfbf2c..2a996c2 100644 --- a/glade/glade-db-model-editor.c +++ b/glade/glade-db-model-editor.c @@ -19,13 +19,22 @@ //+++++++++++++++++++++++++++++++++++++++++++++++++++ GladeModelEditor -static void glade_model_editor_add_list_eprop (GladeModelEditor * obj, - GladeWidgetAdaptor * adaptor, const gchar * name, const gchar * tooltip) +GtkWidget * glade_model_editor_new (GladeWidgetAdaptor * adaptor, + GladeEditable * editable) { GtkWidget * frame, * alignment, * vbox; - GladeEditorProperty * eprop = - glade_widget_adaptor_create_eprop_by_name (adaptor, name, FALSE, TRUE); + GladeEditorProperty * eprop; + GladeModelEditor * obj; + g_return_val_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor), NULL); + g_return_val_if_fail (GLADE_IS_EDITABLE (editable), NULL); + + obj = g_object_new (GLADE_TYPE_MODEL_EDITOR, + "orientation", GTK_ORIENTATION_VERTICAL, NULL); + obj->base = GTK_WIDGET (editable); + gtk_box_pack_start (GTK_BOX (obj), GTK_WIDGET (editable), TRUE, TRUE, 0); + + eprop = glade_widget_adaptor_create_eprop_by_name (adaptor, "links", FALSE, TRUE); obj->props = g_list_prepend (obj->props, eprop); frame = gtk_frame_new (NULL); @@ -42,27 +51,7 @@ static void glade_model_editor_add_list_eprop (GladeModelEditor * obj, gtk_container_add (GTK_CONTAINER (alignment), vbox); gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (eprop), FALSE, FALSE, 4); - gtk_widget_set_tooltip_text (vbox, tooltip); -} - -GtkWidget * glade_model_editor_new (GladeWidgetAdaptor * adaptor, - GladeEditable * editable) -{ - GladeModelEditor * obj; - - g_return_val_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor), NULL); - g_return_val_if_fail (GLADE_IS_EDITABLE (editable), NULL); - - obj = g_object_new (GLADE_TYPE_MODEL_EDITOR, - "orientation", GTK_ORIENTATION_VERTICAL, NULL); - obj->base = GTK_WIDGET (editable); - gtk_box_pack_start (GTK_BOX (obj), GTK_WIDGET (editable), TRUE, TRUE, 0); - - glade_model_editor_add_list_eprop (obj, adaptor, "links", - _("List of parameters linked to the model")); - - glade_model_editor_add_list_eprop (obj, adaptor, "batch", - _("List of SqlHolders and identifiers")); + gtk_widget_set_tooltip_text (vbox, _("List of parameters linked to the model")); gtk_widget_show_all (GTK_WIDGET (obj)); return GTK_WIDGET (obj); @@ -112,6 +101,8 @@ static void glade_model_editor_class_init (GladeModelEditorClass * k) static void glade_model_editor_init (GladeModelEditor * obj) { + obj->props = NULL; + obj->base = NULL; } static void glade_model_editor_editable_init (GladeEditableIface * iface) @@ -122,26 +113,3 @@ static void glade_model_editor_editable_init (GladeEditableIface * iface) G_DEFINE_TYPE_WITH_CODE (GladeModelEditor, glade_model_editor, GTK_TYPE_BOX, G_IMPLEMENT_INTERFACE (GLADE_TYPE_EDITABLE, glade_model_editor_editable_init)); - -//+++++++++++++++++++++++++++++++++++++++++++++++++++ GladeDbList - -G_DEFINE_BOXED_TYPE (GladeDbList, glade_db_list, glade_db_list_copy, glade_db_list_free); - -void glade_db_list_free (GladeDbList * list) -{ - if (!list) - return; - - if (list->list) - g_object_unref (list->list); - - g_free (list); - list = NULL; -} - -GladeDbList * glade_db_list_copy (const GladeDbList * list) -{ - GladeDbList * l = g_new (GladeDbList, 1); - l->list = list->list ? g_object_ref (list->list) : NULL; - return l; -} diff --git a/glade/glade-db-model-editor.h b/glade/glade-db-model-editor.h index 07809e9..44c3cc0 100644 --- a/glade/glade-db-model-editor.h +++ b/glade/glade-db-model-editor.h @@ -47,17 +47,4 @@ GType glade_model_editor_get_type (void) G_GNUC_CONST; GtkWidget * glade_model_editor_new (GladeWidgetAdaptor * adaptor, GladeEditable * editable); -#define GLADE_TYPE_DB_LIST (glade_db_list_get_type()) - -typedef struct _GladeDbList GladeDbList; - -struct _GladeDbList -{ - GtkListStore * list; -}; - -GType glade_db_list_get_type (void) G_GNUC_CONST; -void glade_db_list_free (GladeDbList * list); -GladeDbList * glade_db_list_copy (const GladeDbList * list); - #endif diff --git a/glade/glade-db-model.c b/glade/glade-db-model.c index 2a2648c..e45194a 100644 --- a/glade/glade-db-model.c +++ b/glade/glade-db-model.c @@ -46,6 +46,8 @@ typedef struct GtkWidget * entry; gint width; gint height; + gint x; + gint y; } GladeEPropSql; @@ -57,18 +59,87 @@ GLADE_MAKE_EPROP (GladeEPropSql, glade_eprop_sql) #define GLADE_IS_EPROP_SQL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GLADE_TYPE_EPROP_SQL)) #define GLADE_EPROP_SQL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GLADE_EPROP_SQL, GladeEPropSqlClass)) +typedef struct +{ + GladeEditorProperty * eprop; + GtkTextBuffer * buffer; +} +SqlEditorData; + +void glade_eprop_sql_set_text_from_buffer (GladeEditorProperty * eprop, GtkTextBuffer * buffer) +{ + gchar * sql; + GValue val = G_VALUE_INIT; + GladeProperty * p = glade_editor_property_get_property (eprop); + GtkTextIter * start = g_new (GtkTextIter, 1), + * end = g_new (GtkTextIter, 1); + g_value_init (&val, G_TYPE_STRING); + + gtk_text_buffer_get_bounds (buffer, start, end); + sql = gtk_text_buffer_get_text (buffer, start, end, TRUE); + g_value_set_string (&val, sql); + glade_command_set_property_value (p, &val); + + g_value_unset (&val); + g_free (start); + g_free (end); +} + +static gboolean glade_eprop_sql_editor_save (GladeEditorProperty * eprop, + GtkTextBuffer * buffer) +{ + GladeProperty * p = glade_editor_property_get_property (eprop); + GladeWidget * widget = glade_property_get_widget (p); + GladeProject * project = glade_widget_get_project (widget); + const gchar * path = glade_project_get_path (project); + + glade_eprop_sql_set_text_from_buffer (eprop, buffer); + + if (!path) + { + GtkWidget * dialog = glade_util_file_dialog_new (_("Save as...") + ,project + ,GTK_WINDOW (glade_app_get_window ()) + ,GLADE_FILE_DIALOG_ACTION_SAVE); + + if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK) + path = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); + + gtk_widget_destroy (dialog); + } + + return path ? glade_project_save (project, path, NULL) : FALSE; +} + +static void glade_eprop_sql_on_editor_save_clicked (GtkToolButton * button, + SqlEditorData * data) +{ + glade_eprop_sql_editor_save (data->eprop, data->buffer); +} + +static gboolean glade_eprop_sql_on_editor_key_pressed (GtkWidget * widget, + GdkEventKey * event, SqlEditorData * data) +{ + if (event->state & GDK_CONTROL_MASK + && (event->keyval == GDK_KEY_S || event->keyval == GDK_KEY_s)) + return glade_eprop_sql_editor_save (data->eprop, data->buffer); + return FALSE; +} + static void glade_eprop_sql_show_dialog (GtkButton * button, GladeEditorProperty * eprop) { gpointer text, buffer; const gchar * sql; GladeEPropSql * obj = GLADE_EPROP_SQL (eprop); PangoFontDescription * font; - GtkWidget * scroll; + GtkWidget * dialog_area, * scroll, * toolbar, * item; + GtkStyleContext * context; + SqlEditorData * data; GladeProperty * p = glade_editor_property_get_property (eprop); GtkDialog * dialog = GTK_DIALOG (gtk_dialog_new_with_buttons (_("SQL Editor") - ,GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (eprop))) - ,GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT + ,NULL + ,GTK_DIALOG_DESTROY_WITH_PARENT ,_("OK"), GTK_RESPONSE_OK ,_("Clear"), GTK_RESPONSE_REJECT ,_("Cancel"), GTK_RESPONSE_CANCEL @@ -78,15 +149,19 @@ static void glade_eprop_sql_show_dialog (GtkButton * button, GladeEditorProperty gtk_dialog_set_default_response (dialog, GTK_RESPONSE_OK); gtk_window_set_default_size (GTK_WINDOW (dialog), obj->width, obj->height); + if (obj->x && obj->y) + gtk_window_move (GTK_WINDOW (dialog), obj->x, obj->y); + + dialog_area = gtk_dialog_get_content_area (dialog); + gtk_widget_set_margin_top (dialog_area, 6); + gtk_widget_set_margin_bottom (dialog_area, 6); + gtk_widget_set_margin_start (dialog_area, 6); + gtk_widget_set_margin_end (dialog_area, 6); + scroll = gtk_scrolled_window_new (gtk_adjustment_new (0,0,0,0,0,0), gtk_adjustment_new (0,0,0,0,0,0)); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scroll), GTK_SHADOW_IN); - gtk_widget_set_margin_top (scroll, 6); - gtk_widget_set_margin_bottom (scroll, 6); - gtk_widget_set_margin_start (scroll, 6); - gtk_widget_set_margin_end (scroll, 6); - gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (dialog)), - scroll, TRUE, TRUE, 6); + gtk_box_pack_start (GTK_BOX (dialog_area), scroll, TRUE, TRUE, 0); #ifdef _HAVE_GTKSOURCEVIEW GtkSourceLanguageManager * lm = gtk_source_language_manager_new (); @@ -111,25 +186,38 @@ static void glade_eprop_sql_show_dialog (GtkButton * button, GladeEditorProperty gtk_text_buffer_set_text (buffer, sql, -1); gtk_container_add (GTK_CONTAINER (scroll), text); - gtk_widget_show_all (scroll); + + data = g_new (SqlEditorData, 1); + data->eprop = eprop; + data->buffer = buffer; + + g_signal_connect (dialog, "key-press-event", + G_CALLBACK (glade_eprop_sql_on_editor_key_pressed), data); + + toolbar = gtk_toolbar_new (); + gtk_box_pack_start (GTK_BOX (dialog_area), toolbar, FALSE, TRUE, 0); + + item = GTK_WIDGET (g_object_new (GTK_TYPE_TOOL_BUTTON, + "icon-widget", gtk_image_new_from_icon_name + ("document-save-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR), NULL)); + gtk_widget_set_tooltip_text (item, _("Save project")); + g_signal_connect (item, "clicked", + G_CALLBACK (glade_eprop_sql_on_editor_save_clicked), data); + gtk_container_add (GTK_CONTAINER (toolbar), item); + + context = gtk_widget_get_style_context (scroll); + gtk_style_context_set_junction_sides (context, GTK_JUNCTION_BOTTOM); + context = gtk_widget_get_style_context (toolbar); + gtk_style_context_add_class (context, GTK_STYLE_CLASS_INLINE_TOOLBAR); + gtk_style_context_set_junction_sides (context, GTK_JUNCTION_TOP); + + gtk_widget_show_all (dialog_area); switch (gtk_dialog_run (dialog)) { case GTK_RESPONSE_OK: { - GValue val = G_VALUE_INIT; - GtkTextIter * start = g_new (GtkTextIter, 1), - * end = g_new (GtkTextIter, 1); - g_value_init (&val, G_TYPE_STRING); - gtk_text_buffer_get_bounds (buffer, start, end); - - sql = gtk_text_buffer_get_text (buffer, start, end, TRUE); - g_value_set_string (&val, sql); - glade_command_set_property_value (p, &val); - - g_value_unset (&val); - g_free (start); - g_free (end); + glade_eprop_sql_set_text_from_buffer (eprop, buffer); break; } case GTK_RESPONSE_REJECT: @@ -148,7 +236,9 @@ static void glade_eprop_sql_show_dialog (GtkButton * button, GladeEditorProperty obj->width = gtk_widget_get_allocated_width (GTK_WIDGET (dialog)); obj->height = gtk_widget_get_allocated_height (GTK_WIDGET (dialog)); + gtk_window_get_position (GTK_WINDOW (dialog), &obj->x, &obj->y); gtk_widget_destroy (GTK_WIDGET (dialog)); + g_free (data); } static void glade_eprop_sql_entry_text_changed (GtkEntry * entry, @@ -186,8 +276,10 @@ static GtkWidget * glade_eprop_sql_create_input (GladeEditorProperty * eprop) gtk_widget_show_all (box); - obj->width = 750; - obj->height = 550; + obj->width = 930; + obj->height = 730; + obj->x = 0; + obj->y = 0; return box; } @@ -215,7 +307,8 @@ static void glade_eprop_sql_finalize (GObject * object) GObjectClass * parent_class = g_type_class_peek_parent (G_OBJECT_GET_CLASS (object)); G_OBJECT_CLASS (parent_class)->finalize (object); } -//++++++++++++++++++++++++++++ Structure and prototypes for Links and Batch + +//+++++++++++++++++++++++++++++++++++++++++++++++++++ Links Editor Property typedef struct { @@ -224,19 +317,7 @@ typedef struct GtkTreeView * view; gchar * path; } -GladeListEProp; - -void param_col_cell_data (GtkTreeViewColumn * view, GtkCellRenderer * cell, - GtkTreeModel * model, GtkTreeIter * iter, gpointer data); -static void glade_list_eprop_add_param_column (GladeListEProp * obj); -static void glade_list_eporp_on_string_col_edited (GtkCellRendererText * cell, - gchar * path, const gchar * text, GladeEditorProperty * eprop); -static void glade_list_eprop_create_input (GladeListEProp * obj, GtkWidget * box, - gchar * string); - -//+++++++++++++++++++++++++++++++++++++++++++++++++++ Links Editor Property - -typedef GladeListEProp GladeEPropLinks; +GladeEPropLinks; GLADE_MAKE_EPROP (GladeEPropLinks, glade_eprop_links) #define GLADE_TYPE_EPROP_LINKS (glade_eprop_links_get_type ()) @@ -248,171 +329,66 @@ GLADE_MAKE_EPROP (GladeEPropLinks, glade_eprop_links) enum { - LINKS_FIELD_COL - ,LINKS_PARAM_COL - ,LINKS_LINKED_COL - ,LINKS_N_COLS + FIELD_COL + ,PARAM_COL + ,LINKED_COL + ,N_COLS }; -static void linked_col_cell_data (GtkTreeViewColumn * view, GtkCellRenderer * cell, - GtkTreeModel * model, GtkTreeIter * iter, gpointer data) +static void glade_eprop_links_on_param_col_clicked (GtkEntry * entry, + GtkEntryIconPosition icon_pos, GdkEvent * event, GladeEditorProperty * eprop) { - gboolean val; - gtk_tree_model_get (model, iter, LINKS_LINKED_COL, &val, -1); - gtk_cell_renderer_toggle_set_active (GTK_CELL_RENDERER_TOGGLE (cell), val); -} - -static void glade_eprop_links_on_linked_col_toggled (GtkCellRendererToggle * cell, - gchar * path, GladeEditorProperty * eprop) -{ - gboolean val; GtkTreeIter iter; GladeProperty * p = glade_editor_property_get_property (eprop); - GladeDbList * list = g_value_get_boxed (glade_property_inline_value (p)); - GtkListStore * store = list->list; + GladeWidget * widget = glade_property_get_widget (p); + GladeProject * project = glade_widget_get_project (widget); + GtkListStore * store = ((GladeVnList *) g_value_get_boxed (glade_property_inline_value (p)))->list; + gchar * path = GLADE_EPROP_LINKS (eprop)->path; if (!gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL (store), &iter, path)) return; - gtk_tree_model_get (GTK_TREE_MODEL (store), &iter, LINKS_LINKED_COL, &val, -1); - gtk_list_store_set (store, &iter, LINKS_LINKED_COL, !val, -1); + gtk_tree_model_get (GTK_TREE_MODEL (store), &iter, PARAM_COL, &widget, -1); + + if (glade_editor_property_show_object_dialog (project, + _("Select a GvnParam"), NULL, GVN_TYPE_PARAM, NULL, &widget)) + { + if (widget) + gtk_list_store_set (store, &iter, PARAM_COL, widget, -1); + else + gtk_list_store_set (store, &iter, PARAM_COL, NULL, -1); + } } -static GtkWidget * glade_eprop_links_create_input (GladeEditorProperty * eprop) +static gboolean glade_eprop_links_on_param_key_pressed (GtkEntry * entry, + GdkEventKey * event, GladeEditorProperty * eprop) { - GtkCellRenderer * cell; - GtkTreeViewColumn * column; - GladeEPropLinks * obj = GLADE_EPROP_LINKS (eprop); - GtkWidget * box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2); + if (event->keyval == GDK_KEY_Return) + { + glade_eprop_links_on_param_col_clicked (entry, 0, NULL, eprop); + return TRUE; + } + else if (event->keyval == GDK_KEY_Delete) + { + GtkTreeIter iter; + gchar * path = GLADE_EPROP_LINKS (eprop)->path; + GladeProperty * p = glade_editor_property_get_property (eprop); + GtkListStore * store = ((GladeVnList *) g_value_get_boxed (glade_property_inline_value (p)))->list; - glade_list_eprop_create_input ((GladeListEProp *) obj, box, - _("Add or remove links")); - - cell = gtk_cell_renderer_text_new (); - g_object_set (cell, "editable", TRUE, NULL); - column = gtk_tree_view_column_new_with_attributes (_("Column"), cell, - "text", LINKS_FIELD_COL, NULL); - gtk_tree_view_column_set_expand (column, TRUE); - g_signal_connect (cell, "edited", - G_CALLBACK (glade_list_eporp_on_string_col_edited), obj); - gtk_tree_view_append_column (obj->view, column); - - glade_list_eprop_add_param_column (obj); - - cell = gtk_cell_renderer_toggle_new (); - column = gtk_tree_view_column_new_with_attributes (C_("Verb", "Link"), cell, NULL); - gtk_tree_view_column_set_cell_data_func (column, cell, linked_col_cell_data, obj, NULL); - g_signal_connect (cell, "toggled", - G_CALLBACK (glade_eprop_links_on_linked_col_toggled), obj); - gtk_tree_view_append_column (obj->view, column); - - g_object_set (G_OBJECT (box), "height-request", 200, NULL); - gtk_widget_show_all (box); - return box; + if (gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL (store), &iter, path)) + { + gtk_list_store_set (store, &iter, PARAM_COL, NULL, -1); + return TRUE; + } + } + return FALSE; } -static void glade_eprop_links_finalize (GObject * object) -{ - GladeEPropLinks * obj = GLADE_EPROP_LINKS (object); - GObjectClass * parent = g_type_class_peek_parent (GLADE_EPROP_LINKS_GET_CLASS (obj)); - parent->finalize (G_OBJECT (obj)); -} - -static void glade_eprop_links_load (GladeEditorProperty * eprop, GladeProperty * property) -{ - GladeDbList * list; - GladeEPropLinks * obj = GLADE_EPROP_LINKS (eprop); - GladeEditorPropertyClass * parent_class = - g_type_class_peek_parent (GLADE_EDITOR_PROPERTY_GET_CLASS (eprop)); - parent_class->load (eprop, property); - - if (!property) - return; - - if ((list = g_value_get_boxed (glade_property_inline_value (property)))) - gtk_tree_view_set_model (obj->view, GTK_TREE_MODEL (list->list)); - else - gtk_tree_view_set_model (obj->view, NULL); -} - -//+++++++++++++++++++++++++++++++++++++++++++++++++++ Batch Editor Property - -typedef GladeListEProp GladeEPropBatch; - -enum -{ - BATCH_ID_COL - ,BATCH_PARAM_COL - ,BATCH_N_COLS -}; - -GLADE_MAKE_EPROP (GladeEPropBatch, glade_eprop_batch) -#define GLADE_TYPE_EPROP_BATCH (glade_eprop_batch_get_type ()) -#define GLADE_EPROP_BATCH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GLADE_TYPE_EPROP_BATCH, GladeEPropBatch)) -#define GLADE_EPROP_BATCH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GLADE_TYPE_EPROP_BATCH, GladeEPropBatchClass)) -#define GLADE_IS_EPROP_BATCH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GLADE_TYPE_EPROP_BATCH)) -#define GLADE_IS_EPROP_BATCH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GLADE_TYPE_EPROP_BATCH)) -#define GLADE_EPROP_BATCH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GLADE_EPROP_BATCH, GladeEPropBatchClass)) - -static GtkWidget * glade_eprop_batch_create_input (GladeEditorProperty * eprop) -{ - GtkCellRenderer * cell; - GtkTreeViewColumn * column; - GladeEPropBatch * obj = GLADE_EPROP_BATCH (eprop); - GtkWidget * box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2); - - glade_list_eprop_create_input ((GladeListEProp *) obj, box, - _("Add or remove holders")); - - cell = gtk_cell_renderer_text_new (); - g_object_set (cell, "editable", TRUE, NULL); - column = gtk_tree_view_column_new_with_attributes (_("Identifier"), cell, - "text", BATCH_ID_COL, NULL); - gtk_tree_view_column_set_expand (column, TRUE); - g_signal_connect (cell, "edited", - G_CALLBACK (glade_list_eporp_on_string_col_edited), obj); - gtk_tree_view_append_column (obj->view, column); - - glade_list_eprop_add_param_column (obj); - - g_object_set (G_OBJECT (box), "height-request", 200, NULL); - gtk_widget_show_all (box); - return box; -} - -void glade_eprop_batch_finalize (GObject * object) -{ - GladeEPropBatch * obj = GLADE_EPROP_BATCH (object); - GObjectClass * parent = g_type_class_peek_parent (GLADE_EPROP_BATCH_GET_CLASS (obj)); - parent->finalize (G_OBJECT (obj)); -} - -static void glade_eprop_batch_load (GladeEditorProperty * eprop, GladeProperty * property) -{ - GladeDbList * list; - GladeEPropBatch * obj = GLADE_EPROP_BATCH (eprop); - GladeEditorPropertyClass * parent_class = - g_type_class_peek_parent (GLADE_EDITOR_PROPERTY_GET_CLASS (eprop)); - parent_class->load (eprop, property); - - if (!property) - return; - - if ((list = g_value_get_boxed (glade_property_inline_value (property)))) - gtk_tree_view_set_model (obj->view, GTK_TREE_MODEL (list->list)); - else - gtk_tree_view_set_model (obj->view, NULL); -} - -//+++++++++++++++++++++++++++++++++++++++ Methods common to Links and Batch - -void param_col_cell_data (GtkTreeViewColumn * view, GtkCellRenderer * cell, +static void param_col_cell_data (GtkTreeViewColumn * view, GtkCellRenderer * cell, GtkTreeModel * model, GtkTreeIter * iter, gpointer data) { GladeWidget * param; - gint col = GLADE_IS_EPROP_LINKS (data) ? LINKS_PARAM_COL : BATCH_PARAM_COL; - - gtk_tree_model_get (model, iter, col, ¶m, -1); + gtk_tree_model_get (model, iter, PARAM_COL, ¶m, -1); if (param) g_object_set (cell, "text", glade_widget_get_name (param), NULL); @@ -420,61 +396,10 @@ void param_col_cell_data (GtkTreeViewColumn * view, GtkCellRenderer * cell, g_object_set (cell, "text", "", NULL); } -static void glade_list_eprop_on_param_col_clicked (GtkEntry * entry, - GtkEntryIconPosition icon_pos, GdkEvent * event, GladeEditorProperty * eprop) -{ - GtkTreeIter iter; - GladeProperty * p = glade_editor_property_get_property (eprop); - GladeWidget * widget = glade_property_get_widget (p); - GladeProject * project = glade_widget_get_project (widget); - GtkListStore * store = ((GladeDbList *) g_value_get_boxed (glade_property_inline_value (p)))->list; - gchar * path = ((GladeListEProp *) eprop)->path; - gint col = GLADE_IS_EPROP_LINKS (eprop) ? LINKS_PARAM_COL : BATCH_PARAM_COL; - - if (!gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL (store), &iter, path)) - return; - - gtk_tree_model_get (GTK_TREE_MODEL (store), &iter, col, &widget, -1); - - if (glade_editor_property_show_object_dialog (project, - _("Select a GvnParam"), NULL, GVN_TYPE_PARAM, NULL, &widget)) - { - if (widget) - gtk_list_store_set (store, &iter, col, widget, -1); - else - gtk_list_store_set (store, &iter, col, NULL, -1); - } -} - -static gboolean glade_list_eprop_on_param_key_pressed (GtkEntry * entry, - GdkEventKey * event, GladeEditorProperty * eprop) -{ - if (event->keyval == GDK_KEY_Return) - { - glade_list_eprop_on_param_col_clicked (entry, 0, NULL, eprop); - return TRUE; - } - else if (event->keyval == GDK_KEY_Delete) - { - GtkTreeIter iter; - gchar * path = ((GladeListEProp *) eprop)->path; - GladeProperty * p = glade_editor_property_get_property (eprop); - GtkListStore * store = ((GladeDbList *) g_value_get_boxed (glade_property_inline_value (p)))->list; - - if (gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL (store), &iter, path)) - { - gint col = GLADE_IS_EPROP_LINKS (eprop) ? LINKS_PARAM_COL : BATCH_PARAM_COL; - gtk_list_store_set (store, &iter, col, NULL, -1); - return TRUE; - } - } - return FALSE; -} - -static void glade_list_eporp_on_param_col_editing_started (GtkCellRendererText * cell, +static void glade_eporp_links_on_param_col_editing_started (GtkCellRendererText * cell, GtkEntry * entry, gchar * path, GladeEditorProperty * eprop) { - GladeListEProp * obj = (GladeListEProp *) eprop; + GladeEPropLinks * obj = GLADE_EPROP_LINKS (eprop); if (GTK_IS_ENTRY (entry)) { @@ -503,9 +428,9 @@ static void glade_list_eporp_on_param_col_editing_started (GtkCellRendererText * obj->path = g_strdup (path); g_signal_connect (entry, "icon-press", - G_CALLBACK (glade_list_eprop_on_param_col_clicked), eprop); + G_CALLBACK (glade_eprop_links_on_param_col_clicked), eprop); g_signal_connect (entry, "key-press-event", - G_CALLBACK (glade_list_eprop_on_param_key_pressed), eprop); + G_CALLBACK (glade_eprop_links_on_param_key_pressed), eprop); } else { @@ -522,32 +447,42 @@ static void glade_list_eporp_on_param_col_editing_started (GtkCellRendererText * } } -static void glade_list_eprop_add_param_column (GladeListEProp * obj) -{ - GtkTreeViewColumn * column; - GtkCellRenderer * cell = gtk_cell_renderer_text_new (); - g_object_set (cell, "editable", TRUE, NULL); - column = gtk_tree_view_column_new_with_attributes (_("Param"), cell, NULL); - gtk_tree_view_column_set_cell_data_func (column, cell, param_col_cell_data, obj, NULL); - gtk_tree_view_column_set_expand (column, TRUE); - g_signal_connect (cell, "editing-started", - G_CALLBACK (glade_list_eporp_on_param_col_editing_started), obj); - gtk_tree_view_append_column (obj->view, column); -} - -static void glade_list_eporp_on_string_col_edited (GtkCellRendererText * cell, +static void glade_eporp_links_on_field_col_edited (GtkCellRendererText * cell, gchar * path, const gchar * text, GladeEditorProperty * eprop) { GtkTreeIter iter; - gint col = GLADE_IS_EPROP_LINKS (eprop) ? LINKS_FIELD_COL : BATCH_ID_COL; GladeProperty * p = glade_editor_property_get_property (eprop); - GladeDbList * list = g_value_get_boxed (glade_property_inline_value (p)); - GtkListStore * store = list->list; + GladeVnList * list = g_value_get_boxed (glade_property_inline_value (p)); + GtkListStore * store = list->list; if (!gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL (store), &iter, path)) return; - gtk_list_store_set (store, &iter, col, text, -1); + gtk_list_store_set (store, &iter, FIELD_COL, text, -1); +} + +static void linked_col_cell_data (GtkTreeViewColumn * view, GtkCellRenderer * cell, + GtkTreeModel * model, GtkTreeIter * iter, gpointer data) +{ + gboolean val; + gtk_tree_model_get (model, iter, LINKED_COL, &val, -1); + gtk_cell_renderer_toggle_set_active (GTK_CELL_RENDERER_TOGGLE (cell), val); +} + +static void glade_eprop_links_on_linked_col_toggled (GtkCellRendererToggle * cell, + gchar * path, GladeEditorProperty * eprop) +{ + gboolean val; + GtkTreeIter iter; + GladeProperty * p = glade_editor_property_get_property (eprop); + GladeVnList * list = g_value_get_boxed (glade_property_inline_value (p)); + GtkListStore * store = list->list; + + if (!gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL (store), &iter, path)) + return; + + gtk_tree_model_get (GTK_TREE_MODEL (store), &iter, LINKED_COL, &val, -1); + gtk_list_store_set (store, &iter, LINKED_COL, !val, -1); } static void glade_widget_on_remove_widget (GladeProject * project, @@ -561,36 +496,30 @@ static void glade_widget_on_remove_widget (GladeProject * project, if (gtk_tree_model_get_iter_first (m, &iter)) do { - gint col = 1; // XXX LINKS_PARAM_COL and BATCH_PARAM_COL GladeWidget * param; - gtk_tree_model_get (m, &iter, col, ¶m, -1); + gtk_tree_model_get (m, &iter, PARAM_COL, ¶m, -1); if (param == widget) - gtk_list_store_set (store, &iter, col, NULL, -1); + gtk_list_store_set (store, &iter, PARAM_COL, NULL, -1); } while (gtk_tree_model_iter_next (m, &iter)); } } -static void glade_list_eprop_on_add_clicked (GtkButton * button, GladeListEProp * obj) +static void glade_eporp_links_on_add_clicked (GtkButton * button, + GladeEPropLinks * obj) { GtkTreeIter iter; GtkTreePath * path; - GladeDbList * list; + GladeVnList * list; GtkListStore * store; GladeProperty * p = glade_editor_property_get_property (GLADE_EDITOR_PROPERTY (obj)); if (!(list = g_value_get_boxed (glade_property_inline_value (p)))) - { - list = g_new (GladeDbList, 1); - - if (GLADE_IS_EPROP_LINKS (obj)) - list->list = gtk_list_store_new (LINKS_N_COLS, - G_TYPE_STRING, GLADE_TYPE_WIDGET, G_TYPE_BOOLEAN); - else - list->list = gtk_list_store_new (BATCH_N_COLS, - G_TYPE_STRING, GLADE_TYPE_WIDGET); - + { + list = g_new (GladeVnList, 1); + list->list = gtk_list_store_new (N_COLS, + G_TYPE_STRING, GLADE_TYPE_WIDGET, G_TYPE_BOOLEAN); glade_property_set (p, list); g_signal_connect (glade_widget_get_project (glade_property_get_widget (p)), @@ -610,8 +539,8 @@ static void glade_list_eprop_on_add_clicked (GtkButton * button, GladeListEProp gtk_tree_path_free (path); } -static void glade_list_eprop_on_remove_clicked (GtkButton * button, - GladeListEProp * obj) +static void glade_eporp_links_on_remove_clicked (GtkButton * button, + GladeEPropLinks * obj) { GtkTreeIter iter; GtkListStore * store; @@ -635,31 +564,34 @@ static void glade_list_eprop_on_remove_clicked (GtkButton * button, } } -static gboolean glade_list_eprop_on_view_key_press (GtkWidget * treeview, - GdkEventKey * event, GladeListEProp * obj) +static gboolean glade_eprop_links_on_view_key_press (GtkWidget * treeview, + GdkEventKey * event, GladeEPropLinks * obj) { if (event->keyval == GDK_KEY_Delete) { - glade_list_eprop_on_remove_clicked (NULL, obj); + glade_eporp_links_on_remove_clicked (NULL, obj); return TRUE; } else if ((event->state & GDK_CONTROL_MASK) != 0 && (event->keyval == GDK_KEY_n || event->keyval == GDK_KEY_N)) { - glade_list_eprop_on_add_clicked (NULL, obj); + glade_eporp_links_on_add_clicked (NULL, obj); return TRUE; } return FALSE; } -static void glade_list_eprop_create_input (GladeListEProp * obj, GtkWidget * box, - gchar * string) +static GtkWidget * glade_eprop_links_create_input (GladeEditorProperty * eprop) { + GtkCellRenderer * cell; + GtkTreeViewColumn * column; + GladeEPropLinks * obj = GLADE_EPROP_LINKS (eprop); GtkWidget * scroll, * button, * label, - * hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4); + * hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4), + * box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2); - label = gtk_label_new (string); + label = gtk_label_new (_("Add or remove links")); gtk_label_set_use_markup (GTK_LABEL (label), TRUE); gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); gtk_misc_set_padding (GTK_MISC (label), 2, 4); @@ -668,13 +600,15 @@ static void glade_list_eprop_create_input (GladeListEProp * obj, GtkWidget * box button = gtk_button_new (); gtk_button_set_image (GTK_BUTTON (button), gtk_image_new_from_icon_name ("list-add-symbolic", GTK_ICON_SIZE_BUTTON)); - g_signal_connect (button, "clicked", G_CALLBACK (glade_list_eprop_on_add_clicked), obj); + g_signal_connect (button, "clicked", + G_CALLBACK (glade_eporp_links_on_add_clicked), obj); gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); button = gtk_button_new (); gtk_button_set_image (GTK_BUTTON (button), gtk_image_new_from_icon_name ("list-remove-symbolic", GTK_ICON_SIZE_BUTTON)); - g_signal_connect (button, "clicked", G_CALLBACK (glade_list_eprop_on_remove_clicked), obj); + g_signal_connect (button, "clicked", + G_CALLBACK (glade_eporp_links_on_remove_clicked), obj); gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (box), hbox, FALSE, FALSE, 0); @@ -683,12 +617,66 @@ static void glade_list_eprop_create_input (GladeListEProp * obj, GtkWidget * box gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scroll), GTK_SHADOW_IN); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - g_object_set (G_OBJECT (scroll), "height-request", 50, NULL); gtk_box_pack_start (GTK_BOX (box), scroll, TRUE, TRUE, 0); obj->view = GTK_TREE_VIEW (gtk_tree_view_new ()); - g_signal_connect (obj->view, "key-press-event", G_CALLBACK (glade_list_eprop_on_view_key_press), obj); + g_signal_connect (obj->view, "key-press-event", + G_CALLBACK (glade_eprop_links_on_view_key_press), obj); gtk_container_add (GTK_CONTAINER (scroll), GTK_WIDGET (obj->view)); + + cell = gtk_cell_renderer_text_new (); + g_object_set (cell, "editable", TRUE, NULL); + column = gtk_tree_view_column_new_with_attributes (_("Column"), cell, + "text", FIELD_COL, NULL); + gtk_tree_view_column_set_expand (column, TRUE); + g_signal_connect (cell, "edited", + G_CALLBACK (glade_eporp_links_on_field_col_edited), obj); + gtk_tree_view_append_column (obj->view, column); + + cell = gtk_cell_renderer_text_new (); + g_object_set (cell, "editable", TRUE, NULL); + column = gtk_tree_view_column_new_with_attributes (_("Param"), cell, NULL); + gtk_tree_view_column_set_cell_data_func (column, cell, param_col_cell_data, obj, NULL); + gtk_tree_view_column_set_expand (column, TRUE); + g_signal_connect (cell, "editing-started", + G_CALLBACK (glade_eporp_links_on_param_col_editing_started), obj); + gtk_tree_view_append_column (obj->view, column); + + cell = gtk_cell_renderer_toggle_new (); + column = gtk_tree_view_column_new_with_attributes (C_("Verb", "Link"), cell, NULL); + gtk_tree_view_column_set_cell_data_func (column, cell, linked_col_cell_data, obj, NULL); + g_signal_connect (cell, "toggled", + G_CALLBACK (glade_eprop_links_on_linked_col_toggled), obj); + gtk_tree_view_append_column (obj->view, column); + + g_object_set (G_OBJECT (box), "height-request", 200, NULL); + gtk_widget_show_all (box); + return box; +} + +static void glade_eprop_links_finalize (GObject * object) +{ + GladeEPropLinks * obj = GLADE_EPROP_LINKS (object); + GObjectClass * parent = + g_type_class_peek_parent (GLADE_EPROP_LINKS_GET_CLASS (obj)); + parent->finalize (G_OBJECT (obj)); +} + +static void glade_eprop_links_load (GladeEditorProperty * eprop, GladeProperty * property) +{ + GladeVnList * list; + GladeEPropLinks * obj = GLADE_EPROP_LINKS (eprop); + GladeEditorPropertyClass * parent_class = + g_type_class_peek_parent (GLADE_EDITOR_PROPERTY_GET_CLASS (eprop)); + parent_class->load (eprop, property); + + if (!property) + return; + + if ((list = g_value_get_boxed (glade_property_inline_value (property)))) + gtk_tree_view_set_model (obj->view, GTK_TREE_MODEL (list->list)); + else + gtk_tree_view_set_model (obj->view, NULL); } //++++++++++++++++++++++++++++++++++++++++++++++++++ DbModel Widget Adaptor @@ -707,10 +695,6 @@ GladeEditorProperty * glade_db_model_create_eprop (GladeWidgetAdaptor * adaptor, eprop = g_object_new (GLADE_TYPE_EPROP_LINKS, "property-class", klass, "use-command", use_command, NULL); - else if (!g_strcmp0 (prop_id, "batch")) - eprop = g_object_new (GLADE_TYPE_EPROP_BATCH, - "property-class", klass, - "use-command", use_command, NULL); else eprop = GWA_GET_CLASS (G_TYPE_OBJECT)->create_eprop (adaptor, klass, use_command); @@ -735,7 +719,7 @@ void glade_db_model_write_widget (GladeWidgetAdaptor * adaptor, { GtkTreeIter iter; GtkTreeModel * m; - GladeDbList * l; + GladeVnList * l; GladeProperty * prop; if (!glade_xml_node_verify (node, GLADE_XML_TAG_WIDGET)) @@ -770,9 +754,9 @@ void glade_db_model_write_widget (GladeWidgetAdaptor * adaptor, GladeXmlNode * link_node; gtk_tree_model_get (m, &iter - ,LINKS_FIELD_COL, &field - ,LINKS_PARAM_COL, ¶m - ,LINKS_LINKED_COL, &linked + ,FIELD_COL, &field + ,PARAM_COL, ¶m + ,LINKED_COL, &linked , -1); link_node = glade_xml_node_new (context, "link"); @@ -793,48 +777,6 @@ void glade_db_model_write_widget (GladeWidgetAdaptor * adaptor, glade_xml_node_append_child (node, links_node); } } - - prop = glade_widget_get_property (widget, "batch"); -// Custom tag for the "batch" property, e.g.: -// -// -// - if ((l = g_value_get_boxed (glade_property_inline_value (prop)))) - { - m = GTK_TREE_MODEL (l->list); - - if (gtk_tree_model_get_iter_first (m, &iter)) - { - GladeXmlNode * batch_node = glade_xml_node_new (context, "batch"); - - do - { - gchar * id; - GladeWidget * param; - GladeXmlNode * holder_node; - - gtk_tree_model_get (m, &iter - ,BATCH_ID_COL, &id - ,BATCH_PARAM_COL, ¶m - , -1); - - holder_node = glade_xml_node_new (context, "holder"); - glade_xml_node_append_child (batch_node, holder_node); - glade_xml_node_set_property_string (holder_node, - "id", id ? id : ""); - glade_xml_node_set_property_string (holder_node, "param", - param ? glade_widget_get_name (param) : ""); - - g_free (id); - } - while (gtk_tree_model_iter_next (m, &iter)); - - if (!glade_xml_node_get_children (batch_node)) - glade_xml_node_delete (batch_node); - else - glade_xml_node_append_child (node, batch_node); - } - } } typedef struct @@ -848,10 +790,7 @@ ParseData; void glade_db_model_on_parse_finished (GladeProject * p, ParseData * pd) { GladeWidget * param = glade_project_get_widget_by_name (p, pd->param_name); - gint col = 1;// XXX LINKS_PARAM_COL and BATCH_PARAM_COL - - gtk_list_store_set (pd->store, pd->iter, col, param, -1); - + gtk_list_store_set (pd->store, pd->iter, PARAM_COL, param, -1); g_object_unref (pd->store); gtk_tree_iter_free (pd->iter); g_free (pd->param_name); @@ -864,7 +803,7 @@ void glade_db_model_read_widget (GladeWidgetAdaptor * adaptor, GladeXmlNode * prop_node; GladeProperty * prop; GladeProject * proj; - GladeDbList * list; + GladeVnList * list; GtkListStore * store; if (!glade_xml_node_verify (node, GLADE_XML_TAG_WIDGET)) @@ -876,15 +815,15 @@ void glade_db_model_read_widget (GladeWidgetAdaptor * adaptor, { GladeXmlNode * links_node = prop_node; proj = glade_widget_get_project (widget); - list = g_new (GladeDbList, 1); - store = gtk_list_store_new (LINKS_N_COLS, G_TYPE_STRING, GLADE_TYPE_WIDGET, G_TYPE_BOOLEAN); + list = g_new (GladeVnList, 1); + store = gtk_list_store_new (N_COLS, G_TYPE_STRING, GLADE_TYPE_WIDGET, G_TYPE_BOOLEAN); list->list = store; for (links_node = glade_xml_node_get_children (links_node); links_node; links_node = glade_xml_node_next (links_node)) { GtkTreeIter iter; - gint col = LINKS_PARAM_COL; + gint col = PARAM_COL; gchar * field = glade_xml_get_property_string (links_node, "field"), * param_name = glade_xml_get_property_string (links_node, "param"); gboolean linked = glade_xml_get_property_boolean (links_node, "linked", TRUE); @@ -908,8 +847,8 @@ void glade_db_model_read_widget (GladeWidgetAdaptor * adaptor, } gtk_list_store_set (store, &iter - ,LINKS_FIELD_COL, field - ,LINKS_LINKED_COL, linked + ,FIELD_COL, field + ,LINKED_COL, linked ,col, param ,-1); @@ -920,51 +859,4 @@ void glade_db_model_read_widget (GladeWidgetAdaptor * adaptor, prop = glade_widget_get_property (widget, "links"); glade_property_set (prop, list); } - - if ((prop_node = glade_xml_search_child (node, "batch"))) - { - GladeXmlNode * batch_node = prop_node; - proj = glade_widget_get_project (widget); - list = g_new (GladeDbList, 1); - store = gtk_list_store_new (BATCH_N_COLS, G_TYPE_STRING, GLADE_TYPE_WIDGET); - list->list = store; - - for (batch_node = glade_xml_node_get_children (batch_node); batch_node; - batch_node = glade_xml_node_next (batch_node)) - { - GtkTreeIter iter; - gint col = BATCH_PARAM_COL; - gchar * id = glade_xml_get_property_string (batch_node, "id"), - * param_name = glade_xml_get_property_string (batch_node, "param"); - GladeWidget * param = glade_project_get_widget_by_name (proj, param_name); - - gtk_list_store_append (store, &iter); - - if (!param) - { - // If the parameter hasn't been read yet, load it after the parse - ParseData * pd; - pd = g_new (ParseData, 1); - pd->store = g_object_ref (store); - pd->iter = gtk_tree_iter_copy (&iter); - pd->param_name = g_strdup (param_name); - - g_signal_connect (proj, "parse-finished", - G_CALLBACK (glade_db_model_on_parse_finished), pd); - - col = -1; - } - - gtk_list_store_set (store, &iter - ,BATCH_ID_COL, id - ,col, param - ,-1); - - g_free (id); - g_free (param_name); - } - - prop = glade_widget_get_property (widget, "batch"); - glade_property_set (prop, list); - } } diff --git a/glade/glade-sql-batch.c b/glade/glade-sql-batch.c new file mode 100644 index 0000000..00779c1 --- /dev/null +++ b/glade/glade-sql-batch.c @@ -0,0 +1,648 @@ +/* + * Copyright (C) 2013 - Juan Ferrer Toribio + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "glade-vn.h" + +//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ SqlBatchEditor + +#define GLADE_TYPE_BATCH_EDITOR (glade_batch_editor_get_type ()) +#define GLADE_BATCH_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GLADE_TYPE_BATCH_EDITOR, GladeBatchEditor)) +#define GLADE_BATCH_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GLADE_TYPE_BATCH_EDITOR, GladeBatchEditorClass)) +#define GLADE_IS_BATCH_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GLADE_TYPE_BATCH_EDITOR)) +#define GLADE_IS_BATCH_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GLADE_TYPE_BATCH_EDITOR)) +#define GLADE_BATCH_EDITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GLADE_TYPE_BATCH_EDITOR, GladeBatchEditorClass)) + +typedef struct _GladeBatchEditor GladeBatchEditor; +typedef struct _GladeBatchEditorClass GladeBatchEditorClass; + +struct _GladeBatchEditor +{ + GtkBox parent; + + GtkWidget * base; + GList * props; +}; + +struct _GladeBatchEditorClass +{ + GtkVBoxClass parent; +}; + +GType glade_batch_editor_get_type (void) G_GNUC_CONST; + +static GtkWidget * glade_sql_batch_editor_new (GladeWidgetAdaptor * adaptor, + GladeEditable * editable) +{ + GtkWidget * frame, * alignment, * vbox; + GladeEditorProperty * eprop; + GladeBatchEditor * obj; + + g_return_val_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor), NULL); + g_return_val_if_fail (GLADE_IS_EDITABLE (editable), NULL); + + obj = g_object_new (GLADE_TYPE_BATCH_EDITOR, + "orientation", GTK_ORIENTATION_VERTICAL, NULL); + obj->base = GTK_WIDGET (editable); + gtk_box_pack_start (GTK_BOX (obj), GTK_WIDGET (editable), TRUE, TRUE, 0); + + eprop = glade_widget_adaptor_create_eprop_by_name (adaptor, "items", FALSE, TRUE); + obj->props = g_list_prepend (obj->props, eprop); + + frame = gtk_frame_new (NULL); + gtk_frame_set_label_widget (GTK_FRAME (frame), + glade_editor_property_get_item_label (eprop)); + gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE); + gtk_box_pack_start (GTK_BOX (obj), frame, FALSE, FALSE, 12); + + alignment = gtk_alignment_new (0.5F, 0.5F, 1.0F, 1.0F); + gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 6, 0, 12, 0); + gtk_container_add (GTK_CONTAINER (frame), alignment); + + vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); + gtk_container_add (GTK_CONTAINER (alignment), vbox); + + gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (eprop), FALSE, FALSE, 4); + gtk_widget_set_tooltip_text (vbox, _("List of items")); + + gtk_widget_show_all (GTK_WIDGET (obj)); + return GTK_WIDGET (obj); +} + +static void glade_batch_editor_load (GladeEditable * editable, GladeWidget * widget) +{ + GList *l; + GladeBatchEditor * obj = GLADE_BATCH_EDITOR (editable); + GladeEditableIface * iface = g_type_default_interface_peek (GLADE_TYPE_EDITABLE); + iface->load (editable, widget); + + if (obj->base) + glade_editable_load (GLADE_EDITABLE (obj->base), widget); + + for (l = obj->props; l; l = l->next) + glade_editor_property_load_by_widget (GLADE_EDITOR_PROPERTY (l->data), widget); +} + +static void glade_batch_editor_set_show_name (GladeEditable * editable, gboolean show_name) +{ + GladeBatchEditor * obj = GLADE_BATCH_EDITOR (editable); + glade_editable_set_show_name (GLADE_EDITABLE (obj->base), show_name); +} + +static void glade_batch_editor_finalize (GObject * object) +{ + GladeBatchEditor * obj = GLADE_BATCH_EDITOR (object); + GObjectClass * parent = g_type_class_peek_parent (GLADE_BATCH_EDITOR_GET_CLASS (obj)); + + if (obj->props) + g_list_free (obj->props); + + obj->props = NULL; + obj->base = NULL; + + glade_editable_load (GLADE_EDITABLE (obj), NULL); + + parent->finalize (G_OBJECT (obj)); +} + +static void glade_batch_editor_class_init (GladeBatchEditorClass * k) +{ + GObjectClass * klass = G_OBJECT_CLASS (k); + klass->finalize = glade_batch_editor_finalize; +} + +static void glade_batch_editor_init (GladeBatchEditor * obj) +{ + obj->props = NULL; + obj->base = NULL; +} + +static void glade_batch_editor_editable_init (GladeEditableIface * iface) +{ + iface->load = glade_batch_editor_load; + iface->set_show_name = glade_batch_editor_set_show_name; +} + +G_DEFINE_TYPE_WITH_CODE (GladeBatchEditor, glade_batch_editor, GTK_TYPE_BOX, + G_IMPLEMENT_INTERFACE (GLADE_TYPE_EDITABLE, glade_batch_editor_editable_init)); + +//+++++++++++++++++++++++++++++++++++++++++++++++++++ Items Editor Property + + +typedef struct +{ + GladeEditorProperty parent; + + GtkTreeView * view; + gchar * path; +} +GladeEPropItems; + +GLADE_MAKE_EPROP (GladeEPropItems, glade_eprop_items) +#define GLADE_TYPE_EPROP_ITEMS (glade_eprop_items_get_type ()) +#define GLADE_EPROP_ITEMS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GLADE_TYPE_EPROP_ITEMS, GladeEPropItems)) +#define GLADE_EPROP_ITEMS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GLADE_TYPE_EPROP_ITEMS, GladeEPropItemsClass)) +#define GLADE_IS_EPROP_ITEMS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GLADE_TYPE_EPROP_ITEMS)) +#define GLADE_IS_EPROP_ITEMS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GLADE_TYPE_EPROP_ITEMS)) +#define GLADE_EPROP_ITEMS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GLADE_EPROP_ITEMS, GladeEPropItemsClass)) + +enum +{ + ID_COL + ,PARAM_COL + ,N_COLS +}; + +static void glade_eprop_items_on_param_col_clicked (GtkEntry * entry, + GtkEntryIconPosition icon_pos, GdkEvent * event, GladeEditorProperty * eprop) +{ + GtkTreeIter iter; + GladeProperty * p = glade_editor_property_get_property (eprop); + GladeWidget * widget = glade_property_get_widget (p); + GladeProject * project = glade_widget_get_project (widget); + GtkListStore * store = ((GladeVnList *) g_value_get_boxed (glade_property_inline_value (p)))->list; + gchar * path = GLADE_EPROP_ITEMS (eprop)->path; + + if (!gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL (store), &iter, path)) + return; + + gtk_tree_model_get (GTK_TREE_MODEL (store), &iter, PARAM_COL, &widget, -1); + + if (glade_editor_property_show_object_dialog (project, + _("Select a GvnParam"), NULL, GVN_TYPE_PARAM, NULL, &widget)) + { + if (widget) + gtk_list_store_set (store, &iter, PARAM_COL, widget, -1); + else + gtk_list_store_set (store, &iter, PARAM_COL, NULL, -1); + } +} + +static gboolean glade_eprop_items_on_param_key_pressed (GtkEntry * entry, + GdkEventKey * event, GladeEditorProperty * eprop) +{ + if (event->keyval == GDK_KEY_Return) + { + glade_eprop_items_on_param_col_clicked (entry, 0, NULL, eprop); + return TRUE; + } + else if (event->keyval == GDK_KEY_Delete) + { + GtkTreeIter iter; + gchar * path = GLADE_EPROP_ITEMS (eprop)->path; + GladeProperty * p = glade_editor_property_get_property (eprop); + GtkListStore * store = ((GladeVnList *) g_value_get_boxed (glade_property_inline_value (p)))->list; + + if (gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL (store), &iter, path)) + { + gtk_list_store_set (store, &iter, PARAM_COL, NULL, -1); + return TRUE; + } + } + return FALSE; +} + +static void param_col_cell_data (GtkTreeViewColumn * view, GtkCellRenderer * cell, + GtkTreeModel * model, GtkTreeIter * iter, gpointer data) +{ + GladeWidget * param; + gtk_tree_model_get (model, iter, PARAM_COL, ¶m, -1); + + if (param) + g_object_set (cell, "text", glade_widget_get_name (param), NULL); + else + g_object_set (cell, "text", "", NULL); +} + +static void glade_eporp_items_on_param_col_editing_started (GtkCellRendererText * cell, + GtkEntry * entry, gchar * path, GladeEditorProperty * eprop) +{ + GladeEPropItems * obj = GLADE_EPROP_ITEMS (eprop); + + if (GTK_IS_ENTRY (entry)) + { + GList * n; + gboolean have_params = FALSE; + GladeProperty * p = glade_editor_property_get_property (eprop); + GladeProject * project = glade_widget_get_project + (glade_property_get_widget (p)); + GList * objects = (GList *) glade_project_get_objects (project); + + for (n = objects; n; n = n->next) + if ((have_params = GVN_IS_PARAM (n->data))) + break; + + if (have_params) + { + g_object_set (entry + ,"secondary-icon-name", "content-loading-symbolic" + ,"secondary-icon-sensitive", TRUE + ,"secondary-icon-tooltip-text", _("Select the parameter from a list") + ,NULL); + + if (obj->path) + g_free (obj->path); + + obj->path = g_strdup (path); + + g_signal_connect (entry, "icon-press", + G_CALLBACK (glade_eprop_items_on_param_col_clicked), eprop); + g_signal_connect (entry, "key-press-event", + G_CALLBACK (glade_eprop_items_on_param_key_pressed), eprop); + } + else + { + g_object_set (entry + ,"secondary-icon-name", "dialog-warning-symbolic" + ,"secondary-icon-sensitive", FALSE + ,"secondary-icon-tooltip-text", _("You need to create at least " + "one GvnParam or derived object") + ,NULL); + g_signal_handlers_disconnect_by_data (entry, eprop); + } + + g_object_set (entry, "editable", FALSE, NULL); + } +} + +static void glade_eporp_items_on_id_col_edited (GtkCellRendererText * cell, + gchar * path, const gchar * text, GladeEditorProperty * eprop) +{ + GtkTreeIter iter; + GladeProperty * p = glade_editor_property_get_property (eprop); + GladeVnList * list = g_value_get_boxed (glade_property_inline_value (p)); + GtkListStore * store = list->list; + + if (!gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL (store), &iter, path)) + return; + + gtk_list_store_set (store, &iter, ID_COL, text, -1); +} + +static void glade_widget_on_remove_widget (GladeProject * project, + GladeWidget * widget, GtkListStore * store) +{ + if (g_type_is_a (G_OBJECT_TYPE (glade_widget_get_object (widget)), GVN_TYPE_PARAM)) + { + GtkTreeIter iter; + GtkTreeModel * m = GTK_TREE_MODEL (store); + + if (gtk_tree_model_get_iter_first (m, &iter)) + do + { + GladeWidget * param; + gtk_tree_model_get (m, &iter, PARAM_COL, ¶m, -1); + + if (param == widget) + gtk_list_store_set (store, &iter, PARAM_COL, NULL, -1); + } + while (gtk_tree_model_iter_next (m, &iter)); + } +} + +static void glade_eporp_items_on_add_clicked (GtkButton * button, + GladeEPropItems * obj) +{ + GtkTreeIter iter; + GtkTreePath * path; + GladeVnList * list; + GtkListStore * store; + GladeProperty * p = glade_editor_property_get_property (GLADE_EDITOR_PROPERTY (obj)); + + if (!(list = g_value_get_boxed (glade_property_inline_value (p)))) + { + list = g_new (GladeVnList, 1); + list->list = gtk_list_store_new (N_COLS, + G_TYPE_STRING, GLADE_TYPE_WIDGET, G_TYPE_BOOLEAN); + glade_property_set (p, list); + + g_signal_connect (glade_widget_get_project (glade_property_get_widget (p)), + "remove-widget", G_CALLBACK (glade_widget_on_remove_widget), list->list); + } + + store = list->list; + gtk_tree_view_set_model (obj->view, GTK_TREE_MODEL (store)); + + gtk_list_store_append (store, &iter); + path = gtk_tree_model_get_path (GTK_TREE_MODEL (store), &iter); + + gtk_tree_view_scroll_to_cell (obj->view, path, NULL, FALSE, 0, 0); + gtk_tree_view_set_cursor (obj->view, path, NULL, TRUE); + gtk_widget_grab_focus (GTK_WIDGET (obj->view)); + + gtk_tree_path_free (path); +} + +static void glade_eporp_items_on_remove_clicked (GtkButton * button, + GladeEPropItems * obj) +{ + GtkTreeIter iter; + GtkListStore * store; + GtkTreeSelection * selection = gtk_tree_view_get_selection (obj->view); + GladeProperty * p; + + if (!gtk_tree_selection_get_selected (selection, (GtkTreeModel **) &store, &iter)) + return; + + p = glade_editor_property_get_property (GLADE_EDITOR_PROPERTY (obj)); + gtk_list_store_remove (store, &iter); + + if (!gtk_tree_model_get_iter_first (GTK_TREE_MODEL (store), &iter)) + { + gtk_tree_view_set_model (obj->view, NULL); + glade_command_set_property (p, NULL); + + g_signal_handlers_disconnect_by_func + (glade_widget_get_project (glade_property_get_widget (p)), + glade_widget_on_remove_widget, store); + } +} + +static gboolean glade_eprop_items_on_view_key_press (GtkWidget * treeview, + GdkEventKey * event, GladeEPropItems * obj) +{ + if (event->keyval == GDK_KEY_Delete) + { + glade_eporp_items_on_remove_clicked (NULL, obj); + return TRUE; + } + else if ((event->state & GDK_CONTROL_MASK) != 0 + && (event->keyval == GDK_KEY_n || event->keyval == GDK_KEY_N)) + { + glade_eporp_items_on_add_clicked (NULL, obj); + return TRUE; + } + + return FALSE; +} + +static GtkWidget * glade_eprop_items_create_input (GladeEditorProperty * eprop) +{ + GtkCellRenderer * cell; + GtkTreeViewColumn * column; + GladeEPropItems * obj = GLADE_EPROP_ITEMS (eprop); + GtkWidget * scroll, * button, * label, + * hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4), + * box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2); + + label = gtk_label_new (_("Add or remove items")); + gtk_label_set_use_markup (GTK_LABEL (label), TRUE); + gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); + gtk_misc_set_padding (GTK_MISC (label), 2, 4); + gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); + + button = gtk_button_new (); + gtk_button_set_image (GTK_BUTTON (button), + gtk_image_new_from_icon_name ("list-add-symbolic", GTK_ICON_SIZE_BUTTON)); + g_signal_connect (button, "clicked", + G_CALLBACK (glade_eporp_items_on_add_clicked), obj); + gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); + + button = gtk_button_new (); + gtk_button_set_image (GTK_BUTTON (button), + gtk_image_new_from_icon_name ("list-remove-symbolic", GTK_ICON_SIZE_BUTTON)); + g_signal_connect (button, "clicked", + G_CALLBACK (glade_eporp_items_on_remove_clicked), obj); + gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); + + gtk_box_pack_start (GTK_BOX (box), hbox, FALSE, FALSE, 0); + + scroll = gtk_scrolled_window_new (NULL, NULL); + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scroll), GTK_SHADOW_IN); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll), + GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_box_pack_start (GTK_BOX (box), scroll, TRUE, TRUE, 0); + + obj->view = GTK_TREE_VIEW (gtk_tree_view_new ()); + g_signal_connect (obj->view, "key-press-event", + G_CALLBACK (glade_eprop_items_on_view_key_press), obj); + gtk_container_add (GTK_CONTAINER (scroll), GTK_WIDGET (obj->view)); + + cell = gtk_cell_renderer_text_new (); + g_object_set (cell, "editable", TRUE, NULL); + column = gtk_tree_view_column_new_with_attributes (_("Identifier"), cell, + "text", ID_COL, NULL); + gtk_tree_view_column_set_expand (column, TRUE); + g_signal_connect (cell, "edited", + G_CALLBACK (glade_eporp_items_on_id_col_edited), obj); + gtk_tree_view_append_column (obj->view, column); + + cell = gtk_cell_renderer_text_new (); + g_object_set (cell, "editable", TRUE, NULL); + column = gtk_tree_view_column_new_with_attributes (_("Parameter"), cell, NULL); + gtk_tree_view_column_set_cell_data_func (column, cell, param_col_cell_data, obj, NULL); + gtk_tree_view_column_set_expand (column, TRUE); + g_signal_connect (cell, "editing-started", + G_CALLBACK (glade_eporp_items_on_param_col_editing_started), obj); + gtk_tree_view_append_column (obj->view, column); + + g_object_set (G_OBJECT (box), "height-request", 200, NULL); + gtk_widget_show_all (box); + return box; +} + +static void glade_eprop_items_finalize (GObject * object) +{ + GladeEPropItems * obj = GLADE_EPROP_ITEMS (object); + GObjectClass * parent = + g_type_class_peek_parent (GLADE_EPROP_ITEMS_GET_CLASS (obj)); + parent->finalize (G_OBJECT (obj)); +} + +static void glade_eprop_items_load (GladeEditorProperty * eprop, GladeProperty * property) +{ + GladeVnList * list; + GladeEPropItems * obj = GLADE_EPROP_ITEMS (eprop); + GladeEditorPropertyClass * parent_class = + g_type_class_peek_parent (GLADE_EDITOR_PROPERTY_GET_CLASS (eprop)); + parent_class->load (eprop, property); + + if (!property) + return; + + if ((list = g_value_get_boxed (glade_property_inline_value (property)))) + gtk_tree_view_set_model (obj->view, GTK_TREE_MODEL (list->list)); + else + gtk_tree_view_set_model (obj->view, NULL); +} + +//+++++++++++++++++++++++++++++++++++++++++++++++++ SqlBatch Widget Adaptor + +GladeEditorProperty * glade_sql_batch_create_eprop (GladeWidgetAdaptor * adaptor, + GladePropertyClass * klass, gboolean use_command) +{ + GladeEditorProperty * eprop; + const gchar * prop_id = glade_property_class_id (klass); + + if (!g_strcmp0 (prop_id, "items")) + eprop = g_object_new (GLADE_TYPE_EPROP_ITEMS, + "property-class", klass, + "use-command", use_command, NULL); + else + eprop = GWA_GET_CLASS (G_TYPE_OBJECT)->create_eprop (adaptor, + klass, use_command); + + return eprop; +} + +GladeEditable * glade_sql_batch_create_editable (GladeWidgetAdaptor * adaptor, + GladeEditorPageType type) +{ + GladeEditable * editable = + GWA_GET_CLASS (G_TYPE_OBJECT)->create_editable (adaptor, type); + + if (type == GLADE_PAGE_GENERAL) + return GLADE_EDITABLE (glade_sql_batch_editor_new (adaptor, editable)); + + return editable; +} + +void glade_sql_batch_write_widget (GladeWidgetAdaptor * adaptor, + GladeWidget * widget, GladeXmlContext * context, GladeXmlNode * node) +{ + GtkTreeIter iter; + GladeVnList * l; + GtkTreeModel * m; + GladeXmlNode * items_node; + GladeProperty * prop; + + if (!glade_xml_node_verify (node, GLADE_XML_TAG_WIDGET)) + return; + + GWA_GET_CLASS (G_TYPE_OBJECT)->write_widget (adaptor, widget, context, node); + + prop = glade_widget_get_property (widget, "items"); +// Custom tag for the "items" property, e.g.: +// +// +// + if (!(l = g_value_get_boxed (glade_property_inline_value (prop)))) + return; + + m = GTK_TREE_MODEL (l->list); + + if (!gtk_tree_model_get_iter_first (m, &iter)) + return; + + items_node = glade_xml_node_new (context, "items"); + + do + { + gchar * id; + GladeWidget * param; + GladeXmlNode * item_node; + + gtk_tree_model_get (m, &iter + ,ID_COL, &id + ,PARAM_COL, ¶m + , -1); + + item_node = glade_xml_node_new (context, "item"); + glade_xml_node_append_child (items_node, item_node); + glade_xml_node_set_property_string (item_node, "id", id ? id : ""); + glade_xml_node_set_property_string (item_node, "param", + param ? glade_widget_get_name (param) : ""); + + g_free (id); + } + while (gtk_tree_model_iter_next (m, &iter)); + + if (!glade_xml_node_get_children (items_node)) + glade_xml_node_delete (items_node); + else + glade_xml_node_append_child (node, items_node); +} + +typedef struct +{ + GtkListStore * store; + GtkTreeIter * iter; + gchar * param_name; +} +ParseData; + +void glade_sql_batch_on_parse_finished (GladeProject * p, ParseData * pd) +{ + GladeWidget * param = glade_project_get_widget_by_name (p, pd->param_name); + + gtk_list_store_set (pd->store, pd->iter, PARAM_COL, param, -1); + + g_object_unref (pd->store); + gtk_tree_iter_free (pd->iter); + g_free (pd->param_name); + g_free (pd); +} + +void glade_sql_batch_read_widget (GladeWidgetAdaptor * adaptor, + GladeWidget * widget, GladeXmlNode * node) +{ + GladeXmlNode * items_node; + GladeProperty * prop; + GladeProject * proj; + GladeVnList * list; + GtkListStore * store; + + if (!glade_xml_node_verify (node, GLADE_XML_TAG_WIDGET)) + return; + + GWA_GET_CLASS (G_TYPE_OBJECT)->read_widget (adaptor, widget, node); + + if ((items_node = glade_xml_search_child (node, "items")) == NULL) + return; + + proj = glade_widget_get_project (widget); + list = g_new (GladeVnList, 1); + store = gtk_list_store_new (N_COLS, G_TYPE_STRING, GLADE_TYPE_WIDGET); + list->list = store; + + for (items_node = glade_xml_node_get_children (items_node); items_node; + items_node = glade_xml_node_next (items_node)) + { + GtkTreeIter iter; + gint col = PARAM_COL; + gchar * id = glade_xml_get_property_string (items_node, "id"), + * param_name = glade_xml_get_property_string (items_node, "param"); + GladeWidget * param = glade_project_get_widget_by_name (proj, param_name); + + gtk_list_store_append (store, &iter); + + if (!param) + { + // If the parameter hasn't been read yet, load it after the parse + ParseData * pd; + pd = g_new (ParseData, 1); + pd->store = g_object_ref (store); + pd->iter = gtk_tree_iter_copy (&iter); + pd->param_name = g_strdup (param_name); + + g_signal_connect (proj, "parse-finished", + G_CALLBACK (glade_sql_batch_on_parse_finished), pd); + + col = -1; + } + + gtk_list_store_set (store, &iter + ,ID_COL, id + ,col, param + ,-1); + + g_free (id); + g_free (param_name); + } + + prop = glade_widget_get_property (widget, "items"); + glade_property_set (prop, list); +} \ No newline at end of file diff --git a/glade/glade-vn-batch.c b/glade/glade-vn-batch.c deleted file mode 100644 index 8203e9d..0000000 --- a/glade/glade-vn-batch.c +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2013 - Juan Ferrer Toribio - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "glade-vn.h" - -void glade_vn_set_add_child (GladeWidgetAdaptor * adaptor, - VnSet * group, GObject * child) -{ - if (G_IS_OBJECT (child)) - vn_set_add (group, child); -} - -void glade_vn_set_remove_child (GladeWidgetAdaptor * adaptor, - VnSet * group, GObject * child) -{ - if (G_IS_OBJECT (child)) - vn_set_remove (group, child); -} - -void glade_vn_set_replace_child (GladeWidgetAdaptor * adaptor, - GObject * container, GObject * current, GObject * new) -{ - VnSet * group = VN_SET (container); - glade_vn_set_remove_child (adaptor, group, current); - glade_vn_set_add_child (adaptor, group, new); -} - -GList * glade_vn_set_get_children (GladeWidgetAdaptor * adaptor, - VnSet * group) -{ - return vn_set_get_objects_list (group); -} - -gboolean glade_vn_set_add_verify (GladeWidgetAdaptor * adaptor, - VnSet * container, GObject * child, gboolean user_feedback) -{ - if (G_IS_OBJECT (child)) - return TRUE; - - if (user_feedback) - { - GladeWidgetAdaptor * object_adaptor = - glade_widget_adaptor_get_by_type (G_TYPE_OBJECT); - - glade_util_ui_message (glade_app_get_window () - ,GLADE_UI_INFO - ,NULL - ,"Only objects of type %s can be added to objects of type %s." - ,glade_widget_adaptor_get_name (object_adaptor) - ,glade_widget_adaptor_get_name (adaptor) - ); - } - - return FALSE; -} diff --git a/glade/glade-vn.c b/glade/glade-vn.c index 99fc84c..9c33e58 100644 --- a/glade/glade-vn.c +++ b/glade/glade-vn.c @@ -17,18 +17,6 @@ #include "glade-vn.h" -GObject * glade_vn_field_get_internal_child (GladeWidgetAdaptor * adaptor, - GObject * parent, const gchar * name) -{ - return G_OBJECT (vn_field_get_widget (VN_FIELD (parent))); -} - -GObject * glade_vn_column_get_internal_child (GladeWidgetAdaptor * adaptor, - GObject * parent, const gchar * name) -{ - return G_OBJECT (vn_column_get_cell_renderer (VN_COLUMN (parent))); -} - gboolean glade_vn_set_first_catalog (gpointer catalog_name) { GList * l, * catalogs = glade_app_get_catalogs (), @@ -70,3 +58,40 @@ void glade_vn_init () g_idle_add (glade_vn_set_first_catalog, "vn"); } + +//+++++++++++++++++++++++++++++++++++++++++++++++++++ GladeDbList + +G_DEFINE_BOXED_TYPE (GladeVnList, glade_vn_list, glade_vn_list_copy, glade_vn_list_free); + +void glade_vn_list_free (GladeVnList * list) +{ + if (!list) + return; + + if (list->list) + g_object_unref (list->list); + + g_free (list); + list = NULL; +} + +GladeVnList * glade_vn_list_copy (const GladeVnList * list) +{ + GladeVnList * l = g_new (GladeVnList, 1); + l->list = list->list ? g_object_ref (list->list) : NULL; + return l; +} + +//+++++++++++++++++++++++++++++++++++++++++++++++++ Internal children + +GObject * glade_vn_field_get_internal_child (GladeWidgetAdaptor * adaptor, + GObject * parent, const gchar * name) +{ + return G_OBJECT (vn_field_get_widget (VN_FIELD (parent))); +} + +GObject * glade_vn_column_get_internal_child (GladeWidgetAdaptor * adaptor, + GObject * parent, const gchar * name) +{ + return G_OBJECT (vn_column_get_cell_renderer (VN_COLUMN (parent))); +} diff --git a/glade/glade-vn.h b/glade/glade-vn.h index 0000d41..1803140 100644 --- a/glade/glade-vn.h +++ b/glade/glade-vn.h @@ -23,4 +23,17 @@ void glade_vn_init (); +#define GLADE_TYPE_VN_LIST (glade_vn_list_get_type()) + +typedef struct _GladeVnList GladeVnList; + +struct _GladeVnList +{ + GtkListStore * list; +}; + +GType glade_vn_list_get_type (void) G_GNUC_CONST; +void glade_vn_list_free (GladeVnList * list); +GladeVnList * glade_vn_list_copy (const GladeVnList * list); + #endif \ No newline at end of file diff --git a/glade/vn.xml b/glade/vn.xml index 74d333f..55295de 100644 --- a/glade/vn.xml +++ b/glade/vn.xml @@ -5,11 +5,19 @@ glade_vn_init - + - - + + + GParamBoxed + GladeVnList + + + glade_sql_batch_create_eprop + glade_sql_batch_create_editable + glade_sql_batch_write_widget + glade_sql_batch_read_widget @@ -29,13 +37,7 @@ GParamBoxed - GladeDbList - - - - - GParamBoxed - GladeDbList + GladeVnList @@ -203,7 +205,7 @@ - + diff --git a/module/data/consulter-menu.xml b/module/data/consulter-menu.xml index f13c5f4..d83e0d6 100644 --- a/module/data/consulter-menu.xml +++ b/module/data/consulter-menu.xml @@ -1,15 +1,15 @@ - + - Send - win.send - <Shift>s + Send + win.send + <Shift>s - Clean - win.clean - <Shift>c + Clean + win.clean + <Shift>c diff --git a/module/data/example-menu.xml b/module/data/example-menu.xml index 3727ea1..c086a5f 100644 --- a/module/data/example-menu.xml +++ b/module/data/example-menu.xml @@ -1,18 +1,18 @@ - +
- Consulter - win.open-form - consulter - F12 + Consulter + win.open-form + consulter + F12 - Customer - win.open-form - customer - F11 + Customer + win.open-form + customer + F11
diff --git a/po/POTFILES.in b/po/POTFILES.in index 260e853..342ce51 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -51,13 +51,14 @@ vn/column/vn-column-image.c vn/gui/login.glade vn/gui/main.glade -vn/gui/menu.glade vn/gui/date-chooser.glade +vn/gui/menu.glade glade/glade-db-model.c glade/glade-db-model-editor.c glade/glade-eprop-model.c glade/glade-db-iterator.c +glade/glade-sql-batch.c [type: gettext/glade]glade/vn.xml [type: gettext/glade]module/data/example.xml diff --git a/po/ca.po b/po/ca.po index 983a68a..4503225 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: 2014-07-07 15:57+0200\n" +"POT-Creation-Date: 2014-07-15 14:27+0200\n" "PO-Revision-Date: 2013-06-04 13:38+0200\n" "Last-Translator: Alejandro T. Colombini Gómez \n" "Language-Team: Catalan\n" @@ -31,7 +31,7 @@ msgstr "El parametre no pot ser nul" msgid "Incompatible type for this param" msgstr "Tipus incompatible per a aquest parametre" -#: ../gvn/gvn-param.c:443 ../sql/sql-value.c:252 ../vn/vn-field.c:573 +#: ../gvn/gvn-param.c:443 ../sql/sql-value.c:255 ../vn/vn-field.c:576 msgid "Value" msgstr "" @@ -47,7 +47,7 @@ msgstr "" msgid "The master GvnParam of this parameter" msgstr "" -#: ../gvn/gvn-param.c:457 ../db/db-iterator.c:1055 +#: ../gvn/gvn-param.c:457 ../db/db-iterator.c:1062 msgid "Mode" msgstr "" @@ -71,15 +71,15 @@ msgstr "" msgid "The spec of the parameter" msgstr "" -#: ../gvn/gvn-param.c:478 ../vn/vn-field.c:601 +#: ../gvn/gvn-param.c:478 ../vn/vn-field.c:604 msgid "Glib Type" msgstr "" -#: ../gvn/gvn-param.c:479 ../vn/vn-field.c:602 +#: ../gvn/gvn-param.c:479 ../vn/vn-field.c:605 msgid "The type of the value" msgstr "" -#: ../gvn/gvn-param.c:485 ../vn/vn-field.c:608 ../vn/vn-column.c:504 +#: ../gvn/gvn-param.c:485 ../vn/vn-field.c:611 ../vn/vn-column.c:507 msgid "Editable" msgstr "" @@ -87,7 +87,7 @@ msgstr "" msgid "Whether the param value can be modified" msgstr "" -#: ../gvn/gvn-param.c:492 ../vn/vn-field.c:615 ../vn/vn-column.c:511 +#: ../gvn/gvn-param.c:492 ../vn/vn-field.c:618 ../vn/vn-column.c:514 msgid "Null" msgstr "" @@ -95,11 +95,11 @@ msgstr "" msgid "Whether the param value can be of type GVN_TYPE_NULL" msgstr "" -#: ../gvn/gvn-param.c:499 ../vn/vn-field.c:622 +#: ../gvn/gvn-param.c:499 ../vn/vn-field.c:625 msgid "Default Value" msgstr "" -#: ../gvn/gvn-param.c:500 ../vn/vn-field.c:623 +#: ../gvn/gvn-param.c:500 ../vn/vn-field.c:626 msgid "The default value" msgstr "" @@ -124,19 +124,19 @@ msgstr "" msgid "The character used for delimite the name of fields, tables..." msgstr "" -#: ../sql/sql-value.c:245 ../glade/glade-db-model.c:530 +#: ../sql/sql-value.c:248 ../glade/glade-db-model.c:638 msgid "Param" msgstr "" -#: ../sql/sql-value.c:246 +#: ../sql/sql-value.c:249 msgid "The param which is linked" msgstr "" -#: ../sql/sql-value.c:253 +#: ../sql/sql-value.c:256 msgid "The value" msgstr "" -#: ../sql/sql-string.c:188 ../db/db-model.c:3311 ../db/db-request.c:449 +#: ../sql/sql-string.c:188 ../db/db-model.c:3315 ../db/db-request.c:449 msgid "SQL" msgstr "" @@ -212,7 +212,7 @@ msgstr "" msgid "The function parameters" msgstr "" -#: ../sql/sql-holder.c:124 ../glade/glade-db-model.c:369 +#: ../sql/sql-holder.c:124 ../glade/glade-sql-batch.c:436 msgid "Identifier" msgstr "" @@ -329,97 +329,97 @@ msgstr "" msgid "Can't allocate the needed memory" msgstr "" -#: ../db/db-iterator.c:1056 +#: ../db/db-iterator.c:1063 msgid "The mode in which the iterator is working" msgstr "" -#: ../db/db-iterator.c:1063 +#: ../db/db-iterator.c:1070 #, fuzzy msgid "Remember selection" msgstr "Recordar" -#: ../db/db-iterator.c:1064 +#: ../db/db-iterator.c:1071 msgid "Wether to rememeber the selection when model is refreshed" msgstr "" -#: ../db/db-model.c:3285 ../db/db-request.c:442 ../vn/vn-gui.c:1560 +#: ../db/db-model.c:3289 ../db/db-request.c:442 ../vn/vn-gui.c:1472 #: ../vn/vn-form.c:245 msgid "Connection" msgstr "" -#: ../db/db-model.c:3286 +#: ../db/db-model.c:3290 msgid "The DbConn that manages the connection to the database" msgstr "" -#: ../db/db-model.c:3293 +#: ../db/db-model.c:3297 msgid "Statement" msgstr "" -#: ../db/db-model.c:3294 +#: ../db/db-model.c:3298 msgid "The statement which retrieves the data" msgstr "" -#: ../db/db-model.c:3301 +#: ../db/db-model.c:3305 msgid "Use file" msgstr "" -#: ../db/db-model.c:3302 +#: ../db/db-model.c:3306 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:3312 +#: ../db/db-model.c:3316 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:3321 +#: ../db/db-model.c:3325 msgid "Main Table" msgstr "" -#: ../db/db-model.c:3322 +#: ../db/db-model.c:3326 msgid "The main table of the model" msgstr "" -#: ../db/db-model.c:3329 +#: ../db/db-model.c:3333 msgid "Update flags" msgstr "" -#: ../db/db-model.c:3330 +#: ../db/db-model.c:3334 msgid "The flags that indicate how a model can be modified" msgstr "" -#: ../db/db-model.c:3338 +#: ../db/db-model.c:3342 msgid "Result position" msgstr "" -#: ../db/db-model.c:3339 +#: ../db/db-model.c:3343 msgid "" "The position where the query that will fill the model will be placed in a " "multi-query" msgstr "" -#: ../db/db-model.c:3349 +#: ../db/db-model.c:3353 msgid "Partial delete" msgstr "" -#: ../db/db-model.c:3350 +#: ../db/db-model.c:3354 msgid "" "When a row is deleted set all the fields from the table to null rather than " "delete it." msgstr "" -#: ../db/db-model.c:3358 +#: ../db/db-model.c:3362 msgid "Batch" msgstr "" -#: ../db/db-model.c:3359 +#: ../db/db-model.c:3363 msgid "The batch assigned to the model" msgstr "" -#: ../db/db-model-holder.c:71 ../db/db-calc.c:329 +#: ../db/db-model-holder.c:71 ../db/db-calc.c:405 msgid "Model" msgstr "" @@ -427,43 +427,52 @@ msgstr "" msgid "The model used by the holder" msgstr "" -#: ../db/db-calc.c:330 +#: ../db/db-calc.c:406 msgid "The model where the operations will be applied" msgstr "" -#: ../db/db-calc.c:337 +#: ../db/db-calc.c:413 msgid "Operation type" msgstr "" -#: ../db/db-calc.c:338 +#: ../db/db-calc.c:414 msgid "The type of the operation applied over the function" msgstr "" -#: ../db/db-calc.c:346 +#: ../db/db-calc.c:422 msgid "Function" msgstr "" -#: ../db/db-calc.c:347 +#: ../db/db-calc.c:423 msgid "The function to execute" msgstr "" -#: ../db/db-calc.c:353 +#: ../db/db-calc.c:429 msgid "Data" msgstr "" -#: ../db/db-calc.c:354 +#: ../db/db-calc.c:430 msgid "The user provided data for the function" msgstr "" -#: ../db/db-calc.c:360 ../glade/glade-db-model.c:293 -msgid "Column" +#: ../db/db-calc.c:436 ../db/db-param.c:258 ../vn/vn-column.c:493 +msgid "Column index" msgstr "" -#: ../db/db-calc.c:361 +#: ../db/db-calc.c:437 msgid "A column to apply the operations over it" msgstr "" -#: ../db/db-param.c:251 ../vn/vn-grid.c:518 ../vn/vn-field.c:587 +#: ../db/db-calc.c:446 ../db/db-param.c:265 ../vn/vn-field.c:597 +#: ../vn/vn-column.c:500 +msgid "Column name" +msgstr "Nom de la columna" + +#: ../db/db-calc.c:447 +msgid "A column name to apply the operations over it" +msgstr "" + +#: ../db/db-param.c:251 ../vn/vn-grid.c:421 ../vn/vn-field.c:590 msgid "Iterator" msgstr "" @@ -471,19 +480,11 @@ msgstr "" msgid "The iterator owner of param" msgstr "" -#: ../db/db-param.c:258 ../vn/vn-column.c:490 -msgid "Column index" -msgstr "" - #: ../db/db-param.c:259 msgid "The referenced column index" msgstr "" -#: ../db/db-param.c:265 ../vn/vn-field.c:594 ../vn/vn-column.c:497 -msgid "Column name" -msgstr "Nom de la columna" - -#: ../db/db-param.c:266 ../vn/vn-column.c:498 +#: ../db/db-param.c:266 ../vn/vn-column.c:501 msgid "The referenced column name" msgstr "Nom de la columna referenciada" @@ -524,7 +525,7 @@ msgid "The path where query files are located" msgstr "" #: ../db/db-conn.c:1062 ../db/db-file-loader.c:716 -#: ../vn/column/vn-column-image.c:493 +#: ../vn/column/vn-column-image.c:498 msgid "Host" msgstr "" @@ -587,11 +588,11 @@ msgstr "" msgid "Unknown content length of file %s" msgstr "" -#: ../db/db-file-loader.c:717 ../vn/column/vn-column-image.c:494 +#: ../db/db-file-loader.c:717 ../vn/column/vn-column-image.c:499 msgid "The host web server name to get the images" msgstr "" -#: ../db/db-file-loader.c:724 ../vn/column/vn-column-image.c:501 +#: ../db/db-file-loader.c:724 ../vn/column/vn-column-image.c:506 msgid "Path" msgstr "" @@ -617,63 +618,63 @@ msgstr "" msgid "The maximal size for the contents of the cache directory" msgstr "" -#: ../vn/vn-gui.c:632 +#: ../vn/vn-gui.c:545 msgid "Connection has been lost. Do you want to reconnect?" msgstr "" -#: ../vn/vn-gui.c:639 +#: ../vn/vn-gui.c:552 msgid "An error occurred in the connection." msgstr "" -#: ../vn/vn-gui.c:642 +#: ../vn/vn-gui.c:555 msgid "Database error" msgstr "" -#: ../vn/vn-gui.c:649 +#: ../vn/vn-gui.c:562 msgid "Unknown error" msgstr "" -#: ../vn/vn-gui.c:998 +#: ../vn/vn-gui.c:910 msgid "Closing connection" msgstr "" -#: ../vn/vn-gui.c:1000 +#: ../vn/vn-gui.c:912 msgid "Transaction started" msgstr "" -#: ../vn/vn-gui.c:1002 +#: ../vn/vn-gui.c:914 msgid "Connecting" msgstr "" -#: ../vn/vn-gui.c:1004 +#: ../vn/vn-gui.c:916 msgid "Connection lost" msgstr "" -#: ../vn/vn-gui.c:1006 +#: ../vn/vn-gui.c:918 msgid "Connection closed" msgstr "" -#: ../vn/vn-gui.c:1008 ../vn/field/vn-http-image.c:119 +#: ../vn/vn-gui.c:920 ../vn/field/vn-http-image.c:119 msgid "Loading" msgstr "" -#: ../vn/vn-gui.c:1010 +#: ../vn/vn-gui.c:922 msgid "Ready" msgstr "" -#: ../vn/vn-gui.c:1561 +#: ../vn/vn-gui.c:1473 msgid "The connection used by Gui" msgstr "" -#: ../vn/vn-gui.c:1567 +#: ../vn/vn-gui.c:1479 msgid "Application" msgstr "" -#: ../vn/vn-gui.c:1568 +#: ../vn/vn-gui.c:1480 msgid "The application handler for the entire program" msgstr "" -#: ../vn/vn-grid.c:519 +#: ../vn/vn-grid.c:422 msgid "The iterator used by VnGrid" msgstr "" @@ -725,19 +726,19 @@ msgstr "" msgid "Move to the last row" msgstr "" -#: ../vn/vn-handler.c:529 +#: ../vn/vn-handler.c:531 msgid "Show flags" msgstr "" -#: ../vn/vn-handler.c:530 +#: ../vn/vn-handler.c:532 msgid "Sets the buttons that will be shown on the interface" msgstr "" -#: ../vn/vn-handler.c:537 +#: ../vn/vn-handler.c:539 msgid "Simple record" msgstr "" -#: ../vn/vn-handler.c:538 +#: ../vn/vn-handler.c:540 msgid "Sets if it is used to handle a iterator with a single record" msgstr "" @@ -782,75 +783,75 @@ msgstr "" msgid "The application identifier" msgstr "" -#: ../vn/vn-field.c:574 +#: ../vn/vn-field.c:577 msgid "The current value of the field" msgstr "" -#: ../vn/vn-field.c:580 ../glade/glade-db-iterator.c:71 -#: ../glade/glade-db-iterator.c:116 +#: ../vn/vn-field.c:583 ../glade/glade-db-iterator.c:71 +#: ../glade/glade-db-iterator.c:116 ../glade/glade-sql-batch.c:445 msgid "Parameter" msgstr "" -#: ../vn/vn-field.c:581 +#: ../vn/vn-field.c:584 msgid "The param where the field can read/write its value" msgstr "" -#: ../vn/vn-field.c:588 +#: ../vn/vn-field.c:591 msgid "The iterator used to get the field param" msgstr "" -#: ../vn/vn-field.c:595 +#: ../vn/vn-field.c:598 msgid "The column name on the iterator" msgstr "" -#: ../vn/vn-field.c:609 +#: ../vn/vn-field.c:612 msgid "Whether the field value is user editable" msgstr "" -#: ../vn/vn-field.c:616 ../vn/vn-column.c:512 +#: ../vn/vn-field.c:619 ../vn/vn-column.c:515 msgid "Whether the field value can be of type GVN_TYPE_NULL" msgstr "" -#: ../vn/vn-field.c:629 ../vn/vn-column.c:525 +#: ../vn/vn-field.c:632 ../vn/vn-column.c:528 msgid "Style function" msgstr "" -#: ../vn/vn-field.c:630 +#: ../vn/vn-field.c:633 msgid "" "A VnFieldStyleFunc to set the properties of each field depending on its value" msgstr "" -#: ../vn/field/vn-entry.c:156 ../vn/field/vn-date-chooser.c:489 -#: ../vn/field/vn-label.c:114 ../vn/column/vn-column-entry.c:122 +#: ../vn/field/vn-entry.c:156 ../vn/field/vn-date-chooser.c:477 +#: ../vn/field/vn-label.c:115 ../vn/column/vn-column-entry.c:127 msgid "Format" msgstr "" -#: ../vn/field/vn-entry.c:157 ../vn/field/vn-label.c:115 -#: ../vn/column/vn-column-entry.c:123 +#: ../vn/field/vn-entry.c:157 ../vn/field/vn-label.c:116 +#: ../vn/column/vn-column-entry.c:128 msgid "The format string describing the output of the entry." msgstr "" -#: ../vn/field/vn-spin.c:171 ../vn/column/vn-column-spin.c:246 +#: ../vn/field/vn-spin.c:171 ../vn/column/vn-column-spin.c:201 msgid "Digits" msgstr "" -#: ../vn/field/vn-spin.c:172 ../vn/column/vn-column-spin.c:247 +#: ../vn/field/vn-spin.c:172 ../vn/column/vn-column-spin.c:202 msgid "The number of decimal places to display." msgstr "" -#: ../vn/field/vn-combo.c:286 ../vn/column/vn-column-combo.c:333 +#: ../vn/field/vn-combo.c:286 ../vn/column/vn-column-combo.c:340 msgid "Index column" msgstr "" -#: ../vn/field/vn-combo.c:287 ../vn/column/vn-column-combo.c:334 +#: ../vn/field/vn-combo.c:287 ../vn/column/vn-column-combo.c:341 msgid "The column index of the model" msgstr "" -#: ../vn/field/vn-combo.c:293 ../vn/column/vn-column-combo.c:340 +#: ../vn/field/vn-combo.c:293 ../vn/column/vn-column-combo.c:347 msgid "Show column" msgstr "" -#: ../vn/field/vn-combo.c:294 ../vn/column/vn-column-combo.c:341 +#: ../vn/field/vn-combo.c:294 ../vn/column/vn-column-combo.c:348 msgid "The column of the model shown by combo" msgstr "" @@ -862,34 +863,34 @@ msgstr "" msgid "The name of the field used for the search" msgstr "" -#: ../vn/field/vn-date-chooser.c:438 +#: ../vn/field/vn-date-chooser.c:426 msgid "Change date" msgstr "" -#: ../vn/field/vn-date-chooser.c:490 +#: ../vn/field/vn-date-chooser.c:478 msgid "The date format string describing the order of the elements." msgstr "" -#: ../vn/field/vn-date-chooser.c:491 +#: ../vn/field/vn-date-chooser.c:479 msgctxt "Default date format string" msgid "%a, %d %b %Y" msgstr "" -#: ../vn/field/vn-date-chooser.c:497 +#: ../vn/field/vn-date-chooser.c:485 msgid "Show time" msgstr "" -#: ../vn/field/vn-date-chooser.c:498 +#: ../vn/field/vn-date-chooser.c:486 msgid "" "Whether to show the hour, minute and second fields to set the time of the " "day in the popup." msgstr "" -#: ../vn/field/vn-date-chooser.c:506 +#: ../vn/field/vn-date-chooser.c:494 msgid "Show date" msgstr "" -#: ../vn/field/vn-date-chooser.c:507 +#: ../vn/field/vn-date-chooser.c:495 msgid "Whether to show the calendar to set the date in the popup." msgstr "" @@ -911,7 +912,7 @@ msgstr "" msgid "No image set" msgstr "" -#: ../vn/field/vn-http-image.c:211 ../vn/column/vn-column-image.c:531 +#: ../vn/field/vn-http-image.c:211 ../vn/column/vn-column-image.c:536 msgid "File loader" msgstr "" @@ -935,92 +936,60 @@ msgstr "" msgid "A GBytes structure with the image data" msgstr "" -#: ../vn/vn-column.c:491 +#: ../vn/vn-column.c:494 msgid "The column index in the model" msgstr "" -#: ../vn/vn-column.c:505 +#: ../vn/vn-column.c:508 msgid "Whether the column values are editable" msgstr "" -#: ../vn/vn-column.c:518 +#: ../vn/vn-column.c:521 msgid "Tab index" msgstr "" -#: ../vn/vn-column.c:519 +#: ../vn/vn-column.c:522 msgid "Order in which the tab selects the columns for edition" msgstr "" -#: ../vn/vn-column.c:526 +#: ../vn/vn-column.c:529 msgid "" "A VnColumnStyleFunc to set the properties of each cell depending on its value" msgstr "" -#: ../vn/column/vn-column-spin.c:238 -msgid "Climb rate" -msgstr "" - -#: ../vn/column/vn-column-spin.c:239 -msgid "The acceleration rate when you hold down a button." -msgstr "" - -#: ../vn/column/vn-column-spin.c:254 -msgid "Minimum value" -msgstr "" - -#: ../vn/column/vn-column-spin.c:255 -msgid "The minimum value of the internal adjustment." -msgstr "" - -#: ../vn/column/vn-column-spin.c:262 -msgid "Maximum value" -msgstr "" - -#: ../vn/column/vn-column-spin.c:263 -msgid "The maximum value of the internal adjustment." -msgstr "" - -#: ../vn/column/vn-column-spin.c:270 -msgid "Step Increment" -msgstr "" - -#: ../vn/column/vn-column-spin.c:271 -msgid "The step increment of the internal adjustment" -msgstr "" - -#: ../vn/column/vn-column-combo.c:347 +#: ../vn/column/vn-column-combo.c:354 msgid "Sort column" msgstr "" -#: ../vn/column/vn-column-combo.c:348 +#: ../vn/column/vn-column-combo.c:355 msgid "The field number of the Grid model used to sort the column" msgstr "" -#: ../vn/column/vn-column-image.c:502 +#: ../vn/column/vn-column-image.c:507 msgid "Base path from the host where the images will be downloaded" msgstr "" -#: ../vn/column/vn-column-image.c:509 +#: ../vn/column/vn-column-image.c:514 msgid "Tooltip path" msgstr "" -#: ../vn/column/vn-column-image.c:510 +#: ../vn/column/vn-column-image.c:515 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:519 +#: ../vn/column/vn-column-image.c:524 msgid "Tooltip size" msgstr "" -#: ../vn/column/vn-column-image.c:520 +#: ../vn/column/vn-column-image.c:525 msgid "" "Size of the bigger side of the tooltip images, the another side will be " "scaled accordingly and smaller images won't be scaled" msgstr "" -#: ../vn/column/vn-column-image.c:532 +#: ../vn/column/vn-column-image.c:537 msgid "An optional file loader, if it's NULL the column will create one" msgstr "" @@ -1101,13 +1070,13 @@ msgid "" "02111-1307 USA." msgstr "" -#: ../vn/gui/date-chooser.glade.h:1 ../glade/glade-db-model.c:72 -#: ../glade/glade-eprop-model.c:163 +#: ../vn/gui/date-chooser.glade.h:1 ../glade/glade-db-model.c:143 +#: ../glade/glade-eprop-model.c:150 msgid "OK" msgstr "" -#: ../vn/gui/date-chooser.glade.h:2 ../glade/glade-db-model.c:73 -#: ../glade/glade-eprop-model.c:164 +#: ../vn/gui/date-chooser.glade.h:2 ../glade/glade-db-model.c:144 +#: ../glade/glade-eprop-model.c:151 msgid "Clear" msgstr "" @@ -1115,76 +1084,100 @@ msgstr "" msgid "Now" msgstr "" +#: ../vn/gui/menu.glade.h:1 +msgid "New window" +msgstr "" + +#: ../vn/gui/menu.glade.h:2 +msgid "Logout" +msgstr "" + +#: ../vn/gui/menu.glade.h:3 +msgid "Connect" +msgstr "" + +#: ../vn/gui/menu.glade.h:4 +msgid "About" +msgstr "" + +#: ../vn/gui/menu.glade.h:5 +msgid "Quit" +msgstr "" + +#: ../vn/gui/menu.glade.h:6 +msgid "Close" +msgstr "" + #: ../glade/glade-db-model.c:37 msgid "New SQL statement" msgstr "" -#: ../glade/glade-db-model.c:69 +#: ../glade/glade-db-model.c:100 +msgid "Save as..." +msgstr "" + +#: ../glade/glade-db-model.c:140 msgid "SQL Editor" msgstr "" -#: ../glade/glade-db-model.c:74 ../glade/glade-eprop-model.c:165 +#: ../glade/glade-db-model.c:145 ../glade/glade-eprop-model.c:152 msgid "Cancel" msgstr "" -#: ../glade/glade-db-model.c:184 +#: ../glade/glade-db-model.c:203 +msgid "Save project" +msgstr "" + +#: ../glade/glade-db-model.c:274 msgid "Open the SQL Editor" msgstr "" -#: ../glade/glade-db-model.c:289 +#: ../glade/glade-db-model.c:354 ../glade/glade-sql-batch.c:185 +msgid "Select a GvnParam" +msgstr "" + +#: ../glade/glade-db-model.c:422 ../glade/glade-sql-batch.c:253 +msgid "Select the parameter from a list" +msgstr "" + +#: ../glade/glade-db-model.c:440 ../glade/glade-sql-batch.c:271 +msgid "You need to create at least one GvnParam or derived object" +msgstr "" + +#: ../glade/glade-db-model.c:594 msgid "Add or remove links" msgstr "" -#: ../glade/glade-db-model.c:303 +#: ../glade/glade-db-model.c:629 +msgid "Column" +msgstr "" + +#: ../glade/glade-db-model.c:646 msgctxt "Verb" msgid "Link" msgstr "" -#: ../glade/glade-db-model.c:365 -msgid "Add or remove holders" -msgstr "" - -#: ../glade/glade-db-model.c:440 -msgid "Select a GvnParam" -msgstr "" - -#: ../glade/glade-db-model.c:497 -msgid "Select the parameter from a list" -msgstr "" - -#: ../glade/glade-db-model.c:515 -msgid "You need to create at least one GvnParam or derived object" -msgstr "" - -#: ../glade/glade-db-model-editor.c:62 +#: ../glade/glade-db-model-editor.c:54 msgid "List of parameters linked to the model" msgstr "" -#: ../glade/glade-db-model-editor.c:65 -msgid "List of SqlHolders and identifiers" -msgstr "" - -#: ../glade/glade-eprop-model.c:128 +#: ../glade/glade-eprop-model.c:118 msgid "Create and set a model for a DbModelHolder" msgstr "" -#: ../glade/glade-eprop-model.c:160 +#: ../glade/glade-eprop-model.c:147 msgid "Model configuration" msgstr "" -#: ../glade/glade-eprop-model.c:160 -msgid "Model properties configuration" -msgstr "" - -#: ../glade/glade-eprop-model.c:243 +#: ../glade/glade-eprop-model.c:218 msgid "Select a VnModel for the property" msgstr "" -#: ../glade/glade-eprop-model.c:264 ../glade/glade-eprop-model.c:310 +#: ../glade/glade-eprop-model.c:239 ../glade/glade-eprop-model.c:285 msgid "New Model" msgstr "" -#: ../glade/glade-eprop-model.c:305 +#: ../glade/glade-eprop-model.c:280 msgid "Edit Model" msgstr "" @@ -1215,6 +1208,14 @@ msgstr "" msgid "Automatic generation of params for %s" msgstr "" +#: ../glade/glade-sql-batch.c:79 +msgid "List of items" +msgstr "" + +#: ../glade/glade-sql-batch.c:401 +msgid "Add or remove items" +msgstr "" + #: ../glade/vn.xml.h:1 msgid "The model held by the object" msgstr "" @@ -1224,10 +1225,28 @@ msgid "Example" msgstr "" #: ../module/data/example.xml.h:2 +msgid "" +"\n" +"\t\t\tConsulter\n" +"\t\t" +msgstr "" + +#: ../module/data/example.xml.h:5 +msgid "" +"\n" +"\t\t\tCustomer\n" +"\t\t" +msgstr "" + +#: ../module/data/example-menu.xml.h:1 msgid "Consulter" msgstr "" -#: ../module/data/consulter.glade.h:1 +#: ../module/data/example-menu.xml.h:2 +msgid "Customer" +msgstr "" + +#: ../module/data/consulter.glade.h:1 ../module/data/consulter-menu.xml.h:1 msgid "Send" msgstr "" @@ -1235,7 +1254,7 @@ msgstr "" msgid "Send the current query" msgstr "" -#: ../module/data/consulter.glade.h:3 +#: ../module/data/consulter.glade.h:3 ../module/data/consulter-menu.xml.h:2 msgid "Clean" msgstr "" @@ -1252,15 +1271,15 @@ msgid "Query:" msgstr "" #: ../module/data/consulter.glade.h:7 -msgid "Immediate changes" -msgstr "" - -#: ../module/src/vn-consulter.c:234 msgid "Type or select a query" msgstr "" -#: ../module/src/vn-consulter.c:236 -msgid "Message" +#: ../module/data/consulter.glade.h:8 +msgid "Log" +msgstr "" + +#: ../module/data/consulter.glade.h:9 +msgid "Immediate changes" msgstr "" #~ msgid "Hedera" diff --git a/po/es.po b/po/es.po index 279a179..0051e0c 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: 2014-07-07 15:57+0200\n" +"POT-Creation-Date: 2014-07-15 14:27+0200\n" "PO-Revision-Date: 2013-06-04 13:36+0200\n" "Last-Translator: Alejandro T. Colombini Gómez \n" "Language-Team: Spanish\n" @@ -33,7 +33,7 @@ msgstr "El parámetro no puede ser nulo" msgid "Incompatible type for this param" msgstr "Tipo incompatible para este parametro" -#: ../gvn/gvn-param.c:443 ../sql/sql-value.c:252 ../vn/vn-field.c:573 +#: ../gvn/gvn-param.c:443 ../sql/sql-value.c:255 ../vn/vn-field.c:576 msgid "Value" msgstr "Valor" @@ -49,7 +49,7 @@ msgstr "Maestro" msgid "The master GvnParam of this parameter" msgstr "El GvnParam maestro de este parámetro" -#: ../gvn/gvn-param.c:457 ../db/db-iterator.c:1055 +#: ../gvn/gvn-param.c:457 ../db/db-iterator.c:1062 msgid "Mode" msgstr "Modo" @@ -73,15 +73,15 @@ msgstr "Spec" msgid "The spec of the parameter" msgstr "Datos específicos del parámetro" -#: ../gvn/gvn-param.c:478 ../vn/vn-field.c:601 +#: ../gvn/gvn-param.c:478 ../vn/vn-field.c:604 msgid "Glib Type" msgstr "Tipo Glib" -#: ../gvn/gvn-param.c:479 ../vn/vn-field.c:602 +#: ../gvn/gvn-param.c:479 ../vn/vn-field.c:605 msgid "The type of the value" msgstr "El tipo del valor" -#: ../gvn/gvn-param.c:485 ../vn/vn-field.c:608 ../vn/vn-column.c:504 +#: ../gvn/gvn-param.c:485 ../vn/vn-field.c:611 ../vn/vn-column.c:507 msgid "Editable" msgstr "Editable" @@ -89,7 +89,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:615 ../vn/vn-column.c:511 +#: ../gvn/gvn-param.c:492 ../vn/vn-field.c:618 ../vn/vn-column.c:514 msgid "Null" msgstr "Nulo" @@ -97,11 +97,11 @@ msgstr "Nulo" msgid "Whether the param value can be of type GVN_TYPE_NULL" msgstr "Indica si el parámetro puede ser nulo" -#: ../gvn/gvn-param.c:499 ../vn/vn-field.c:622 +#: ../gvn/gvn-param.c:499 ../vn/vn-field.c:625 msgid "Default Value" msgstr "Valor por defecto" -#: ../gvn/gvn-param.c:500 ../vn/vn-field.c:623 +#: ../gvn/gvn-param.c:500 ../vn/vn-field.c:626 msgid "The default value" msgstr "El valor por defecto" @@ -126,19 +126,19 @@ msgstr "Delimitador" msgid "The character used for delimite the name of fields, tables..." msgstr "El carácter usado para delimitar los nombres de campos, tablas..." -#: ../sql/sql-value.c:245 ../glade/glade-db-model.c:530 +#: ../sql/sql-value.c:248 ../glade/glade-db-model.c:638 msgid "Param" msgstr "Parámetro" -#: ../sql/sql-value.c:246 +#: ../sql/sql-value.c:249 msgid "The param which is linked" msgstr "El parametro al cual está vinculado" -#: ../sql/sql-value.c:253 +#: ../sql/sql-value.c:256 msgid "The value" msgstr "Valor" -#: ../sql/sql-string.c:188 ../db/db-model.c:3311 ../db/db-request.c:449 +#: ../sql/sql-string.c:188 ../db/db-model.c:3315 ../db/db-request.c:449 msgid "SQL" msgstr "SQL" @@ -210,7 +210,7 @@ msgstr "Parámetros" msgid "The function parameters" msgstr "Los parametros de la función" -#: ../sql/sql-holder.c:124 ../glade/glade-db-model.c:369 +#: ../sql/sql-holder.c:124 ../glade/glade-sql-batch.c:436 msgid "Identifier" msgstr "Identificador" @@ -327,41 +327,41 @@ msgstr "Una de las posibles opciones de #SqlSelectType" msgid "Can't allocate the needed memory" msgstr "No es posible asignar la memoria necesaria" -#: ../db/db-iterator.c:1056 +#: ../db/db-iterator.c:1063 msgid "The mode in which the iterator is working" msgstr "El modo en el que está trabajando el Iterator" -#: ../db/db-iterator.c:1063 +#: ../db/db-iterator.c:1070 msgid "Remember selection" msgstr "Recordar fila seleccionada" -#: ../db/db-iterator.c:1064 +#: ../db/db-iterator.c:1071 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:3285 ../db/db-request.c:442 ../vn/vn-gui.c:1560 +#: ../db/db-model.c:3289 ../db/db-request.c:442 ../vn/vn-gui.c:1472 #: ../vn/vn-form.c:245 msgid "Connection" msgstr "Conexión" -#: ../db/db-model.c:3286 +#: ../db/db-model.c:3290 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:3293 +#: ../db/db-model.c:3297 msgid "Statement" msgstr "Consulta" -#: ../db/db-model.c:3294 +#: ../db/db-model.c:3298 msgid "The statement which retrieves the data" msgstr "La consulta que recupera los datos" -#: ../db/db-model.c:3301 +#: ../db/db-model.c:3305 msgid "Use file" msgstr "Usa fichero" -#: ../db/db-model.c:3302 +#: ../db/db-model.c:3306 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" @@ -369,7 +369,7 @@ 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:3312 +#: ../db/db-model.c:3316 msgid "" "Depending on the \"use-file\" property this will be the path to a file with " "queries for the model or a SQL string" @@ -377,27 +377,27 @@ 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:3321 +#: ../db/db-model.c:3325 msgid "Main Table" msgstr "Tabla principal" -#: ../db/db-model.c:3322 +#: ../db/db-model.c:3326 msgid "The main table of the model" msgstr "La tabla principal del modelo" -#: ../db/db-model.c:3329 +#: ../db/db-model.c:3333 msgid "Update flags" msgstr "Flags de actualización" -#: ../db/db-model.c:3330 +#: ../db/db-model.c:3334 msgid "The flags that indicate how a model can be modified" msgstr "Indican como se puede modificar el modelo" -#: ../db/db-model.c:3338 +#: ../db/db-model.c:3342 msgid "Result position" msgstr "Posición del resultado" -#: ../db/db-model.c:3339 +#: ../db/db-model.c:3343 msgid "" "The position where the query that will fill the model will be placed in a " "multi-query" @@ -405,11 +405,11 @@ msgstr "" "La posición en la que se situa la consulta que pone datos en el modelo en " "una consulta múltiple" -#: ../db/db-model.c:3349 +#: ../db/db-model.c:3353 msgid "Partial delete" msgstr "Delete parcial" -#: ../db/db-model.c:3350 +#: ../db/db-model.c:3354 msgid "" "When a row is deleted set all the fields from the table to null rather than " "delete it." @@ -417,15 +417,15 @@ msgstr "" "Cuando una fila es eliminada, poner todos los campos de la tabla a nulo en " "lugar de borrarla." -#: ../db/db-model.c:3358 +#: ../db/db-model.c:3362 msgid "Batch" msgstr "Batch" -#: ../db/db-model.c:3359 +#: ../db/db-model.c:3363 msgid "The batch assigned to the model" msgstr "El batch asignado al modelo" -#: ../db/db-model-holder.c:71 ../db/db-calc.c:329 +#: ../db/db-model-holder.c:71 ../db/db-calc.c:405 msgid "Model" msgstr "Modelo" @@ -433,43 +433,52 @@ msgstr "Modelo" msgid "The model used by the holder" msgstr "La conexión empleada por el objeto" -#: ../db/db-calc.c:330 +#: ../db/db-calc.c:406 msgid "The model where the operations will be applied" msgstr "El modelo en el que se aplicarán las operaciones" -#: ../db/db-calc.c:337 +#: ../db/db-calc.c:413 msgid "Operation type" msgstr "Tipo de operación" -#: ../db/db-calc.c:338 +#: ../db/db-calc.c:414 msgid "The type of the operation applied over the function" msgstr "El tipo de operación aplicada sobre la función" -#: ../db/db-calc.c:346 +#: ../db/db-calc.c:422 msgid "Function" msgstr "Función" -#: ../db/db-calc.c:347 +#: ../db/db-calc.c:423 msgid "The function to execute" msgstr "Función a ejecutar" -#: ../db/db-calc.c:353 +#: ../db/db-calc.c:429 msgid "Data" msgstr "Datos" -#: ../db/db-calc.c:354 +#: ../db/db-calc.c:430 msgid "The user provided data for the function" msgstr "Datos proporcionados por el usuario" -#: ../db/db-calc.c:360 ../glade/glade-db-model.c:293 -msgid "Column" -msgstr "Columna" +#: ../db/db-calc.c:436 ../db/db-param.c:258 ../vn/vn-column.c:493 +msgid "Column index" +msgstr "Posición" -#: ../db/db-calc.c:361 +#: ../db/db-calc.c:437 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:518 ../vn/vn-field.c:587 +#: ../db/db-calc.c:446 ../db/db-param.c:265 ../vn/vn-field.c:597 +#: ../vn/vn-column.c:500 +msgid "Column name" +msgstr "Nombre de la columna" + +#: ../db/db-calc.c:447 +msgid "A column name to apply the operations over it" +msgstr "Nombre de la columna sobre la que se aplicarán las operaciones" + +#: ../db/db-param.c:251 ../vn/vn-grid.c:421 ../vn/vn-field.c:590 msgid "Iterator" msgstr "Iterator" @@ -477,19 +486,11 @@ 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:490 -msgid "Column index" -msgstr "Posición" - #: ../db/db-param.c:259 msgid "The referenced column index" msgstr "La posición de la columna en el Grid" -#: ../db/db-param.c:265 ../vn/vn-field.c:594 ../vn/vn-column.c:497 -msgid "Column name" -msgstr "Nombre de la columna" - -#: ../db/db-param.c:266 ../vn/vn-column.c:498 +#: ../db/db-param.c:266 ../vn/vn-column.c:501 msgid "The referenced column name" msgstr "" "El nombre del campo en el Iterator vinculado al Grid al que pretenece la " @@ -532,7 +533,7 @@ msgid "The path where query files are located" msgstr "La ruta donde se encuentran los archivos de consultas" #: ../db/db-conn.c:1062 ../db/db-file-loader.c:716 -#: ../vn/column/vn-column-image.c:493 +#: ../vn/column/vn-column-image.c:498 msgid "Host" msgstr "Host" @@ -595,11 +596,11 @@ msgstr "No se ha guardado %s en la cache" msgid "Unknown content length of file %s" msgstr "Longitud del contenido del archivo %s desconocida" -#: ../db/db-file-loader.c:717 ../vn/column/vn-column-image.c:494 +#: ../db/db-file-loader.c:717 ../vn/column/vn-column-image.c:499 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:724 ../vn/column/vn-column-image.c:501 +#: ../db/db-file-loader.c:724 ../vn/column/vn-column-image.c:506 msgid "Path" msgstr "Ruta" @@ -627,63 +628,63 @@ msgstr "Tamaño máximo de la caché" msgid "The maximal size for the contents of the cache directory" msgstr "El tamaño máximo para los contenidos del directorio de caché" -#: ../vn/vn-gui.c:632 +#: ../vn/vn-gui.c:545 msgid "Connection has been lost. Do you want to reconnect?" msgstr "Se ha perdido la conexión. ¿Quieres reconectar?" -#: ../vn/vn-gui.c:639 +#: ../vn/vn-gui.c:552 msgid "An error occurred in the connection." msgstr "Ha habido un error en la conexión." -#: ../vn/vn-gui.c:642 +#: ../vn/vn-gui.c:555 msgid "Database error" msgstr "Error en la base de datos" -#: ../vn/vn-gui.c:649 +#: ../vn/vn-gui.c:562 msgid "Unknown error" msgstr "Error desconocido" -#: ../vn/vn-gui.c:998 +#: ../vn/vn-gui.c:910 msgid "Closing connection" msgstr "Cerrando conexión" -#: ../vn/vn-gui.c:1000 +#: ../vn/vn-gui.c:912 msgid "Transaction started" msgstr "Transacción iniciada" -#: ../vn/vn-gui.c:1002 +#: ../vn/vn-gui.c:914 msgid "Connecting" msgstr "Conectando" -#: ../vn/vn-gui.c:1004 +#: ../vn/vn-gui.c:916 msgid "Connection lost" msgstr "Conexión perdida" -#: ../vn/vn-gui.c:1006 +#: ../vn/vn-gui.c:918 msgid "Connection closed" msgstr "Conexión cerrada" -#: ../vn/vn-gui.c:1008 ../vn/field/vn-http-image.c:119 +#: ../vn/vn-gui.c:920 ../vn/field/vn-http-image.c:119 msgid "Loading" msgstr "Cargando" -#: ../vn/vn-gui.c:1010 +#: ../vn/vn-gui.c:922 msgid "Ready" msgstr "Preparado" -#: ../vn/vn-gui.c:1561 +#: ../vn/vn-gui.c:1473 msgid "The connection used by Gui" msgstr "La conexión empleada por Gui" -#: ../vn/vn-gui.c:1567 +#: ../vn/vn-gui.c:1479 msgid "Application" msgstr "Aplicación" -#: ../vn/vn-gui.c:1568 +#: ../vn/vn-gui.c:1480 msgid "The application handler for the entire program" msgstr "El manejador de la aplicación para todo el programa" -#: ../vn/vn-grid.c:519 +#: ../vn/vn-grid.c:422 msgid "The iterator used by VnGrid" msgstr "El Iterator empleado por VnGrid" @@ -735,19 +736,19 @@ msgstr "Mover a la siguiente fila" msgid "Move to the last row" msgstr "Mover a la última fila" -#: ../vn/vn-handler.c:529 +#: ../vn/vn-handler.c:531 msgid "Show flags" msgstr "Visibilidad" -#: ../vn/vn-handler.c:530 +#: ../vn/vn-handler.c:532 msgid "Sets the buttons that will be shown on the interface" msgstr "Indica los botones que se mostrarán en la interfaz" -#: ../vn/vn-handler.c:537 +#: ../vn/vn-handler.c:539 msgid "Simple record" msgstr "Registro simple" -#: ../vn/vn-handler.c:538 +#: ../vn/vn-handler.c:540 msgid "Sets if it is used to handle a iterator with a single record" msgstr "Indica si se utiliza para manejar solo un registro" @@ -792,77 +793,77 @@ msgstr "Id de la aplicación" msgid "The application identifier" msgstr "El identificador de la aplicación" -#: ../vn/vn-field.c:574 +#: ../vn/vn-field.c:577 msgid "The current value of the field" msgstr "El valor actual del campo" -#: ../vn/vn-field.c:580 ../glade/glade-db-iterator.c:71 -#: ../glade/glade-db-iterator.c:116 +#: ../vn/vn-field.c:583 ../glade/glade-db-iterator.c:71 +#: ../glade/glade-db-iterator.c:116 ../glade/glade-sql-batch.c:445 msgid "Parameter" msgstr "Parámetro" -#: ../vn/vn-field.c:581 +#: ../vn/vn-field.c:584 msgid "The param where the field can read/write its value" msgstr "El parámetro en el que el campo escribe/lee su valor" -#: ../vn/vn-field.c:588 +#: ../vn/vn-field.c:591 msgid "The iterator used to get the field param" msgstr "El Iterator con el que se obtiene el parámetro" -#: ../vn/vn-field.c:595 +#: ../vn/vn-field.c:598 msgid "The column name on the iterator" msgstr "El nombre de la columna en el Iterator" -#: ../vn/vn-field.c:609 +#: ../vn/vn-field.c:612 msgid "Whether the field value is user editable" msgstr "Si el valor de campo puede ser editado por el usuario" -#: ../vn/vn-field.c:616 ../vn/vn-column.c:512 +#: ../vn/vn-field.c:619 ../vn/vn-column.c:515 msgid "Whether the field value can be of type GVN_TYPE_NULL" msgstr "Si el campo puede ser del tipo GVN_TYPE_NULL" -#: ../vn/vn-field.c:629 ../vn/vn-column.c:525 +#: ../vn/vn-field.c:632 ../vn/vn-column.c:528 msgid "Style function" msgstr "Función de estilo" -#: ../vn/vn-field.c:630 +#: ../vn/vn-field.c:633 msgid "" "A VnFieldStyleFunc to set the properties of each field depending on its value" msgstr "" "Una VnFieldStyleFunc para configurar las propiedades de cada campo " "dependiendo de su valor" -#: ../vn/field/vn-entry.c:156 ../vn/field/vn-date-chooser.c:489 -#: ../vn/field/vn-label.c:114 ../vn/column/vn-column-entry.c:122 +#: ../vn/field/vn-entry.c:156 ../vn/field/vn-date-chooser.c:477 +#: ../vn/field/vn-label.c:115 ../vn/column/vn-column-entry.c:127 msgid "Format" msgstr "Formato" -#: ../vn/field/vn-entry.c:157 ../vn/field/vn-label.c:115 -#: ../vn/column/vn-column-entry.c:123 +#: ../vn/field/vn-entry.c:157 ../vn/field/vn-label.c:116 +#: ../vn/column/vn-column-entry.c:128 msgid "The format string describing the output of the entry." msgstr "La cadena de formato que describe la salida del campo de texto." -#: ../vn/field/vn-spin.c:171 ../vn/column/vn-column-spin.c:246 +#: ../vn/field/vn-spin.c:171 ../vn/column/vn-column-spin.c:201 msgid "Digits" msgstr "Dígitos" -#: ../vn/field/vn-spin.c:172 ../vn/column/vn-column-spin.c:247 +#: ../vn/field/vn-spin.c:172 ../vn/column/vn-column-spin.c:202 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:333 +#: ../vn/field/vn-combo.c:286 ../vn/column/vn-column-combo.c:340 msgid "Index column" msgstr "Columna índice" -#: ../vn/field/vn-combo.c:287 ../vn/column/vn-column-combo.c:334 +#: ../vn/field/vn-combo.c:287 ../vn/column/vn-column-combo.c:341 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:340 +#: ../vn/field/vn-combo.c:293 ../vn/column/vn-column-combo.c:347 msgid "Show column" msgstr "Columna visible" -#: ../vn/field/vn-combo.c:294 ../vn/column/vn-column-combo.c:341 +#: ../vn/field/vn-combo.c:294 ../vn/column/vn-column-combo.c:348 msgid "The column of the model shown by combo" msgstr "La columna del modelo que se mostrará en el combo" @@ -874,25 +875,25 @@ msgstr "Campo" msgid "The name of the field used for the search" msgstr "El nombre del campo usado para la búsqueda" -#: ../vn/field/vn-date-chooser.c:438 +#: ../vn/field/vn-date-chooser.c:426 msgid "Change date" msgstr "Cambiar fecha" -#: ../vn/field/vn-date-chooser.c:490 +#: ../vn/field/vn-date-chooser.c:478 msgid "The date format string describing the order of the elements." msgstr "" "La cadena de formato de fechas que describe la salida del campo de texto." -#: ../vn/field/vn-date-chooser.c:491 +#: ../vn/field/vn-date-chooser.c:479 msgctxt "Default date format string" msgid "%a, %d %b %Y" msgstr "%a, %d %b %Y" -#: ../vn/field/vn-date-chooser.c:497 +#: ../vn/field/vn-date-chooser.c:485 msgid "Show time" msgstr "Mostrar tiempo" -#: ../vn/field/vn-date-chooser.c:498 +#: ../vn/field/vn-date-chooser.c:486 msgid "" "Whether to show the hour, minute and second fields to set the time of the " "day in the popup." @@ -900,11 +901,11 @@ msgstr "" "Si se muestran los campos para hora, minuto y segundo para indicar el " "instante del día en el emergente" -#: ../vn/field/vn-date-chooser.c:506 +#: ../vn/field/vn-date-chooser.c:494 msgid "Show date" msgstr "Mostrar fecha" -#: ../vn/field/vn-date-chooser.c:507 +#: ../vn/field/vn-date-chooser.c:495 msgid "Whether to show the calendar to set the date in the popup." msgstr "Si se debe mostrar el calendario para poner la fecha en el emergente." @@ -926,7 +927,7 @@ msgstr "Ya se ha especificado un cargador de archivos" msgid "No image set" msgstr "Sin imagen" -#: ../vn/field/vn-http-image.c:211 ../vn/column/vn-column-image.c:531 +#: ../vn/field/vn-http-image.c:211 ../vn/column/vn-column-image.c:536 msgid "File loader" msgstr "Cargador de archivos" @@ -950,79 +951,47 @@ 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:491 +#: ../vn/vn-column.c:494 msgid "The column index in the model" msgstr "El índice de la columna en el modelo" -#: ../vn/vn-column.c:505 +#: ../vn/vn-column.c:508 msgid "Whether the column values are editable" msgstr "Si el valor de campo puede ser editado por el usuario" -#: ../vn/vn-column.c:518 +#: ../vn/vn-column.c:521 msgid "Tab index" msgstr "Tab index" -#: ../vn/vn-column.c:519 +#: ../vn/vn-column.c:522 msgid "Order in which the tab selects the columns for edition" msgstr "Orden en el cual el tabulador selecciona las columnas para editar" -#: ../vn/vn-column.c:526 +#: ../vn/vn-column.c:529 msgid "" "A VnColumnStyleFunc to set the properties of each cell depending on its value" msgstr "" "Una VnColumnStyleFunc para configurar las propiedadesde cada celda " "dependiendo de su valor" -#: ../vn/column/vn-column-spin.c:238 -msgid "Climb rate" -msgstr "Tasa de subida" - -#: ../vn/column/vn-column-spin.c:239 -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-spin.c:254 -msgid "Minimum value" -msgstr "Valor mínimo" - -#: ../vn/column/vn-column-spin.c:255 -msgid "The minimum value of the internal adjustment." -msgstr "Valor mínimo del ajuste interno." - -#: ../vn/column/vn-column-spin.c:262 -msgid "Maximum value" -msgstr "Valor máximo" - -#: ../vn/column/vn-column-spin.c:263 -msgid "The maximum value of the internal adjustment." -msgstr "Valor máximo del ajuste interno." - -#: ../vn/column/vn-column-spin.c:270 -msgid "Step Increment" -msgstr "Incremento del paso" - -#: ../vn/column/vn-column-spin.c:271 -msgid "The step increment of the internal adjustment" -msgstr "El incremento del paso del ajuste interno" - -#: ../vn/column/vn-column-combo.c:347 +#: ../vn/column/vn-column-combo.c:354 msgid "Sort column" msgstr "Columna de ordenación" -#: ../vn/column/vn-column-combo.c:348 +#: ../vn/column/vn-column-combo.c:355 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:502 +#: ../vn/column/vn-column-image.c:507 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:509 +#: ../vn/column/vn-column-image.c:514 msgid "Tooltip path" msgstr "Ruta del tooltip" -#: ../vn/column/vn-column-image.c:510 +#: ../vn/column/vn-column-image.c:515 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" @@ -1031,11 +1000,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:519 +#: ../vn/column/vn-column-image.c:524 msgid "Tooltip size" msgstr "Tamaño del tooltip" -#: ../vn/column/vn-column-image.c:520 +#: ../vn/column/vn-column-image.c:525 msgid "" "Size of the bigger side of the tooltip images, the another side will be " "scaled accordingly and smaller images won't be scaled" @@ -1043,7 +1012,7 @@ msgstr "" "Tamaño del lado más grande de las imágenes de tooltip, el otro lado se " "escalará de acuerdo a este y las imágenes más pequeñas no se escalarán" -#: ../vn/column/vn-column-image.c:532 +#: ../vn/column/vn-column-image.c:537 msgid "An optional file loader, if it's NULL the column will create one" msgstr "Un cargador de archivos opcional, si es nulo la columna creará uno" @@ -1138,13 +1107,13 @@ msgstr "" "Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA\n" "02111-1307 USA." -#: ../vn/gui/date-chooser.glade.h:1 ../glade/glade-db-model.c:72 -#: ../glade/glade-eprop-model.c:163 +#: ../vn/gui/date-chooser.glade.h:1 ../glade/glade-db-model.c:143 +#: ../glade/glade-eprop-model.c:150 msgid "OK" msgstr "OK" -#: ../vn/gui/date-chooser.glade.h:2 ../glade/glade-db-model.c:73 -#: ../glade/glade-eprop-model.c:164 +#: ../vn/gui/date-chooser.glade.h:2 ../glade/glade-db-model.c:144 +#: ../glade/glade-eprop-model.c:151 msgid "Clear" msgstr "Limpiar" @@ -1152,76 +1121,100 @@ msgstr "Limpiar" msgid "Now" msgstr "Ahora" +#: ../vn/gui/menu.glade.h:1 +msgid "New window" +msgstr "Nueva ventana" + +#: ../vn/gui/menu.glade.h:2 +msgid "Logout" +msgstr "Desconectar" + +#: ../vn/gui/menu.glade.h:3 +msgid "Connect" +msgstr "Conectar" + +#: ../vn/gui/menu.glade.h:4 +msgid "About" +msgstr "Acerca de" + +#: ../vn/gui/menu.glade.h:5 +msgid "Quit" +msgstr "Salir" + +#: ../vn/gui/menu.glade.h:6 +msgid "Close" +msgstr "Cerrar" + #: ../glade/glade-db-model.c:37 msgid "New SQL statement" msgstr "Nueva consulta SQL" -#: ../glade/glade-db-model.c:69 +#: ../glade/glade-db-model.c:100 +msgid "Save as..." +msgstr "Guardar como..." + +#: ../glade/glade-db-model.c:140 msgid "SQL Editor" msgstr "Editor SQL" -#: ../glade/glade-db-model.c:74 ../glade/glade-eprop-model.c:165 +#: ../glade/glade-db-model.c:145 ../glade/glade-eprop-model.c:152 msgid "Cancel" msgstr "Cancelar" -#: ../glade/glade-db-model.c:184 +#: ../glade/glade-db-model.c:203 +msgid "Save project" +msgstr "Guardar proyecto" + +#: ../glade/glade-db-model.c:274 msgid "Open the SQL Editor" msgstr "Abrir el Editor SQL" -#: ../glade/glade-db-model.c:289 +#: ../glade/glade-db-model.c:354 ../glade/glade-sql-batch.c:185 +msgid "Select a GvnParam" +msgstr "Elige un GvnParam" + +#: ../glade/glade-db-model.c:422 ../glade/glade-sql-batch.c:253 +msgid "Select the parameter from a list" +msgstr "Eligir un parametro de una lista" + +#: ../glade/glade-db-model.c:440 ../glade/glade-sql-batch.c:271 +msgid "You need to create at least one GvnParam or derived object" +msgstr "Necesitas crear por lo menos un GvnParam o algun objeto derivado" + +#: ../glade/glade-db-model.c:594 msgid "Add or remove links" msgstr "Añadir o quitar enlaces" -#: ../glade/glade-db-model.c:303 +#: ../glade/glade-db-model.c:629 +msgid "Column" +msgstr "Columna" + +#: ../glade/glade-db-model.c:646 msgctxt "Verb" msgid "Link" msgstr "Enlazar" -#: ../glade/glade-db-model.c:365 -msgid "Add or remove holders" -msgstr "Añadir o quitar holders" - -#: ../glade/glade-db-model.c:440 -msgid "Select a GvnParam" -msgstr "Elige un GvnParam" - -#: ../glade/glade-db-model.c:497 -msgid "Select the parameter from a list" -msgstr "Eligir un parametro de una lista" - -#: ../glade/glade-db-model.c:515 -msgid "You need to create at least one GvnParam or derived object" -msgstr "Necesitas crear por lo menos un GvnParam o algun objeto derivado" - -#: ../glade/glade-db-model-editor.c:62 +#: ../glade/glade-db-model-editor.c:54 msgid "List of parameters linked to the model" msgstr "Lista de parámetros vinculados al modelo" -#: ../glade/glade-db-model-editor.c:65 -msgid "List of SqlHolders and identifiers" -msgstr "Lista de SqlHolders e identificadores" - -#: ../glade/glade-eprop-model.c:128 +#: ../glade/glade-eprop-model.c:118 msgid "Create and set a model for a DbModelHolder" msgstr "Crear y poner el modelo a un DbModelHolder" -#: ../glade/glade-eprop-model.c:160 +#: ../glade/glade-eprop-model.c:147 msgid "Model configuration" msgstr "Configuración del modelo" -#: ../glade/glade-eprop-model.c:160 -msgid "Model properties configuration" -msgstr "Configuración de propiedades del modelo" - -#: ../glade/glade-eprop-model.c:243 +#: ../glade/glade-eprop-model.c:218 msgid "Select a VnModel for the property" msgstr "Elige un VnModel para la propiedad" -#: ../glade/glade-eprop-model.c:264 ../glade/glade-eprop-model.c:310 +#: ../glade/glade-eprop-model.c:239 ../glade/glade-eprop-model.c:285 msgid "New Model" msgstr "Nuevo Modelo" -#: ../glade/glade-eprop-model.c:305 +#: ../glade/glade-eprop-model.c:280 msgid "Edit Model" msgstr "Editar Modelo" @@ -1252,6 +1245,14 @@ msgstr "%s debe tener \"Modelo\" asignado. %s" msgid "Automatic generation of params for %s" msgstr "Generación automatica de params para %s" +#: ../glade/glade-sql-batch.c:79 +msgid "List of items" +msgstr "Lista de elementos" + +#: ../glade/glade-sql-batch.c:401 +msgid "Add or remove items" +msgstr "Añadir o quitar elementos" + #: ../glade/vn.xml.h:1 msgid "The model held by the object" msgstr "La conexión empleada por el objeto" @@ -1261,10 +1262,34 @@ msgid "Example" msgstr "Ejemplo" #: ../module/data/example.xml.h:2 +msgid "" +"\n" +"\t\t\tConsulter\n" +"\t\t" +msgstr "" +"\n" +"\t\t\tConsultor\n" +"\t\t" + +#: ../module/data/example.xml.h:5 +msgid "" +"\n" +"\t\t\tCustomer\n" +"\t\t" +msgstr "" +"\n" +"\t\t\tCliente\n" +"\t\t" + +#: ../module/data/example-menu.xml.h:1 msgid "Consulter" msgstr "Consultor" -#: ../module/data/consulter.glade.h:1 +#: ../module/data/example-menu.xml.h:2 +msgid "Customer" +msgstr "Cliente" + +#: ../module/data/consulter.glade.h:1 ../module/data/consulter-menu.xml.h:1 msgid "Send" msgstr "Enviar" @@ -1272,7 +1297,7 @@ msgstr "Enviar" msgid "Send the current query" msgstr "Enviar la consulta actual" -#: ../module/data/consulter.glade.h:3 +#: ../module/data/consulter.glade.h:3 ../module/data/consulter-menu.xml.h:2 msgid "Clean" msgstr "Limpiar" @@ -1289,16 +1314,58 @@ msgid "Query:" msgstr "Consulta:" #: ../module/data/consulter.glade.h:7 -msgid "Immediate changes" -msgstr "Cambios inmediatos" - -#: ../module/src/vn-consulter.c:234 msgid "Type or select a query" msgstr "Escribe o elige una consulta" -#: ../module/src/vn-consulter.c:236 -msgid "Message" -msgstr "Mensaje" +#: ../module/data/consulter.glade.h:8 +msgid "Log" +msgstr "Registro" + +#: ../module/data/consulter.glade.h:9 +msgid "Immediate changes" +msgstr "Cambios inmediatos" + +#~ msgid "Set property value" +#~ msgstr "Establecer valor" + +#~ msgid "Climb rate" +#~ 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." + +#~ msgid "Minimum value" +#~ msgstr "Valor mínimo" + +#~ msgid "The minimum value of the internal adjustment." +#~ msgstr "Valor mínimo del ajuste interno." + +#~ msgid "Maximum value" +#~ msgstr "Valor máximo" + +#~ msgid "The maximum value of the internal adjustment." +#~ msgstr "Valor máximo del ajuste interno." + +#~ msgid "Step Increment" +#~ msgstr "Incremento del paso" + +#~ msgid "The step increment of the internal adjustment" +#~ msgstr "El incremento del paso del ajuste interno" + +#~ msgid "Message" +#~ msgstr "Mensaje" + +#~ msgid "Add or remove holders" +#~ msgstr "Añadir o quitar holders" + +#~ msgid "List of SqlHolders and identifiers" +#~ msgstr "Lista de SqlHolders e identificadores" + +#~ msgid "Save" +#~ msgstr "Guardar" + +#~ msgid "Model properties configuration" +#~ msgstr "Configuración de propiedades del modelo" #~ msgid "The statement to execute" #~ msgstr "La instrucción a ejecutar" @@ -1309,21 +1376,9 @@ msgstr "Mensaje" #~ msgid "[user-name]" #~ msgstr "[user-name]" -#~ msgid "_Logout" -#~ msgstr "_Desconectar" - -#~ msgid "Logout" -#~ msgstr "Desconectar" - #~ msgid "_Quit" #~ msgstr "_Salir" -#~ msgid "Quit" -#~ msgstr "Salir" - -#~ msgid "_About" -#~ msgstr "_Acerca de" - #~ msgid "_File" #~ msgstr "_Archivo" @@ -1336,9 +1391,6 @@ msgstr "Mensaje" #~ msgid "Reconnect" #~ msgstr "Reconectar" -#~ msgid "_Close" -#~ msgstr "_Cerrar" - #~ msgid "_View" #~ msgstr "_Ver" @@ -1353,15 +1405,6 @@ msgstr "Mensaje" #~ msgid "Tool_bar" #~ msgstr "_Barra de herramientas" -#~ msgid "" -#~ "\n" -#~ "\t\t\tCustomer\n" -#~ "\t\t" -#~ msgstr "" -#~ "\n" -#~ "\t\t\tCliente\n" -#~ "\t\t" - #~ msgid "Err" #~ msgstr "Err" diff --git a/po/nl.po b/po/nl.po index 037461d..6a2ab37 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: 2014-07-07 15:57+0200\n" +"POT-Creation-Date: 2014-07-15 14:27+0200\n" "PO-Revision-Date: 2012-10-09 11:38+0200\n" "Last-Translator: Alejandro T. Colombini Gómez \n" "Language-Team: Dutch\n" @@ -33,7 +33,7 @@ msgstr "" msgid "Incompatible type for this param" msgstr "" -#: ../gvn/gvn-param.c:443 ../sql/sql-value.c:252 ../vn/vn-field.c:573 +#: ../gvn/gvn-param.c:443 ../sql/sql-value.c:255 ../vn/vn-field.c:576 msgid "Value" msgstr "" @@ -49,7 +49,7 @@ msgstr "" msgid "The master GvnParam of this parameter" msgstr "" -#: ../gvn/gvn-param.c:457 ../db/db-iterator.c:1055 +#: ../gvn/gvn-param.c:457 ../db/db-iterator.c:1062 msgid "Mode" msgstr "" @@ -73,15 +73,15 @@ msgstr "" msgid "The spec of the parameter" msgstr "" -#: ../gvn/gvn-param.c:478 ../vn/vn-field.c:601 +#: ../gvn/gvn-param.c:478 ../vn/vn-field.c:604 msgid "Glib Type" msgstr "" -#: ../gvn/gvn-param.c:479 ../vn/vn-field.c:602 +#: ../gvn/gvn-param.c:479 ../vn/vn-field.c:605 msgid "The type of the value" msgstr "" -#: ../gvn/gvn-param.c:485 ../vn/vn-field.c:608 ../vn/vn-column.c:504 +#: ../gvn/gvn-param.c:485 ../vn/vn-field.c:611 ../vn/vn-column.c:507 msgid "Editable" msgstr "" @@ -89,7 +89,7 @@ msgstr "" msgid "Whether the param value can be modified" msgstr "" -#: ../gvn/gvn-param.c:492 ../vn/vn-field.c:615 ../vn/vn-column.c:511 +#: ../gvn/gvn-param.c:492 ../vn/vn-field.c:618 ../vn/vn-column.c:514 msgid "Null" msgstr "" @@ -97,11 +97,11 @@ msgstr "" msgid "Whether the param value can be of type GVN_TYPE_NULL" msgstr "" -#: ../gvn/gvn-param.c:499 ../vn/vn-field.c:622 +#: ../gvn/gvn-param.c:499 ../vn/vn-field.c:625 msgid "Default Value" msgstr "" -#: ../gvn/gvn-param.c:500 ../vn/vn-field.c:623 +#: ../gvn/gvn-param.c:500 ../vn/vn-field.c:626 msgid "The default value" msgstr "" @@ -126,19 +126,19 @@ msgstr "" msgid "The character used for delimite the name of fields, tables..." msgstr "" -#: ../sql/sql-value.c:245 ../glade/glade-db-model.c:530 +#: ../sql/sql-value.c:248 ../glade/glade-db-model.c:638 msgid "Param" msgstr "" -#: ../sql/sql-value.c:246 +#: ../sql/sql-value.c:249 msgid "The param which is linked" msgstr "" -#: ../sql/sql-value.c:253 +#: ../sql/sql-value.c:256 msgid "The value" msgstr "" -#: ../sql/sql-string.c:188 ../db/db-model.c:3311 ../db/db-request.c:449 +#: ../sql/sql-string.c:188 ../db/db-model.c:3315 ../db/db-request.c:449 msgid "SQL" msgstr "" @@ -210,7 +210,7 @@ msgstr "" msgid "The function parameters" msgstr "" -#: ../sql/sql-holder.c:124 ../glade/glade-db-model.c:369 +#: ../sql/sql-holder.c:124 ../glade/glade-sql-batch.c:436 msgid "Identifier" msgstr "" @@ -327,96 +327,96 @@ msgstr "" msgid "Can't allocate the needed memory" msgstr "" -#: ../db/db-iterator.c:1056 +#: ../db/db-iterator.c:1063 msgid "The mode in which the iterator is working" msgstr "" -#: ../db/db-iterator.c:1063 +#: ../db/db-iterator.c:1070 msgid "Remember selection" msgstr "" -#: ../db/db-iterator.c:1064 +#: ../db/db-iterator.c:1071 msgid "Wether to rememeber the selection when model is refreshed" msgstr "" -#: ../db/db-model.c:3285 ../db/db-request.c:442 ../vn/vn-gui.c:1560 +#: ../db/db-model.c:3289 ../db/db-request.c:442 ../vn/vn-gui.c:1472 #: ../vn/vn-form.c:245 msgid "Connection" msgstr "" -#: ../db/db-model.c:3286 +#: ../db/db-model.c:3290 msgid "The DbConn that manages the connection to the database" msgstr "" -#: ../db/db-model.c:3293 +#: ../db/db-model.c:3297 msgid "Statement" msgstr "" -#: ../db/db-model.c:3294 +#: ../db/db-model.c:3298 msgid "The statement which retrieves the data" msgstr "" -#: ../db/db-model.c:3301 +#: ../db/db-model.c:3305 msgid "Use file" msgstr "" -#: ../db/db-model.c:3302 +#: ../db/db-model.c:3306 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:3312 +#: ../db/db-model.c:3316 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:3321 +#: ../db/db-model.c:3325 msgid "Main Table" msgstr "" -#: ../db/db-model.c:3322 +#: ../db/db-model.c:3326 msgid "The main table of the model" msgstr "" -#: ../db/db-model.c:3329 +#: ../db/db-model.c:3333 msgid "Update flags" msgstr "" -#: ../db/db-model.c:3330 +#: ../db/db-model.c:3334 msgid "The flags that indicate how a model can be modified" msgstr "" -#: ../db/db-model.c:3338 +#: ../db/db-model.c:3342 msgid "Result position" msgstr "" -#: ../db/db-model.c:3339 +#: ../db/db-model.c:3343 msgid "" "The position where the query that will fill the model will be placed in a " "multi-query" msgstr "" -#: ../db/db-model.c:3349 +#: ../db/db-model.c:3353 msgid "Partial delete" msgstr "" -#: ../db/db-model.c:3350 +#: ../db/db-model.c:3354 msgid "" "When a row is deleted set all the fields from the table to null rather than " "delete it." msgstr "" -#: ../db/db-model.c:3358 +#: ../db/db-model.c:3362 msgid "Batch" msgstr "" -#: ../db/db-model.c:3359 +#: ../db/db-model.c:3363 msgid "The batch assigned to the model" msgstr "" -#: ../db/db-model-holder.c:71 ../db/db-calc.c:329 +#: ../db/db-model-holder.c:71 ../db/db-calc.c:405 msgid "Model" msgstr "" @@ -424,43 +424,52 @@ msgstr "" msgid "The model used by the holder" msgstr "" -#: ../db/db-calc.c:330 +#: ../db/db-calc.c:406 msgid "The model where the operations will be applied" msgstr "" -#: ../db/db-calc.c:337 +#: ../db/db-calc.c:413 msgid "Operation type" msgstr "" -#: ../db/db-calc.c:338 +#: ../db/db-calc.c:414 msgid "The type of the operation applied over the function" msgstr "" -#: ../db/db-calc.c:346 +#: ../db/db-calc.c:422 msgid "Function" msgstr "" -#: ../db/db-calc.c:347 +#: ../db/db-calc.c:423 msgid "The function to execute" msgstr "" -#: ../db/db-calc.c:353 +#: ../db/db-calc.c:429 msgid "Data" msgstr "" -#: ../db/db-calc.c:354 +#: ../db/db-calc.c:430 msgid "The user provided data for the function" msgstr "" -#: ../db/db-calc.c:360 ../glade/glade-db-model.c:293 -msgid "Column" +#: ../db/db-calc.c:436 ../db/db-param.c:258 ../vn/vn-column.c:493 +msgid "Column index" msgstr "" -#: ../db/db-calc.c:361 +#: ../db/db-calc.c:437 msgid "A column to apply the operations over it" msgstr "" -#: ../db/db-param.c:251 ../vn/vn-grid.c:518 ../vn/vn-field.c:587 +#: ../db/db-calc.c:446 ../db/db-param.c:265 ../vn/vn-field.c:597 +#: ../vn/vn-column.c:500 +msgid "Column name" +msgstr "" + +#: ../db/db-calc.c:447 +msgid "A column name to apply the operations over it" +msgstr "" + +#: ../db/db-param.c:251 ../vn/vn-grid.c:421 ../vn/vn-field.c:590 msgid "Iterator" msgstr "" @@ -468,19 +477,11 @@ msgstr "" msgid "The iterator owner of param" msgstr "" -#: ../db/db-param.c:258 ../vn/vn-column.c:490 -msgid "Column index" -msgstr "" - #: ../db/db-param.c:259 msgid "The referenced column index" msgstr "" -#: ../db/db-param.c:265 ../vn/vn-field.c:594 ../vn/vn-column.c:497 -msgid "Column name" -msgstr "" - -#: ../db/db-param.c:266 ../vn/vn-column.c:498 +#: ../db/db-param.c:266 ../vn/vn-column.c:501 msgid "The referenced column name" msgstr "" @@ -521,7 +522,7 @@ msgid "The path where query files are located" msgstr "" #: ../db/db-conn.c:1062 ../db/db-file-loader.c:716 -#: ../vn/column/vn-column-image.c:493 +#: ../vn/column/vn-column-image.c:498 msgid "Host" msgstr "" @@ -584,11 +585,11 @@ msgstr "" msgid "Unknown content length of file %s" msgstr "" -#: ../db/db-file-loader.c:717 ../vn/column/vn-column-image.c:494 +#: ../db/db-file-loader.c:717 ../vn/column/vn-column-image.c:499 msgid "The host web server name to get the images" msgstr "" -#: ../db/db-file-loader.c:724 ../vn/column/vn-column-image.c:501 +#: ../db/db-file-loader.c:724 ../vn/column/vn-column-image.c:506 msgid "Path" msgstr "" @@ -614,63 +615,63 @@ msgstr "" msgid "The maximal size for the contents of the cache directory" msgstr "" -#: ../vn/vn-gui.c:632 +#: ../vn/vn-gui.c:545 msgid "Connection has been lost. Do you want to reconnect?" msgstr "" -#: ../vn/vn-gui.c:639 +#: ../vn/vn-gui.c:552 msgid "An error occurred in the connection." msgstr "" -#: ../vn/vn-gui.c:642 +#: ../vn/vn-gui.c:555 msgid "Database error" msgstr "" -#: ../vn/vn-gui.c:649 +#: ../vn/vn-gui.c:562 msgid "Unknown error" msgstr "" -#: ../vn/vn-gui.c:998 +#: ../vn/vn-gui.c:910 msgid "Closing connection" msgstr "" -#: ../vn/vn-gui.c:1000 +#: ../vn/vn-gui.c:912 msgid "Transaction started" msgstr "" -#: ../vn/vn-gui.c:1002 +#: ../vn/vn-gui.c:914 msgid "Connecting" msgstr "" -#: ../vn/vn-gui.c:1004 +#: ../vn/vn-gui.c:916 msgid "Connection lost" msgstr "" -#: ../vn/vn-gui.c:1006 +#: ../vn/vn-gui.c:918 msgid "Connection closed" msgstr "" -#: ../vn/vn-gui.c:1008 ../vn/field/vn-http-image.c:119 +#: ../vn/vn-gui.c:920 ../vn/field/vn-http-image.c:119 msgid "Loading" msgstr "" -#: ../vn/vn-gui.c:1010 +#: ../vn/vn-gui.c:922 msgid "Ready" msgstr "" -#: ../vn/vn-gui.c:1561 +#: ../vn/vn-gui.c:1473 msgid "The connection used by Gui" msgstr "" -#: ../vn/vn-gui.c:1567 +#: ../vn/vn-gui.c:1479 msgid "Application" msgstr "" -#: ../vn/vn-gui.c:1568 +#: ../vn/vn-gui.c:1480 msgid "The application handler for the entire program" msgstr "" -#: ../vn/vn-grid.c:519 +#: ../vn/vn-grid.c:422 msgid "The iterator used by VnGrid" msgstr "" @@ -722,19 +723,19 @@ msgstr "" msgid "Move to the last row" msgstr "" -#: ../vn/vn-handler.c:529 +#: ../vn/vn-handler.c:531 msgid "Show flags" msgstr "" -#: ../vn/vn-handler.c:530 +#: ../vn/vn-handler.c:532 msgid "Sets the buttons that will be shown on the interface" msgstr "" -#: ../vn/vn-handler.c:537 +#: ../vn/vn-handler.c:539 msgid "Simple record" msgstr "" -#: ../vn/vn-handler.c:538 +#: ../vn/vn-handler.c:540 msgid "Sets if it is used to handle a iterator with a single record" msgstr "" @@ -779,75 +780,75 @@ msgstr "" msgid "The application identifier" msgstr "" -#: ../vn/vn-field.c:574 +#: ../vn/vn-field.c:577 msgid "The current value of the field" msgstr "" -#: ../vn/vn-field.c:580 ../glade/glade-db-iterator.c:71 -#: ../glade/glade-db-iterator.c:116 +#: ../vn/vn-field.c:583 ../glade/glade-db-iterator.c:71 +#: ../glade/glade-db-iterator.c:116 ../glade/glade-sql-batch.c:445 msgid "Parameter" msgstr "" -#: ../vn/vn-field.c:581 +#: ../vn/vn-field.c:584 msgid "The param where the field can read/write its value" msgstr "" -#: ../vn/vn-field.c:588 +#: ../vn/vn-field.c:591 msgid "The iterator used to get the field param" msgstr "" -#: ../vn/vn-field.c:595 +#: ../vn/vn-field.c:598 msgid "The column name on the iterator" msgstr "" -#: ../vn/vn-field.c:609 +#: ../vn/vn-field.c:612 msgid "Whether the field value is user editable" msgstr "" -#: ../vn/vn-field.c:616 ../vn/vn-column.c:512 +#: ../vn/vn-field.c:619 ../vn/vn-column.c:515 msgid "Whether the field value can be of type GVN_TYPE_NULL" msgstr "" -#: ../vn/vn-field.c:629 ../vn/vn-column.c:525 +#: ../vn/vn-field.c:632 ../vn/vn-column.c:528 msgid "Style function" msgstr "" -#: ../vn/vn-field.c:630 +#: ../vn/vn-field.c:633 msgid "" "A VnFieldStyleFunc to set the properties of each field depending on its value" msgstr "" -#: ../vn/field/vn-entry.c:156 ../vn/field/vn-date-chooser.c:489 -#: ../vn/field/vn-label.c:114 ../vn/column/vn-column-entry.c:122 +#: ../vn/field/vn-entry.c:156 ../vn/field/vn-date-chooser.c:477 +#: ../vn/field/vn-label.c:115 ../vn/column/vn-column-entry.c:127 msgid "Format" msgstr "" -#: ../vn/field/vn-entry.c:157 ../vn/field/vn-label.c:115 -#: ../vn/column/vn-column-entry.c:123 +#: ../vn/field/vn-entry.c:157 ../vn/field/vn-label.c:116 +#: ../vn/column/vn-column-entry.c:128 msgid "The format string describing the output of the entry." msgstr "" -#: ../vn/field/vn-spin.c:171 ../vn/column/vn-column-spin.c:246 +#: ../vn/field/vn-spin.c:171 ../vn/column/vn-column-spin.c:201 msgid "Digits" msgstr "" -#: ../vn/field/vn-spin.c:172 ../vn/column/vn-column-spin.c:247 +#: ../vn/field/vn-spin.c:172 ../vn/column/vn-column-spin.c:202 msgid "The number of decimal places to display." msgstr "" -#: ../vn/field/vn-combo.c:286 ../vn/column/vn-column-combo.c:333 +#: ../vn/field/vn-combo.c:286 ../vn/column/vn-column-combo.c:340 msgid "Index column" msgstr "" -#: ../vn/field/vn-combo.c:287 ../vn/column/vn-column-combo.c:334 +#: ../vn/field/vn-combo.c:287 ../vn/column/vn-column-combo.c:341 msgid "The column index of the model" msgstr "" -#: ../vn/field/vn-combo.c:293 ../vn/column/vn-column-combo.c:340 +#: ../vn/field/vn-combo.c:293 ../vn/column/vn-column-combo.c:347 msgid "Show column" msgstr "" -#: ../vn/field/vn-combo.c:294 ../vn/column/vn-column-combo.c:341 +#: ../vn/field/vn-combo.c:294 ../vn/column/vn-column-combo.c:348 msgid "The column of the model shown by combo" msgstr "" @@ -859,34 +860,34 @@ msgstr "" msgid "The name of the field used for the search" msgstr "" -#: ../vn/field/vn-date-chooser.c:438 +#: ../vn/field/vn-date-chooser.c:426 msgid "Change date" msgstr "" -#: ../vn/field/vn-date-chooser.c:490 +#: ../vn/field/vn-date-chooser.c:478 msgid "The date format string describing the order of the elements." msgstr "" -#: ../vn/field/vn-date-chooser.c:491 +#: ../vn/field/vn-date-chooser.c:479 msgctxt "Default date format string" msgid "%a, %d %b %Y" msgstr "" -#: ../vn/field/vn-date-chooser.c:497 +#: ../vn/field/vn-date-chooser.c:485 msgid "Show time" msgstr "" -#: ../vn/field/vn-date-chooser.c:498 +#: ../vn/field/vn-date-chooser.c:486 msgid "" "Whether to show the hour, minute and second fields to set the time of the " "day in the popup." msgstr "" -#: ../vn/field/vn-date-chooser.c:506 +#: ../vn/field/vn-date-chooser.c:494 msgid "Show date" msgstr "" -#: ../vn/field/vn-date-chooser.c:507 +#: ../vn/field/vn-date-chooser.c:495 msgid "Whether to show the calendar to set the date in the popup." msgstr "" @@ -908,7 +909,7 @@ msgstr "" msgid "No image set" msgstr "" -#: ../vn/field/vn-http-image.c:211 ../vn/column/vn-column-image.c:531 +#: ../vn/field/vn-http-image.c:211 ../vn/column/vn-column-image.c:536 msgid "File loader" msgstr "" @@ -932,92 +933,60 @@ msgstr "" msgid "A GBytes structure with the image data" msgstr "" -#: ../vn/vn-column.c:491 +#: ../vn/vn-column.c:494 msgid "The column index in the model" msgstr "" -#: ../vn/vn-column.c:505 +#: ../vn/vn-column.c:508 msgid "Whether the column values are editable" msgstr "" -#: ../vn/vn-column.c:518 +#: ../vn/vn-column.c:521 msgid "Tab index" msgstr "" -#: ../vn/vn-column.c:519 +#: ../vn/vn-column.c:522 msgid "Order in which the tab selects the columns for edition" msgstr "" -#: ../vn/vn-column.c:526 +#: ../vn/vn-column.c:529 msgid "" "A VnColumnStyleFunc to set the properties of each cell depending on its value" msgstr "" -#: ../vn/column/vn-column-spin.c:238 -msgid "Climb rate" -msgstr "" - -#: ../vn/column/vn-column-spin.c:239 -msgid "The acceleration rate when you hold down a button." -msgstr "" - -#: ../vn/column/vn-column-spin.c:254 -msgid "Minimum value" -msgstr "" - -#: ../vn/column/vn-column-spin.c:255 -msgid "The minimum value of the internal adjustment." -msgstr "" - -#: ../vn/column/vn-column-spin.c:262 -msgid "Maximum value" -msgstr "" - -#: ../vn/column/vn-column-spin.c:263 -msgid "The maximum value of the internal adjustment." -msgstr "" - -#: ../vn/column/vn-column-spin.c:270 -msgid "Step Increment" -msgstr "" - -#: ../vn/column/vn-column-spin.c:271 -msgid "The step increment of the internal adjustment" -msgstr "" - -#: ../vn/column/vn-column-combo.c:347 +#: ../vn/column/vn-column-combo.c:354 msgid "Sort column" msgstr "" -#: ../vn/column/vn-column-combo.c:348 +#: ../vn/column/vn-column-combo.c:355 msgid "The field number of the Grid model used to sort the column" msgstr "" -#: ../vn/column/vn-column-image.c:502 +#: ../vn/column/vn-column-image.c:507 msgid "Base path from the host where the images will be downloaded" msgstr "" -#: ../vn/column/vn-column-image.c:509 +#: ../vn/column/vn-column-image.c:514 msgid "Tooltip path" msgstr "" -#: ../vn/column/vn-column-image.c:510 +#: ../vn/column/vn-column-image.c:515 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:519 +#: ../vn/column/vn-column-image.c:524 msgid "Tooltip size" msgstr "" -#: ../vn/column/vn-column-image.c:520 +#: ../vn/column/vn-column-image.c:525 msgid "" "Size of the bigger side of the tooltip images, the another side will be " "scaled accordingly and smaller images won't be scaled" msgstr "" -#: ../vn/column/vn-column-image.c:532 +#: ../vn/column/vn-column-image.c:537 msgid "An optional file loader, if it's NULL the column will create one" msgstr "" @@ -1097,13 +1066,13 @@ msgid "" "02111-1307 USA." msgstr "" -#: ../vn/gui/date-chooser.glade.h:1 ../glade/glade-db-model.c:72 -#: ../glade/glade-eprop-model.c:163 +#: ../vn/gui/date-chooser.glade.h:1 ../glade/glade-db-model.c:143 +#: ../glade/glade-eprop-model.c:150 msgid "OK" msgstr "" -#: ../vn/gui/date-chooser.glade.h:2 ../glade/glade-db-model.c:73 -#: ../glade/glade-eprop-model.c:164 +#: ../vn/gui/date-chooser.glade.h:2 ../glade/glade-db-model.c:144 +#: ../glade/glade-eprop-model.c:151 msgid "Clear" msgstr "" @@ -1111,76 +1080,100 @@ msgstr "" msgid "Now" msgstr "" +#: ../vn/gui/menu.glade.h:1 +msgid "New window" +msgstr "" + +#: ../vn/gui/menu.glade.h:2 +msgid "Logout" +msgstr "" + +#: ../vn/gui/menu.glade.h:3 +msgid "Connect" +msgstr "" + +#: ../vn/gui/menu.glade.h:4 +msgid "About" +msgstr "" + +#: ../vn/gui/menu.glade.h:5 +msgid "Quit" +msgstr "" + +#: ../vn/gui/menu.glade.h:6 +msgid "Close" +msgstr "" + #: ../glade/glade-db-model.c:37 msgid "New SQL statement" msgstr "" -#: ../glade/glade-db-model.c:69 +#: ../glade/glade-db-model.c:100 +msgid "Save as..." +msgstr "" + +#: ../glade/glade-db-model.c:140 msgid "SQL Editor" msgstr "" -#: ../glade/glade-db-model.c:74 ../glade/glade-eprop-model.c:165 +#: ../glade/glade-db-model.c:145 ../glade/glade-eprop-model.c:152 msgid "Cancel" msgstr "" -#: ../glade/glade-db-model.c:184 +#: ../glade/glade-db-model.c:203 +msgid "Save project" +msgstr "" + +#: ../glade/glade-db-model.c:274 msgid "Open the SQL Editor" msgstr "" -#: ../glade/glade-db-model.c:289 +#: ../glade/glade-db-model.c:354 ../glade/glade-sql-batch.c:185 +msgid "Select a GvnParam" +msgstr "" + +#: ../glade/glade-db-model.c:422 ../glade/glade-sql-batch.c:253 +msgid "Select the parameter from a list" +msgstr "" + +#: ../glade/glade-db-model.c:440 ../glade/glade-sql-batch.c:271 +msgid "You need to create at least one GvnParam or derived object" +msgstr "" + +#: ../glade/glade-db-model.c:594 msgid "Add or remove links" msgstr "" -#: ../glade/glade-db-model.c:303 +#: ../glade/glade-db-model.c:629 +msgid "Column" +msgstr "" + +#: ../glade/glade-db-model.c:646 msgctxt "Verb" msgid "Link" msgstr "" -#: ../glade/glade-db-model.c:365 -msgid "Add or remove holders" -msgstr "" - -#: ../glade/glade-db-model.c:440 -msgid "Select a GvnParam" -msgstr "" - -#: ../glade/glade-db-model.c:497 -msgid "Select the parameter from a list" -msgstr "" - -#: ../glade/glade-db-model.c:515 -msgid "You need to create at least one GvnParam or derived object" -msgstr "" - -#: ../glade/glade-db-model-editor.c:62 +#: ../glade/glade-db-model-editor.c:54 msgid "List of parameters linked to the model" msgstr "" -#: ../glade/glade-db-model-editor.c:65 -msgid "List of SqlHolders and identifiers" -msgstr "" - -#: ../glade/glade-eprop-model.c:128 +#: ../glade/glade-eprop-model.c:118 msgid "Create and set a model for a DbModelHolder" msgstr "" -#: ../glade/glade-eprop-model.c:160 +#: ../glade/glade-eprop-model.c:147 msgid "Model configuration" msgstr "" -#: ../glade/glade-eprop-model.c:160 -msgid "Model properties configuration" -msgstr "" - -#: ../glade/glade-eprop-model.c:243 +#: ../glade/glade-eprop-model.c:218 msgid "Select a VnModel for the property" msgstr "" -#: ../glade/glade-eprop-model.c:264 ../glade/glade-eprop-model.c:310 +#: ../glade/glade-eprop-model.c:239 ../glade/glade-eprop-model.c:285 msgid "New Model" msgstr "" -#: ../glade/glade-eprop-model.c:305 +#: ../glade/glade-eprop-model.c:280 msgid "Edit Model" msgstr "" @@ -1211,6 +1204,14 @@ msgstr "" msgid "Automatic generation of params for %s" msgstr "" +#: ../glade/glade-sql-batch.c:79 +msgid "List of items" +msgstr "" + +#: ../glade/glade-sql-batch.c:401 +msgid "Add or remove items" +msgstr "" + #: ../glade/vn.xml.h:1 msgid "The model held by the object" msgstr "" @@ -1220,10 +1221,28 @@ msgid "Example" msgstr "" #: ../module/data/example.xml.h:2 +msgid "" +"\n" +"\t\t\tConsulter\n" +"\t\t" +msgstr "" + +#: ../module/data/example.xml.h:5 +msgid "" +"\n" +"\t\t\tCustomer\n" +"\t\t" +msgstr "" + +#: ../module/data/example-menu.xml.h:1 msgid "Consulter" msgstr "" -#: ../module/data/consulter.glade.h:1 +#: ../module/data/example-menu.xml.h:2 +msgid "Customer" +msgstr "" + +#: ../module/data/consulter.glade.h:1 ../module/data/consulter-menu.xml.h:1 msgid "Send" msgstr "" @@ -1231,7 +1250,7 @@ msgstr "" msgid "Send the current query" msgstr "" -#: ../module/data/consulter.glade.h:3 +#: ../module/data/consulter.glade.h:3 ../module/data/consulter-menu.xml.h:2 msgid "Clean" msgstr "" @@ -1248,13 +1267,13 @@ msgid "Query:" msgstr "" #: ../module/data/consulter.glade.h:7 -msgid "Immediate changes" -msgstr "" - -#: ../module/src/vn-consulter.c:234 msgid "Type or select a query" msgstr "" -#: ../module/src/vn-consulter.c:236 -msgid "Message" +#: ../module/data/consulter.glade.h:8 +msgid "Log" +msgstr "" + +#: ../module/data/consulter.glade.h:9 +msgid "Immediate changes" msgstr "" diff --git a/vn/Makefile.am b/vn/Makefile.am index ad61648..2f7c70c 100644 --- a/vn/Makefile.am +++ b/vn/Makefile.am @@ -17,7 +17,6 @@ vn_include_HEADERS = \ vn-grid.h \ vn-handler.h \ vn-set.h \ - vn-batch.h \ field/field.h \ column/column.h @@ -48,7 +47,9 @@ glade_files = \ $(top_srcdir)/vn/glade/vn-iterator.h \ $(top_srcdir)/vn/glade/vn-iterator.c \ $(top_srcdir)/vn/glade/vn-model.h \ - $(top_srcdir)/vn/glade/vn-model.c + $(top_srcdir)/vn/glade/vn-model.c \ + $(top_srcdir)/vn/glade/vn-batch.h \ + $(top_srcdir)/vn/glade/vn-batch.c libvn_la_SOURCES = \ $(libvn_files) \ $(glade_files) diff --git a/vn/glade/vn-batch.c b/vn/glade/vn-batch.c index 02cbf6b..09df3cf 100644 --- a/vn/glade/vn-batch.c +++ b/vn/glade/vn-batch.c @@ -17,124 +17,118 @@ #include "vn-batch.h" -/** - * SECTION: vn-batch - * @Short_description: a group of objects - * @Title: VnBatch - * - * A group of GObjects. - */ - static void vn_batch_buildable_interface_init (GtkBuildableIface * iface); -G_DEFINE_TYPE_WITH_CODE (VnBatch, vn_batch, G_TYPE_OBJECT, +G_DEFINE_TYPE_WITH_CODE (VnBatch, vn_batch, SQL_TYPE_BATCH, G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE, vn_batch_buildable_interface_init) ); -//+++++++++++++++++++++++++++++++++++++++++++++++++++ Methods +/* GtkBuildable custom tag implementation: + * + * + * ... + * + */ -/** - * vn_batch_add: - * @obj: a #VnBatch - * @child: a #GObject - * - * Adds a child identified whith @id to the group. - **/ -void vn_batch_add (VnBatch * obj, GObject * child) +typedef struct { - g_return_if_fail (VN_IS_BATCH (obj)); - g_return_if_fail (G_IS_OBJECT (child)); + GtkBuilder * builder; + SqlBatch * batch; + GSList * ids; + GSList * params; +} +VnBatchData; - obj->objects = g_list_prepend (obj->objects, child); - obj->count++; +//+++++++++++++++++++++++++++++++++++++++++++++++++++ GtkBuildable + +static void vn_batch_start_element (GMarkupParseContext * context, + const gchar * element, const gchar ** names, + const gchar ** values, gpointer data, GError ** err) +{ + guint i; + VnBatchData * d = data; + + if (!g_strcmp0 (element, "item")) + { + for (i = 0; names[i]; i++) + if (!g_strcmp0 (names[i], "id")) + d->ids = g_slist_prepend (d->ids, g_strdup (values[i])); + else if (!g_strcmp0 (names[i], "param")) + d->params = g_slist_prepend (d->params, g_strdup (values[i])); + } } -/** - * vn_batch_remove: - * @obj: a #VnBatch - * @child: a #GObject contained by @obj - * - * Removes a child from the group. - **/ -void vn_batch_remove (VnBatch * obj, GObject * child) +static const GMarkupParser vn_batch_parser = { - g_return_if_fail (VN_IS_BATCH (obj)); + vn_batch_start_element +}; - obj->objects = g_list_remove (obj->objects, child); - obj->count--; +static gboolean vn_batch_buildable_custom_tag_start (GtkBuildable * buildable, + GtkBuilder * builder, GObject * child, const gchar * tag, + GMarkupParser * parser, gpointer * data) +{ + if (child) + return FALSE; + + if (!g_strcmp0 (tag, "items")) + { + VnBatchData * data_ptr = g_slice_new (VnBatchData); + data_ptr->builder = builder; + data_ptr->batch = SQL_BATCH (buildable); + data_ptr->ids = NULL; + data_ptr->params = NULL; + *data = data_ptr; + *parser = vn_batch_parser; + + return TRUE; + } + else + g_warning ("Unknown custom batch tag: %s", tag); + + return FALSE; } -/** - * vn_batch_get_objects_list: - * @obj: a #VnBatch - * - * Returns all the #GObjects in @obj, copying the list. This method is - * mainly for internal use, use vn_batch_get_objects() instead if you don't need - * to do further use of the list of objects. - * - * Return value: (transfer container) (element-type GObject): a #GList with all - * the objects, that must be freed with #g_list_free - **/ -GList * vn_batch_get_objects_list (VnBatch * obj) +static void vn_batch_buildable_custom_finished (GtkBuildable * buildable, + GtkBuilder * builder, GObject * child, const gchar * tagname, gpointer data) { - g_return_val_if_fail (VN_IS_BATCH (obj), NULL); + GSList * i, * p; + VnBatchData * d = data; - return g_list_copy (obj->objects); -} + g_return_if_fail (d->builder); -/** - * vn_batch_get_objects: - * @obj: a #VnBatch - * - * Returns all the #GObjects in @obj. - * - * Return value: (transfer none) (element-type GObject): a #GList with all - * the objects, that must not be freed - **/ -const GList * vn_batch_get_objects (VnBatch * obj) -{ - g_return_val_if_fail (VN_IS_BATCH (obj), NULL); + if (!g_strcmp0 (tagname, "items")) + { + for (i = d->ids, p = d->params; + i && p; + i = i->next, p = p->next) + { + gchar * id = i->data; + GvnParam * param = GVN_PARAM (gtk_builder_get_object (d->builder, p->data)); + sql_batch_add_from_param (SQL_BATCH (buildable), id, param); + } - return obj->objects; -} - -/** - * vn_batch_get_length: - * @obj: a #VnBatch - * - * Returns the number of childs currently contained in @obj. - * - * Return value: the number of childs - **/ -guint vn_batch_get_length (VnBatch * obj) -{ - g_return_val_if_fail (VN_IS_BATCH (obj), 0); - - return obj->count; -} - -static void vn_batch_buildable_add_child (GtkBuildable * obj, - GtkBuilder * builder, GObject * child, const gchar * type) -{ - vn_batch_add (VN_BATCH (obj), child); + g_slist_free_full (d->ids, g_free); + g_slist_free_full (d->params, g_free); + g_slice_free (VnBatchData, d); + } } //+++++++++++++++++++++++++++++++++++++++++++++++++++ Class +static void vn_batch_buildable_interface_init (GtkBuildableIface * iface) +{ + iface->custom_tag_start = vn_batch_buildable_custom_tag_start; + iface->custom_finished = vn_batch_buildable_custom_finished; +} + static void vn_batch_init (VnBatch * obj) { - obj->objects = NULL; - obj->count = 0; } static void vn_batch_finalize (VnBatch * obj) { - GObjectClass * parent = g_type_class_peek_parent (VN_BATCH_GET_CLASS (obj)); - - g_list_free (obj->objects); - - parent->finalize (G_OBJECT (obj)); + G_OBJECT_CLASS (vn_batch_parent_class)->finalize (G_OBJECT (obj)); } static void vn_batch_class_init (VnBatchClass * klass) @@ -142,8 +136,3 @@ static void vn_batch_class_init (VnBatchClass * klass) GObjectClass * k = G_OBJECT_CLASS (klass); k->finalize = (GObjectFinalizeFunc) vn_batch_finalize; } - -static void vn_batch_buildable_interface_init (GtkBuildableIface * iface) -{ - iface->add_child = vn_batch_buildable_add_child; -} diff --git a/vn/glade/vn-batch.h b/vn/glade/vn-batch.h index 7a6deae..2c04daf 100644 --- a/vn/glade/vn-batch.h +++ b/vn/glade/vn-batch.h @@ -18,7 +18,7 @@ #ifndef VN_BATCH_H #define VN_BATCH_H -#include +#include #include #define VN_TYPE_BATCH (vn_batch_get_type ()) @@ -31,15 +31,9 @@ typedef struct _VnBatch VnBatch; typedef struct _VnBatchClass VnBatchClass; -/** - * VnBatch: - * @objects: (element-type GObject): - **/ struct _VnBatch { - GObject parent; - GList * objects; - guint count; + SqlBatch parent; }; struct _VnBatchClass @@ -49,12 +43,4 @@ struct _VnBatchClass GType vn_batch_get_type (); -void vn_batch_add (VnBatch * obj - ,GObject * child); -void vn_batch_remove (VnBatch * obj - ,GObject * child); -const GList * vn_batch_get_objects (VnBatch * obj); -GList * vn_batch_get_objects_list (VnBatch * obj); -guint vn_batch_get_length (VnBatch * obj); - #endif \ No newline at end of file diff --git a/vn/glade/vn-model.c b/vn/glade/vn-model.c index aa249a9..7c3dad3 100644 --- a/vn/glade/vn-model.c +++ b/vn/glade/vn-model.c @@ -26,16 +26,10 @@ G_DEFINE_TYPE_WITH_CODE (VnModel, vn_model, DB_TYPE_MODEL, ); /* GtkBuildable custom tag implementation: - * * * * ... * - * - * - * - * ... - * */ typedef struct @@ -70,12 +64,6 @@ static void vn_model_start_element (GMarkupParseContext * context, d->linked = g_slist_prepend (d->linked, GINT_TO_POINTER (b)); } } - else if (!g_strcmp0 (element, "holder")) - for (i = 0; names[i]; i++) - if (!g_strcmp0 (names[i], "id")) - d->fields = g_slist_prepend (d->fields, g_strdup (values[i])); - else if (!g_strcmp0 (names[i], "param")) - d->params = g_slist_prepend (d->params, g_strdup (values[i])); } static const GMarkupParser vn_model_parser = @@ -90,7 +78,7 @@ static gboolean vn_model_buildable_custom_tag_start (GtkBuildable * buildable, if (child) return FALSE; - if (!g_strcmp0 (tag, "links") || !g_strcmp0 (tag, "batch")) + if (!g_strcmp0 (tag, "links")) { VnModelData * data_ptr = g_slice_new (VnModelData); data_ptr->builder = builder; @@ -135,30 +123,6 @@ static void vn_model_buildable_custom_finished (GtkBuildable * buildable, g_slist_free (d->linked); g_slice_free (VnModelData, d); } - else if (!g_strcmp0 (tagname, "batch")) - { - for (f = d->fields, p = d->params; - f && p; - f = f->next, p = p->next) - { - gchar * id = f->data; - GvnParam * param = GVN_PARAM (gtk_builder_get_object (d->builder, p->data)); - SqlBatch * batch = db_model_get_batch (d->model); - - if (!batch) - { - batch = sql_batch_new (); - sql_batch_add_from_param (batch, id, param); - db_model_set_batch (d->model, batch); - } - else - sql_batch_add_from_param (batch, id, param); - } - - g_slist_free_full (d->fields, g_free); - g_slist_free_full (d->params, g_free); - g_slice_free (VnModelData, d); - } } static void vn_model_buildable_set_buildable_property (GtkBuildable * buildable, @@ -179,10 +143,6 @@ static void vn_model_buildable_set_buildable_property (GtkBuildable * buildable, //+++++++++++++++++++++++++++++++++++++++++++++++++++ Class -static void vn_model_class_init (VnModelClass * klass) -{ -} - static void vn_model_buildable_init (GtkBuildableIface * iface) { iface->custom_tag_start = vn_model_buildable_custom_tag_start; @@ -193,3 +153,13 @@ static void vn_model_buildable_init (GtkBuildableIface * iface) static void vn_model_init (VnModel * obj) {} +static void vn_model_finalize (VnModel * obj) +{ + G_OBJECT_CLASS (vn_model_parent_class)->finalize (G_OBJECT (obj)); +} + +static void vn_model_class_init (VnModelClass * klass) +{ + GObjectClass * k = G_OBJECT_CLASS (klass); + k->finalize = (GObjectFinalizeFunc) vn_model_finalize; +} diff --git a/vn/gui/menu.glade b/vn/gui/menu.glade index 6b69a6c..7794221 100644 --- a/vn/gui/menu.glade +++ b/vn/gui/menu.glade @@ -1,48 +1,48 @@ - +
- New window - app.new-window - <Primary>n + New window + app.new-window + <Primary>n
- Logout - app.logout - <Primary><Shift>l + Logout + app.logout + <Primary><Shift>l - Connect - app.connect - <Primary>l + Connect + app.connect + <Primary>l
- About - app.about - <Primary>h + About + app.about + <Primary>h
- Quit - app.quit - <Primary>q + Quit + app.quit + <Primary>q
- -
+ +
- Close - win.close - <Primary>w + Close + win.close + <Primary>w
diff --git a/vn/vn-form.h b/vn/vn-form.h index a5c43f4..ca9d80b 100644 --- a/vn/vn-form.h +++ b/vn/vn-form.h @@ -31,7 +31,7 @@ typedef struct _VnFormClass VnFormClass; #include "vn-gui.h" typedef GType (* VnFormGetTypeFunc) (); -typedef void (* VnFormOpenFunc) (VnForm * obj, GtkBuilder * builder, gpointer user_data); +typedef void (* VnFormOpenFunc) (VnForm * obj); typedef void (* VnFormActivateFunc) (VnForm * obj); typedef void (* VnFormDeactivateFunc) (VnForm * obj);