1 static Xcls_PopoverFiles _PopoverFiles;
3 public class Xcls_PopoverFiles : Object
6 private Xcls_PopoverFiles _this;
8 public static Xcls_PopoverFiles singleton()
10 if (_PopoverFiles == null) {
11 _PopoverFiles= new Xcls_PopoverFiles();
15 public Xcls_view view;
16 public Xcls_model model;
17 public Xcls_namecol namecol;
18 public Xcls_iconsearch iconsearch;
19 public Xcls_iconscroll iconscroll;
20 public Xcls_iconview iconview;
21 public Xcls_iconmodel iconmodel;
22 public Xcls_file_container file_container;
23 public Xcls_fileview fileview;
24 public Xcls_filemodel filemodel;
25 public Xcls_filenamecol filenamecol;
28 public Xcls_MainWindow win;
29 public string lastfilter;
30 public bool in_onprojectselected;
31 public Project.Project selectedProject;
32 public bool is_loading;
33 public bool new_window;
34 public Gdk.Pixbuf missing_thumb_pixbuf;
35 public Gee.HashMap<string,Gdk.Pixbuf> image_cache;
37 public bool is_loaded;
40 public Xcls_PopoverFiles()
43 this.el = new Gtk.Popover( null );
47 this.in_onprojectselected = false;
48 this.is_loading = false;
49 this.new_window = false;
50 this.image_cache = null;
52 this.is_loaded = false;
55 this.el.width_request = 900;
56 this.el.height_request = 800;
57 this.el.hexpand = false;
59 this.el.position = Gtk.PositionType.TOP;
60 var child_0 = new Xcls_Box2( _this );
62 this.el.add ( child_0.el );
65 this.el.hide.connect( ( ) => {
68 //if (project != null) {
69 // this.selectProject(project);
71 if (_this.win.windowstate.project == null) {
77 // user defined functions
78 public void onProjectSelected (Project.Project project)
80 if (this.in_onprojectselected) {
83 this.in_onprojectselected = true;
86 this.selectedProject = project;
88 //this.clutterfiles.loadProject(proj);
92 _this.iconsearch.el.text = "";
98 //this.project_title_name.el.text = pr.name;
99 //this.project_title_path.el.text = pr.firstPath();
101 // file items contains a reference until we reload ...
105 GLib.Timeout.add(500, () => {
106 _this.iconsearch.el.grab_focus();
113 this.in_onprojectselected = false;
115 public void selectProject (Project.Project project) {
117 var sel = _this.view.el.get_selection();
122 _this.model.el.foreach((mod, path, iter) => {
125 mod.get_value(iter, 1, out val);
126 if ( ( (Project.Project)val.get_object()).fn != project.fn) {
127 print("SKIP %s != %s\n", ((Project.Project)val.get_object()).name , project.name);
128 return false;//continue
130 sel.select_iter(iter);
131 this.selectedProject = project;
132 this.onProjectSelected(project);
139 print("tried to select %s, could not find it", project.name);
142 public void show (Gtk.Widget on_el, Project.Project? project, bool new_window) {
143 //this.editor.show( file, node, ptype, key);
145 this.new_window = new_window;
148 this.el.show_all(); // show first - so we can hide stuff later.
149 if (project != null) {
151 this.selectProject(project);
156 this.win.el.get_size(out w, out h);
158 // left tree = 250, editor area = 500?
163 //var ww = on_el.get_allocated_width();
165 // width = should be max = w-ww , or 600 at best..?
167 this.el.set_size_request( w, h); // same as parent...
170 this.el.set_modal(true);
171 this.el.set_relative_to(on_el);
176 public void load () {
179 if (_this.is_loaded) {
182 _this.is_loading = true;
184 _this.is_loaded = true;
186 Project.Project.loadAll();
187 var projects = Project.Project.allProjectsByName();
190 var m = this.model.el;
193 for (var i = 0; i < projects.size; i++) {
195 m.set(iter, 0,projects.get(i).name );
197 var o = GLib.Value(typeof(Object));
198 o.set_object((Object)projects.get(i));
200 m.set_value(iter, 1, o);
203 m.set_sort_column_id(0, Gtk.SortType.ASCENDING);
204 _this.is_loading = false;
206 public void loadTreeView () {
207 var project = this.selectedProject;
209 this.filemodel.el.clear();
213 if (!(project is Project.Gtk)) {
214 //print ("not gtk... skipping files");
215 this.file_container.el.hide();
221 var filter = _this.iconsearch.el.text.down();
223 this.file_container.el.show();
224 var gpr = (Project.Gtk)project;
225 var def = gpr.compilegroups.get("_default_");
226 // not sure why the above is returng null!??
228 def = new Project.GtkValaSettings("_default_");
229 gpr.compilegroups.set("_default_", def);
231 var items = def.sources;
233 Gtk.TreeIter citer; // folder iter
234 Gtk.TreeIter fxiter; // file iter
235 for(var i =0 ; i < items.size; i++) {
236 // print ("cheking folder %s\n", items.get(i));
237 var files = gpr.filesForOpen(items.get(i));
243 if (files.size < 1) {
247 for(var j =0 ; j < files.size; j++) {
250 var ff = GLib.Path.get_basename(files.get(j)).down();
251 var dp = ff.last_index_of(".");
252 if (!ff.substring(0,dp < 0 ? ff.length :dp ).contains(filter)) {
263 this.filemodel.el.append(out citer,null);
264 this.filemodel.el.set(citer, 0, GLib.Path.get_basename(items.get(i)));
265 this.filemodel.el.set(citer, 1, null); // parent (empty as it's a folder)
268 // add the directory... items.get(i);
269 //var x = new Xcls_folderitem(this,items.get(i));
270 //this.fileitems.add(x);
271 //this.filelayout.el.add_child(x.el);
274 for(var j =0 ; j < files.size; j++) {
277 var ff = GLib.Path.get_basename(files.get(j)).down();
278 var dp = ff.last_index_of(".");
279 if (!ff.substring(0,dp < 0 ? ff.length :dp ).contains(filter)) {
285 this.filemodel.el.insert(out fxiter,citer, -1);
286 this.filemodel.el.set(fxiter, 0, GLib.Path.get_basename(files.get(j))); // filename
287 this.filemodel.el.set(fxiter, 1, files.get(j)); // Folder?
293 //this.el.set_value(citer, 1, items.get(i) );
295 _this.fileview.el.expand_all();
297 public void loadIconView () {
299 if (_this.image_cache == null) {
300 _this.image_cache = new Gee.HashMap<string,Gdk.Pixbuf>();
303 var project = this.selectedProject;
305 Gdk.Pixbuf pixbuf = null;
306 Gdk.Pixbuf bigpixbuf = null;
308 var m = this.iconmodel.el;
312 var filter = _this.iconsearch.el.text.down();
313 this.lastfilter = filter;
315 var fiter = project.sortedFiles().list_iterator();
319 if (_this.missing_thumb_pixbuf == null) {
320 var icon_theme = Gtk.IconTheme.get_default ();
321 _this.missing_thumb_pixbuf = icon_theme.load_icon ("package-x-generic", 92, 0);
322 _this.missing_thumb_pixbuf.ref();
332 while (fiter.next()) {
334 var file = fiter.get();
336 if (!file.name.down().contains(filter)) {
346 m.set(iter, 0,file ); // zero contains the file reference
347 m.set(iter, 1,file.nickType() + "\n" + file.nickName()); // marked up title?
348 m.set(iter, 2,file.nickType() ); // file type?
353 pixbuf = file.getIcon(92);
354 bigpixbuf = file.getIcon(368);
358 if (pixbuf == null) {
359 GLib.debug("PIXBUF is null? %s", file.name);
360 pixbuf = _this.missing_thumb_pixbuf;
361 bigpixbuf = _this.missing_thumb_pixbuf;
366 m.set(iter, 3,pixbuf);
367 m.set(iter, 4,bigpixbuf);
369 // this needs to add to the iconview?
371 //var a = new Xcls_fileitem(this,fiter.get());
372 //this.fileitems.add(a);
374 //this.filelayout.el.add_child(a.el);
377 public void setMainWindow (Xcls_MainWindow win) {
381 public class Xcls_Box2 : Object
384 private Xcls_PopoverFiles _this;
390 public Xcls_Box2(Xcls_PopoverFiles _owner )
393 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
397 // set gobject values
398 var child_0 = new Xcls_Box3( _this );
400 this.el.add ( child_0.el );
401 var child_1 = new Xcls_Box10( _this );
403 this.el.add ( child_1.el );
406 // user defined functions
408 public class Xcls_Box3 : Object
411 private Xcls_PopoverFiles _this;
417 public Xcls_Box3(Xcls_PopoverFiles _owner )
420 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
424 // set gobject values
425 var child_0 = new Xcls_Toolbar4( _this );
427 this.el.add ( child_0.el );
430 // user defined functions
432 public class Xcls_Toolbar4 : Object
434 public Gtk.Toolbar el;
435 private Xcls_PopoverFiles _this;
441 public Xcls_Toolbar4(Xcls_PopoverFiles _owner )
444 this.el = new Gtk.Toolbar();
448 // set gobject values
449 this.el.toolbar_style = Gtk.ToolbarStyle.BOTH;
450 var child_0 = new Xcls_ToolButton5( _this );
452 this.el.add ( child_0.el );
453 var child_1 = new Xcls_ToolButton6( _this );
455 this.el.add ( child_1.el );
456 var child_2 = new Xcls_ToolButton7( _this );
458 this.el.add ( child_2.el );
459 var child_3 = new Xcls_ToolButton8( _this );
461 this.el.add ( child_3.el );
462 var child_4 = new Xcls_ToolButton9( _this );
464 this.el.add ( child_4.el );
467 // user defined functions
469 public class Xcls_ToolButton5 : Object
471 public Gtk.ToolButton el;
472 private Xcls_PopoverFiles _this;
478 public Xcls_ToolButton5(Xcls_PopoverFiles _owner )
481 this.el = new Gtk.ToolButton( null, "New Project" );
485 // set gobject values
486 this.el.icon_name = "folder-new";
489 this.el.clicked.connect( ( ) => {
491 // create a new file in project..
492 //Xcls_DialogNewComponent.singleton().show(
493 var pe = EditProject.singleton();
494 //pe.el.set_transient_for(_this.el);
495 pe.el.set_modal(true);
504 _this.win.windowstate.left_projects.is_loaded = false;
505 _this.win.windowstate.left_projects.load();
506 _this.win.windowstate.left_projects.selectProject(p);
513 // user defined functions
516 public class Xcls_ToolButton6 : Object
518 public Gtk.ToolButton el;
519 private Xcls_PopoverFiles _this;
525 public Xcls_ToolButton6(Xcls_PopoverFiles _owner )
528 this.el = new Gtk.ToolButton( null, "Project Properties" );
532 // set gobject values
533 this.el.icon_name = "emblem-system";
536 this.el.clicked.connect( ( ) => {
537 // should disable the button really.
538 if (_this.selectedProject == null) {
541 _this.win.windowstate.projectPopoverShow(this.el, _this.selectedProject);
545 // user defined functions
548 public class Xcls_ToolButton7 : Object
550 public Gtk.ToolButton el;
551 private Xcls_PopoverFiles _this;
557 public Xcls_ToolButton7(Xcls_PopoverFiles _owner )
560 this.el = new Gtk.ToolButton( null, "Delete Project" );
564 // set gobject values
565 this.el.icon_name = "user-trash";
568 this.el.clicked.connect( ( ) => {
570 var cd = DialogConfirm.singleton();
571 cd.el.set_transient_for(_this.el);
572 cd.el.set_modal(true);
574 var project = _this.windowstate.left_projects.getSelectedProject();
575 if (project == null) {
576 print("SKIP - no project\n");
581 if (Gtk.ResponseType.YES != cd.show("Confirm",
582 "Are you sure you want to delete project %s".printf(project.name))) {
588 Project.Project.remove(project);
589 _this.project = null;
591 _this.windowstate.left_projects.is_loaded = false;
592 _this.windowstate.left_projects.load();
593 _this.windowstate.clutterfiles.clearFiles();
599 // user defined functions
602 public class Xcls_ToolButton8 : Object
604 public Gtk.ToolButton el;
605 private Xcls_PopoverFiles _this;
611 public Xcls_ToolButton8(Xcls_PopoverFiles _owner )
614 this.el = new Gtk.ToolButton( null, "New File" );
618 // set gobject values
619 this.el.icon_name = "document-new";
622 this.el.clicked.connect( () => {
623 // create a new file in project..
624 print("add file selected\n");
626 if (_this.selectedProject == null) {
630 var f = JsRender.JsRender.factory(_this.selectedProject.xtype, _this.selectedProject, "");
631 _this.win.windowstate.file_details.show( f, this.el, _this.new_window );
632 } catch (JsRender.Error e) {}
637 // user defined functions
640 public class Xcls_ToolButton9 : Object
642 public Gtk.ToolButton el;
643 private Xcls_PopoverFiles _this;
649 public Xcls_ToolButton9(Xcls_PopoverFiles _owner )
652 this.el = new Gtk.ToolButton( null, "New File" );
656 // set gobject values
657 this.el.icon_name = "document-new";
660 this.el.clicked.connect( () => {
661 // create a new file in project..
662 print("add file selected\n");
664 if (_this.selectedProject == null) {
668 var f = JsRender.JsRender.factory(_this.selectedProject.xtype, _this.selectedProject, "");
669 _this.win.windowstate.file_details.show( f, this.el, _this.new_window );
670 } catch (JsRender.Error e) {}
675 // user defined functions
680 public class Xcls_Box10 : Object
683 private Xcls_PopoverFiles _this;
689 public Xcls_Box10(Xcls_PopoverFiles _owner )
692 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
696 // set gobject values
697 this.el.homogeneous = false;
698 var child_0 = new Xcls_ScrolledWindow11( _this );
700 this.el.add ( child_0.el );
701 var child_1 = new Xcls_Box16( _this );
703 this.el.add( child_1.el );
704 var child_2 = new Xcls_file_container( _this );
706 this.el.add ( child_2.el );
709 // user defined functions
711 public class Xcls_ScrolledWindow11 : Object
713 public Gtk.ScrolledWindow el;
714 private Xcls_PopoverFiles _this;
720 public Xcls_ScrolledWindow11(Xcls_PopoverFiles _owner )
723 this.el = new Gtk.ScrolledWindow( null, null );
727 // set gobject values
728 this.el.width_request = 150;
729 this.el.expand = true;
730 this.el.shadow_type = Gtk.ShadowType.IN;
731 var child_0 = new Xcls_view( _this );
733 this.el.add ( child_0.el );
737 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
740 // user defined functions
742 public class Xcls_view : Object
744 public Gtk.TreeView el;
745 private Xcls_PopoverFiles _this;
749 public Gtk.CssProvider css;
752 public Xcls_view(Xcls_PopoverFiles _owner )
756 this.el = new Gtk.TreeView();
760 // set gobject values
761 this.el.name = "popover-files-view";
762 this.el.enable_tree_lines = true;
763 this.el.headers_visible = true;
764 var child_0 = new Xcls_model( _this );
766 this.el.set_model ( child_0.el );
767 var child_1 = new Xcls_TreeViewColumn14( _this );
769 this.el.append_column ( child_1.el );
773 this.css = new Gtk.CssProvider();
775 this.css.load_from_data("#popover-files-view { font-size: 10px;}");
777 this.el.get_style_context().add_provider(this.css,Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
782 var selection = this.el.get_selection();
783 selection.set_mode( Gtk.SelectionMode.SINGLE);
786 this.el.cursor_changed.connect( () => {
787 if (_this.is_loading) {
794 var s = this.el.get_selection();
795 if (!s.get_selected(out mod, out iter)) {
801 mod.get_value(iter, 1 , out gval);
802 var project = (Project.Project)gval.get_object();
804 _this.onProjectSelected(project);
809 // user defined functions
811 public class Xcls_model : Object
813 public Gtk.ListStore el;
814 private Xcls_PopoverFiles _this;
820 public Xcls_model(Xcls_PopoverFiles _owner )
824 this.el = new Gtk.ListStore.newv( { typeof(string), typeof(Object) } );
828 // set gobject values
833 this.el.set_sort_func(0, (mod,a,b) => {
835 mod.get_value(a,0, out ga);
836 mod.get_value(b,0, out gb);
838 if ((string)ga == (string)gb) {
841 return (string)ga > (string)gb ? 1 : -1;
848 // user defined functions
851 public class Xcls_TreeViewColumn14 : Object
853 public Gtk.TreeViewColumn el;
854 private Xcls_PopoverFiles _this;
860 public Xcls_TreeViewColumn14(Xcls_PopoverFiles _owner )
863 this.el = new Gtk.TreeViewColumn();
867 // set gobject values
868 this.el.title = "Projects";
869 var child_0 = new Xcls_namecol( _this );
871 this.el.pack_start ( child_0.el , true );
875 this.el.add_attribute(_this.namecol.el , "markup", 0 );
878 // user defined functions
880 public class Xcls_namecol : Object
882 public Gtk.CellRendererText el;
883 private Xcls_PopoverFiles _this;
889 public Xcls_namecol(Xcls_PopoverFiles _owner )
892 _this.namecol = this;
893 this.el = new Gtk.CellRendererText();
897 // set gobject values
900 // user defined functions
906 public class Xcls_Box16 : Object
909 private Xcls_PopoverFiles _this;
915 public Xcls_Box16(Xcls_PopoverFiles _owner )
918 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
922 // set gobject values
923 this.el.width_request = 600;
924 this.el.expand = true;
925 var child_0 = new Xcls_Box17( _this );
927 this.el.add( child_0.el );
928 var child_1 = new Xcls_iconscroll( _this );
930 this.el.add ( child_1.el );
933 // user defined functions
935 public class Xcls_Box17 : Object
938 private Xcls_PopoverFiles _this;
944 public Xcls_Box17(Xcls_PopoverFiles _owner )
947 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
951 // set gobject values
952 this.el.hexpand = true;
953 var child_0 = new Xcls_iconsearch( _this );
955 this.el.add( child_0.el );
958 // user defined functions
960 public class Xcls_iconsearch : Object
962 public Gtk.SearchEntry el;
963 private Xcls_PopoverFiles _this;
967 public Gtk.CssProvider css;
970 public Xcls_iconsearch(Xcls_PopoverFiles _owner )
973 _this.iconsearch = this;
974 this.el = new Gtk.SearchEntry();
978 // set gobject values
979 this.el.name = "popover-files-iconsearch";
980 this.el.hexpand = true;
981 this.el.placeholder_text = "type to filter results";
985 this.css = new Gtk.CssProvider();
987 this.css.load_from_data("#popover-files-iconsearch { font: monospace 10px;}");
989 this.el.get_style_context().add_provider(this.css,Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
992 this.el.changed.connect( ( ) => {
993 GLib.debug("Got '%s'", this.el.text);
995 if (this.el.text.down() != _this.lastfilter) {
996 _this.loadIconView();
997 _this.loadTreeView();
1002 // user defined functions
1006 public class Xcls_iconscroll : Object
1008 public Gtk.ScrolledWindow el;
1009 private Xcls_PopoverFiles _this;
1015 public Xcls_iconscroll(Xcls_PopoverFiles _owner )
1018 _this.iconscroll = this;
1019 this.el = new Gtk.ScrolledWindow( null, null );
1023 // set gobject values
1024 this.el.width_request = 600;
1025 this.el.expand = true;
1026 this.el.shadow_type = Gtk.ShadowType.IN;
1027 var child_0 = new Xcls_iconview( _this );
1029 this.el.add ( child_0.el );
1033 this.el.set_policy (Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC);
1036 // user defined functions
1038 public class Xcls_iconview : Object
1040 public Gtk.IconView el;
1041 private Xcls_PopoverFiles _this;
1047 public Xcls_iconview(Xcls_PopoverFiles _owner )
1050 _this.iconview = this;
1051 this.el = new Gtk.IconView();
1055 // set gobject values
1056 this.el.markup_column = 1;
1057 this.el.pixbuf_column = 3;
1058 this.el.has_tooltip = true;
1059 this.el.item_width = 100;
1060 var child_0 = new Xcls_iconmodel( _this );
1062 this.el.model = child_0.el;
1071 this.el.item_activated.connect( (path) => {
1073 _this.win.windowstate.project = _this.selectedProject;
1080 this.el.model.get_iter(out iter, path);
1084 this.el.model.get_value(iter, 0 , out gval);
1085 var file = (JsRender.JsRender)gval;
1088 _this.win.windowstate.fileViewOpen(file, _this.new_window);
1093 this.el.query_tooltip.connect( (x, y, keyboard_tooltip, tooltip) => {
1096 Gtk.CellRenderer cell;
1097 _this.iconview.el.get_item_at_pos(x,y + (int) _this.iconscroll.el.vadjustment.value, out path, out cell);
1100 // GLib.debug("Tooltip? %d,%d scroll: %d",x,y, (int)_this.iconscroll.el.vadjustment.value);
1104 // GLib.debug("Tooltip? - no path");
1109 _this.iconmodel.el.get_iter(out iter, path);
1111 _this.iconmodel.el.get_value(iter, 4, out val);
1113 tooltip.set_icon((Gdk.Pixbuf) val.get_object());
1114 _this.iconview.el.set_tooltip_item(tooltip, path);
1119 // user defined functions
1121 public class Xcls_iconmodel : Object
1123 public Gtk.ListStore el;
1124 private Xcls_PopoverFiles _this;
1130 public Xcls_iconmodel(Xcls_PopoverFiles _owner )
1133 _this.iconmodel = this;
1134 this.el = new Gtk.ListStore.newv( { typeof(Object), typeof(string), typeof(string), typeof(Gdk.Pixbuf), typeof(Gdk.Pixbuf) } );
1138 // set gobject values
1141 // user defined functions
1147 public class Xcls_file_container : Object
1149 public Gtk.ScrolledWindow el;
1150 private Xcls_PopoverFiles _this;
1156 public Xcls_file_container(Xcls_PopoverFiles _owner )
1159 _this.file_container = this;
1160 this.el = new Gtk.ScrolledWindow( null, null );
1164 // set gobject values
1165 this.el.width_request = 100;
1166 this.el.expand = true;
1167 this.el.shadow_type = Gtk.ShadowType.IN;
1168 this.el.visible = false;
1169 var child_0 = new Xcls_fileview( _this );
1171 this.el.add ( child_0.el );
1175 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
1178 // user defined functions
1180 public class Xcls_fileview : Object
1182 public Gtk.TreeView el;
1183 private Xcls_PopoverFiles _this;
1187 public Gtk.CssProvider css;
1190 public Xcls_fileview(Xcls_PopoverFiles _owner )
1193 _this.fileview = this;
1194 this.el = new Gtk.TreeView();
1198 // set gobject values
1199 this.el.name = "popover-files-fileview";
1200 this.el.activate_on_single_click = false;
1201 this.el.expand = true;
1202 this.el.enable_tree_lines = true;
1203 this.el.headers_visible = true;
1204 var child_0 = new Xcls_filemodel( _this );
1206 this.el.set_model ( child_0.el );
1207 var child_1 = new Xcls_TreeViewColumn25( _this );
1209 this.el.append_column ( child_1.el );
1213 this.css = new Gtk.CssProvider();
1215 this.css.load_from_data("#popover-files-fileview { font-size: 12px;}");
1216 } catch (Error e) {}
1217 this.el.get_style_context().add_provider(this.css,Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
1223 var selection = this.el.get_selection();
1224 selection.set_mode( Gtk.SelectionMode.SINGLE);
1227 this.el.row_activated.connect( (path, col) => {
1232 this.el.model.get_iter(out iter, path);
1236 this.el.model.get_value(iter, 1 , out gval);
1237 var fn = (string)gval;
1238 if (fn.length < 1) {
1241 _this.win.windowstate.project = _this.selectedProject;
1244 var f = JsRender.JsRender.factory("PlainFile", _this.selectedProject, fn);
1245 _this.win.windowstate.fileViewOpen(f, _this.new_window);
1246 } catch (JsRender.Error e) {}
1249 this.el.cursor_changed.connect( () => {
1251 if (_this.is_loading) {
1258 var s = this.el.get_selection();
1259 if (!s.get_selected(out mod, out iter)) {
1265 mod.get_value(iter, 1 , out gval);
1266 var project = (Project.Project)gval.get_object();
1268 _this.project_selected(project);
1273 // user defined functions
1275 public class Xcls_filemodel : Object
1277 public Gtk.TreeStore el;
1278 private Xcls_PopoverFiles _this;
1284 public Xcls_filemodel(Xcls_PopoverFiles _owner )
1287 _this.filemodel = this;
1288 this.el = new Gtk.TreeStore.newv( { typeof(string), typeof(string) } );
1292 // set gobject values
1297 this.el.set_sort_func(0, (mod,a,b) => {
1299 mod.get_value(a,0, out ga);
1300 mod.get_value(b,0, out gb);
1302 if ((string)ga == (string)gb) {
1305 return (string)ga > (string)gb ? 1 : -1;
1312 // user defined functions
1315 public class Xcls_TreeViewColumn25 : Object
1317 public Gtk.TreeViewColumn el;
1318 private Xcls_PopoverFiles _this;
1324 public Xcls_TreeViewColumn25(Xcls_PopoverFiles _owner )
1327 this.el = new Gtk.TreeViewColumn();
1331 // set gobject values
1332 this.el.title = "File";
1333 var child_0 = new Xcls_filenamecol( _this );
1335 this.el.pack_start ( child_0.el , true );
1339 this.el.add_attribute(_this.filenamecol.el , "markup", 0 );
1342 // user defined functions
1344 public class Xcls_filenamecol : Object
1346 public Gtk.CellRendererText el;
1347 private Xcls_PopoverFiles _this;
1353 public Xcls_filenamecol(Xcls_PopoverFiles _owner )
1356 _this.filenamecol = this;
1357 this.el = new Gtk.CellRendererText();
1361 // set gobject values
1364 // user defined functions