Commit 34d0e9d0 authored by Victor Ananjevsky's avatar Victor Ananjevsky

add child items from menu in editable lists

parent 8a3b3689
...@@ -7,7 +7,7 @@ msgid "" ...@@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: YAD\n" "Project-Id-Version: YAD\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-08-11 10:38+0300\n" "POT-Creation-Date: 2019-08-11 11:17+0300\n"
"PO-Revision-Date: 2009-04-30 16:47+0300\n" "PO-Revision-Date: 2009-04-30 16:47+0300\n"
"Last-Translator: Victor Ananjevsky <ananasik@gmail.com>\n" "Last-Translator: Victor Ananjevsky <ananasik@gmail.com>\n"
"Language-Team: \n" "Language-Team: \n"
...@@ -195,23 +195,27 @@ msgstr "Неизвестная команда '%s'\n" ...@@ -195,23 +195,27 @@ msgstr "Неизвестная команда '%s'\n"
msgid "Yad notification" msgid "Yad notification"
msgstr "Диалог уведомлений" msgstr "Диалог уведомлений"
#: ../src/list.c:1014 #: ../src/list.c:1024
msgid "Add row" msgid "Add row"
msgstr "Добавить строку" msgstr "Добавить строку"
#: ../src/list.c:1019 #: ../src/list.c:1031
msgid "Add child row"
msgstr "Добавить дочернюю строку"
#: ../src/list.c:1038
msgid "Delete row" msgid "Delete row"
msgstr "Удалить строку" msgstr "Удалить строку"
#: ../src/list.c:1026 #: ../src/list.c:1045
msgid "Edit row" msgid "Edit row"
msgstr "Редактировать строку" msgstr "Редактировать строку"
#: ../src/list.c:1032 #: ../src/list.c:1051
msgid "Duplicate row" msgid "Duplicate row"
msgstr "Скопировать строку" msgstr "Скопировать строку"
#: ../src/list.c:1173 #: ../src/list.c:1192
#, c-format #, c-format
msgid "No column titles specified for List dialog.\n" msgid "No column titles specified for List dialog.\n"
msgstr "Не заданы заголовоки колонок для диалога со списком\n" msgstr "Не заданы заголовоки колонок для диалога со списком\n"
......
...@@ -7,7 +7,7 @@ msgid "" ...@@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: YAD\n" "Project-Id-Version: YAD\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-08-11 10:38+0300\n" "POT-Creation-Date: 2019-08-11 11:17+0300\n"
"PO-Revision-Date: 2009-04-30 16:47+0300\n" "PO-Revision-Date: 2009-04-30 16:47+0300\n"
"Last-Translator: Victor Ananjevsky <ananasik@gmail.com>\n" "Last-Translator: Victor Ananjevsky <ananasik@gmail.com>\n"
"Language-Team: \n" "Language-Team: \n"
...@@ -195,23 +195,27 @@ msgstr "Невідома команда '%s'\n" ...@@ -195,23 +195,27 @@ msgstr "Невідома команда '%s'\n"
msgid "Yad notification" msgid "Yad notification"
msgstr "Діалог повідомлень" msgstr "Діалог повідомлень"
#: ../src/list.c:1014 #: ../src/list.c:1024
msgid "Add row" msgid "Add row"
msgstr "Додати рядок" msgstr "Додати рядок"
#: ../src/list.c:1019 #: ../src/list.c:1031
msgid "Add child row"
msgstr "Додати дочірній рядок"
#: ../src/list.c:1038
msgid "Delete row" msgid "Delete row"
msgstr "Видалити рядок" msgstr "Видалити рядок"
#: ../src/list.c:1026 #: ../src/list.c:1045
msgid "Edit row" msgid "Edit row"
msgstr "Редагувати рядок" msgstr "Редагувати рядок"
#: ../src/list.c:1032 #: ../src/list.c:1051
msgid "Duplicate row" msgid "Duplicate row"
msgstr "Скопіювати рядок" msgstr "Скопіювати рядок"
#: ../src/list.c:1173 #: ../src/list.c:1192
#, c-format #, c-format
msgid "No column titles specified for List dialog.\n" msgid "No column titles specified for List dialog.\n"
msgstr "Не задані заголовки стовпчиків для діалогу зі списком\n" msgstr "Не задані заголовки стовпчиків для діалогу зі списком\n"
......
...@@ -831,8 +831,18 @@ add_row_cb (GtkMenuItem *item, gpointer data) ...@@ -831,8 +831,18 @@ add_row_cb (GtkMenuItem *item, gpointer data)
gchar *cmd; gchar *cmd;
model = gtk_tree_view_get_model (GTK_TREE_VIEW (list_view)); model = gtk_tree_view_get_model (GTK_TREE_VIEW (list_view));
/* FIXME: add id for new row here */ if (g_object_get_data (G_OBJECT (item), "child") != NULL)
yad_list_add_row (GTK_TREE_STORE (model), &iter, NULL, NULL); {
GtkTreeIter parent;
GtkTreeSelection *sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (list_view));
if (gtk_tree_selection_get_selected (sel, NULL, &parent))
gtk_tree_store_append (GTK_TREE_STORE (model), &iter, &parent);
else
gtk_tree_store_append (GTK_TREE_STORE (model), &iter, NULL);
}
else
gtk_tree_store_append (GTK_TREE_STORE (model), &iter, NULL);
if (options.list_data.row_action) if (options.list_data.row_action)
{ {
...@@ -1016,6 +1026,15 @@ popup_menu_cb (GtkWidget *w, GdkEventButton *ev, gpointer data) ...@@ -1016,6 +1026,15 @@ popup_menu_cb (GtkWidget *w, GdkEventButton *ev, gpointer data)
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
g_signal_connect (G_OBJECT (item), "activate", G_CALLBACK (add_row_cb), menu); g_signal_connect (G_OBJECT (item), "activate", G_CALLBACK (add_row_cb), menu);
if (options.list_data.tree_mode)
{
item = gtk_menu_item_new_with_label (_("Add child row"));
gtk_widget_show (item);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
g_object_set_data (G_OBJECT (item), "child", "1");
g_signal_connect (G_OBJECT (item), "activate", G_CALLBACK (add_row_cb), menu);
}
item = gtk_menu_item_new_with_label (_("Delete row")); item = gtk_menu_item_new_with_label (_("Delete row"));
gtk_widget_show (item); gtk_widget_show (item);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment