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\") {",
663 "\t\tif (str.length < 1) {",
664 "\t\t\treturn true;",
666 "\t\tfor (var i =0 ; i < j.childfiles.n_items; i++) {",
667 "\t\t\tvar f = (JsRender.JsRender) j.childfiles.get_item(i);",
668 "\t\t\tif (f.xtype != \"PlainFile\") {",
671 "\t\t\tif (f.name.down().contains(str)) {",
672 "\t\t\t\treturn true;",
677 "\tif (j.xtype != \"PlainFile\") {",
681 "\tif (str.length < 1) {",
684 "\tif (j.name.down().contains(str)) {",
692 "xtype" : "CustomFilter"
695 "xtype" : "FilterListModel"
699 "notify[\"selected\"]" : [
701 "\tif (this.el.selected == Gtk.INVALID_LIST_POSITION) {",
702 "\t\tif (_this.iconsel.el.selected == Gtk.INVALID_LIST_POSITION) {",
703 "\t\t\t_this.btn_delfile.el.hide();",
708 "\tvar tr = (Gtk.TreeListRow)_this.treeselmodel.el.selected_item;",
709 "\tGLib.debug(\"SELECTED = %s\", tr.item.get_type().name());",
710 "\tvar f = (JsRender.JsRender) tr.item;",
711 "\tif (f.xtype == \"Dir\") {",
712 "\t\t_this.btn_delfile.el.hide();\t",
714 "\t\t_this.btn_delfile.el.show();",
717 "\t_this.iconsel.el.selected = Gtk.INVALID_LIST_POSITION;",
726 "xtype" : "SingleSelection",
727 "| JsRender.JsRender? selectedFile" : [
730 "\tif (this.el.selected == Gtk.INVALID_LIST_POSITION) {",
733 "\tvar tr = (Gtk.TreeListRow) this.el.selected_item;",
735 "\treturn (JsRender.JsRender) tr.item;",
743 "\t// this.el.set_sorter( new Gtk.StringSorter(",
744 "\t// \tnew Gtk.PropertyExpression(typeof(JsRender.NodeProp), null, \"name\")",
750 "* pack" : "append_column",
751 "bool expand" : true,
752 "bool resizable" : true,
757 "* prop" : "factory",
762 "\t //GLib.debug(\"listitme is is %s\", ((Gtk.ListItem)listitem).get_type().name());",
766 " \t//var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
767 " \tvar expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
769 " \tvar hbox = (Gtk.Box) expand.child;",
772 "\t\tvar img = (Gtk.Image) hbox.get_first_child();",
773 "\t\tvar lbl = (Gtk.Label) img.get_next_sibling();",
777 " \t if (lbl.label != \"\") { // do not update",
780 " \tvar lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();",
781 " \t//GLib.debug(\"LR = %s\", lr.get_type().name());",
784 " \tvar jr =(JsRender.JsRender) lr.get_item();",
785 " \t//GLib.debug(\"JR = %s\", jr.get_type().name());\t\t",
787 " \t if (jr == null) {",
788 " \t\t GLib.debug(\"Problem getting item\"); ",
792 "\t\tjr.bind_property(\"icon\",",
794 " GLib.BindingFlags.SYNC_CREATE);",
796 " \t//GLib.debug(\"change %s to %s\", lbl.label, np.name);",
797 " \tlbl.label = jr.name; // for dir's we could hsow the sub path..",
798 " \tlbl.tooltip_markup = jr.path;",
800 " expand.set_hide_expander( jr.xtype != \"Dir\" );",
801 " \t expand.set_list_row(lr);",
804 " \t// bind image...",
811 "\tvar expand = new Gtk.TreeExpander();",
813 "\texpand.set_indent_for_depth(true);",
814 "\texpand.set_indent_for_icon(true);",
815 "\tvar hbox = new Gtk.Box(Gtk.Orientation.HORIZONTAL,0);",
816 "\tvar icon = new Gtk.Image();",
817 "\ticon.margin_end = 4;",
818 "\tvar lbl = new Gtk.Label(\"\");",
819 "\tlbl.use_markup = true;",
822 " \tlbl.justify = Gtk.Justification.LEFT;",
823 " \tlbl.xalign = 0;",
825 " \thbox.append(icon);",
826 "\thbox.append(lbl);",
827 "\texpand.set_child(hbox);",
828 "\t((Gtk.ListItem)listitem).set_child(expand);",
829 "\t((Gtk.ListItem)listitem).activatable = false;",
834 "xtype" : "SignalListItemFactory"
837 "string title" : "General Files",
838 "xtype" : "ColumnViewColumn"
841 "string name" : "file-list",
842 "xtype" : "ColumnView"
845 "xtype" : "ScrolledWindow"
858 "* prop" : "titlebar",
859 "* title" : "Select Project / File",
860 "bool show_title_buttons" : false,
864 "* pack" : "pack_end",
868 "\tif (BuilderApplication.windows.size < 2 && ",
869 "\t\t_this.win.windowstate.file == null",
871 "\t\tBuilderApplication.singleton(null).quit();",
875 "\t_this.el.hide();",
877 "\t if (_this.win.windowstate.file == null) {\t\t ",
878 "\t\tBuilderApplication.removeWindow(_this.win);",
888 "string label" : "Close / Cancel",
893 "* pack" : "pack_start",
894 "id" : "btn_newproj",
897 "$ Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
902 "$ Gtk.IconSize icon_size" : "Gtk.IconSize.NORMAL",
904 "int margin_end" : 4,
905 "string icon_name" : "folder-new",
909 "$ Gtk.Align halign" : "Gtk.Align.START",
911 "string label" : "New Project",
922 " // create a new file in project..",
923 " //Xcls_DialogNewComponent.singleton().show(",
924 " var pe = EditProject.singleton();",
925 " pe.windowstate = _this.win.windowstate;",
927 " pe.el.application = _this.win.el.application;",
928 " pe.el.set_transient_for( _this.el );",
930 " var cb = new Project.Callback();",
931 " cb.call.connect((pr) => {",
932 " \t_this.show( pr , _this.new_window);",
942 "| void onCreated" : [
944 "\tvar pe = EditProject.singleton();",
946 "\t_this.show( pe.result , _this.new_window);",
952 "* pack" : "pack_start",
953 "id" : "btn_projprop",
958 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
963 "int margin_end" : 4,
964 "string icon_name" : "emblem-system",
969 "string label" : "Project Properties",
979 " // should disable the button really.",
980 " if (_this.selectedProject == null) {",
983 "\t_this.win.windowstate.projectPopoverShow(_this.el, _this.selectedProject, null);",
991 "* pack" : "pack_start",
992 "DialogConfirm confirm" : "null",
993 "id" : "btn_delproj",
998 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
1003 "string icon_name" : "user-trash",
1008 "string label" : "Delete Project",
1020 " \tif (this.confirm == null) {",
1021 " \t\tthis.confirm = new DialogConfirm();",
1022 " \t\tthis.confirm.el.set_transient_for(_this.el);",
1025 "\tvar project = (Project.Project) _this.projectsort.el.get_item(",
1026 "\t\t_this.projectselection.el.selected",
1029 "\tthis.confirm.el.response.connect((res) => {",
1030 "\t\tthis.confirm.el.hide();",
1031 "\t\tif (res == Gtk.ResponseType.CANCEL) {",
1034 "\t project = (Project.Project) _this.projectsort.el.get_item(",
1035 "\t\t\t_this.projectselection.el.selected",
1037 "\t\tProject.Project.remove(project);",
1038 "\t _this.projectmodel.remove(project);",
1039 "\t\t_this.projectselection.el.selected = Gtk.INVALID_LIST_POSITION;",
1042 " \tthis.confirm.showIt(\"Confirm Delete Project\", \"Are you sure you want to delete this project?\");",
1050 "* pack" : "pack_start",
1051 "id" : "btn_addfile",
1056 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
1061 "int margin_end" : 4,
1062 "string icon_name" : "document-new",
1067 "string label" : "New File",
1077 " // create a new file in project..",
1078 " print(\"add file selected\\n\");",
1080 " if (_this.selectedProject == null) {",
1084 " \tvar f = JsRender.JsRender.factory(_this.selectedProject.xtype, _this.selectedProject, \"\");",
1085 " \t_this.win.windowstate.file_details.show( f, _this.el, _this.new_window );",
1086 " } catch (JsRender.Error e) {}",
1095 "* pack" : "pack_start",
1096 "DialogConfirm confirm" : "null",
1097 "id" : "btn_delfile",
1102 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
1107 "string icon_name" : "user-trash",
1112 "string label" : "Delete File",
1123 " \tif (this.confirm == null) {",
1124 " \t\tthis.confirm = new DialogConfirm();",
1125 " \t\tthis.confirm.el.set_transient_for(_this.el);",
1128 "\tGLib.debug(\"DELETE\");",
1129 "\tvar is_icon = true;",
1130 " \tvar isel = _this.iconsel.selectedFile();",
1132 " \tif (isel == null) {",
1133 " \t\tGLib.debug(\"DELETE - no icons selected\");",
1134 "\t \tis_icon = false;",
1135 "\t \tisel = _this.treeselmodel.selectedFile();",
1137 " \tif (isel == null) {",
1138 " \t \t\tGLib.debug(\"DELETE - no tree item selected\");",
1139 " \t\treturn; // should nto happen..",
1142 "\tGLib.debug(\"DELETE - calling confirm.\");",
1143 "\tthis.confirm.el.response.connect((res) => {",
1144 "\t\tthis.confirm.el.hide();",
1145 "\t\tif (res == Gtk.ResponseType.CANCEL) {",
1148 "\t\tis_icon = true;",
1149 "\t \tisel = _this.iconsel.selectedFile();",
1150 "\t \tif (isel == null) {",
1151 "\t\t \tis_icon = false;",
1152 "\t\t \tisel = _this.treeselmodel.selectedFile();",
1154 "\t \tif (isel == null) {",
1155 "\t \t\treturn; // should nto happen..",
1158 "\t \tif (is_icon) {",
1159 "\t\t \tisel.project.deleteFile(isel);",
1160 "\t \t\t_this.gridmodel.remove(isel);",
1163 " \t\tisel.project.deleteFile(isel); \t\t",
1166 "\t \tthis.confirm.showIt(\"Confirm Delete File\",",
1167 "\t \t\t\"Are you sure you want to delete this file?\");",
1177 "xtype" : "HeaderBar"
1180 "name" : "DialogFiles",
1181 "string lastfilter" : "",
1182 "title" : "Select Project / File",
1186 " // clear list...",
1189 " _this.is_loading = true;",
1192 " Project.Project.loadAll();",
1193 " _this.project_list.el.set_model(new Gtk.SingleSelection(null));",
1194 " Project.Project.loadIntoStore(this.projectmodel.el);",
1196 "\t_this.project_list.el.set_model(_this.projectselection.el);",
1198 "\t_this.is_loading = false;",
1200 " _this.projectselection.el.selected = Gtk.INVALID_LIST_POSITION; ",
1201 "\t_this.btn_delfile.el.hide();",
1207 "| void onProjectSelected" : [
1208 "(Project.Project? project) ",
1210 "\tif (this.in_onprojectselected) { ",
1213 "\tthis.selectedProject = project;",
1215 "\tif (project == null) {",
1216 "\t\tGLib.debug(\"Hide project files\");",
1217 "\t\t_this.mainpane.el.set_end_child(null);",
1218 "\t\t_this.filepane.el.hide();",
1223 "\tGLib.debug(\"Show project files\");",
1224 "\t_this.mainpane.el.set_end_child(_this.filepane.el);",
1226 "\t_this.filepane.el.show();\t",
1227 "\tthis.in_onprojectselected = true;",
1231 "\tproject.load();",
1234 "\t_this.searchbox.el.text = \"\";",
1235 "\t _this.gridview.el.set_model(new Gtk.SingleSelection(null));",
1236 "\t _this.selectedProject.loadFilesIntoStore(_this.gridmodel.el);",
1237 "\t _this.iconsel.el.selected = Gtk.INVALID_LIST_POSITION;",
1239 "\t _this.gridview.el.set_model(_this.iconsel.el);",
1242 " \t GLib.Timeout.add(500, () => {",
1243 " \t\t_this.iconsel.el.selected = Gtk.INVALID_LIST_POSITION;",
1244 " \t \t _this.treeselmodel.el.selected = Gtk.INVALID_LIST_POSITION;\t\t ",
1246 "\t _this.searchbox.el.grab_focus();",
1247 "\t\t return false;",
1249 "\t _this.treeview.el.set_model(new Gtk.SingleSelection(null));",
1251 " this.selectedProject.loadDirsIntoStore(_this.treemodel.el);",
1253 " _this.treeview.el.set_model(_this.treeselmodel.el);",
1255 " \t _this.treeselmodel.el.selected = Gtk.INVALID_LIST_POSITION;",
1256 " \tthis.treescroll.el.vadjustment.value = 0;",
1257 "\tthis.in_onprojectselected = false;\t",
1261 "| void selectProject" : [
1262 "(Project.Project? project) {",
1266 "\tvar sm = this.projectselection.el;",
1267 "\tif (project == null) {",
1268 "\t\tsm.selected = Gtk.INVALID_LIST_POSITION;",
1269 "\t\tthis.onProjectSelected(null);",
1274 "\tfor (var i =0; i < sm.n_items; i++) {",
1275 "\t\tvar p = (Project.Project) sm.get_item(i);",
1276 "\t\tif (p.path == project.path) {",
1277 "\t\t\tGLib.debug(\"Select Project %s => %d\", project.name, i);",
1278 "\t\t\tsm.selected = i;",
1287 "(Project.Project? project, bool new_window) {",
1289 " \tthis.new_window = new_window;",
1291 " this.projectscroll.el.vadjustment.value = 0; // scroll to top?",
1294 "\t //var win = this.win.el;",
1295 " //var w = win.get_width();",
1296 " //var h = win.get_height();",
1299 "\t this.el.show();",
1301 "\tthis.selectProject(project);",
1302 "\tthis.onProjectSelected(project); //?? twice?",
1304 "\t GLib.Timeout.add(500, () => {",
1305 "\t \tif (project == null) {",
1306 " \t \t\t_this.projectselection.el.selected = Gtk.INVALID_LIST_POSITION;",
1307 "\t\t\t\tthis.onProjectSelected(null); ",
1310 "\t this.el.set_size_request( 800 , 750); // ?? based on default ",
1318 "name" : "DialogFiles"