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 Xcls_MainWindow window;
39 public Gtk.PositionType position;
40 public Project.GtkValaSettings? selected_target;
41 public uint border_width;
43 public Project.Gtk project;
47 public ValaProjectSettingsPopover()
50 this.el = new Gtk.Window();
54 this.position = Gtk.PositionType.RIGHT;
55 this.selected_target = null;
56 this.border_width = 0;
59 this.autohide = false;
63 var child_1 = new Xcls_HeaderBar2( _this );
64 this.el.titlebar = child_1.el;
65 var child_2 = new Xcls_Box5( _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) {
87 //print("ValaProjectSettings show\n");
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.set_transient_for(pwin);
112 // print("SHOWALL - POPIP\n");
113 this.el.set_size_request(800,800);
115 this.notebook.el.page = 0; // first page.
117 //this.view.el.grab_focus();
120 public void save () {
123 public class Xcls_HeaderBar2 : Object
125 public Gtk.HeaderBar el;
126 private ValaProjectSettingsPopover _this;
132 public Xcls_HeaderBar2(ValaProjectSettingsPopover _owner )
135 this.el = new Gtk.HeaderBar();
139 // set gobject values
140 var child_1 = new Xcls_Label3( _this );
141 this.el.title_widget = child_1.el;
142 var child_2 = new Xcls_Button4( _this );
144 this.el.pack_end ( child_2.el );
147 // user defined functions
149 public class Xcls_Label3 : Object
152 private ValaProjectSettingsPopover _this;
158 public Xcls_Label3(ValaProjectSettingsPopover _owner )
161 this.el = new Gtk.Label( "Change Vala Compile settings" );
165 // set gobject values
168 // user defined functions
171 public class Xcls_Button4 : Object
173 public Gtk.Button el;
174 private ValaProjectSettingsPopover _this;
180 public Xcls_Button4(ValaProjectSettingsPopover _owner )
183 this.el = new Gtk.Button();
187 // set gobject values
188 this.el.icon_name = "";
189 this.el.label = "Create / Recreate Build files (configure.ac / makefile.am etc)";
192 // user defined functions
196 public class Xcls_Box5 : Object
199 private ValaProjectSettingsPopover _this;
205 public Xcls_Box5(ValaProjectSettingsPopover _owner )
208 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
212 // set gobject values
213 this.el.hexpand = true;
214 this.el.vexpand = true;
215 new Xcls_notebook( _this );
216 this.el.append( _this.notebook.el );
217 var child_2 = new Xcls_Box59( _this );
219 this.el.append( child_2.el );
222 // user defined functions
224 public class Xcls_notebook : Object
226 public Gtk.Notebook el;
227 private ValaProjectSettingsPopover _this;
233 public Xcls_notebook(ValaProjectSettingsPopover _owner )
236 _this.notebook = this;
237 this.el = new Gtk.Notebook();
241 // set gobject values
242 this.el.vexpand = true;
243 new Xcls_label_global( _this );
244 new Xcls_label_targets( _this );
245 var child_3 = new Xcls_Box9( _this );
247 this.el.append_page ( child_3.el , _this.label_global.el );
248 var child_4 = new Xcls_Paned27( _this );
250 this.el.append_page ( child_4.el , _this.label_targets.el );
253 // user defined functions
255 public class Xcls_label_global : Object
258 private ValaProjectSettingsPopover _this;
264 public Xcls_label_global(ValaProjectSettingsPopover _owner )
267 _this.label_global = this;
268 this.el = new Gtk.Label( "Global" );
272 // set gobject values
275 // user defined functions
278 public class Xcls_label_targets : Object
281 private ValaProjectSettingsPopover _this;
287 public Xcls_label_targets(ValaProjectSettingsPopover _owner )
290 _this.label_targets = this;
291 this.el = new Gtk.Label( "Targets" );
295 // set gobject values
298 // user defined functions
301 public class Xcls_Box9 : Object
304 private ValaProjectSettingsPopover _this;
310 public Xcls_Box9(ValaProjectSettingsPopover _owner )
313 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
317 // set gobject values
318 this.el.homogeneous = false;
319 var child_1 = new Xcls_Label10( _this );
321 this.el.append( child_1.el );
322 new Xcls_compile_flags( _this );
323 this.el.append( _this.compile_flags.el );
324 new Xcls_vapi_scroll( _this );
325 this.el.append( _this.vapi_scroll.el );
326 new Xcls_vapi_search( _this );
327 this.el.append( _this.vapi_search.el );
330 // user defined functions
332 public class Xcls_Label10 : Object
335 private ValaProjectSettingsPopover _this;
341 public Xcls_Label10(ValaProjectSettingsPopover _owner )
344 this.el = new Gtk.Label( "compile flags" );
348 // set gobject values
349 this.el.halign = Gtk.Align.START;
350 this.el.hexpand = true;
353 // user defined functions
356 public class Xcls_compile_flags : Object
359 private ValaProjectSettingsPopover _this;
365 public Xcls_compile_flags(ValaProjectSettingsPopover _owner )
368 _this.compile_flags = this;
369 this.el = new Gtk.Entry();
373 // set gobject values
374 this.el.placeholder_text = "eg. -g --valasrc $BASEDIR ";
377 this.el.changed.connect( () => {
379 _this.project.compile_flags = this.el.buffer.text;
380 _this.project.save();
381 // _this.project.save();
386 // user defined functions
389 public class Xcls_vapi_scroll : Object
391 public Gtk.ScrolledWindow el;
392 private ValaProjectSettingsPopover _this;
398 public Xcls_vapi_scroll(ValaProjectSettingsPopover _owner )
401 _this.vapi_scroll = this;
402 this.el = new Gtk.ScrolledWindow();
406 // set gobject values
407 this.el.vscrollbar_policy = Gtk.PolicyType.AUTOMATIC;
408 this.el.has_frame = true;
409 this.el.hexpand = true;
410 this.el.vexpand = true;
411 this.el.hscrollbar_policy = Gtk.PolicyType.AUTOMATIC;
412 var child_1 = new Xcls_ColumnView13( _this );
413 this.el.child = child_1.el;
416 // user defined functions
418 public class Xcls_ColumnView13 : Object
420 public Gtk.ColumnView el;
421 private ValaProjectSettingsPopover _this;
427 public Xcls_ColumnView13(ValaProjectSettingsPopover _owner )
430 var child_1 = new Xcls_NoSelection14( _this );
432 this.el = new Gtk.ColumnView( child_1.el );
436 // set gobject values
437 var child_2 = new Xcls_ColumnViewColumn22( _this );
439 this.el.append_column ( child_2.el );
440 var child_3 = new Xcls_ColumnViewColumn24( _this );
442 this.el.append_column ( child_3.el );
445 // user defined functions
447 public class Xcls_NoSelection14 : Object
449 public Gtk.NoSelection el;
450 private ValaProjectSettingsPopover _this;
456 public Xcls_NoSelection14(ValaProjectSettingsPopover _owner )
459 var child_1 = new Xcls_FilterListModel15( _this );
461 this.el = new Gtk.NoSelection( child_1.el );
465 // set gobject values
468 // user defined functions
470 public class Xcls_FilterListModel15 : Object
472 public Gtk.FilterListModel el;
473 private ValaProjectSettingsPopover _this;
479 public Xcls_FilterListModel15(ValaProjectSettingsPopover _owner )
482 var child_1 = new Xcls_SortListModel16( _this );
484 new Xcls_vapi_filter( _this );
485 this.el = new Gtk.FilterListModel( child_1.el, _this.vapi_filter.el );
489 // set gobject values
492 // user defined functions
494 public class Xcls_SortListModel16 : Object
496 public Gtk.SortListModel el;
497 private ValaProjectSettingsPopover _this;
503 public Xcls_SortListModel16(ValaProjectSettingsPopover _owner )
506 new Xcls_vapimodel( _this );
507 var child_2 = new Xcls_StringSorter18( _this );
509 this.el = new Gtk.SortListModel( _this.vapimodel.el, child_2.el );
513 // set gobject values
516 // user defined functions
518 public class Xcls_vapimodel : Object
520 public GLib.ListStore el;
521 private ValaProjectSettingsPopover _this;
527 public Xcls_vapimodel(ValaProjectSettingsPopover _owner )
530 _this.vapimodel = this;
531 this.el = new GLib.ListStore( typeof(Project.VapiSelection) );
535 // set gobject values
538 // user defined functions
541 public class Xcls_StringSorter18 : Object
543 public Gtk.StringSorter el;
544 private ValaProjectSettingsPopover _this;
550 public Xcls_StringSorter18(ValaProjectSettingsPopover _owner )
553 var child_1 = new Xcls_PropertyExpression19( _this );
555 this.el = new Gtk.StringSorter( child_1.el );
559 // set gobject values
562 // user defined functions
564 public class Xcls_PropertyExpression19 : Object
566 public Gtk.PropertyExpression el;
567 private ValaProjectSettingsPopover _this;
573 public Xcls_PropertyExpression19(ValaProjectSettingsPopover _owner )
576 this.el = new Gtk.PropertyExpression( typeof(Project.VapiSelection), null, "sortkey" );
580 // set gobject values
583 // user defined functions
588 public class Xcls_vapi_filter : Object
590 public Gtk.StringFilter el;
591 private ValaProjectSettingsPopover _this;
597 public Xcls_vapi_filter(ValaProjectSettingsPopover _owner )
600 _this.vapi_filter = this;
601 var child_1 = new Xcls_PropertyExpression21( _this );
603 this.el = new Gtk.StringFilter( child_1.el );
607 // set gobject values
610 // user defined functions
612 public class Xcls_PropertyExpression21 : Object
614 public Gtk.PropertyExpression el;
615 private ValaProjectSettingsPopover _this;
621 public Xcls_PropertyExpression21(ValaProjectSettingsPopover _owner )
624 this.el = new Gtk.PropertyExpression( typeof(Project.VapiSelection), null, "sortkey" );
628 // set gobject values
631 // user defined functions
637 public class Xcls_ColumnViewColumn22 : Object
639 public Gtk.ColumnViewColumn el;
640 private ValaProjectSettingsPopover _this;
646 public Xcls_ColumnViewColumn22(ValaProjectSettingsPopover _owner )
649 var child_1 = new Xcls_SignalListItemFactory23( _this );
651 this.el = new Gtk.ColumnViewColumn( "Vapi Package", child_1.el );
655 // set gobject values
656 this.el.expand = true;
659 // user defined functions
661 public class Xcls_SignalListItemFactory23 : Object
663 public Gtk.SignalListItemFactory el;
664 private ValaProjectSettingsPopover _this;
670 public Xcls_SignalListItemFactory23(ValaProjectSettingsPopover _owner )
673 this.el = new Gtk.SignalListItemFactory();
677 // set gobject values
680 this.el.setup.connect( (item) => {
681 //var j = (JsRender.JsRender) item;
682 var gi = (Gtk.ListItem)item;
684 var lbl = new Gtk.Label("");
685 lbl.halign = Gtk.Align.START;
691 this.el.bind.connect( (listitem) => {
693 var lbl = (Gtk.Box) ((Gtk.ListItem)listitem).get_child();
695 var item = (Project.VapiSelection) ((Gtk.ListItem)listitem).get_item();
697 item.bind_property("name",
699 GLib.BindingFlags.SYNC_CREATE);
705 // user defined functions
709 public class Xcls_ColumnViewColumn24 : Object
711 public Gtk.ColumnViewColumn el;
712 private ValaProjectSettingsPopover _this;
718 public Xcls_ColumnViewColumn24(ValaProjectSettingsPopover _owner )
721 var child_1 = new Xcls_SignalListItemFactory25( _this );
723 this.el = new Gtk.ColumnViewColumn( "use", child_1.el );
727 // set gobject values
730 // user defined functions
732 public class Xcls_SignalListItemFactory25 : Object
734 public Gtk.SignalListItemFactory el;
735 private ValaProjectSettingsPopover _this;
741 public Xcls_SignalListItemFactory25(ValaProjectSettingsPopover _owner )
744 this.el = new Gtk.SignalListItemFactory();
748 // set gobject values
751 this.el.setup.connect( (listitem) => {
753 var btn = new Gtk.CheckButton();
755 ((Gtk.ListItem)listitem).set_child(btn);
757 btn.toggled.connect(() => {
759 var jr = (Project.VapiSelection) ((Gtk.ListItem)listitem).get_item();
760 jr.selected = btn.active;
763 this.el.bind.connect( (listitem) => {
764 //GLib.debug("listitme is is %s", ((Gtk.ListItem)listitem).get_type().name());
768 //var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();
769 var btn = (Gtk.CheckButton) ((Gtk.ListItem)listitem).get_child();
772 var vs = (Project.VapiSelection)((Gtk.ListItem)listitem).get_item();
774 //GLib.debug("change %s to %s", lbl.label, np.name);
776 btn.active = vs.selected;
784 // user defined functions
790 public class Xcls_vapi_search : Object
792 public Gtk.SearchEntry el;
793 private ValaProjectSettingsPopover _this;
799 public Xcls_vapi_search(ValaProjectSettingsPopover _owner )
802 _this.vapi_search = this;
803 this.el = new Gtk.SearchEntry();
807 // set gobject values
808 this.el.placeholder_text = "Search Libraries (Vapi)";
809 this.el.search_delay = 500;
812 this.el.search_changed.connect( ( ) => {
814 _this.vapi_filter.el.set_search(this.el.get_text());
819 // user defined functions
823 public class Xcls_Paned27 : Object
826 private ValaProjectSettingsPopover _this;
832 public Xcls_Paned27(ValaProjectSettingsPopover _owner )
835 this.el = new Gtk.Paned( Gtk.Orientation.HORIZONTAL );
839 // set gobject values
840 this.el.vexpand = true;
841 this.el.position = 300;
842 new Xcls_set_vbox( _this );
843 this.el.set_end_child ( _this.set_vbox.el );
844 var child_2 = new Xcls_Box44( _this );
845 this.el.start_child = child_2.el;
848 // user defined functions
850 public class Xcls_set_vbox : Object
853 private ValaProjectSettingsPopover _this;
859 public Xcls_set_vbox(ValaProjectSettingsPopover _owner )
862 _this.set_vbox = this;
863 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
867 // set gobject values
868 this.el.homogeneous = false;
869 var child_1 = new Xcls_ScrolledWindow29( _this );
871 this.el.append( child_1.el );
874 // user defined functions
876 public class Xcls_ScrolledWindow29 : Object
878 public Gtk.ScrolledWindow el;
879 private ValaProjectSettingsPopover _this;
885 public Xcls_ScrolledWindow29(ValaProjectSettingsPopover _owner )
888 this.el = new Gtk.ScrolledWindow();
892 // set gobject values
893 this.el.vexpand = true;
894 new Xcls_treeview( _this );
895 this.el.child = _this.treeview.el;
898 // user defined functions
900 public class Xcls_treeview : Object
902 public Gtk.ColumnView el;
903 private ValaProjectSettingsPopover _this;
909 public Xcls_treeview(ValaProjectSettingsPopover _owner )
912 _this.treeview = this;
913 new Xcls_treeselmodel( _this );
914 this.el = new Gtk.ColumnView( _this.treeselmodel.el );
918 // set gobject values
919 new Xcls_name( _this );
920 this.el.append_column ( _this.name.el );
921 var child_3 = new Xcls_ColumnViewColumn42( _this );
923 this.el.append_column ( child_3.el );
926 // user defined functions
928 public class Xcls_treeselmodel : Object
930 public Gtk.SingleSelection el;
931 private ValaProjectSettingsPopover _this;
937 public Xcls_treeselmodel(ValaProjectSettingsPopover _owner )
940 _this.treeselmodel = this;
941 var child_1 = new Xcls_FilterListModel32( _this );
943 this.el = new Gtk.SingleSelection( child_1.el );
947 // set gobject values
950 // user defined functions
952 public class Xcls_FilterListModel32 : Object
954 public Gtk.FilterListModel el;
955 private ValaProjectSettingsPopover _this;
961 public Xcls_FilterListModel32(ValaProjectSettingsPopover _owner )
964 new Xcls_treelistsort( _this );
965 var child_2 = new Xcls_CustomFilter39( _this );
967 this.el = new Gtk.FilterListModel( _this.treelistsort.el, child_2.el );
971 // set gobject values
974 // user defined functions
976 public class Xcls_treelistsort : Object
978 public Gtk.SortListModel el;
979 private ValaProjectSettingsPopover _this;
985 public Xcls_treelistsort(ValaProjectSettingsPopover _owner )
988 _this.treelistsort = this;
989 new Xcls_treelistmodel( _this );
990 var child_2 = new Xcls_TreeListRowSorter36( _this );
992 this.el = new Gtk.SortListModel( _this.treelistmodel.el, child_2.el );
996 // set gobject values
1001 //this.el.set_sorter(new Gtk.TreeListRowSorter(_this.treeview.el.sorter));
1005 // user defined functions
1007 public class Xcls_treelistmodel : Object
1009 public Gtk.TreeListModel el;
1010 private ValaProjectSettingsPopover _this;
1016 public Xcls_treelistmodel(ValaProjectSettingsPopover _owner )
1019 _this.treelistmodel = this;
1020 new Xcls_treemodel( _this );
1021 this.el = new Gtk.TreeListModel( _this.treemodel.el, false, true, (item) => {
1022 //GLib.debug("liststore got %s", item.get_type().name());
1023 return ((JsRender.JsRender)item).childfiles;
1028 // set gobject values
1031 // user defined functions
1033 public class Xcls_treemodel : Object
1035 public GLib.ListStore el;
1036 private ValaProjectSettingsPopover _this;
1042 public Xcls_treemodel(ValaProjectSettingsPopover _owner )
1045 _this.treemodel = this;
1046 this.el = new GLib.ListStore( typeof(JsRender.JsRender) );
1050 // set gobject values
1053 // user defined functions
1057 public class Xcls_TreeListRowSorter36 : Object
1059 public Gtk.TreeListRowSorter el;
1060 private ValaProjectSettingsPopover _this;
1066 public Xcls_TreeListRowSorter36(ValaProjectSettingsPopover _owner )
1069 var child_1 = new Xcls_StringSorter37( _this );
1071 this.el = new Gtk.TreeListRowSorter( child_1.el );
1075 // set gobject values
1078 // user defined functions
1080 public class Xcls_StringSorter37 : Object
1082 public Gtk.StringSorter el;
1083 private ValaProjectSettingsPopover _this;
1089 public Xcls_StringSorter37(ValaProjectSettingsPopover _owner )
1092 var child_1 = new Xcls_PropertyExpression38( _this );
1094 this.el = new Gtk.StringSorter( child_1.el );
1098 // set gobject values
1101 // user defined functions
1103 public class Xcls_PropertyExpression38 : Object
1105 public Gtk.PropertyExpression el;
1106 private ValaProjectSettingsPopover _this;
1112 public Xcls_PropertyExpression38(ValaProjectSettingsPopover _owner )
1115 this.el = new Gtk.PropertyExpression( typeof(JsRender.JsRender), null, "name" );
1119 // set gobject values
1122 // user defined functions
1128 public class Xcls_CustomFilter39 : Object
1130 public Gtk.CustomFilter el;
1131 private ValaProjectSettingsPopover _this;
1137 public Xcls_CustomFilter39(ValaProjectSettingsPopover _owner )
1140 this.el = new Gtk.CustomFilter( (item) => {
1142 var tr = ((Gtk.TreeListRow)item).get_item();
1143 //GLib.debug("filter %s", tr.get_type().name());
1144 var j = (JsRender.JsRender) tr;
1145 if (j.xtype == "Gtk") {
1148 if (j.xtype != "Dir") {
1149 return j.path.has_suffix(".vala") || j.path.has_suffix(".c");
1153 for (var i =0 ; i < j.childfiles.n_items; i++) {
1154 var f = (JsRender.JsRender) j.childfiles.get_item(i);
1155 if (f.xtype == "Gtk") {
1158 if (f.path.has_suffix(".vala") || f.path.has_suffix(".c")) {
1168 // set gobject values
1171 // user defined functions
1176 public class Xcls_name : Object
1178 public Gtk.ColumnViewColumn el;
1179 private ValaProjectSettingsPopover _this;
1185 public Xcls_name(ValaProjectSettingsPopover _owner )
1189 var child_1 = new Xcls_SignalListItemFactory41( _this );
1191 this.el = new Gtk.ColumnViewColumn( "Other Files", child_1.el );
1195 // set gobject values
1196 this.el.id = "name";
1197 this.el.expand = true;
1198 this.el.resizable = true;
1203 this.el.set_sorter( new Gtk.StringSorter(
1204 new Gtk.PropertyExpression(typeof(JsRender.JsRender), null, "name")
1211 // user defined functions
1213 public class Xcls_SignalListItemFactory41 : Object
1215 public Gtk.SignalListItemFactory el;
1216 private ValaProjectSettingsPopover _this;
1222 public Xcls_SignalListItemFactory41(ValaProjectSettingsPopover _owner )
1225 this.el = new Gtk.SignalListItemFactory();
1229 // set gobject values
1232 this.el.setup.connect( (listitem) => {
1234 var expand = new Gtk.TreeExpander();
1236 expand.set_indent_for_depth(true);
1237 expand.set_indent_for_icon(true);
1239 var lbl = new Gtk.Label("");
1240 lbl.use_markup = true;
1243 lbl.justify = Gtk.Justification.LEFT;
1247 expand.set_child(lbl);
1248 ((Gtk.ListItem)listitem).set_child(expand);
1249 ((Gtk.ListItem)listitem).activatable = false;
1251 this.el.bind.connect( (listitem) => {
1252 //GLib.debug("listitme is is %s", ((Gtk.ListItem)listitem).get_type().name());
1256 //var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();
1257 var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();
1260 var lbl = (Gtk.Label) expand.child;
1262 if (lbl.label != "") { // do not update
1267 var lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();
1268 var jr = (JsRender.JsRender) lr.get_item();
1269 //GLib.debug("change %s to %s", lbl.label, np.name);
1270 lbl.label = jr.name; // for dir's we could hsow the sub path..
1271 lbl.tooltip_markup = jr.path;
1273 expand.set_hide_expander( jr.childfiles.n_items < 1);
1274 expand.set_list_row(lr);
1276 expand.set_hide_expander( jr.xtype != "Dir" );
1277 expand.set_list_row(lr);
1284 // user defined functions
1288 public class Xcls_ColumnViewColumn42 : Object
1290 public Gtk.ColumnViewColumn el;
1291 private ValaProjectSettingsPopover _this;
1297 public Xcls_ColumnViewColumn42(ValaProjectSettingsPopover _owner )
1300 var child_1 = new Xcls_SignalListItemFactory43( _this );
1302 this.el = new Gtk.ColumnViewColumn( "use", child_1.el );
1306 // set gobject values
1309 // user defined functions
1311 public class Xcls_SignalListItemFactory43 : Object
1313 public Gtk.SignalListItemFactory el;
1314 private ValaProjectSettingsPopover _this;
1320 public Xcls_SignalListItemFactory43(ValaProjectSettingsPopover _owner )
1323 this.el = new Gtk.SignalListItemFactory();
1327 // set gobject values
1330 this.el.setup.connect( (listitem) => {
1332 var btn = new Gtk.CheckButton();
1334 ((Gtk.ListItem)listitem).set_child(btn);
1336 btn.toggled.connect(() => {
1338 var lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();
1339 var jr = (JsRender.JsRender) lr.get_item();
1340 jr.compile_group_selected = btn.active;
1345 this.el.bind.connect( (listitem) => {
1346 //GLib.debug("listitme is is %s", ((Gtk.ListItem)listitem).get_type().name());
1350 //var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();
1351 var btn = (Gtk.CheckButton) ((Gtk.ListItem)listitem).get_child();
1354 var lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();
1355 var jr = (JsRender.JsRender) lr.get_item();
1356 //GLib.debug("change %s to %s", lbl.label, np.name);
1360 jr.bind_property("compile_group_selected",
1362 GLib.BindingFlags.SYNC_CREATE);
1368 // user defined functions
1375 public class Xcls_Box44 : Object
1378 private ValaProjectSettingsPopover _this;
1384 public Xcls_Box44(ValaProjectSettingsPopover _owner )
1387 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
1391 // set gobject values
1392 var child_1 = new Xcls_Box45( _this );
1394 this.el.append( child_1.el );
1395 var child_2 = new Xcls_ScrolledWindow48( _this );
1397 this.el.append( child_2.el );
1398 new Xcls_set_vboxb( _this );
1399 this.el.append( _this.set_vboxb.el );
1402 // user defined functions
1404 public class Xcls_Box45 : Object
1407 private ValaProjectSettingsPopover _this;
1413 public Xcls_Box45(ValaProjectSettingsPopover _owner )
1416 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
1420 // set gobject values
1421 this.el.hexpand = true;
1422 var child_1 = new Xcls_Button46( _this );
1424 this.el.append( child_1.el );
1425 var child_2 = new Xcls_Button47( _this );
1427 this.el.append( child_2.el );
1430 // user defined functions
1432 public class Xcls_Button46 : Object
1434 public Gtk.Button el;
1435 private ValaProjectSettingsPopover _this;
1441 public Xcls_Button46(ValaProjectSettingsPopover _owner )
1444 this.el = new Gtk.Button();
1448 // set gobject values
1449 this.el.hexpand = true;
1450 this.el.label = "Add Compile Target";
1453 this.el.clicked.connect( () => {
1455 if (_this.project.compilegroups.has_key("NEW GROUP")) {
1458 var cg = new Project.GtkValaSettings(_this.project, "NEW GROUP");
1459 _this.project.compilegroups.set(cg.name, cg);
1460 _this.project.loadTargetsIntoStore(_this.target_model.el);
1461 // select it.. ?? should load it??
1462 for(var i =0;i < _this.target_model.el.n_items; i++) {
1463 var ncg = (Project.GtkValaSettings) _this.target_model.el.get_item(i);
1464 if (ncg.name == cg.name) {
1465 _this.target_sel.el.selected = i;
1466 _this.target_sel.selectTarget(cg);
1476 // user defined functions
1479 public class Xcls_Button47 : Object
1481 public Gtk.Button el;
1482 private ValaProjectSettingsPopover _this;
1488 public Xcls_Button47(ValaProjectSettingsPopover _owner )
1491 this.el = new Gtk.Button();
1495 // set gobject values
1496 this.el.hexpand = true;
1497 this.el.label = "Remove Target";
1500 this.el.clicked.connect( () => {
1501 // load the new values.
1502 if (_this.target_sel.el.selected == Gtk.INVALID_LIST_POSITION) {
1503 GLib.debug("nothing selected");
1508 // add the directory..
1509 var cg = (Project.GtkValaSettings) _this.target_model.el.get_item(_this.target_sel.el.selected);
1512 GLib.debug("remove: %s\n", cg.name);
1513 if (!_this.project.compilegroups.unset(cg.name)) {
1514 GLib.debug("remove failed");
1516 _this.project.loadTargetsIntoStore(_this.target_model.el);
1520 // user defined functions
1524 public class Xcls_ScrolledWindow48 : Object
1526 public Gtk.ScrolledWindow el;
1527 private ValaProjectSettingsPopover _this;
1533 public Xcls_ScrolledWindow48(ValaProjectSettingsPopover _owner )
1536 this.el = new Gtk.ScrolledWindow();
1540 // set gobject values
1541 this.el.vexpand = true;
1542 var child_1 = new Xcls_ColumnView49( _this );
1543 this.el.child = child_1.el;
1548 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
1553 // user defined functions
1555 public class Xcls_ColumnView49 : Object
1557 public Gtk.ColumnView el;
1558 private ValaProjectSettingsPopover _this;
1564 public Xcls_ColumnView49(ValaProjectSettingsPopover _owner )
1567 new Xcls_target_sel( _this );
1568 this.el = new Gtk.ColumnView( _this.target_sel.el );
1572 // set gobject values
1573 var child_2 = new Xcls_ColumnViewColumn52( _this );
1575 this.el.append_column ( child_2.el );
1578 // user defined functions
1580 public class Xcls_target_sel : Object
1582 public Gtk.SingleSelection el;
1583 private ValaProjectSettingsPopover _this;
1589 public Xcls_target_sel(ValaProjectSettingsPopover _owner )
1592 _this.target_sel = this;
1593 new Xcls_target_model( _this );
1594 this.el = new Gtk.SingleSelection( _this.target_model.el );
1598 // set gobject values
1601 this.el.selection_changed.connect( (position, n_items) => {
1604 // load the new values.
1605 if (this.el.selected == Gtk.INVALID_LIST_POSITION) {
1606 this.selectTarget(null);
1609 this.selectTarget(null);
1613 // add the directory..
1614 var cg = (Project.GtkValaSettings) _this.target_model.el.get_item(this.el.selected);
1616 this.selectTarget(cg);
1621 // user defined functions
1622 public void selectTarget (Project.GtkValaSettings? cg) {
1623 // load the new values
1624 _this.selected_target = cg;
1625 _this.project.active_cg = cg;
1630 _this.set_vbox.el.hide();
1631 _this.set_vboxb.el.hide();
1636 _this.set_vbox.el.show();
1637 _this.set_vboxb.el.show();
1638 // add the directory..
1641 GLib.debug("loading dirs into project list");
1642 cg.loading_ui = true;
1645 _this.treeview.el.set_model(new Gtk.SingleSelection(null));
1646 _this.project.loadDirsIntoStore(_this.treemodel.el);
1647 _this.treeview.el.set_model(_this.treeselmodel.el);
1649 cg.loading_ui = false;
1650 GLib.debug("Set name to %s", cg.name);
1652 _this.build_name.el.buffer.set_text(cg.name.data);
1655 _this.build_execute_args.el.buffer.set_text( cg.execute_args.data );
1660 public class Xcls_target_model : Object
1662 public GLib.ListStore el;
1663 private ValaProjectSettingsPopover _this;
1669 public Xcls_target_model(ValaProjectSettingsPopover _owner )
1672 _this.target_model = this;
1673 this.el = new GLib.ListStore( typeof(Project.GtkValaSettings) );
1677 // set gobject values
1680 // user defined functions
1684 public class Xcls_ColumnViewColumn52 : Object
1686 public Gtk.ColumnViewColumn el;
1687 private ValaProjectSettingsPopover _this;
1693 public Xcls_ColumnViewColumn52(ValaProjectSettingsPopover _owner )
1696 var child_1 = new Xcls_SignalListItemFactory53( _this );
1698 this.el = new Gtk.ColumnViewColumn( "Build Target", child_1.el );
1702 // set gobject values
1703 this.el.expand = true;
1706 // user defined functions
1708 public class Xcls_SignalListItemFactory53 : Object
1710 public Gtk.SignalListItemFactory el;
1711 private ValaProjectSettingsPopover _this;
1717 public Xcls_SignalListItemFactory53(ValaProjectSettingsPopover _owner )
1720 this.el = new Gtk.SignalListItemFactory();
1724 // set gobject values
1727 this.el.setup.connect( (item) => {
1728 //var j = (JsRender.JsRender) item;
1729 var gi = (Gtk.ListItem)item;
1731 var lbl = new Gtk.Label("");
1732 lbl.halign = Gtk.Align.START;
1738 this.el.bind.connect( (listitem) => {
1740 var lbl = (Gtk.Box) ((Gtk.ListItem)listitem).get_child();
1742 var item = (Project.GtkValaSettings) ((Gtk.ListItem)listitem).get_item();
1744 item.bind_property("name",
1746 GLib.BindingFlags.SYNC_CREATE);
1752 // user defined functions
1758 public class Xcls_set_vboxb : Object
1761 private ValaProjectSettingsPopover _this;
1767 public Xcls_set_vboxb(ValaProjectSettingsPopover _owner )
1770 _this.set_vboxb = this;
1771 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
1775 // set gobject values
1776 var child_1 = new Xcls_Label55( _this );
1778 this.el.append( child_1.el );
1779 new Xcls_build_name( _this );
1780 this.el.append( _this.build_name.el );
1781 var child_3 = new Xcls_Label57( _this );
1783 this.el.append( child_3.el );
1784 new Xcls_build_execute_args( _this );
1785 this.el.append( _this.build_execute_args.el );
1788 // user defined functions
1790 public class Xcls_Label55 : Object
1792 public Gtk.Label el;
1793 private ValaProjectSettingsPopover _this;
1799 public Xcls_Label55(ValaProjectSettingsPopover _owner )
1802 this.el = new Gtk.Label( "Build Name (executable name)" );
1806 // set gobject values
1809 // user defined functions
1812 public class Xcls_build_name : Object
1814 public Gtk.Entry el;
1815 private ValaProjectSettingsPopover _this;
1821 public Xcls_build_name(ValaProjectSettingsPopover _owner )
1824 _this.build_name = this;
1825 this.el = new Gtk.Entry();
1829 // set gobject values
1832 this.el.changed.connect( () => {
1833 if (_this.selected_target == null) {
1836 var name = this.el.text;
1837 // name ischanging.. probably always..
1838 if (_this.selected_target.name != name) {
1839 _this.project.compilegroups.unset(_this.selected_target.name);
1840 _this.project.compilegroups.set(name, _this.selected_target);
1843 _this.selected_target.name = this.el.buffer.text;
1847 // user defined functions
1850 public class Xcls_Label57 : Object
1852 public Gtk.Label el;
1853 private ValaProjectSettingsPopover _this;
1859 public Xcls_Label57(ValaProjectSettingsPopover _owner )
1862 this.el = new Gtk.Label( "test argments - when run after a build" );
1866 // set gobject values
1869 // user defined functions
1872 public class Xcls_build_execute_args : Object
1874 public Gtk.Entry el;
1875 private ValaProjectSettingsPopover _this;
1881 public Xcls_build_execute_args(ValaProjectSettingsPopover _owner )
1884 _this.build_execute_args = this;
1885 this.el = new Gtk.Entry();
1889 // set gobject values
1890 this.el.placeholder_text = "eg. -f somefile -g ";
1893 this.el.changed.connect( () => {
1894 if (_this.selected_target == null) {
1897 _this.selected_target.execute_args = this.el.buffer.text;
1902 // user defined functions
1909 public class Xcls_Box59 : Object
1912 private ValaProjectSettingsPopover _this;
1918 public Xcls_Box59(ValaProjectSettingsPopover _owner )
1921 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
1925 // set gobject values
1926 this.el.margin_end = 4;
1927 this.el.margin_start = 4;
1928 this.el.hexpand = true;
1929 this.el.margin_bottom = 4;
1930 this.el.margin_top = 4;
1931 var child_1 = new Xcls_Button60( _this );
1933 this.el.append( child_1.el );
1934 var child_2 = new Xcls_Label61( _this );
1936 this.el.append( child_2.el );
1937 new Xcls_save_btn( _this );
1938 this.el.append( _this.save_btn.el );
1941 // user defined functions
1943 public class Xcls_Button60 : Object
1945 public Gtk.Button el;
1946 private ValaProjectSettingsPopover _this;
1952 public Xcls_Button60(ValaProjectSettingsPopover _owner )
1955 this.el = new Gtk.Button();
1959 // set gobject values
1960 this.el.label = "Cancel";
1963 this.el.clicked.connect( () => {
1970 // user defined functions
1973 public class Xcls_Label61 : Object
1975 public Gtk.Label el;
1976 private ValaProjectSettingsPopover _this;
1982 public Xcls_Label61(ValaProjectSettingsPopover _owner )
1985 this.el = new Gtk.Label( "" );
1989 // set gobject values
1990 this.el.hexpand = true;
1993 // user defined functions
1996 public class Xcls_save_btn : Object
1998 public Gtk.Button el;
1999 private ValaProjectSettingsPopover _this;
2005 public Xcls_save_btn(ValaProjectSettingsPopover _owner )
2008 _this.save_btn = this;
2009 this.el = new Gtk.Button();
2013 // set gobject values
2014 this.el.css_classes = { "suggested-action" };
2015 this.el.label = "Save";
2018 this.el.clicked.connect( ( ) => {
2021 _this.project.save();
2027 // hopefull this will work with bjs files..
2034 // user defined functions