From d68d3006f1e459f72851e787feab0e9b79535068 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Mon, 17 Dec 2018 14:14:13 +0800 Subject: [PATCH] Ticket.bjs Ticket.vala --- Ticket.bjs | 2 +- Ticket.vala | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Ticket.bjs b/Ticket.bjs index dd3f75e8..02d2ba0b 100644 --- a/Ticket.bjs +++ b/Ticket.bjs @@ -219,7 +219,7 @@ "items" : [ { "id" : "clmodel", - "| void loadClassifications" : " (string id) {\n\n var rt = RooTicket.singleton();\n // rt.loadProjects();\n \n _this.classification_id.loading = true;\n\n this.el.clear(); \n Gtk.TreeIter iter;\n var el = this.el;\n \n el.append(out iter);\n\n \n el.set_value(iter, 0, \"\");\n el.set_value(iter, 1, \"-- select a project --\");\n if (id == \"\") {\n\t _this.classification_id.el.set_active_iter(iter);\n }\n /*\n var projects = rt.projects;\n foreach(var project in projects) {\n \n el.append(out iter);\n \n el.set_value(iter, 0, project.id);\n el.set_value(iter, 1, project.name );\n if (id == project.id) {\n\t \t _this.classification_id.el.set_active_iter(iter);\n\t } \n \n }\n */\n _this.classification_id.loading = false;\n //this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING); \n \n}\n", + "| void loadClassifications" : " ( ) {\n\n var rt = RooTicket.singleton();\n // rt.loadProjects();\n \n _this.classification_id.loading = true;\n\n this.el.clear(); \n Gtk.TreeIter iter;\n var el = this.el;\n \n el.append(out iter);\n\n \n el.set_value(iter, 0, \"\");\n el.set_value(iter, 1, \"-- select a project --\");\n if (id == \"\") {\n\t _this.classification_id.el.set_active_iter(iter);\n }\n \n var projects = rt.classifications;\n foreach(var project in projects) {\n \n el.append(out iter);\n \n el.set_value(iter, 0, project.id);\n el.set_value(iter, 1, project.display_name );\n // if (id == project.id) {\n\t// \t _this.classification_id.el.set_active_iter(iter);\n\t// } \n \n }\n \n _this.classification_id.loading = false;\n //this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING); \n \n}\n", "* pack" : "set_model", "xtype" : "ListStore", "$ columns" : "typeof(string),typeof(string)", diff --git a/Ticket.vala b/Ticket.vala index 12e3ecec..7bc34b94 100644 --- a/Ticket.vala +++ b/Ticket.vala @@ -985,7 +985,7 @@ public class Ticket : Object } // user defined functions - public void loadClassifications (string id) { + public void loadClassifications ( ) { var rt = RooTicket.singleton(); // rt.loadProjects(); @@ -1004,20 +1004,20 @@ public class Ticket : Object if (id == "") { _this.classification_id.el.set_active_iter(iter); } - /* - var projects = rt.projects; + + var projects = rt.classifications; foreach(var project in projects) { el.append(out iter); el.set_value(iter, 0, project.id); - el.set_value(iter, 1, project.name ); - if (id == project.id) { - _this.classification_id.el.set_active_iter(iter); - } + el.set_value(iter, 1, project.display_name ); + // if (id == project.id) { + // _this.classification_id.el.set_active_iter(iter); + // } } - */ + _this.classification_id.loading = false; //this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING); -- 2.39.2