2 "build_module" : "builder",
3 "gen_extended" : false,
6 "# Xcls_MainWindow win" : "",
8 "Gdk.Pixbuf missing_thumb_pixbuf" : "",
9 "Gee.HashMap<string,Gdk.Pixbuf> image_cache" : "",
10 "Project.Project selectedProject" : "",
11 "bool in_onprojectselected" : false,
12 "bool is_loading" : false,
14 "bool new_window" : false,
15 "int default_height" : 550,
16 "int default_width" : 1000,
19 "$ homogeneous" : false,
22 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
24 "int margin_bottom" : 10,
25 "int margin_end" : 10,
26 "int margin_start" : 10,
27 "int margin_top" : 10,
31 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
32 "bool hexpand" : true,
38 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
39 "bool hexpand" : true,
40 "bool homogeneous" : false,
41 "bool vexpand" : true,
49 " this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);",
52 "* prop" : "start_child",
54 "bool has_frame" : true,
55 "bool hexpand" : true,
56 "bool vexpand" : true,
57 "id" : "projectscroll",
58 "int width_request" : 150,
65 "\tthis.css = new Gtk.CssProvider();",
67 "\tthis.css.load_from_string(\"",
68 "\t\t#project-list { font-size: 12px;}",
71 "\tGtk.StyleContext.add_provider_for_display(",
72 "\t\tthis.el.get_display(),",
74 "\t\tGtk.STYLE_PROVIDER_PRIORITY_APPLICATION",
82 "Gtk.CssProvider css" : "",
83 "id" : "project_list",
88 "bool can_unselect" : true,
89 "id" : "projectselection",
94 "bool incremental" : true,
100 "GLib.Type item_type" : "typeof(Project.Project)",
101 "id" : "projectmodel",
102 "xtype" : "ListStore",
104 "(Project.Project p) {",
106 "\tfor (var i =0;i < this.el.n_items; i++ ) {",
107 "\t\tvar pr = (Project.Project) this.el.get_item(i);",
108 "\t\tif (p.path == pr.path) {",
109 "\t\t\tthis.el.remove(i);",
124 "* prop" : "expression",
125 "GLib.Type this_type" : "typeof(Project.Project)",
126 "string property_name" : "name",
127 "xtype" : "PropertyExpression"
130 "xtype" : "StringSorter"
133 "xtype" : "SortListModel"
137 "notify[\"selected\"]" : [
138 "(position, n_items) => {",
140 " if (_this.is_loading) {",
144 "\tif (this.el.selected == Gtk.INVALID_LIST_POSITION) {",
145 "\t\t_this.btn_delproj.el.hide();",
146 "\t\t_this.btn_projprop.el.hide();",
147 "\t\t_this.btn_addfile.el.hide();",
148 "\t\t//_this.btn_delfile.el.hide();",
151 "\t\t_this.btn_delproj.el.show();",
152 "\t\t_this.btn_projprop.el.show();",
153 "\t\t_this.btn_addfile.el.show();",
154 "\t\t//_this.btn_delfile.el.show(); // ??",
161 " if (_this.is_loading) {",
165 "\t Project.Project project = this.el.selected == Gtk.INVALID_LIST_POSITION ? null :",
166 "\t\t \t(Project.Project) _this.projectsort.el.get_item(this.el.selected);",
168 "\t GLib.debug(\"selection changed to %s\", project == null ? \"none\" : project.name);",
170 " _this.onProjectSelected(project);",
175 "xtype" : "SingleSelection"
179 "* pack" : "append_column",
180 "bool expand" : true,
184 "* prop" : "factory",
189 "\tvar lbl = (Gtk.Label) ((Gtk.ListItem)listitem).get_child();",
191 "\tvar item = (Project.Project) ((Gtk.ListItem)listitem).get_item();",
193 "\titem.bind_property(\"name\",",
195 " GLib.BindingFlags.SYNC_CREATE);",
203 "\t//var j = (JsRender.JsRender) item;",
204 "\tvar gi = (Gtk.ListItem)item;",
206 "\tvar lbl = new Gtk.Label(\"\");",
207 "\tlbl.halign = Gtk.Align.START;",
208 "\tgi.set_child(lbl);",
216 "xtype" : "SignalListItemFactory"
219 "string title" : "Project",
220 "xtype" : "ColumnViewColumn"
223 "string name" : "project-list",
224 "xtype" : "ColumnView"
227 "xtype" : "ScrolledWindow"
231 "* prop" : "end_child",
232 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
233 "bool visible" : false,
235 "int position" : 200,
239 "* prop" : "end_child",
240 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
241 "bool hexpand" : true,
242 "bool vexpand" : true,
247 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
248 "bool hexpand" : true,
256 "this.css = new Gtk.CssProvider();",
258 "\tthis.css.load_from_data(\"#popover-files-iconsearch { font: 10px monospace;}\".data);",
259 "} catch (Error e) {}",
260 "this.el.get_style_context().add_provider(this.css,Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);",
265 "Gtk.CssProvider css" : "",
266 "bool hexpand" : true,
272 "\t_this.treefilter.el.changed(Gtk.FilterChange.DIFFERENT);",
273 "\t_this.iconsearch.el.set_search(this.el.text);",
278 "string name" : "popover-files-iconsearch",
279 "string placeholder_text" : "type to filter results",
280 "uint search_delay" : 1000,
281 "xtype" : "SearchEntry"
289 " this.el.set_policy (Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC);",
292 "bool has_frame" : true,
293 "bool hexpand" : true,
294 "bool vexpand" : true,
306 "(n_press, x, y) => {",
307 "\tif (n_press == 2) {",
308 "\t\tGLib.debug(\"double cliced\");",
312 "\tvar f = (JsRender.JsRender)_this.iconsel.el.selected_item;",
314 "\tGLib.debug(\"Click %s\", f.name);",
315 "\tif (f.xtype == \"Dir\") {",
320 " \t_this.win.windowstate.fileViewOpen(f, _this.new_window);",
321 "\t_this.el.hide();",
330 "xtype" : "GestureClick"
335 "bool can_unselect" : true,
350 "GLib.Type item_type" : "typeof(JsRender.JsRender)",
352 "xtype" : "ListStore",
354 "(JsRender.JsRender p) {",
356 "\tfor (var i =0;i < this.el.n_items; i++ ) {",
357 "\t\tvar pr = (JsRender.JsRender) this.el.get_item(i);",
358 "\t\tif (p.path == pr.path) {",
359 "\t\t\tthis.el.remove(i);",
370 "bool ignore_case" : true,
374 "* prop" : "expression",
375 "GLib.Type this_type" : "typeof(JsRender.JsRender)",
376 "string property_name" : "name",
377 "xtype" : "PropertyExpression"
380 "xtype" : "StringSorter"
383 "xtype" : "SortListModel"
386 "$ Gtk.StringFilterMatchMode match_mode" : "Gtk.StringFilterMatchMode.SUBSTRING",
389 "bool ignore_case" : true,
394 "* prop" : "expression",
395 "GLib.Type this_type" : "typeof(JsRender.JsRender)",
396 "string property_name" : "name",
397 "xtype" : "PropertyExpression"
400 "xtype" : "StringFilter"
403 "xtype" : "FilterListModel"
407 "notify[\"selected\"]" : [
409 "\tif (this.el.selected == Gtk.INVALID_LIST_POSITION) {",
410 "\t\tif (_this.treeselmodel.el.selected == Gtk.INVALID_LIST_POSITION) {",
411 "\t\t\t_this.btn_delfile.el.hide();",
416 "\t_this.btn_delfile.el.show();",
417 "\t_this.treeselmodel.el.selected = Gtk.INVALID_LIST_POSITION;",
426 "xtype" : "SingleSelection",
427 "| JsRender.JsRender? selectedFile" : [
430 "\tif (this.el.selected == Gtk.INVALID_LIST_POSITION) {",
433 "\treturn (JsRender.JsRender)this.el.get_item(this.el.selected); ",
441 "* prop" : "factory",
446 "\tvar box = (Gtk.Box) ((Gtk.ListItem)listitem).get_child();",
448 "\tvar img = (Gtk.Image) box.get_first_child();",
449 "\tvar lbl = (Gtk.Label)img.get_next_sibling();",
451 "\tvar item = (JsRender.JsRender) ((Gtk.ListItem)listitem).get_item();",
452 "\t//GLib.debug(\"set label name to %s\", item.name);",
454 "\tvar ns = item.name.split(\".\");",
455 "\tif (ns.length < 2) {",
456 "\t\tlbl.label = item.name;",
459 "\t\t\titem.name.substring(0, item.name.length - ns[ns.length-1].length)",
460 "\t\t \t + \"\\n\"+ ns[ns.length-1];",
464 "\titem.bind_property(\"name\",",
466 " GLib.BindingFlags.SYNC_CREATE);",
469 " img.set_from_file(item.getIconFileName());",
477 "\t//var j = (JsRender.JsRender) item;",
478 "\tvar gi = (Gtk.ListItem)item;",
479 "\tvar b = new Gtk.Box(Gtk.Orientation.VERTICAL,4);",
480 "\tvar i = new Gtk.Image();",
481 "\ti.pixel_size = 96;",
482 "\tvar t = new Gtk.Label(\"\");",
486 "\tgi.set_child(b);",
487 "\tb.has_tooltip = true;",
488 "\tb.query_tooltip.connect((x, y, keyboard_tooltip, tooltip) => {",
489 "\t\tvar j = (JsRender.JsRender) gi.get_item();",
491 "\t\tvar ti = new Gtk.Image.from_file ( j.getIconFileName());",
492 "\t\tti.pixel_size = 368;",
493 "\t\ttooltip.set_custom( ti );",
502 "xtype" : "SignalListItemFactory"
508 "xtype" : "ScrolledWindow"
515 "* init" : " this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);",
516 "* prop" : "start_child",
517 "bool has_frame" : true,
518 "bool hexpand" : true,
519 "bool vexpand" : true,
520 "bool visible" : true,
522 "int width_request" : 200,
529 "\tthis.css = new Gtk.CssProvider();",
531 "\tthis.css.load_from_string(\"",
532 "#file-list { font-size: 12px;}",
533 "#file-list indent {",
534 "-gtk-icon-size : 2px;",
536 "#file-list indent:nth-last-child(2) {",
541 "\tGtk.StyleContext.add_provider_for_display(",
542 "\t\tthis.el.get_display(),",
544 "\t\tGtk.STYLE_PROVIDER_PRIORITY_APPLICATION",
551 "Gtk.CssProvider css" : "",
558 "(n_press, x, y) => {",
559 "\tif (n_press == 2) {",
560 "\t\tGLib.debug(\"double cliced\");",
564 "\tvar tr = (Gtk.TreeListRow)_this.treeselmodel.el.selected_item;",
565 "\tGLib.debug(\"SELECTED = %s\", tr.item.get_type().name());",
566 "\tvar f = (JsRender.JsRender) tr.item;",
567 "\tGLib.debug(\"Click %s\", f.name);",
568 "\tif (f.xtype == \"Dir\") {",
573 " \t_this.win.windowstate.fileViewOpen(f, _this.new_window);",
575 "\t_this.el.hide();",
583 "xtype" : "GestureClick"
588 "bool can_unselect" : true,
589 "id" : "treeselmodel",
598 "bool incremental" : true,
599 "id" : "treelistsort",
604 "Gtk.TreeListModelCreateModelFunc create_func" : [
606 "\t//GLib.debug(\"liststore got %s\", item.get_type().name());",
607 "\treturn ((JsRender.JsRender)item).childfiles;",
610 "bool autoexpand" : true,
611 "bool passthrough" : false,
612 "id" : "treelistmodel",
617 "GLib.Type item_type" : "typeof(JsRender.JsRender)",
619 "xtype" : "ListStore"
622 "xtype" : "TreeListModel"
631 "bool ignore_case" : true,
635 "* prop" : "expression",
636 "GLib.Type this_type" : "typeof(JsRender.JsRender) ",
637 "string property_name" : "name",
638 "xtype" : "PropertyExpression"
641 "xtype" : "StringSorter"
644 "xtype" : "TreeListRowSorter"
647 "xtype" : "SortListModel"
652 "Gtk.CustomFilterFunc match_func" : [
654 "\tvar tr = ((Gtk.TreeListRow)item).get_item();",
655 "\t//GLib.debug(\"filter %s\", tr.get_type().name());",
656 "\tvar j = (JsRender.JsRender) tr;",
657 "\tif (j.xtype == \"Dir\" && j.childfiles.n_items < 1) {",
660 "\tvar str = _this.searchbox.el.text.down();\t",
661 "\tif (j.xtype == \"Dir\") {",
664 "\t\tfor (var i =0 ; i < j.childfiles.n_items; i++) {",
665 "\t\t\tvar f = (JsRender.JsRender) j.childfiles.get_item(i);",
666 "\t\t\tif (f.xtype != \"PlainFile\") {",
669 "\t\t\tif (f.content_type.contains(\"image\")) {",
672 "\t\t\tif (str.length < 1) {",
673 "\t\t\t\treturn true;",
675 "\t\t\tif (f.name.down().contains(str)) {",
676 "\t\t\t\treturn true;",
683 "\tif (j.xtype != \"PlainFile\") {",
686 " \tif (j.content_type.contains(\"image\")) {",
690 "\tif (str.length < 1) { // no search.",
693 "\tif (j.name.down().contains(str)) {",
701 "xtype" : "CustomFilter"
704 "xtype" : "FilterListModel"
708 "notify[\"selected\"]" : [
710 "\tif (this.el.selected == Gtk.INVALID_LIST_POSITION) {",
711 "\t\tif (_this.iconsel.el.selected == Gtk.INVALID_LIST_POSITION) {",
712 "\t\t\t_this.btn_delfile.el.hide();",
717 "\tvar tr = (Gtk.TreeListRow)_this.treeselmodel.el.selected_item;",
718 "\tGLib.debug(\"SELECTED = %s\", tr.item.get_type().name());",
719 "\tvar f = (JsRender.JsRender) tr.item;",
720 "\tif (f.xtype == \"Dir\") {",
721 "\t\t_this.btn_delfile.el.hide();\t",
723 "\t\t_this.btn_delfile.el.show();",
726 "\t_this.iconsel.el.selected = Gtk.INVALID_LIST_POSITION;",
735 "xtype" : "SingleSelection",
736 "| JsRender.JsRender? selectedFile" : [
739 "\tif (this.el.selected == Gtk.INVALID_LIST_POSITION) {",
742 "\tvar tr = (Gtk.TreeListRow) this.el.selected_item;",
744 "\treturn (JsRender.JsRender) tr.item;",
752 "\t// this.el.set_sorter( new Gtk.StringSorter(",
753 "\t// \tnew Gtk.PropertyExpression(typeof(JsRender.NodeProp), null, \"name\")",
759 "* pack" : "append_column",
760 "bool expand" : true,
761 "bool resizable" : true,
766 "* prop" : "factory",
771 "\t //GLib.debug(\"listitme is is %s\", ((Gtk.ListItem)listitem).get_type().name());",
775 " \t//var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
776 " \tvar expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
778 " \tvar hbox = (Gtk.Box) expand.child;",
781 "\t\tvar img = (Gtk.Image) hbox.get_first_child();",
782 "\t\tvar lbl = (Gtk.Label) img.get_next_sibling();",
786 " \t if (lbl.label != \"\") { // do not update",
789 " \tvar lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();",
790 " \t//GLib.debug(\"LR = %s\", lr.get_type().name());",
793 " \tvar jr =(JsRender.JsRender) lr.get_item();",
794 " \t//GLib.debug(\"JR = %s\", jr.get_type().name());\t\t",
796 " \t if (jr == null) {",
797 " \t\t GLib.debug(\"Problem getting item\"); ",
801 "\t\tjr.bind_property(\"icon\",",
803 " GLib.BindingFlags.SYNC_CREATE);",
805 " \t//GLib.debug(\"change %s to %s\", lbl.label, np.name);",
806 " \tlbl.label = jr.name; // for dir's we could hsow the sub path..",
807 " \tlbl.tooltip_markup = jr.path;",
809 " expand.set_hide_expander( jr.xtype != \"Dir\" );",
810 " \t expand.set_list_row(lr);",
813 " \t// bind image...",
820 "\tvar expand = new Gtk.TreeExpander();",
822 "\texpand.set_indent_for_depth(true);",
823 "\texpand.set_indent_for_icon(true);",
824 "\tvar hbox = new Gtk.Box(Gtk.Orientation.HORIZONTAL,0);",
825 "\tvar icon = new Gtk.Image();",
826 "\ticon.margin_end = 4;",
827 "\tvar lbl = new Gtk.Label(\"\");",
828 "\tlbl.use_markup = true;",
831 " \tlbl.justify = Gtk.Justification.LEFT;",
832 " \tlbl.xalign = 0;",
834 " \thbox.append(icon);",
835 "\thbox.append(lbl);",
836 "\texpand.set_child(hbox);",
837 "\t((Gtk.ListItem)listitem).set_child(expand);",
838 "\t((Gtk.ListItem)listitem).activatable = false;",
843 "xtype" : "SignalListItemFactory"
846 "string title" : "General Files",
847 "xtype" : "ColumnViewColumn"
850 "string name" : "file-list",
851 "xtype" : "ColumnView"
854 "xtype" : "ScrolledWindow"
867 "* prop" : "titlebar",
868 "* title" : "Select Project / File",
869 "bool show_title_buttons" : false,
873 "* pack" : "pack_end",
877 "\tif (BuilderApplication.windows.size < 2 && ",
878 "\t\t_this.win.windowstate.file == null",
880 "\t\tBuilderApplication.singleton(null).quit();",
884 "\t_this.el.hide();",
886 "\t if (_this.win.windowstate.file == null) {\t\t ",
887 "\t\tBuilderApplication.removeWindow(_this.win);",
897 "string label" : "Close / Cancel",
902 "* pack" : "pack_start",
903 "id" : "btn_newproj",
906 "$ Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
911 "$ Gtk.IconSize icon_size" : "Gtk.IconSize.NORMAL",
913 "int margin_end" : 4,
914 "string icon_name" : "folder-new",
918 "$ Gtk.Align halign" : "Gtk.Align.START",
920 "string label" : "New Project",
931 " // create a new file in project..",
932 " //Xcls_DialogNewComponent.singleton().show(",
933 " var pe = EditProject.singleton();",
934 " pe.windowstate = _this.win.windowstate;",
936 " pe.el.application = _this.win.el.application;",
937 " pe.el.set_transient_for( _this.el );",
939 " var cb = new Project.Callback();",
940 " cb.call.connect((pr) => {",
941 " \t_this.show( pr , _this.new_window);",
951 "| void onCreated" : [
953 "\tvar pe = EditProject.singleton();",
955 "\t_this.show( pe.result , _this.new_window);",
961 "* pack" : "pack_start",
962 "id" : "btn_projprop",
967 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
972 "int margin_end" : 4,
973 "string icon_name" : "emblem-system",
978 "string label" : "Project Properties",
988 " // should disable the button really.",
989 " if (_this.selectedProject == null) {",
992 "\t_this.win.windowstate.projectPopoverShow(_this.el, _this.selectedProject, null);",
1000 "* pack" : "pack_start",
1001 "DialogConfirm confirm" : "null",
1002 "id" : "btn_delproj",
1007 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
1012 "string icon_name" : "user-trash",
1017 "string label" : "Delete Project",
1029 " \tif (this.confirm == null) {",
1030 " \t\tthis.confirm = new DialogConfirm();",
1031 " \t\tthis.confirm.el.set_transient_for(_this.el);",
1034 "\tvar project = (Project.Project) _this.projectsort.el.get_item(",
1035 "\t\t_this.projectselection.el.selected",
1038 "\tthis.confirm.el.response.connect((res) => {",
1039 "\t\tthis.confirm.el.hide();",
1040 "\t\tif (res == Gtk.ResponseType.CANCEL) {",
1043 "\t project = (Project.Project) _this.projectsort.el.get_item(",
1044 "\t\t\t_this.projectselection.el.selected",
1046 "\t\tProject.Project.remove(project);",
1047 "\t _this.projectmodel.remove(project);",
1048 "\t\t_this.projectselection.el.selected = Gtk.INVALID_LIST_POSITION;",
1051 " \tthis.confirm.showIt(\"Confirm Delete Project\", \"Are you sure you want to delete this project?\");",
1059 "* pack" : "pack_start",
1060 "id" : "btn_addfile",
1065 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
1070 "int margin_end" : 4,
1071 "string icon_name" : "document-new",
1076 "string label" : "New File",
1086 " // create a new file in project..",
1087 " print(\"add file selected\\n\");",
1089 " if (_this.selectedProject == null) {",
1093 " \tvar f = JsRender.JsRender.factory(_this.selectedProject.xtype, _this.selectedProject, \"\");",
1094 " \t_this.win.windowstate.file_details.show( f, _this.el, _this.new_window );",
1095 " } catch (JsRender.Error e) {}",
1104 "* pack" : "pack_start",
1105 "DialogConfirm confirm" : "null",
1106 "id" : "btn_delfile",
1111 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
1116 "string icon_name" : "user-trash",
1121 "string label" : "Delete File",
1132 " \tif (this.confirm == null) {",
1133 " \t\tthis.confirm = new DialogConfirm();",
1134 " \t\tthis.confirm.el.set_transient_for(_this.el);",
1137 "\tGLib.debug(\"DELETE\");",
1138 "\tvar is_icon = true;",
1139 " \tvar isel = _this.iconsel.selectedFile();",
1141 " \tif (isel == null) {",
1142 " \t\tGLib.debug(\"DELETE - no icons selected\");",
1143 "\t \tis_icon = false;",
1144 "\t \tisel = _this.treeselmodel.selectedFile();",
1146 " \tif (isel == null) {",
1147 " \t \t\tGLib.debug(\"DELETE - no tree item selected\");",
1148 " \t\treturn; // should nto happen..",
1151 "\tGLib.debug(\"DELETE - calling confirm.\");",
1152 "\tthis.confirm.el.response.connect((res) => {",
1153 "\t\tthis.confirm.el.hide();",
1154 "\t\tif (res == Gtk.ResponseType.CANCEL) {",
1157 "\t\tis_icon = true;",
1158 "\t \tisel = _this.iconsel.selectedFile();",
1159 "\t \tif (isel == null) {",
1160 "\t\t \tis_icon = false;",
1161 "\t\t \tisel = _this.treeselmodel.selectedFile();",
1163 "\t \tif (isel == null) {",
1164 "\t \t\treturn; // should nto happen..",
1167 "\t \tif (is_icon) {",
1168 "\t\t \tisel.project.deleteFile(isel);",
1169 "\t \t\t_this.gridmodel.remove(isel);",
1172 " \t\tisel.project.deleteFile(isel); \t\t",
1175 "\t \tthis.confirm.showIt(\"Confirm Delete File\",",
1176 "\t \t\t\"Are you sure you want to delete this file?\");",
1186 "xtype" : "HeaderBar"
1189 "name" : "DialogFiles",
1190 "string lastfilter" : "",
1191 "title" : "Select Project / File",
1198 " _this.is_loading = true;",
1201 " Project.Project.loadAll();",
1202 " _this.project_list.el.set_model(new Gtk.SingleSelection(null));",
1203 " Project.Project.loadIntoStore(this.projectmodel.el);",
1205 "\t_this.project_list.el.set_model(_this.projectselection.el);",
1207 "\t_this.is_loading = false;",
1209 " _this.projectselection.el.selected = Gtk.INVALID_LIST_POSITION; ",
1210 "\t_this.btn_delfile.el.hide();",
1216 "| void onProjectSelected" : [
1217 "(Project.Project? project) ",
1219 "\tif (this.in_onprojectselected) { ",
1222 "\tthis.selectedProject = project;",
1224 "\tif (project == null) {",
1225 "\t\tGLib.debug(\"Hide project files\");",
1226 "\t\t_this.mainpane.el.set_end_child(null);",
1227 "\t\t_this.filepane.el.hide();",
1232 "\tGLib.debug(\"Show project files\");",
1233 "\t_this.mainpane.el.set_end_child(_this.filepane.el);",
1235 "\t_this.filepane.el.show();\t",
1236 "\tthis.in_onprojectselected = true;",
1240 "\tproject.load();",
1243 "\t_this.searchbox.el.text = \"\";",
1244 "\t _this.gridview.el.set_model(new Gtk.SingleSelection(null));",
1245 "\t _this.selectedProject.loadFilesIntoStore(_this.gridmodel.el);",
1246 "\t _this.iconsel.el.selected = Gtk.INVALID_LIST_POSITION;",
1248 "\t _this.gridview.el.set_model(_this.iconsel.el);",
1251 " \t GLib.Timeout.add(500, () => {",
1252 " \t\t_this.iconsel.el.selected = Gtk.INVALID_LIST_POSITION;",
1253 " \t \t _this.treeselmodel.el.selected = Gtk.INVALID_LIST_POSITION;\t\t ",
1255 "\t _this.searchbox.el.grab_focus();",
1256 "\t\t return false;",
1258 "\t _this.treeview.el.set_model(new Gtk.SingleSelection(null));",
1260 " this.selectedProject.loadDirsIntoStore(_this.treemodel.el);",
1262 " _this.treeview.el.set_model(_this.treeselmodel.el);",
1264 " \t _this.treeselmodel.el.selected = Gtk.INVALID_LIST_POSITION;",
1265 " \tthis.treescroll.el.vadjustment.value = 0;",
1266 "\tthis.in_onprojectselected = false;\t",
1270 "| void selectProject" : [
1271 "(Project.Project? project) {",
1275 "\tvar sm = this.projectselection.el;",
1276 "\tif (project == null) {",
1277 "\t\tsm.selected = Gtk.INVALID_LIST_POSITION;",
1278 "\t\tthis.onProjectSelected(null);",
1283 "\tfor (var i =0; i < sm.n_items; i++) {",
1284 "\t\tvar p = (Project.Project) sm.get_item(i);",
1285 "\t\tif (p.path == project.path) {",
1286 "\t\t\tGLib.debug(\"Select Project %s => %d\", project.name, i);",
1287 "\t\t\tsm.selected = i;",
1296 "(Project.Project? project, bool new_window) {",
1298 " \tthis.new_window = new_window;",
1300 " this.projectscroll.el.vadjustment.value = 0; // scroll to top?",
1303 "\t //var win = this.win.el;",
1304 " //var w = win.get_width();",
1305 " //var h = win.get_height();",
1308 "\t this.el.show();",
1310 "\tthis.selectProject(project);",
1311 "\tthis.onProjectSelected(project); //?? twice?",
1313 "\t GLib.Timeout.add(500, () => {",
1314 "\t \tif (project == null) {",
1315 " \t \t\t_this.projectselection.el.selected = Gtk.INVALID_LIST_POSITION;",
1316 "\t\t\t\tthis.onProjectSelected(null); ",
1319 "\t this.el.set_size_request( 800 , 750); // ?? based on default ",
1327 "name" : "DialogFiles"