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_HeaderBar2( _this );
64 this.el.titlebar = child_1.el;
65 var child_2 = new Xcls_Box4( _this );
67 this.el.set_child ( child_2.el );
70 this.el.close_request.connect( ( ) => {
76 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_HeaderBar2 : Object
127 public Gtk.HeaderBar el;
128 private ValaProjectSettingsPopover _this;
134 public Xcls_HeaderBar2(ValaProjectSettingsPopover _owner )
137 this.el = new Gtk.HeaderBar();
141 // set gobject values
142 var child_1 = new Xcls_Label3( _this );
143 this.el.title_widget = child_1.el;
146 // user defined functions
148 public class Xcls_Label3 : Object
151 private ValaProjectSettingsPopover _this;
157 public Xcls_Label3(ValaProjectSettingsPopover _owner )
160 this.el = new Gtk.Label( "Change Vala Compile settings" );
164 // set gobject values
167 // user defined functions
171 public class Xcls_Box4 : Object
174 private ValaProjectSettingsPopover _this;
180 public Xcls_Box4(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_Box58( _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_Box8( _this );
222 this.el.append_page ( child_3.el , _this.label_global.el );
223 var child_4 = new Xcls_Paned26( _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_Box8 : Object
279 private ValaProjectSettingsPopover _this;
285 public Xcls_Box8(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_Label9( _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_Label9 : Object
310 private ValaProjectSettingsPopover _this;
316 public Xcls_Label9(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_ColumnView12( _this );
388 this.el.child = child_1.el;
391 // user defined functions
393 public class Xcls_ColumnView12 : Object
395 public Gtk.ColumnView el;
396 private ValaProjectSettingsPopover _this;
402 public Xcls_ColumnView12(ValaProjectSettingsPopover _owner )
405 var child_1 = new Xcls_NoSelection13( _this );
407 this.el = new Gtk.ColumnView( child_1.el );
411 // set gobject values
412 var child_2 = new Xcls_ColumnViewColumn21( _this );
414 this.el.append_column ( child_2.el );
415 var child_3 = new Xcls_ColumnViewColumn23( _this );
417 this.el.append_column ( child_3.el );
420 // user defined functions
422 public class Xcls_NoSelection13 : Object
424 public Gtk.NoSelection el;
425 private ValaProjectSettingsPopover _this;
431 public Xcls_NoSelection13(ValaProjectSettingsPopover _owner )
434 var child_1 = new Xcls_FilterListModel14( _this );
436 this.el = new Gtk.NoSelection( child_1.el );
440 // set gobject values
443 // user defined functions
445 public class Xcls_FilterListModel14 : Object
447 public Gtk.FilterListModel el;
448 private ValaProjectSettingsPopover _this;
454 public Xcls_FilterListModel14(ValaProjectSettingsPopover _owner )
457 var child_1 = new Xcls_SortListModel15( _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_SortListModel15 : Object
471 public Gtk.SortListModel el;
472 private ValaProjectSettingsPopover _this;
478 public Xcls_SortListModel15(ValaProjectSettingsPopover _owner )
481 new Xcls_vapimodel( _this );
482 var child_2 = new Xcls_StringSorter17( _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_StringSorter17 : Object
518 public Gtk.StringSorter el;
519 private ValaProjectSettingsPopover _this;
525 public Xcls_StringSorter17(ValaProjectSettingsPopover _owner )
528 var child_1 = new Xcls_PropertyExpression18( _this );
530 this.el = new Gtk.StringSorter( child_1.el );
534 // set gobject values
537 // user defined functions
539 public class Xcls_PropertyExpression18 : Object
541 public Gtk.PropertyExpression el;
542 private ValaProjectSettingsPopover _this;
548 public Xcls_PropertyExpression18(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_PropertyExpression20( _this );
578 this.el = new Gtk.StringFilter( child_1.el );
582 // set gobject values
585 // user defined functions
587 public class Xcls_PropertyExpression20 : Object
589 public Gtk.PropertyExpression el;
590 private ValaProjectSettingsPopover _this;
596 public Xcls_PropertyExpression20(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_ColumnViewColumn21 : Object
614 public Gtk.ColumnViewColumn el;
615 private ValaProjectSettingsPopover _this;
621 public Xcls_ColumnViewColumn21(ValaProjectSettingsPopover _owner )
624 var child_1 = new Xcls_SignalListItemFactory22( _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_SignalListItemFactory22 : Object
638 public Gtk.SignalListItemFactory el;
639 private ValaProjectSettingsPopover _this;
645 public Xcls_SignalListItemFactory22(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_ColumnViewColumn23 : Object
686 public Gtk.ColumnViewColumn el;
687 private ValaProjectSettingsPopover _this;
693 public Xcls_ColumnViewColumn23(ValaProjectSettingsPopover _owner )
696 var child_1 = new Xcls_SignalListItemFactory24( _this );
698 this.el = new Gtk.ColumnViewColumn( "use", child_1.el );
702 // set gobject values
705 // user defined functions
707 public class Xcls_SignalListItemFactory24 : Object
709 public Gtk.SignalListItemFactory el;
710 private ValaProjectSettingsPopover _this;
716 public Xcls_SignalListItemFactory24(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_Paned26 : Object
801 private ValaProjectSettingsPopover _this;
807 public Xcls_Paned26(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_Box43( _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_ScrolledWindow28( _this );
846 this.el.append( child_1.el );
849 // user defined functions
851 public class Xcls_ScrolledWindow28 : Object
853 public Gtk.ScrolledWindow el;
854 private ValaProjectSettingsPopover _this;
860 public Xcls_ScrolledWindow28(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_ColumnViewColumn41( _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_FilterListModel31( _this );
918 this.el = new Gtk.SingleSelection( child_1.el );
922 // set gobject values
925 // user defined functions
927 public class Xcls_FilterListModel31 : Object
929 public Gtk.FilterListModel el;
930 private ValaProjectSettingsPopover _this;
936 public Xcls_FilterListModel31(ValaProjectSettingsPopover _owner )
939 new Xcls_treelistsort( _this );
940 var child_2 = new Xcls_CustomFilter38( _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_TreeListRowSorter35( _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_TreeListRowSorter35 : Object
1034 public Gtk.TreeListRowSorter el;
1035 private ValaProjectSettingsPopover _this;
1041 public Xcls_TreeListRowSorter35(ValaProjectSettingsPopover _owner )
1044 var child_1 = new Xcls_StringSorter36( _this );
1046 this.el = new Gtk.TreeListRowSorter( child_1.el );
1050 // set gobject values
1053 // user defined functions
1055 public class Xcls_StringSorter36 : Object
1057 public Gtk.StringSorter el;
1058 private ValaProjectSettingsPopover _this;
1064 public Xcls_StringSorter36(ValaProjectSettingsPopover _owner )
1067 var child_1 = new Xcls_PropertyExpression37( _this );
1069 this.el = new Gtk.StringSorter( child_1.el );
1073 // set gobject values
1076 // user defined functions
1078 public class Xcls_PropertyExpression37 : Object
1080 public Gtk.PropertyExpression el;
1081 private ValaProjectSettingsPopover _this;
1087 public Xcls_PropertyExpression37(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_CustomFilter38 : Object
1105 public Gtk.CustomFilter el;
1106 private ValaProjectSettingsPopover _this;
1112 public Xcls_CustomFilter38(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_SignalListItemFactory40( _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_SignalListItemFactory40 : Object
1190 public Gtk.SignalListItemFactory el;
1191 private ValaProjectSettingsPopover _this;
1197 public Xcls_SignalListItemFactory40(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_ColumnViewColumn41 : Object
1265 public Gtk.ColumnViewColumn el;
1266 private ValaProjectSettingsPopover _this;
1272 public Xcls_ColumnViewColumn41(ValaProjectSettingsPopover _owner )
1275 var child_1 = new Xcls_SignalListItemFactory42( _this );
1277 this.el = new Gtk.ColumnViewColumn( "use", child_1.el );
1281 // set gobject values
1284 // user defined functions
1286 public class Xcls_SignalListItemFactory42 : Object
1288 public Gtk.SignalListItemFactory el;
1289 private ValaProjectSettingsPopover _this;
1295 public Xcls_SignalListItemFactory42(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;
1337 jr.bind_property("compile_group_selected",
1339 GLib.BindingFlags.BIDIRECTIONAL);
1345 // user defined functions
1352 public class Xcls_Box43 : Object
1355 private ValaProjectSettingsPopover _this;
1361 public Xcls_Box43(ValaProjectSettingsPopover _owner )
1364 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
1368 // set gobject values
1369 var child_1 = new Xcls_Box44( _this );
1371 this.el.append( child_1.el );
1372 var child_2 = new Xcls_ScrolledWindow47( _this );
1374 this.el.append( child_2.el );
1375 new Xcls_set_vboxb( _this );
1376 this.el.append( _this.set_vboxb.el );
1379 // user defined functions
1381 public class Xcls_Box44 : Object
1384 private ValaProjectSettingsPopover _this;
1390 public Xcls_Box44(ValaProjectSettingsPopover _owner )
1393 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
1397 // set gobject values
1398 this.el.hexpand = true;
1399 var child_1 = new Xcls_Button45( _this );
1401 this.el.append( child_1.el );
1402 var child_2 = new Xcls_Button46( _this );
1404 this.el.append( child_2.el );
1407 // user defined functions
1409 public class Xcls_Button45 : Object
1411 public Gtk.Button el;
1412 private ValaProjectSettingsPopover _this;
1418 public Xcls_Button45(ValaProjectSettingsPopover _owner )
1421 this.el = new Gtk.Button();
1425 // set gobject values
1426 this.el.hexpand = true;
1427 this.el.label = "Add Compile Target";
1430 this.el.clicked.connect( () => {
1432 if (_this.project.compilegroups.has_key("NEW GROUP")) {
1435 var cg = new Project.GtkValaSettings(_this.project, "NEW GROUP");
1436 _this.project.compilegroups.set(cg.name, cg);
1437 _this.project.loadTargetsIntoStore(_this.target_model.el);
1438 // select it.. ?? should load it??
1439 for(var i =0;i < _this.target_model.el.n_items; i++) {
1440 var ncg = (Project.GtkValaSettings) _this.target_model.el.get_item(i);
1441 if (ncg.name == cg.name) {
1442 _this.target_sel.el.selected = i;
1443 _this.target_sel.selectTarget(cg);
1453 // user defined functions
1456 public class Xcls_Button46 : Object
1458 public Gtk.Button el;
1459 private ValaProjectSettingsPopover _this;
1465 public Xcls_Button46(ValaProjectSettingsPopover _owner )
1468 this.el = new Gtk.Button();
1472 // set gobject values
1473 this.el.hexpand = true;
1474 this.el.label = "Remove Target";
1477 this.el.clicked.connect( () => {
1478 // load the new values.
1479 if (_this.target_sel.el.selected == Gtk.INVALID_LIST_POSITION) {
1480 GLib.debug("nothing selected");
1485 // add the directory..
1486 var cg = (Project.GtkValaSettings) _this.target_model.el.get_item(_this.target_sel.el.selected);
1489 GLib.debug("remove: %s\n", cg.name);
1490 if (!_this.project.compilegroups.unset(cg.name)) {
1491 GLib.debug("remove failed");
1493 _this.project.loadTargetsIntoStore(_this.target_model.el);
1497 // user defined functions
1501 public class Xcls_ScrolledWindow47 : Object
1503 public Gtk.ScrolledWindow el;
1504 private ValaProjectSettingsPopover _this;
1510 public Xcls_ScrolledWindow47(ValaProjectSettingsPopover _owner )
1513 this.el = new Gtk.ScrolledWindow();
1517 // set gobject values
1518 this.el.vexpand = true;
1519 var child_1 = new Xcls_ColumnView48( _this );
1520 this.el.child = child_1.el;
1525 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
1530 // user defined functions
1532 public class Xcls_ColumnView48 : Object
1534 public Gtk.ColumnView el;
1535 private ValaProjectSettingsPopover _this;
1541 public Xcls_ColumnView48(ValaProjectSettingsPopover _owner )
1544 new Xcls_target_sel( _this );
1545 this.el = new Gtk.ColumnView( _this.target_sel.el );
1549 // set gobject values
1550 var child_2 = new Xcls_ColumnViewColumn51( _this );
1552 this.el.append_column ( child_2.el );
1555 // user defined functions
1557 public class Xcls_target_sel : Object
1559 public Gtk.SingleSelection el;
1560 private ValaProjectSettingsPopover _this;
1566 public Xcls_target_sel(ValaProjectSettingsPopover _owner )
1569 _this.target_sel = this;
1570 new Xcls_target_model( _this );
1571 this.el = new Gtk.SingleSelection( _this.target_model.el );
1575 // set gobject values
1578 this.el.selection_changed.connect( (position, n_items) => {
1581 // load the new values.
1582 if (this.el.selected == Gtk.INVALID_LIST_POSITION) {
1583 this.selectTarget(null);
1586 this.selectTarget(null);
1590 // add the directory..
1591 var cg = (Project.GtkValaSettings) _this.target_model.el.get_item(this.el.selected);
1593 this.selectTarget(cg);
1598 // user defined functions
1599 public void selectTarget (Project.GtkValaSettings? cg) {
1600 // load the new values
1601 _this.selected_target = cg;
1602 _this.project.active_cg = cg;
1607 _this.set_vbox.el.hide();
1608 _this.set_vboxb.el.hide();
1613 _this.set_vbox.el.show();
1614 _this.set_vboxb.el.show();
1615 // add the directory..
1618 GLib.debug("loading dirs into project list");
1619 cg.loading_ui = true;
1620 _this.cg_loading = true;
1622 _this.treeview.el.set_model(new Gtk.SingleSelection(null));
1623 _this.project.loadDirsIntoStore(_this.treemodel.el);
1624 _this.treeview.el.set_model(_this.treeselmodel.el);
1626 cg.loading_ui = false;
1628 _this.cg_loading = false;
1629 GLib.debug("Set name to %s", cg.name);
1631 _this.build_name.el.buffer.set_text(cg.name.data);
1634 _this.build_execute_args.el.buffer.set_text( cg.execute_args.data );
1638 public class Xcls_target_model : Object
1640 public GLib.ListStore el;
1641 private ValaProjectSettingsPopover _this;
1647 public Xcls_target_model(ValaProjectSettingsPopover _owner )
1650 _this.target_model = this;
1651 this.el = new GLib.ListStore( typeof(Project.GtkValaSettings) );
1655 // set gobject values
1658 // user defined functions
1662 public class Xcls_ColumnViewColumn51 : Object
1664 public Gtk.ColumnViewColumn el;
1665 private ValaProjectSettingsPopover _this;
1671 public Xcls_ColumnViewColumn51(ValaProjectSettingsPopover _owner )
1674 var child_1 = new Xcls_SignalListItemFactory52( _this );
1676 this.el = new Gtk.ColumnViewColumn( "Build Target", child_1.el );
1680 // set gobject values
1681 this.el.expand = true;
1684 // user defined functions
1686 public class Xcls_SignalListItemFactory52 : Object
1688 public Gtk.SignalListItemFactory el;
1689 private ValaProjectSettingsPopover _this;
1695 public Xcls_SignalListItemFactory52(ValaProjectSettingsPopover _owner )
1698 this.el = new Gtk.SignalListItemFactory();
1702 // set gobject values
1705 this.el.setup.connect( (item) => {
1706 //var j = (JsRender.JsRender) item;
1707 var gi = (Gtk.ListItem)item;
1709 var lbl = new Gtk.Label("");
1710 lbl.halign = Gtk.Align.START;
1716 this.el.bind.connect( (listitem) => {
1718 var lbl = (Gtk.Label) ((Gtk.ListItem)listitem).get_child();
1720 var item = (Project.GtkValaSettings) ((Gtk.ListItem)listitem).get_item();
1722 item.bind_property("name",
1724 GLib.BindingFlags.SYNC_CREATE);
1730 // user defined functions
1736 public class Xcls_set_vboxb : Object
1739 private ValaProjectSettingsPopover _this;
1745 public Xcls_set_vboxb(ValaProjectSettingsPopover _owner )
1748 _this.set_vboxb = this;
1749 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
1753 // set gobject values
1754 var child_1 = new Xcls_Label54( _this );
1756 this.el.append( child_1.el );
1757 new Xcls_build_name( _this );
1758 this.el.append( _this.build_name.el );
1759 var child_3 = new Xcls_Label56( _this );
1761 this.el.append( child_3.el );
1762 new Xcls_build_execute_args( _this );
1763 this.el.append( _this.build_execute_args.el );
1766 // user defined functions
1768 public class Xcls_Label54 : Object
1770 public Gtk.Label el;
1771 private ValaProjectSettingsPopover _this;
1777 public Xcls_Label54(ValaProjectSettingsPopover _owner )
1780 this.el = new Gtk.Label( "Build Name (executable name)" );
1784 // set gobject values
1787 // user defined functions
1790 public class Xcls_build_name : Object
1792 public Gtk.Entry el;
1793 private ValaProjectSettingsPopover _this;
1799 public Xcls_build_name(ValaProjectSettingsPopover _owner )
1802 _this.build_name = this;
1803 this.el = new Gtk.Entry();
1807 // set gobject values
1810 this.el.changed.connect( () => {
1811 if (_this.selected_target == null) {
1814 var name = this.el.text;
1815 // name ischanging.. probably always..
1816 if (_this.selected_target.name != name) {
1817 _this.project.compilegroups.unset(_this.selected_target.name);
1818 _this.project.compilegroups.set(name, _this.selected_target);
1821 _this.selected_target.name = this.el.buffer.text;
1825 // user defined functions
1828 public class Xcls_Label56 : Object
1830 public Gtk.Label el;
1831 private ValaProjectSettingsPopover _this;
1837 public Xcls_Label56(ValaProjectSettingsPopover _owner )
1840 this.el = new Gtk.Label( "test argments - when run after a build" );
1844 // set gobject values
1847 // user defined functions
1850 public class Xcls_build_execute_args : Object
1852 public Gtk.Entry el;
1853 private ValaProjectSettingsPopover _this;
1859 public Xcls_build_execute_args(ValaProjectSettingsPopover _owner )
1862 _this.build_execute_args = this;
1863 this.el = new Gtk.Entry();
1867 // set gobject values
1868 this.el.placeholder_text = "eg. -f somefile -g ";
1871 this.el.changed.connect( () => {
1872 if (_this.selected_target == null) {
1875 _this.selected_target.execute_args = this.el.buffer.text;
1880 // user defined functions
1887 public class Xcls_Box58 : Object
1890 private ValaProjectSettingsPopover _this;
1896 public Xcls_Box58(ValaProjectSettingsPopover _owner )
1899 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
1903 // set gobject values
1904 this.el.margin_end = 4;
1905 this.el.margin_start = 4;
1906 this.el.hexpand = true;
1907 this.el.margin_bottom = 4;
1908 this.el.margin_top = 4;
1909 var child_1 = new Xcls_Button59( _this );
1911 this.el.append( child_1.el );
1912 var child_2 = new Xcls_Label60( _this );
1914 this.el.append( child_2.el );
1915 new Xcls_save_btn( _this );
1916 this.el.append( _this.save_btn.el );
1919 // user defined functions
1921 public class Xcls_Button59 : Object
1923 public Gtk.Button el;
1924 private ValaProjectSettingsPopover _this;
1930 public Xcls_Button59(ValaProjectSettingsPopover _owner )
1933 this.el = new Gtk.Button();
1937 // set gobject values
1938 this.el.label = "Cancel";
1941 this.el.clicked.connect( () => {
1948 // user defined functions
1951 public class Xcls_Label60 : Object
1953 public Gtk.Label el;
1954 private ValaProjectSettingsPopover _this;
1960 public Xcls_Label60(ValaProjectSettingsPopover _owner )
1963 this.el = new Gtk.Label( "" );
1967 // set gobject values
1968 this.el.hexpand = true;
1971 // user defined functions
1974 public class Xcls_save_btn : Object
1976 public Gtk.Button el;
1977 private ValaProjectSettingsPopover _this;
1983 public Xcls_save_btn(ValaProjectSettingsPopover _owner )
1986 _this.save_btn = this;
1987 this.el = new Gtk.Button();
1991 // set gobject values
1992 this.el.css_classes = { "suggested-action" };
1993 this.el.label = "Save";
1996 this.el.clicked.connect( ( ) => {
1999 _this.project.save();
2004 if (_this.doneObj != null) {
2005 _this.doneObj.call(_this.project);
2012 // user defined functions