1 static ValaProjectSettingsPopover _ValaProjectSettingsPopover;
3 public class ValaProjectSettingsPopover : Object
6 private ValaProjectSettingsPopover _this;
8 public static ValaProjectSettingsPopover singleton()
10 if (_ValaProjectSettingsPopover == null) {
11 _ValaProjectSettingsPopover= new ValaProjectSettingsPopover();
13 return _ValaProjectSettingsPopover;
15 public Xcls_notebook notebook;
16 public Xcls_label_global label_global;
17 public Xcls_label_targets label_targets;
18 public Xcls_compile_flags compile_flags;
19 public Xcls_vapi_scroll vapi_scroll;
20 public Xcls_vapimodel vapimodel;
21 public Xcls_vapi_filter vapi_filter;
22 public Xcls_vapi_search vapi_search;
23 public Xcls_set_vbox set_vbox;
24 public Xcls_treeview treeview;
25 public Xcls_treeselmodel treeselmodel;
26 public Xcls_treelistsort treelistsort;
27 public Xcls_treelistmodel treelistmodel;
28 public Xcls_treemodel treemodel;
29 public Xcls_name name;
30 public Xcls_target_sel target_sel;
31 public Xcls_target_model target_model;
32 public Xcls_set_vboxb set_vboxb;
33 public Xcls_build_name build_name;
34 public Xcls_build_execute_args build_execute_args;
35 public Xcls_save_btn save_btn;
38 public Project.Callback doneObj;
39 public bool cg_loading;
40 public Xcls_MainWindow window;
41 public Project.GtkValaSettings? selected_target;
42 public uint border_width;
44 public Project.Gtk project;
47 public ValaProjectSettingsPopover()
50 this.el = new Gtk.Window();
54 this.cg_loading = false;
56 this.selected_target = null;
57 this.border_width = 0;
63 var child_1 = new Xcls_HeaderBar1( _this );
64 this.el.titlebar = child_1.el;
65 var child_2 = new Xcls_Box3( _this );
67 this.el.set_child ( child_2.el );
70 this.el.close_request.connect( ( ) => {
77 this.el.hide.connect( () => {
84 // user defined functions
85 public void show (Gtk.Window pwin, Project.Gtk project, Project.Callback? doneObj) {
87 //print("ValaProjectSettings show\n");
88 this.doneObj = doneObj;
89 this.project= project;
91 this.compile_flags.el.buffer.set_text(
92 project.compile_flags.data
95 project.loadVapiIntoStore(_this.vapimodel.el);
96 GLib.Timeout.add(500, () => {
97 this.vapi_scroll.el.vadjustment.value = 0;
103 project.loadTargetsIntoStore(this.target_model.el);
105 _this.target_sel.el.selected = Gtk.INVALID_LIST_POSITION;
106 _this.target_sel.selectTarget(null);
107 // Gtk.Allocation rect;
108 //btn.get_allocation(out rect);
109 // this.el.set_pointing_to(rect);
110 this.el.application = pwin.application; // ??? make it modal?
111 this.el.set_transient_for(pwin);
114 // print("SHOWALL - POPIP\n");
115 this.el.set_size_request(800,800);
117 this.notebook.el.page = 0; // first page.
119 //this.view.el.grab_focus();
122 public void save () {
125 public class Xcls_HeaderBar1 : Object
127 public Gtk.HeaderBar el;
128 private ValaProjectSettingsPopover _this;
134 public Xcls_HeaderBar1(ValaProjectSettingsPopover _owner )
137 this.el = new Gtk.HeaderBar();
141 // set gobject values
142 var child_1 = new Xcls_Label2( _this );
143 this.el.title_widget = child_1.el;
146 // user defined functions
148 public class Xcls_Label2 : Object
151 private ValaProjectSettingsPopover _this;
157 public Xcls_Label2(ValaProjectSettingsPopover _owner )
160 this.el = new Gtk.Label( "Change Vala Compile settings" );
164 // set gobject values
167 // user defined functions
171 public class Xcls_Box3 : Object
174 private ValaProjectSettingsPopover _this;
180 public Xcls_Box3(ValaProjectSettingsPopover _owner )
183 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
187 // set gobject values
188 this.el.hexpand = true;
189 this.el.vexpand = true;
190 new Xcls_notebook( _this );
191 this.el.append( _this.notebook.el );
192 var child_2 = new Xcls_Box57( _this );
194 this.el.append( child_2.el );
197 // user defined functions
199 public class Xcls_notebook : Object
201 public Gtk.Notebook el;
202 private ValaProjectSettingsPopover _this;
208 public Xcls_notebook(ValaProjectSettingsPopover _owner )
211 _this.notebook = this;
212 this.el = new Gtk.Notebook();
216 // set gobject values
217 this.el.vexpand = true;
218 new Xcls_label_global( _this );
219 new Xcls_label_targets( _this );
220 var child_3 = new Xcls_Box7( _this );
222 this.el.append_page ( child_3.el , _this.label_global.el );
223 var child_4 = new Xcls_Paned25( _this );
225 this.el.append_page ( child_4.el , _this.label_targets.el );
228 // user defined functions
230 public class Xcls_label_global : Object
233 private ValaProjectSettingsPopover _this;
239 public Xcls_label_global(ValaProjectSettingsPopover _owner )
242 _this.label_global = this;
243 this.el = new Gtk.Label( "Global" );
247 // set gobject values
250 // user defined functions
253 public class Xcls_label_targets : Object
256 private ValaProjectSettingsPopover _this;
262 public Xcls_label_targets(ValaProjectSettingsPopover _owner )
265 _this.label_targets = this;
266 this.el = new Gtk.Label( "Targets" );
270 // set gobject values
273 // user defined functions
276 public class Xcls_Box7 : Object
279 private ValaProjectSettingsPopover _this;
285 public Xcls_Box7(ValaProjectSettingsPopover _owner )
288 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
292 // set gobject values
293 this.el.homogeneous = false;
294 var child_1 = new Xcls_Label8( _this );
296 this.el.append( child_1.el );
297 new Xcls_compile_flags( _this );
298 this.el.append( _this.compile_flags.el );
299 new Xcls_vapi_scroll( _this );
300 this.el.append( _this.vapi_scroll.el );
301 new Xcls_vapi_search( _this );
302 this.el.append( _this.vapi_search.el );
305 // user defined functions
307 public class Xcls_Label8 : Object
310 private ValaProjectSettingsPopover _this;
316 public Xcls_Label8(ValaProjectSettingsPopover _owner )
319 this.el = new Gtk.Label( "compile flags" );
323 // set gobject values
324 this.el.halign = Gtk.Align.START;
325 this.el.hexpand = true;
328 // user defined functions
331 public class Xcls_compile_flags : Object
334 private ValaProjectSettingsPopover _this;
340 public Xcls_compile_flags(ValaProjectSettingsPopover _owner )
343 _this.compile_flags = this;
344 this.el = new Gtk.Entry();
348 // set gobject values
349 this.el.placeholder_text = "eg. -g --valasrc $BASEDIR ";
352 this.el.changed.connect( () => {
354 _this.project.compile_flags = this.el.buffer.text;
355 _this.project.save();
356 // _this.project.save();
361 // user defined functions
364 public class Xcls_vapi_scroll : Object
366 public Gtk.ScrolledWindow el;
367 private ValaProjectSettingsPopover _this;
373 public Xcls_vapi_scroll(ValaProjectSettingsPopover _owner )
376 _this.vapi_scroll = this;
377 this.el = new Gtk.ScrolledWindow();
381 // set gobject values
382 this.el.vscrollbar_policy = Gtk.PolicyType.AUTOMATIC;
383 this.el.has_frame = true;
384 this.el.hexpand = true;
385 this.el.vexpand = true;
386 this.el.hscrollbar_policy = Gtk.PolicyType.AUTOMATIC;
387 var child_1 = new Xcls_ColumnView11( _this );
388 this.el.child = child_1.el;
391 // user defined functions
393 public class Xcls_ColumnView11 : Object
395 public Gtk.ColumnView el;
396 private ValaProjectSettingsPopover _this;
402 public Xcls_ColumnView11(ValaProjectSettingsPopover _owner )
405 var child_1 = new Xcls_NoSelection12( _this );
407 this.el = new Gtk.ColumnView( child_1.el );
411 // set gobject values
412 var child_2 = new Xcls_ColumnViewColumn20( _this );
414 this.el.append_column ( child_2.el );
415 var child_3 = new Xcls_ColumnViewColumn22( _this );
417 this.el.append_column ( child_3.el );
420 // user defined functions
422 public class Xcls_NoSelection12 : Object
424 public Gtk.NoSelection el;
425 private ValaProjectSettingsPopover _this;
431 public Xcls_NoSelection12(ValaProjectSettingsPopover _owner )
434 var child_1 = new Xcls_FilterListModel13( _this );
436 this.el = new Gtk.NoSelection( child_1.el );
440 // set gobject values
443 // user defined functions
445 public class Xcls_FilterListModel13 : Object
447 public Gtk.FilterListModel el;
448 private ValaProjectSettingsPopover _this;
454 public Xcls_FilterListModel13(ValaProjectSettingsPopover _owner )
457 var child_1 = new Xcls_SortListModel14( _this );
459 new Xcls_vapi_filter( _this );
460 this.el = new Gtk.FilterListModel( child_1.el, _this.vapi_filter.el );
464 // set gobject values
467 // user defined functions
469 public class Xcls_SortListModel14 : Object
471 public Gtk.SortListModel el;
472 private ValaProjectSettingsPopover _this;
478 public Xcls_SortListModel14(ValaProjectSettingsPopover _owner )
481 new Xcls_vapimodel( _this );
482 var child_2 = new Xcls_StringSorter16( _this );
484 this.el = new Gtk.SortListModel( _this.vapimodel.el, child_2.el );
488 // set gobject values
491 // user defined functions
493 public class Xcls_vapimodel : Object
495 public GLib.ListStore el;
496 private ValaProjectSettingsPopover _this;
502 public Xcls_vapimodel(ValaProjectSettingsPopover _owner )
505 _this.vapimodel = this;
506 this.el = new GLib.ListStore( typeof(Project.VapiSelection) );
510 // set gobject values
513 // user defined functions
516 public class Xcls_StringSorter16 : Object
518 public Gtk.StringSorter el;
519 private ValaProjectSettingsPopover _this;
525 public Xcls_StringSorter16(ValaProjectSettingsPopover _owner )
528 var child_1 = new Xcls_PropertyExpression17( _this );
530 this.el = new Gtk.StringSorter( child_1.el );
534 // set gobject values
537 // user defined functions
539 public class Xcls_PropertyExpression17 : Object
541 public Gtk.PropertyExpression el;
542 private ValaProjectSettingsPopover _this;
548 public Xcls_PropertyExpression17(ValaProjectSettingsPopover _owner )
551 this.el = new Gtk.PropertyExpression( typeof(Project.VapiSelection), null, "sortkey" );
555 // set gobject values
558 // user defined functions
563 public class Xcls_vapi_filter : Object
565 public Gtk.StringFilter el;
566 private ValaProjectSettingsPopover _this;
572 public Xcls_vapi_filter(ValaProjectSettingsPopover _owner )
575 _this.vapi_filter = this;
576 var child_1 = new Xcls_PropertyExpression19( _this );
578 this.el = new Gtk.StringFilter( child_1.el );
582 // set gobject values
585 // user defined functions
587 public class Xcls_PropertyExpression19 : Object
589 public Gtk.PropertyExpression el;
590 private ValaProjectSettingsPopover _this;
596 public Xcls_PropertyExpression19(ValaProjectSettingsPopover _owner )
599 this.el = new Gtk.PropertyExpression( typeof(Project.VapiSelection), null, "sortkey" );
603 // set gobject values
606 // user defined functions
612 public class Xcls_ColumnViewColumn20 : Object
614 public Gtk.ColumnViewColumn el;
615 private ValaProjectSettingsPopover _this;
621 public Xcls_ColumnViewColumn20(ValaProjectSettingsPopover _owner )
624 var child_1 = new Xcls_SignalListItemFactory21( _this );
626 this.el = new Gtk.ColumnViewColumn( "Vapi Package", child_1.el );
630 // set gobject values
631 this.el.expand = true;
634 // user defined functions
636 public class Xcls_SignalListItemFactory21 : Object
638 public Gtk.SignalListItemFactory el;
639 private ValaProjectSettingsPopover _this;
645 public Xcls_SignalListItemFactory21(ValaProjectSettingsPopover _owner )
648 this.el = new Gtk.SignalListItemFactory();
652 // set gobject values
655 this.el.setup.connect( (item) => {
656 //var j = (JsRender.JsRender) item;
657 var gi = (Gtk.ListItem)item;
659 var lbl = new Gtk.Label("");
660 lbl.halign = Gtk.Align.START;
666 this.el.bind.connect( (listitem) => {
668 var lbl = (Gtk.Label) ((Gtk.ListItem)listitem).get_child();
670 var item = (Project.VapiSelection) ((Gtk.ListItem)listitem).get_item();
672 item.bind_property("name",
674 GLib.BindingFlags.SYNC_CREATE);
680 // user defined functions
684 public class Xcls_ColumnViewColumn22 : Object
686 public Gtk.ColumnViewColumn el;
687 private ValaProjectSettingsPopover _this;
693 public Xcls_ColumnViewColumn22(ValaProjectSettingsPopover _owner )
696 var child_1 = new Xcls_SignalListItemFactory23( _this );
698 this.el = new Gtk.ColumnViewColumn( "use", child_1.el );
702 // set gobject values
705 // user defined functions
707 public class Xcls_SignalListItemFactory23 : Object
709 public Gtk.SignalListItemFactory el;
710 private ValaProjectSettingsPopover _this;
716 public Xcls_SignalListItemFactory23(ValaProjectSettingsPopover _owner )
719 this.el = new Gtk.SignalListItemFactory();
723 // set gobject values
726 this.el.setup.connect( (listitem) => {
728 var btn = new Gtk.CheckButton();
730 ((Gtk.ListItem)listitem).set_child(btn);
732 btn.toggled.connect(() => {
734 var jr = (Project.VapiSelection) ((Gtk.ListItem)listitem).get_item();
735 jr.selected = btn.active;
738 this.el.bind.connect( (listitem) => {
739 //GLib.debug("listitme is is %s", ((Gtk.ListItem)listitem).get_type().name());
743 //var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();
744 var btn = (Gtk.CheckButton) ((Gtk.ListItem)listitem).get_child();
747 var vs = (Project.VapiSelection)((Gtk.ListItem)listitem).get_item();
749 //GLib.debug("change %s to %s", lbl.label, np.name);
751 btn.active = vs.selected;
759 // user defined functions
765 public class Xcls_vapi_search : Object
767 public Gtk.SearchEntry el;
768 private ValaProjectSettingsPopover _this;
774 public Xcls_vapi_search(ValaProjectSettingsPopover _owner )
777 _this.vapi_search = this;
778 this.el = new Gtk.SearchEntry();
782 // set gobject values
783 this.el.placeholder_text = "Search Libraries (Vapi)";
784 this.el.search_delay = 500;
787 this.el.search_changed.connect( ( ) => {
789 _this.vapi_filter.el.set_search(this.el.get_text());
794 // user defined functions
798 public class Xcls_Paned25 : Object
801 private ValaProjectSettingsPopover _this;
807 public Xcls_Paned25(ValaProjectSettingsPopover _owner )
810 this.el = new Gtk.Paned( Gtk.Orientation.HORIZONTAL );
814 // set gobject values
815 this.el.vexpand = true;
816 this.el.position = 300;
817 new Xcls_set_vbox( _this );
818 this.el.set_end_child ( _this.set_vbox.el );
819 var child_2 = new Xcls_Box42( _this );
820 this.el.start_child = child_2.el;
823 // user defined functions
825 public class Xcls_set_vbox : Object
828 private ValaProjectSettingsPopover _this;
834 public Xcls_set_vbox(ValaProjectSettingsPopover _owner )
837 _this.set_vbox = this;
838 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
842 // set gobject values
843 this.el.homogeneous = false;
844 var child_1 = new Xcls_ScrolledWindow27( _this );
846 this.el.append( child_1.el );
849 // user defined functions
851 public class Xcls_ScrolledWindow27 : Object
853 public Gtk.ScrolledWindow el;
854 private ValaProjectSettingsPopover _this;
860 public Xcls_ScrolledWindow27(ValaProjectSettingsPopover _owner )
863 this.el = new Gtk.ScrolledWindow();
867 // set gobject values
868 this.el.vexpand = true;
869 new Xcls_treeview( _this );
870 this.el.child = _this.treeview.el;
873 // user defined functions
875 public class Xcls_treeview : Object
877 public Gtk.ColumnView el;
878 private ValaProjectSettingsPopover _this;
884 public Xcls_treeview(ValaProjectSettingsPopover _owner )
887 _this.treeview = this;
888 new Xcls_treeselmodel( _this );
889 this.el = new Gtk.ColumnView( _this.treeselmodel.el );
893 // set gobject values
894 new Xcls_name( _this );
895 this.el.append_column ( _this.name.el );
896 var child_3 = new Xcls_ColumnViewColumn40( _this );
898 this.el.append_column ( child_3.el );
901 // user defined functions
903 public class Xcls_treeselmodel : Object
905 public Gtk.SingleSelection el;
906 private ValaProjectSettingsPopover _this;
912 public Xcls_treeselmodel(ValaProjectSettingsPopover _owner )
915 _this.treeselmodel = this;
916 var child_1 = new Xcls_FilterListModel30( _this );
918 this.el = new Gtk.SingleSelection( child_1.el );
922 // set gobject values
925 // user defined functions
927 public class Xcls_FilterListModel30 : Object
929 public Gtk.FilterListModel el;
930 private ValaProjectSettingsPopover _this;
936 public Xcls_FilterListModel30(ValaProjectSettingsPopover _owner )
939 new Xcls_treelistsort( _this );
940 var child_2 = new Xcls_CustomFilter37( _this );
942 this.el = new Gtk.FilterListModel( _this.treelistsort.el, child_2.el );
946 // set gobject values
949 // user defined functions
951 public class Xcls_treelistsort : Object
953 public Gtk.SortListModel el;
954 private ValaProjectSettingsPopover _this;
960 public Xcls_treelistsort(ValaProjectSettingsPopover _owner )
963 _this.treelistsort = this;
964 new Xcls_treelistmodel( _this );
965 var child_2 = new Xcls_TreeListRowSorter34( _this );
967 this.el = new Gtk.SortListModel( _this.treelistmodel.el, child_2.el );
971 // set gobject values
976 //this.el.set_sorter(new Gtk.TreeListRowSorter(_this.treeview.el.sorter));
980 // user defined functions
982 public class Xcls_treelistmodel : Object
984 public Gtk.TreeListModel el;
985 private ValaProjectSettingsPopover _this;
991 public Xcls_treelistmodel(ValaProjectSettingsPopover _owner )
994 _this.treelistmodel = this;
995 new Xcls_treemodel( _this );
996 this.el = new Gtk.TreeListModel( _this.treemodel.el, false, true, (item) => {
997 //GLib.debug("liststore got %s", item.get_type().name());
998 return ((JsRender.JsRender)item).childfiles;
1003 // set gobject values
1006 // user defined functions
1008 public class Xcls_treemodel : Object
1010 public GLib.ListStore el;
1011 private ValaProjectSettingsPopover _this;
1017 public Xcls_treemodel(ValaProjectSettingsPopover _owner )
1020 _this.treemodel = this;
1021 this.el = new GLib.ListStore( typeof(JsRender.JsRender) );
1025 // set gobject values
1028 // user defined functions
1032 public class Xcls_TreeListRowSorter34 : Object
1034 public Gtk.TreeListRowSorter el;
1035 private ValaProjectSettingsPopover _this;
1041 public Xcls_TreeListRowSorter34(ValaProjectSettingsPopover _owner )
1044 var child_1 = new Xcls_StringSorter35( _this );
1046 this.el = new Gtk.TreeListRowSorter( child_1.el );
1050 // set gobject values
1053 // user defined functions
1055 public class Xcls_StringSorter35 : Object
1057 public Gtk.StringSorter el;
1058 private ValaProjectSettingsPopover _this;
1064 public Xcls_StringSorter35(ValaProjectSettingsPopover _owner )
1067 var child_1 = new Xcls_PropertyExpression36( _this );
1069 this.el = new Gtk.StringSorter( child_1.el );
1073 // set gobject values
1076 // user defined functions
1078 public class Xcls_PropertyExpression36 : Object
1080 public Gtk.PropertyExpression el;
1081 private ValaProjectSettingsPopover _this;
1087 public Xcls_PropertyExpression36(ValaProjectSettingsPopover _owner )
1090 this.el = new Gtk.PropertyExpression( typeof(JsRender.JsRender), null, "name" );
1094 // set gobject values
1097 // user defined functions
1103 public class Xcls_CustomFilter37 : Object
1105 public Gtk.CustomFilter el;
1106 private ValaProjectSettingsPopover _this;
1112 public Xcls_CustomFilter37(ValaProjectSettingsPopover _owner )
1115 this.el = new Gtk.CustomFilter( (item) => {
1117 var tr = ((Gtk.TreeListRow)item).get_item();
1118 //GLib.debug("filter %s", tr.get_type().name());
1119 var j = (JsRender.JsRender) tr;
1120 if (j.xtype == "Gtk") {
1123 if (j.xtype != "Dir") {
1124 return j.path.has_suffix(".vala") || j.path.has_suffix(".c");
1128 for (var i =0 ; i < j.childfiles.n_items; i++) {
1129 var f = (JsRender.JsRender) j.childfiles.get_item(i);
1130 if (f.xtype == "Gtk") {
1133 if (f.path.has_suffix(".vala") || f.path.has_suffix(".c")) {
1143 // set gobject values
1146 // user defined functions
1151 public class Xcls_name : Object
1153 public Gtk.ColumnViewColumn el;
1154 private ValaProjectSettingsPopover _this;
1160 public Xcls_name(ValaProjectSettingsPopover _owner )
1164 var child_1 = new Xcls_SignalListItemFactory39( _this );
1166 this.el = new Gtk.ColumnViewColumn( "Other Files", child_1.el );
1170 // set gobject values
1171 this.el.id = "name";
1172 this.el.expand = true;
1173 this.el.resizable = true;
1178 this.el.set_sorter( new Gtk.StringSorter(
1179 new Gtk.PropertyExpression(typeof(JsRender.JsRender), null, "name")
1186 // user defined functions
1188 public class Xcls_SignalListItemFactory39 : Object
1190 public Gtk.SignalListItemFactory el;
1191 private ValaProjectSettingsPopover _this;
1197 public Xcls_SignalListItemFactory39(ValaProjectSettingsPopover _owner )
1200 this.el = new Gtk.SignalListItemFactory();
1204 // set gobject values
1207 this.el.setup.connect( (listitem) => {
1209 var expand = new Gtk.TreeExpander();
1211 expand.set_indent_for_depth(true);
1212 expand.set_indent_for_icon(true);
1214 var lbl = new Gtk.Label("");
1215 lbl.use_markup = true;
1218 lbl.justify = Gtk.Justification.LEFT;
1222 expand.set_child(lbl);
1223 ((Gtk.ListItem)listitem).set_child(expand);
1224 ((Gtk.ListItem)listitem).activatable = false;
1226 this.el.bind.connect( (listitem) => {
1227 //GLib.debug("listitme is is %s", ((Gtk.ListItem)listitem).get_type().name());
1231 //var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();
1232 var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();
1235 var lbl = (Gtk.Label) expand.child;
1237 if (lbl.label != "") { // do not update
1242 var lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();
1243 var jr = (JsRender.JsRender) lr.get_item();
1244 //GLib.debug("change %s to %s", lbl.label, np.name);
1245 lbl.label = jr.name; // for dir's we could hsow the sub path..
1246 lbl.tooltip_markup = jr.path;
1248 expand.set_hide_expander( jr.childfiles.n_items < 1);
1249 expand.set_list_row(lr);
1251 expand.set_hide_expander( jr.xtype != "Dir" );
1252 expand.set_list_row(lr);
1259 // user defined functions
1263 public class Xcls_ColumnViewColumn40 : Object
1265 public Gtk.ColumnViewColumn el;
1266 private ValaProjectSettingsPopover _this;
1272 public Xcls_ColumnViewColumn40(ValaProjectSettingsPopover _owner )
1275 var child_1 = new Xcls_SignalListItemFactory41( _this );
1277 this.el = new Gtk.ColumnViewColumn( "use", child_1.el );
1281 // set gobject values
1284 // user defined functions
1286 public class Xcls_SignalListItemFactory41 : Object
1288 public Gtk.SignalListItemFactory el;
1289 private ValaProjectSettingsPopover _this;
1295 public Xcls_SignalListItemFactory41(ValaProjectSettingsPopover _owner )
1298 this.el = new Gtk.SignalListItemFactory();
1302 // set gobject values
1305 this.el.setup.connect( (listitem) => {
1307 var btn = new Gtk.CheckButton();
1309 ((Gtk.ListItem)listitem).set_child(btn);
1311 btn.toggled.connect(() => {
1312 if (_this.cg_loading) {
1315 var lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();
1316 var jr = (JsRender.JsRender) lr.get_item();
1317 jr.compile_group_selected = btn.active;
1322 this.el.bind.connect( (listitem) => {
1323 //GLib.debug("listitme is is %s", ((Gtk.ListItem)listitem).get_type().name());
1327 //var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();
1328 var btn = (Gtk.CheckButton) ((Gtk.ListItem)listitem).get_child();
1331 var lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();
1332 var jr = (JsRender.JsRender) lr.get_item();
1333 //GLib.debug("change %s to %s", lbl.label, np.name);
1335 //btn.active = jr.compile_group_selected;
1336 btn.active = _this.selected_target.has_file(jr);
1338 //jr.bind_property("compile_group_selected",
1340 // GLib.BindingFlags.BIDIRECTIONAL);
1346 // user defined functions
1353 public class Xcls_Box42 : Object
1356 private ValaProjectSettingsPopover _this;
1362 public Xcls_Box42(ValaProjectSettingsPopover _owner )
1365 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
1369 // set gobject values
1370 var child_1 = new Xcls_Box43( _this );
1372 this.el.append( child_1.el );
1373 var child_2 = new Xcls_ScrolledWindow46( _this );
1375 this.el.append( child_2.el );
1376 new Xcls_set_vboxb( _this );
1377 this.el.append( _this.set_vboxb.el );
1380 // user defined functions
1382 public class Xcls_Box43 : Object
1385 private ValaProjectSettingsPopover _this;
1391 public Xcls_Box43(ValaProjectSettingsPopover _owner )
1394 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
1398 // set gobject values
1399 this.el.hexpand = true;
1400 var child_1 = new Xcls_Button44( _this );
1402 this.el.append( child_1.el );
1403 var child_2 = new Xcls_Button45( _this );
1405 this.el.append( child_2.el );
1408 // user defined functions
1410 public class Xcls_Button44 : Object
1412 public Gtk.Button el;
1413 private ValaProjectSettingsPopover _this;
1419 public Xcls_Button44(ValaProjectSettingsPopover _owner )
1422 this.el = new Gtk.Button();
1426 // set gobject values
1427 this.el.hexpand = true;
1428 this.el.label = "Add Compile Target";
1431 this.el.clicked.connect( () => {
1433 if (_this.project.compilegroups.has_key("NEW GROUP")) {
1436 var cg = new Project.GtkValaSettings(_this.project, "NEW GROUP");
1437 _this.project.compilegroups.set(cg.name, cg);
1438 _this.project.loadTargetsIntoStore(_this.target_model.el);
1439 // select it.. ?? should load it??
1440 for(var i =0;i < _this.target_model.el.n_items; i++) {
1441 var ncg = (Project.GtkValaSettings) _this.target_model.el.get_item(i);
1442 if (ncg.name == cg.name) {
1443 _this.target_sel.el.selected = i;
1444 _this.target_sel.selectTarget(cg);
1454 // user defined functions
1457 public class Xcls_Button45 : Object
1459 public Gtk.Button el;
1460 private ValaProjectSettingsPopover _this;
1466 public Xcls_Button45(ValaProjectSettingsPopover _owner )
1469 this.el = new Gtk.Button();
1473 // set gobject values
1474 this.el.hexpand = true;
1475 this.el.label = "Remove Target";
1478 this.el.clicked.connect( () => {
1479 // load the new values.
1480 if (_this.target_sel.el.selected == Gtk.INVALID_LIST_POSITION) {
1481 GLib.debug("nothing selected");
1486 // add the directory..
1487 var cg = (Project.GtkValaSettings) _this.target_model.el.get_item(_this.target_sel.el.selected);
1490 GLib.debug("remove: %s\n", cg.name);
1491 if (!_this.project.compilegroups.unset(cg.name)) {
1492 GLib.debug("remove failed");
1494 _this.project.loadTargetsIntoStore(_this.target_model.el);
1498 // user defined functions
1502 public class Xcls_ScrolledWindow46 : Object
1504 public Gtk.ScrolledWindow el;
1505 private ValaProjectSettingsPopover _this;
1511 public Xcls_ScrolledWindow46(ValaProjectSettingsPopover _owner )
1514 this.el = new Gtk.ScrolledWindow();
1518 // set gobject values
1519 this.el.vexpand = true;
1520 var child_1 = new Xcls_ColumnView47( _this );
1521 this.el.child = child_1.el;
1526 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
1531 // user defined functions
1533 public class Xcls_ColumnView47 : Object
1535 public Gtk.ColumnView el;
1536 private ValaProjectSettingsPopover _this;
1542 public Xcls_ColumnView47(ValaProjectSettingsPopover _owner )
1545 new Xcls_target_sel( _this );
1546 this.el = new Gtk.ColumnView( _this.target_sel.el );
1550 // set gobject values
1551 var child_2 = new Xcls_ColumnViewColumn50( _this );
1553 this.el.append_column ( child_2.el );
1556 // user defined functions
1558 public class Xcls_target_sel : Object
1560 public Gtk.SingleSelection el;
1561 private ValaProjectSettingsPopover _this;
1567 public Xcls_target_sel(ValaProjectSettingsPopover _owner )
1570 _this.target_sel = this;
1571 new Xcls_target_model( _this );
1572 this.el = new Gtk.SingleSelection( _this.target_model.el );
1576 // set gobject values
1579 this.el.selection_changed.connect( (position, n_items) => {
1582 // load the new values.
1583 if (this.el.selected == Gtk.INVALID_LIST_POSITION) {
1584 this.selectTarget(null);
1587 this.selectTarget(null);
1591 // add the directory..
1592 var cg = (Project.GtkValaSettings) _this.target_model.el.get_item(this.el.selected);
1594 this.selectTarget(cg);
1599 // user defined functions
1600 public void selectTarget (Project.GtkValaSettings? cg) {
1601 // load the new values
1602 _this.selected_target = cg;
1603 _this.project.active_cg = cg;
1608 _this.set_vbox.el.hide();
1609 _this.set_vboxb.el.hide();
1614 _this.set_vbox.el.show();
1615 _this.set_vboxb.el.show();
1616 // add the directory..
1619 GLib.debug("loading dirs into project list");
1620 cg.loading_ui = true;
1621 _this.cg_loading = true;
1623 _this.treeview.el.set_model(new Gtk.SingleSelection(null));
1624 _this.project.loadDirsIntoStore(_this.treemodel.el);
1625 _this.treeview.el.set_model(_this.treeselmodel.el);
1627 cg.loading_ui = false;
1629 _this.cg_loading = false;
1630 GLib.debug("Set name to %s", cg.name);
1632 _this.build_name.el.buffer.set_text(cg.name.data);
1635 _this.build_execute_args.el.buffer.set_text( cg.execute_args.data );
1639 public class Xcls_target_model : Object
1641 public GLib.ListStore el;
1642 private ValaProjectSettingsPopover _this;
1648 public Xcls_target_model(ValaProjectSettingsPopover _owner )
1651 _this.target_model = this;
1652 this.el = new GLib.ListStore( typeof(Project.GtkValaSettings) );
1656 // set gobject values
1659 // user defined functions
1663 public class Xcls_ColumnViewColumn50 : Object
1665 public Gtk.ColumnViewColumn el;
1666 private ValaProjectSettingsPopover _this;
1672 public Xcls_ColumnViewColumn50(ValaProjectSettingsPopover _owner )
1675 var child_1 = new Xcls_SignalListItemFactory51( _this );
1677 this.el = new Gtk.ColumnViewColumn( "Build Target", child_1.el );
1681 // set gobject values
1682 this.el.expand = true;
1685 // user defined functions
1687 public class Xcls_SignalListItemFactory51 : Object
1689 public Gtk.SignalListItemFactory el;
1690 private ValaProjectSettingsPopover _this;
1696 public Xcls_SignalListItemFactory51(ValaProjectSettingsPopover _owner )
1699 this.el = new Gtk.SignalListItemFactory();
1703 // set gobject values
1706 this.el.setup.connect( (item) => {
1707 //var j = (JsRender.JsRender) item;
1708 var gi = (Gtk.ListItem)item;
1710 var lbl = new Gtk.Label("");
1711 lbl.halign = Gtk.Align.START;
1717 this.el.bind.connect( (listitem) => {
1719 var lbl = (Gtk.Label) ((Gtk.ListItem)listitem).get_child();
1721 var item = (Project.GtkValaSettings) ((Gtk.ListItem)listitem).get_item();
1723 item.bind_property("name",
1725 GLib.BindingFlags.SYNC_CREATE);
1731 // user defined functions
1737 public class Xcls_set_vboxb : Object
1740 private ValaProjectSettingsPopover _this;
1746 public Xcls_set_vboxb(ValaProjectSettingsPopover _owner )
1749 _this.set_vboxb = this;
1750 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
1754 // set gobject values
1755 var child_1 = new Xcls_Label53( _this );
1757 this.el.append( child_1.el );
1758 new Xcls_build_name( _this );
1759 this.el.append( _this.build_name.el );
1760 var child_3 = new Xcls_Label55( _this );
1762 this.el.append( child_3.el );
1763 new Xcls_build_execute_args( _this );
1764 this.el.append( _this.build_execute_args.el );
1767 // user defined functions
1769 public class Xcls_Label53 : Object
1771 public Gtk.Label el;
1772 private ValaProjectSettingsPopover _this;
1778 public Xcls_Label53(ValaProjectSettingsPopover _owner )
1781 this.el = new Gtk.Label( "Build Name (executable name)" );
1785 // set gobject values
1788 // user defined functions
1791 public class Xcls_build_name : Object
1793 public Gtk.Entry el;
1794 private ValaProjectSettingsPopover _this;
1798 public bool in_insert;
1801 public Xcls_build_name(ValaProjectSettingsPopover _owner )
1804 _this.build_name = this;
1805 this.el = new Gtk.Entry();
1808 this.in_insert = false;
1810 // set gobject values
1814 var ed = (this.el.get_delegate() as Gtk.Editable);
1816 ed.insert_text.connect((text, length, ref position) => {
1817 if (this.in_insert) {
1820 GLib.debug("got insert text %s", text);
1823 for(var i = 0;i < text.length; i++){
1824 if (Posix.isupper(text[i]) ||Posix.islower(text[i]) ) {
1825 nt += text[i].to_string();
1828 if (nt.length < 1) {
1829 GLib.Signal.stop_emission_by_name(ed, "insert_text");
1833 this.in_insert = true;
1835 this.el.insert_text(nt,nt.length, ref position);
1836 this.in_insert = false;
1837 GLib.Signal.stop_emission_by_name(ed, "insert_text");
1843 this.el.insert_text.connect( (text, length, ref position) => {
1844 if (this.in_insert) {
1847 GLib.debug("got insert text %s", text);
1850 for(var i = 0;i < text.length; i++){
1851 if (Posix.isalpha(text[i])) {
1852 nt += text[i].to_string();
1855 if (nt.length < 1) {
1859 this.in_insert = true;
1861 this.el.insert_text(text,length, ref position);
1862 this.in_insert = false;
1864 this.el.changed.connect( () => {
1865 if (_this.selected_target == null) {
1868 var name = this.el.text;
1869 // name ischanging.. probably always..
1870 if (_this.selected_target.name != name) {
1871 _this.project.compilegroups.unset(_this.selected_target.name);
1872 _this.project.compilegroups.set(name, _this.selected_target);
1875 _this.selected_target.name = this.el.buffer.text;
1879 // user defined functions
1882 public class Xcls_Label55 : Object
1884 public Gtk.Label el;
1885 private ValaProjectSettingsPopover _this;
1891 public Xcls_Label55(ValaProjectSettingsPopover _owner )
1894 this.el = new Gtk.Label( "test argments - when run after a build" );
1898 // set gobject values
1901 // user defined functions
1904 public class Xcls_build_execute_args : Object
1906 public Gtk.Entry el;
1907 private ValaProjectSettingsPopover _this;
1913 public Xcls_build_execute_args(ValaProjectSettingsPopover _owner )
1916 _this.build_execute_args = this;
1917 this.el = new Gtk.Entry();
1921 // set gobject values
1922 this.el.placeholder_text = "eg. -f somefile -g ";
1925 this.el.changed.connect( () => {
1926 if (_this.selected_target == null) {
1929 _this.selected_target.execute_args = this.el.buffer.text;
1934 // user defined functions
1941 public class Xcls_Box57 : Object
1944 private ValaProjectSettingsPopover _this;
1950 public Xcls_Box57(ValaProjectSettingsPopover _owner )
1953 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
1957 // set gobject values
1958 this.el.margin_end = 4;
1959 this.el.margin_start = 4;
1960 this.el.hexpand = true;
1961 this.el.margin_bottom = 4;
1962 this.el.margin_top = 4;
1963 var child_1 = new Xcls_Button58( _this );
1965 this.el.append( child_1.el );
1966 var child_2 = new Xcls_Label59( _this );
1968 this.el.append( child_2.el );
1969 new Xcls_save_btn( _this );
1970 this.el.append( _this.save_btn.el );
1973 // user defined functions
1975 public class Xcls_Button58 : Object
1977 public Gtk.Button el;
1978 private ValaProjectSettingsPopover _this;
1984 public Xcls_Button58(ValaProjectSettingsPopover _owner )
1987 this.el = new Gtk.Button();
1991 // set gobject values
1992 this.el.label = "Cancel";
1995 this.el.clicked.connect( () => {
2002 // user defined functions
2005 public class Xcls_Label59 : Object
2007 public Gtk.Label el;
2008 private ValaProjectSettingsPopover _this;
2014 public Xcls_Label59(ValaProjectSettingsPopover _owner )
2017 this.el = new Gtk.Label( "" );
2021 // set gobject values
2022 this.el.hexpand = true;
2025 // user defined functions
2028 public class Xcls_save_btn : Object
2030 public Gtk.Button el;
2031 private ValaProjectSettingsPopover _this;
2037 public Xcls_save_btn(ValaProjectSettingsPopover _owner )
2040 _this.save_btn = this;
2041 this.el = new Gtk.Button();
2045 // set gobject values
2046 this.el.css_classes = { "suggested-action" };
2047 this.el.label = "Save";
2050 this.el.clicked.connect( ( ) => {
2053 _this.project.save();
2058 if (_this.doneObj != null) {
2059 _this.doneObj.call(_this.project);
2066 // user defined functions