2 "build_module" : "builder",
3 "gen_extended" : false,
6 "# Xcls_MainWindow win" : "",
10 "\tvar ev = new Gtk.EventControllerKey();",
11 "\tev.propagation_phase = Gtk.PropagationPhase.CAPTURE;",
14 "\t// set gobject values",
17 "\tev.key_released.connect( (keyval, keycode, state) => {",
19 "\t\t// GLib.debug(\"key pressed %d\", (int)keycode);",
20 "\t\tif (keycode != 9) {",
23 "\t\tif (BuilderApplication.windows.size < 2 && ",
24 "\t\t\t_this.win.windowstate.file == null",
26 "\t\t\tBuilderApplication.singleton(null).quit();",
30 "\t\t_this.el.hide();",
32 "\t\t if (_this.win.windowstate.file == null) {\t\t ",
33 "\t\t\tBuilderApplication.removeWindow(_this.win);",
39 "\tev.ref(); //?? needed?",
40 "\t((Gtk.Widget)this.el).add_controller(ev);",
44 "Gdk.Pixbuf missing_thumb_pixbuf" : "",
45 "Gee.HashMap<string,Gdk.Pixbuf> image_cache" : "",
46 "Project.Project selectedProject" : "",
47 "bool in_onprojectselected" : false,
48 "bool is_loading" : false,
50 "bool new_window" : false,
51 "int default_height" : 550,
52 "int default_width" : 1000,
55 "$ homogeneous" : false,
58 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
60 "int margin_bottom" : 10,
61 "int margin_end" : 10,
62 "int margin_start" : 10,
63 "int margin_top" : 10,
67 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
68 "bool hexpand" : true,
74 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
75 "bool hexpand" : true,
76 "bool homogeneous" : false,
77 "bool vexpand" : true,
85 " this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);",
88 "* prop" : "start_child",
90 "bool has_frame" : true,
91 "bool hexpand" : true,
92 "bool vexpand" : true,
93 "id" : "projectscroll",
94 "int width_request" : 150,
99 "Gtk.CssProvider css" : "",
100 "id" : "project_list",
105 "bool can_unselect" : true,
106 "id" : "projectselection",
111 "bool incremental" : true,
112 "id" : "projectsort",
117 "GLib.Type item_type" : "typeof(Project.Project)",
118 "id" : "projectmodel",
119 "xtype" : "ListStore",
121 "(Project.Project p) {",
123 "\tfor (var i =0;i < this.el.n_items; i++ ) {",
124 "\t\tvar pr = (Project.Project) this.el.get_item(i);",
125 "\t\tif (p.path == pr.path) {",
126 "\t\t\tthis.el.remove(i);",
141 "* prop" : "expression",
142 "GLib.Type this_type" : "typeof(Project.Project)",
143 "string property_name" : "name",
144 "xtype" : "PropertyExpression"
147 "xtype" : "StringSorter"
150 "xtype" : "SortListModel"
154 "notify[\"selected\"]" : [
155 "(position, n_items) => {",
157 " if (_this.is_loading) {",
161 "\tif (this.el.selected == Gtk.INVALID_LIST_POSITION) {",
162 "\t\t_this.btn_delproj.el.hide();",
163 "\t\t_this.btn_projprop.el.hide();",
164 "\t\t_this.btn_addfile.el.hide();",
165 "\t\t//_this.btn_delfile.el.hide();",
168 "\t\t_this.btn_delproj.el.show();",
169 "\t\t_this.btn_projprop.el.show();",
170 "\t\t_this.btn_addfile.el.show();",
171 "\t\t//_this.btn_delfile.el.show(); // ??",
178 " if (_this.is_loading) {",
182 "\t Project.Project project = this.el.selected == Gtk.INVALID_LIST_POSITION ? null :",
183 "\t\t \t(Project.Project) _this.projectsort.el.get_item(this.el.selected);",
185 "\t GLib.debug(\"selection changed to %s\", project == null ? \"none\" : project.name);",
187 " _this.onProjectSelected(project);",
192 "xtype" : "SingleSelection"
196 "* pack" : "append_column",
197 "bool expand" : true,
201 "* prop" : "factory",
206 "\tvar lbl = (Gtk.Label) ((Gtk.ListItem)listitem).get_child();",
208 "\tvar item = (Project.Project) ((Gtk.ListItem)listitem).get_item();",
210 "\titem.bind_property(\"name\",",
212 " GLib.BindingFlags.SYNC_CREATE);",
220 "\t//var j = (JsRender.JsRender) item;",
221 "\tvar gi = (Gtk.ListItem)item;",
223 "\tvar lbl = new Gtk.Label(\"\");",
224 "\tlbl.halign = Gtk.Align.START;",
225 "\tgi.set_child(lbl);",
233 "xtype" : "SignalListItemFactory"
236 "string title" : "Project",
237 "xtype" : "ColumnViewColumn"
240 "string name" : "project-list",
241 "xtype" : "ColumnView"
244 "xtype" : "ScrolledWindow"
248 "* prop" : "end_child",
249 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
250 "bool visible" : false,
252 "int position" : 200,
256 "* prop" : "end_child",
257 "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
258 "bool hexpand" : true,
259 "bool vexpand" : true,
264 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
265 "bool hexpand" : true,
273 "this.css = new Gtk.CssProvider();",
275 "\tthis.css.load_from_data(\"#popover-files-iconsearch { font: 10px monospace;}\".data);",
276 "} catch (Error e) {}",
277 "this.el.get_style_context().add_provider(this.css,Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);",
282 "Gtk.CssProvider css" : "",
283 "bool hexpand" : true,
289 "\t_this.treefilter.el.changed(Gtk.FilterChange.DIFFERENT);",
290 "\t_this.iconsearch.el.set_search(this.el.text);",
295 "string name" : "popover-files-iconsearch",
296 "string placeholder_text" : "type to filter results",
297 "uint search_delay" : 1000,
298 "xtype" : "SearchEntry"
306 " this.el.set_policy (Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC);",
309 "bool has_frame" : true,
310 "bool hexpand" : true,
311 "bool vexpand" : true,
323 "(n_press, x, y) => {",
324 "\tif (n_press == 2) {",
325 "\t\tGLib.debug(\"double cliced\");",
329 "\tvar f = (JsRender.JsRender)_this.iconsel.el.selected_item;",
331 "\tGLib.debug(\"Click %s\", f.name);",
332 "\tif (f.xtype == \"Dir\") {",
337 " \t_this.win.windowstate.fileViewOpen(f, _this.new_window);",
338 "\t_this.el.hide();",
347 "xtype" : "GestureClick"
352 "bool can_unselect" : true,
367 "GLib.Type item_type" : "typeof(JsRender.JsRender)",
369 "xtype" : "ListStore",
371 "(JsRender.JsRender p) {",
373 "\tfor (var i =0;i < this.el.n_items; i++ ) {",
374 "\t\tvar pr = (JsRender.JsRender) this.el.get_item(i);",
375 "\t\tif (p.path == pr.path) {",
376 "\t\t\tthis.el.remove(i);",
387 "bool ignore_case" : true,
391 "* prop" : "expression",
392 "GLib.Type this_type" : "typeof(JsRender.JsRender)",
393 "string property_name" : "name",
394 "xtype" : "PropertyExpression"
397 "xtype" : "StringSorter"
400 "xtype" : "SortListModel"
403 "$ Gtk.StringFilterMatchMode match_mode" : "Gtk.StringFilterMatchMode.SUBSTRING",
406 "bool ignore_case" : true,
411 "* prop" : "expression",
412 "GLib.Type this_type" : "typeof(JsRender.JsRender)",
413 "string property_name" : "name",
414 "xtype" : "PropertyExpression"
417 "xtype" : "StringFilter"
420 "xtype" : "FilterListModel"
424 "notify[\"selected\"]" : [
426 "\tif (this.el.selected == Gtk.INVALID_LIST_POSITION) {",
427 "\t\tif (_this.treeselmodel.el.selected == Gtk.INVALID_LIST_POSITION) {",
428 "\t\t\t_this.btn_delfile.el.hide();",
433 "\t_this.btn_delfile.el.show();",
434 "\t_this.treeselmodel.el.selected = Gtk.INVALID_LIST_POSITION;",
443 "xtype" : "SingleSelection",
444 "| JsRender.JsRender? selectedFile" : [
447 "\tif (this.el.selected == Gtk.INVALID_LIST_POSITION) {",
450 "\treturn (JsRender.JsRender)this.el.get_item(this.el.selected); ",
458 "* prop" : "factory",
463 "\tvar box = (Gtk.Box) ((Gtk.ListItem)listitem).get_child();",
465 "\tvar img = (Gtk.Image) box.get_first_child();",
466 "\tvar lbl = (Gtk.Label)img.get_next_sibling();",
468 "\tvar item = (JsRender.JsRender) ((Gtk.ListItem)listitem).get_item();",
469 "\t//GLib.debug(\"set label name to %s\", item.name);",
471 "\tvar ns = item.name.split(\".\");",
472 "\tif (ns.length < 2) {",
473 "\t\tlbl.label = item.name;",
476 "\t\t\titem.name.substring(0, item.name.length - ns[ns.length-1].length)",
477 "\t\t \t + \"\\n\"+ ns[ns.length-1];",
481 "\titem.bind_property(\"name\",",
483 " GLib.BindingFlags.SYNC_CREATE);",
486 " img.set_from_file(item.getIconFileName());",
494 "\t//var j = (JsRender.JsRender) item;",
495 "\tvar gi = (Gtk.ListItem)item;",
496 "\tvar b = new Gtk.Box(Gtk.Orientation.VERTICAL,4);",
497 "\tvar i = new Gtk.Image();",
498 "\ti.pixel_size = 96;",
499 "\tvar t = new Gtk.Label(\"\");",
503 "\tgi.set_child(b);",
504 "\tb.has_tooltip = true;",
505 "\tb.query_tooltip.connect((x, y, keyboard_tooltip, tooltip) => {",
506 "\t\tvar j = (JsRender.JsRender) gi.get_item();",
508 "\t\tvar ti = new Gtk.Image.from_file ( j.getIconFileName());",
509 "\t\tti.pixel_size = 368;",
510 "\t\ttooltip.set_custom( ti );",
519 "xtype" : "SignalListItemFactory"
525 "xtype" : "ScrolledWindow"
532 "* init" : " this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);",
533 "* prop" : "start_child",
534 "bool has_frame" : true,
535 "bool hexpand" : true,
536 "bool vexpand" : true,
537 "bool visible" : true,
539 "int width_request" : 200,
546 "\tthis.css = new Gtk.CssProvider();",
548 "\tthis.css.load_from_string(\"",
549 "#file-list { font-size: 12px;}",
550 "#file-list indent {",
551 "-gtk-icon-size : 2px;",
553 "#file-list indent:nth-last-child(2) {",
558 "\tGtk.StyleContext.add_provider_for_display(",
559 "\t\tthis.el.get_display(),",
561 "\t\tGtk.STYLE_PROVIDER_PRIORITY_APPLICATION",
568 "Gtk.CssProvider css" : "",
575 "(n_press, x, y) => {",
576 "\tif (n_press == 2) {",
577 "\t\tGLib.debug(\"double cliced\");",
581 "\tvar tr = (Gtk.TreeListRow)_this.treeselmodel.el.selected_item;",
582 "\tGLib.debug(\"SELECTED = %s\", tr.item.get_type().name());",
583 "\tvar f = (JsRender.JsRender) tr.item;",
584 "\tGLib.debug(\"Click %s\", f.name);",
585 "\tif (f.xtype == \"Dir\") {",
590 " \t_this.win.windowstate.fileViewOpen(f, _this.new_window);",
592 "\t_this.el.hide();",
600 "xtype" : "GestureClick"
605 "bool can_unselect" : true,
606 "id" : "treeselmodel",
615 "bool incremental" : true,
616 "id" : "treelistsort",
621 "Gtk.TreeListModelCreateModelFunc create_func" : [
623 "\t//GLib.debug(\"liststore got %s\", item.get_type().name());",
624 "\treturn ((JsRender.JsRender)item).childfiles;",
627 "bool autoexpand" : true,
628 "bool passthrough" : false,
629 "id" : "treelistmodel",
634 "GLib.Type item_type" : "typeof(JsRender.JsRender)",
636 "xtype" : "ListStore"
639 "xtype" : "TreeListModel"
648 "bool ignore_case" : true,
652 "* prop" : "expression",
653 "GLib.Type this_type" : "typeof(JsRender.JsRender) ",
654 "string property_name" : "name",
655 "xtype" : "PropertyExpression"
658 "xtype" : "StringSorter"
661 "xtype" : "TreeListRowSorter"
664 "xtype" : "SortListModel"
669 "Gtk.CustomFilterFunc match_func" : [
671 "\tvar tr = ((Gtk.TreeListRow)item).get_item();",
672 "\t//GLib.debug(\"filter %s\", tr.get_type().name());",
673 "\tvar j = (JsRender.JsRender) tr;",
674 "\tif (j.xtype == \"Dir\" && j.childfiles.n_items < 1) {",
677 "\tvar str = _this.searchbox.el.text.down();\t",
678 "\tif (j.xtype == \"Dir\") {",
681 "\t\tfor (var i =0 ; i < j.childfiles.n_items; i++) {",
682 "\t\t\tvar f = (JsRender.JsRender) j.childfiles.get_item(i);",
683 "\t\t\tif (f.xtype != \"PlainFile\") {",
686 "\t\t\tif (f.content_type.contains(\"image\")) {",
689 "\t\t\tif (str.length < 1) {",
690 "\t\t\t\treturn true;",
692 "\t\t\tif (f.name.down().contains(str)) {",
693 "\t\t\t\treturn true;",
700 "\tif (j.xtype != \"PlainFile\") {",
703 " \tif (j.content_type.contains(\"image\")) {",
707 "\tif (str.length < 1) { // no search.",
710 "\tif (j.name.down().contains(str)) {",
718 "xtype" : "CustomFilter"
721 "xtype" : "FilterListModel"
725 "notify[\"selected\"]" : [
727 "\tif (this.el.selected == Gtk.INVALID_LIST_POSITION) {",
728 "\t\tif (_this.iconsel.el.selected == Gtk.INVALID_LIST_POSITION) {",
729 "\t\t\t_this.btn_delfile.el.hide();",
734 "\tvar tr = (Gtk.TreeListRow)_this.treeselmodel.el.selected_item;",
735 "\tGLib.debug(\"SELECTED = %s\", tr.item.get_type().name());",
736 "\tvar f = (JsRender.JsRender) tr.item;",
737 "\tif (f.xtype == \"Dir\") {",
738 "\t\t_this.btn_delfile.el.hide();\t",
740 "\t\t_this.btn_delfile.el.show();",
743 "\t_this.iconsel.el.selected = Gtk.INVALID_LIST_POSITION;",
752 "xtype" : "SingleSelection",
753 "| JsRender.JsRender? selectedFile" : [
756 "\tif (this.el.selected == Gtk.INVALID_LIST_POSITION) {",
759 "\tvar tr = (Gtk.TreeListRow) this.el.selected_item;",
761 "\treturn (JsRender.JsRender) tr.item;",
769 "\t// this.el.set_sorter( new Gtk.StringSorter(",
770 "\t// \tnew Gtk.PropertyExpression(typeof(JsRender.NodeProp), null, \"name\")",
776 "* pack" : "append_column",
777 "bool expand" : true,
778 "bool resizable" : true,
783 "* prop" : "factory",
788 "\t //GLib.debug(\"listitme is is %s\", ((Gtk.ListItem)listitem).get_type().name());",
792 " \t//var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
793 " \tvar expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();",
795 " \tvar hbox = (Gtk.Box) expand.child;",
798 "\t\tvar img = (Gtk.Image) hbox.get_first_child();",
799 "\t\tvar lbl = (Gtk.Label) img.get_next_sibling();",
803 " \t if (lbl.label != \"\") { // do not update",
806 " \tvar lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();",
807 " \t//GLib.debug(\"LR = %s\", lr.get_type().name());",
810 " \tvar jr =(JsRender.JsRender) lr.get_item();",
811 " \t//GLib.debug(\"JR = %s\", jr.get_type().name());\t\t",
813 " \t if (jr == null) {",
814 " \t\t GLib.debug(\"Problem getting item\"); ",
818 "\t\tjr.bind_property(\"icon\",",
820 " GLib.BindingFlags.SYNC_CREATE);",
822 " \t//GLib.debug(\"change %s to %s\", lbl.label, np.name);",
823 " \tlbl.label = jr.name; // for dir's we could hsow the sub path..",
824 " \tlbl.tooltip_markup = jr.path;",
826 " expand.set_hide_expander( jr.xtype != \"Dir\" );",
827 " \t expand.set_list_row(lr);",
830 " \t// bind image...",
837 "\tvar expand = new Gtk.TreeExpander();",
839 "\texpand.set_indent_for_depth(true);",
840 "\texpand.set_indent_for_icon(true);",
841 "\tvar hbox = new Gtk.Box(Gtk.Orientation.HORIZONTAL,0);",
842 "\tvar icon = new Gtk.Image();",
843 "\ticon.margin_end = 4;",
844 "\tvar lbl = new Gtk.Label(\"\");",
845 "\tlbl.use_markup = true;",
848 " \tlbl.justify = Gtk.Justification.LEFT;",
849 " \tlbl.xalign = 0;",
851 " \thbox.append(icon);",
852 "\thbox.append(lbl);",
853 "\texpand.set_child(hbox);",
854 "\t((Gtk.ListItem)listitem).set_child(expand);",
855 "\t((Gtk.ListItem)listitem).activatable = false;",
860 "xtype" : "SignalListItemFactory"
863 "string title" : "General Files",
864 "xtype" : "ColumnViewColumn"
867 "string name" : "file-list",
868 "xtype" : "ColumnView"
871 "xtype" : "ScrolledWindow"
880 "(keyval, keycode, state) => {",
882 "\tif (keycode != Gdk.Key.Escape) {",
885 "\tif (BuilderApplication.windows.size < 2 && ",
886 "\t\t_this.win.windowstate.file == null",
888 "\t\tBuilderApplication.singleton(null).quit();",
892 "\t_this.el.hide();",
894 "\t if (_this.win.windowstate.file == null) {\t\t ",
895 "\t\tBuilderApplication.removeWindow(_this.win);",
904 "xtype" : "EventControllerKey"
914 "* prop" : "titlebar",
915 "* title" : "Select Project / File",
916 "bool show_title_buttons" : false,
920 "* pack" : "pack_end",
924 "\tif (BuilderApplication.windows.size < 2 && ",
925 "\t\t_this.win.windowstate.file == null",
927 "\t\tBuilderApplication.singleton(null).quit();",
931 "\t_this.el.hide();",
933 "\t if (_this.win.windowstate.file == null) {\t\t ",
934 "\t\tBuilderApplication.removeWindow(_this.win);",
944 "string label" : "Close / Cancel",
949 "* pack" : "pack_start",
950 "id" : "btn_newproj",
953 "$ Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
958 "$ Gtk.IconSize icon_size" : "Gtk.IconSize.NORMAL",
960 "int margin_end" : 4,
961 "string icon_name" : "folder-new",
965 "$ Gtk.Align halign" : "Gtk.Align.START",
967 "string label" : "New Project",
978 " // create a new file in project..",
979 " //Xcls_DialogNewComponent.singleton().show(",
980 " var pe = EditProject.singleton();",
981 " pe.windowstate = _this.win.windowstate;",
983 " pe.el.application = _this.win.el.application;",
984 " pe.el.set_transient_for( _this.el );",
986 " var cb = new Project.Callback();",
987 " cb.call.connect((pr) => {",
988 " \t_this.show( pr , _this.new_window);",
998 "| void onCreated" : [
1000 "\tvar pe = EditProject.singleton();",
1002 "\t_this.show( pe.result , _this.new_window);",
1008 "* pack" : "pack_start",
1009 "id" : "btn_projprop",
1014 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
1019 "int margin_end" : 4,
1020 "string icon_name" : "emblem-system",
1025 "string label" : "Project Properties",
1035 " // should disable the button really.",
1036 " if (_this.selectedProject == null) {",
1039 "\t_this.win.windowstate.projectPopoverShow(_this.el, _this.selectedProject, null);",
1047 "* pack" : "pack_start",
1048 "DialogConfirm confirm" : "null",
1049 "id" : "btn_delproj",
1054 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
1059 "string icon_name" : "user-trash",
1064 "string label" : "Delete Project",
1076 " \tif (this.confirm == null) {",
1077 " \t\tthis.confirm = new DialogConfirm();",
1078 " \t\tthis.confirm.el.set_transient_for(_this.el);",
1081 "\tvar project = (Project.Project) _this.projectsort.el.get_item(",
1082 "\t\t_this.projectselection.el.selected",
1085 "\tthis.confirm.el.response.connect((res) => {",
1086 "\t\tthis.confirm.el.hide();",
1087 "\t\tif (res == Gtk.ResponseType.CANCEL) {",
1090 "\t project = (Project.Project) _this.projectsort.el.get_item(",
1091 "\t\t\t_this.projectselection.el.selected",
1093 "\t\tProject.Project.remove(project);",
1094 "\t _this.projectmodel.remove(project);",
1095 "\t\t_this.projectselection.el.selected = Gtk.INVALID_LIST_POSITION;",
1098 " \tthis.confirm.showIt(\"Confirm Delete Project\", \"Are you sure you want to delete this project?\");",
1106 "* pack" : "pack_start",
1107 "id" : "btn_addfile",
1112 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
1117 "int margin_end" : 4,
1118 "string icon_name" : "document-new",
1123 "string label" : "New File",
1133 " // create a new file in project..",
1134 " print(\"add file selected\\n\");",
1136 " if (_this.selectedProject == null) {",
1140 " \tvar f = JsRender.JsRender.factory(_this.selectedProject.xtype, _this.selectedProject, \"\");",
1141 " \t_this.win.windowstate.file_details.show( f, _this.el, _this.new_window );",
1142 " } catch (JsRender.Error e) {}",
1151 "* pack" : "pack_start",
1152 "DialogConfirm confirm" : "null",
1153 "id" : "btn_delfile",
1158 "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
1163 "string icon_name" : "user-trash",
1168 "string label" : "Delete File",
1179 " \tif (this.confirm == null) {",
1180 " \t\tthis.confirm = new DialogConfirm();",
1181 " \t\tthis.confirm.el.set_transient_for(_this.el);",
1184 "\tGLib.debug(\"DELETE\");",
1185 "\tvar is_icon = true;",
1186 " \tvar isel = _this.iconsel.selectedFile();",
1188 " \tif (isel == null) {",
1189 " \t\tGLib.debug(\"DELETE - no icons selected\");",
1190 "\t \tis_icon = false;",
1191 "\t \tisel = _this.treeselmodel.selectedFile();",
1193 " \tif (isel == null) {",
1194 " \t \t\tGLib.debug(\"DELETE - no tree item selected\");",
1195 " \t\treturn; // should nto happen..",
1198 "\tGLib.debug(\"DELETE - calling confirm.\");",
1199 "\tthis.confirm.el.response.connect((res) => {",
1200 "\t\tthis.confirm.el.hide();",
1201 "\t\tif (res == Gtk.ResponseType.CANCEL) {",
1204 "\t\tis_icon = true;",
1205 "\t \tisel = _this.iconsel.selectedFile();",
1206 "\t \tif (isel == null) {",
1207 "\t\t \tis_icon = false;",
1208 "\t\t \tisel = _this.treeselmodel.selectedFile();",
1210 "\t \tif (isel == null) {",
1211 "\t \t\treturn; // should nto happen..",
1214 "\t \tif (is_icon) {",
1215 "\t\t \tisel.project.deleteFile(isel);",
1216 "\t \t\t_this.gridmodel.remove(isel);",
1219 " \t\tisel.project.deleteFile(isel); \t\t",
1222 "\t \tthis.confirm.showIt(\"Confirm Delete File\",",
1223 "\t \t\t\"Are you sure you want to delete this file?\");",
1233 "xtype" : "HeaderBar"
1236 "name" : "DialogFiles",
1237 "string lastfilter" : "",
1238 "title" : "Select Project / File",
1245 " _this.is_loading = true;",
1248 " Project.Project.loadAll();",
1249 " _this.project_list.el.set_model(new Gtk.SingleSelection(null));",
1250 " Project.Project.loadIntoStore(this.projectmodel.el);",
1252 "\t_this.project_list.el.set_model(_this.projectselection.el);",
1254 "\t_this.is_loading = false;",
1256 " _this.projectselection.el.selected = Gtk.INVALID_LIST_POSITION; ",
1257 "\t_this.btn_delfile.el.hide();",
1263 "| void onProjectSelected" : [
1264 "(Project.Project? project) ",
1266 "\tif (this.in_onprojectselected) { ",
1269 "\tthis.selectedProject = project;",
1271 "\tif (project == null) {",
1272 "\t\tGLib.debug(\"Hide project files\");",
1273 "\t\t_this.mainpane.el.set_end_child(null);",
1274 "\t\t_this.filepane.el.hide();",
1279 "\tGLib.debug(\"Show project files\");",
1280 "\t_this.mainpane.el.set_end_child(_this.filepane.el);",
1282 "\t_this.filepane.el.show();\t",
1283 "\tthis.in_onprojectselected = true;",
1287 "\tproject.load();",
1290 "\t_this.searchbox.el.text = \"\";",
1291 "\t _this.gridview.el.set_model(new Gtk.SingleSelection(null));",
1292 "\t _this.selectedProject.loadFilesIntoStore(_this.gridmodel.el);",
1293 "\t _this.iconsel.el.selected = Gtk.INVALID_LIST_POSITION;",
1295 "\t _this.gridview.el.set_model(_this.iconsel.el);",
1298 " \t GLib.Timeout.add(500, () => {",
1299 " \t\t_this.iconsel.el.selected = Gtk.INVALID_LIST_POSITION;",
1300 " \t \t _this.treeselmodel.el.selected = Gtk.INVALID_LIST_POSITION;\t\t ",
1302 "\t _this.searchbox.el.grab_focus();",
1303 "\t\t return false;",
1305 "\t _this.treeview.el.set_model(new Gtk.SingleSelection(null));",
1307 " this.selectedProject.loadDirsIntoStore(_this.treemodel.el);",
1309 " _this.treeview.el.set_model(_this.treeselmodel.el);",
1311 " \t _this.treeselmodel.el.selected = Gtk.INVALID_LIST_POSITION;",
1312 " \tthis.treescroll.el.vadjustment.value = 0;",
1313 "\tthis.in_onprojectselected = false;\t",
1317 "| void selectProject" : [
1318 "(Project.Project? project) {",
1322 "\tvar sm = this.projectselection.el;",
1323 "\tif (project == null) {",
1324 "\t\tsm.selected = Gtk.INVALID_LIST_POSITION;",
1325 "\t\tthis.onProjectSelected(null);",
1330 "\tfor (var i =0; i < sm.n_items; i++) {",
1331 "\t\tvar p = (Project.Project) sm.get_item(i);",
1332 "\t\tif (p.path == project.path) {",
1333 "\t\t\tGLib.debug(\"Select Project %s => %d\", project.name, i);",
1334 "\t\t\tsm.selected = i;",
1343 "(Project.Project? project, bool new_window) {",
1345 " \tthis.new_window = new_window;",
1347 " this.projectscroll.el.vadjustment.value = 0; // scroll to top?",
1350 "\t //var win = this.win.el;",
1351 " //var w = win.get_width();",
1352 " //var h = win.get_height();",
1355 "\t this.el.show();",
1357 "\tthis.selectProject(project);",
1358 "\tthis.onProjectSelected(project); //?? twice?",
1360 "\t GLib.Timeout.add(500, () => {",
1361 "\t \tif (project == null) {",
1362 " \t \t\t_this.projectselection.el.selected = Gtk.INVALID_LIST_POSITION;",
1363 "\t\t\t\tthis.onProjectSelected(null); ",
1366 "\t this.el.set_size_request( 800 , 750); // ?? based on default ",
1374 "name" : "DialogFiles"