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 Xcls_MainWindow window;
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();
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, 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;
144 var child_2 = new Xcls_Button4( _this );
146 this.el.pack_end ( child_2.el );
149 // user defined functions
151 public class Xcls_Label3 : Object
154 private ValaProjectSettingsPopover _this;
160 public Xcls_Label3(ValaProjectSettingsPopover _owner )
163 this.el = new Gtk.Label( "Change Vala Compile settings" );
167 // set gobject values
170 // user defined functions
173 public class Xcls_Button4 : Object
175 public Gtk.Button el;
176 private ValaProjectSettingsPopover _this;
182 public Xcls_Button4(ValaProjectSettingsPopover _owner )
185 this.el = new Gtk.Button();
189 // set gobject values
190 this.el.icon_name = "";
191 this.el.label = "Create / Recreate Build files (configure.ac / makefile.am etc)";
194 // user defined functions
198 public class Xcls_Box5 : Object
201 private ValaProjectSettingsPopover _this;
207 public Xcls_Box5(ValaProjectSettingsPopover _owner )
210 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
214 // set gobject values
215 this.el.hexpand = true;
216 this.el.vexpand = true;
217 new Xcls_notebook( _this );
218 this.el.append( _this.notebook.el );
219 var child_2 = new Xcls_Box59( _this );
221 this.el.append( child_2.el );
224 // user defined functions
226 public class Xcls_notebook : Object
228 public Gtk.Notebook el;
229 private ValaProjectSettingsPopover _this;
235 public Xcls_notebook(ValaProjectSettingsPopover _owner )
238 _this.notebook = this;
239 this.el = new Gtk.Notebook();
243 // set gobject values
244 this.el.vexpand = true;
245 new Xcls_label_global( _this );
246 new Xcls_label_targets( _this );
247 var child_3 = new Xcls_Box9( _this );
249 this.el.append_page ( child_3.el , _this.label_global.el );
250 var child_4 = new Xcls_Paned27( _this );
252 this.el.append_page ( child_4.el , _this.label_targets.el );
255 // user defined functions
257 public class Xcls_label_global : Object
260 private ValaProjectSettingsPopover _this;
266 public Xcls_label_global(ValaProjectSettingsPopover _owner )
269 _this.label_global = this;
270 this.el = new Gtk.Label( "Global" );
274 // set gobject values
277 // user defined functions
280 public class Xcls_label_targets : Object
283 private ValaProjectSettingsPopover _this;
289 public Xcls_label_targets(ValaProjectSettingsPopover _owner )
292 _this.label_targets = this;
293 this.el = new Gtk.Label( "Targets" );
297 // set gobject values
300 // user defined functions
303 public class Xcls_Box9 : Object
306 private ValaProjectSettingsPopover _this;
312 public Xcls_Box9(ValaProjectSettingsPopover _owner )
315 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
319 // set gobject values
320 this.el.homogeneous = false;
321 var child_1 = new Xcls_Label10( _this );
323 this.el.append( child_1.el );
324 new Xcls_compile_flags( _this );
325 this.el.append( _this.compile_flags.el );
326 new Xcls_vapi_scroll( _this );
327 this.el.append( _this.vapi_scroll.el );
328 new Xcls_vapi_search( _this );
329 this.el.append( _this.vapi_search.el );
332 // user defined functions
334 public class Xcls_Label10 : Object
337 private ValaProjectSettingsPopover _this;
343 public Xcls_Label10(ValaProjectSettingsPopover _owner )
346 this.el = new Gtk.Label( "compile flags" );
350 // set gobject values
351 this.el.halign = Gtk.Align.START;
352 this.el.hexpand = true;
355 // user defined functions
358 public class Xcls_compile_flags : Object
361 private ValaProjectSettingsPopover _this;
367 public Xcls_compile_flags(ValaProjectSettingsPopover _owner )
370 _this.compile_flags = this;
371 this.el = new Gtk.Entry();
375 // set gobject values
376 this.el.placeholder_text = "eg. -g --valasrc $BASEDIR ";
379 this.el.changed.connect( () => {
381 _this.project.compile_flags = this.el.buffer.text;
382 _this.project.save();
383 // _this.project.save();
388 // user defined functions
391 public class Xcls_vapi_scroll : Object
393 public Gtk.ScrolledWindow el;
394 private ValaProjectSettingsPopover _this;
400 public Xcls_vapi_scroll(ValaProjectSettingsPopover _owner )
403 _this.vapi_scroll = this;
404 this.el = new Gtk.ScrolledWindow();
408 // set gobject values
409 this.el.vscrollbar_policy = Gtk.PolicyType.AUTOMATIC;
410 this.el.has_frame = true;
411 this.el.hexpand = true;
412 this.el.vexpand = true;
413 this.el.hscrollbar_policy = Gtk.PolicyType.AUTOMATIC;
414 var child_1 = new Xcls_ColumnView13( _this );
415 this.el.child = child_1.el;
418 // user defined functions
420 public class Xcls_ColumnView13 : Object
422 public Gtk.ColumnView el;
423 private ValaProjectSettingsPopover _this;
429 public Xcls_ColumnView13(ValaProjectSettingsPopover _owner )
432 var child_1 = new Xcls_NoSelection14( _this );
434 this.el = new Gtk.ColumnView( child_1.el );
438 // set gobject values
439 var child_2 = new Xcls_ColumnViewColumn22( _this );
441 this.el.append_column ( child_2.el );
442 var child_3 = new Xcls_ColumnViewColumn24( _this );
444 this.el.append_column ( child_3.el );
447 // user defined functions
449 public class Xcls_NoSelection14 : Object
451 public Gtk.NoSelection el;
452 private ValaProjectSettingsPopover _this;
458 public Xcls_NoSelection14(ValaProjectSettingsPopover _owner )
461 var child_1 = new Xcls_FilterListModel15( _this );
463 this.el = new Gtk.NoSelection( child_1.el );
467 // set gobject values
470 // user defined functions
472 public class Xcls_FilterListModel15 : Object
474 public Gtk.FilterListModel el;
475 private ValaProjectSettingsPopover _this;
481 public Xcls_FilterListModel15(ValaProjectSettingsPopover _owner )
484 var child_1 = new Xcls_SortListModel16( _this );
486 new Xcls_vapi_filter( _this );
487 this.el = new Gtk.FilterListModel( child_1.el, _this.vapi_filter.el );
491 // set gobject values
494 // user defined functions
496 public class Xcls_SortListModel16 : Object
498 public Gtk.SortListModel el;
499 private ValaProjectSettingsPopover _this;
505 public Xcls_SortListModel16(ValaProjectSettingsPopover _owner )
508 new Xcls_vapimodel( _this );
509 var child_2 = new Xcls_StringSorter18( _this );
511 this.el = new Gtk.SortListModel( _this.vapimodel.el, child_2.el );
515 // set gobject values
518 // user defined functions
520 public class Xcls_vapimodel : Object
522 public GLib.ListStore el;
523 private ValaProjectSettingsPopover _this;
529 public Xcls_vapimodel(ValaProjectSettingsPopover _owner )
532 _this.vapimodel = this;
533 this.el = new GLib.ListStore( typeof(Project.VapiSelection) );
537 // set gobject values
540 // user defined functions
543 public class Xcls_StringSorter18 : Object
545 public Gtk.StringSorter el;
546 private ValaProjectSettingsPopover _this;
552 public Xcls_StringSorter18(ValaProjectSettingsPopover _owner )
555 var child_1 = new Xcls_PropertyExpression19( _this );
557 this.el = new Gtk.StringSorter( child_1.el );
561 // set gobject values
564 // user defined functions
566 public class Xcls_PropertyExpression19 : Object
568 public Gtk.PropertyExpression el;
569 private ValaProjectSettingsPopover _this;
575 public Xcls_PropertyExpression19(ValaProjectSettingsPopover _owner )
578 this.el = new Gtk.PropertyExpression( typeof(Project.VapiSelection), null, "sortkey" );
582 // set gobject values
585 // user defined functions
590 public class Xcls_vapi_filter : Object
592 public Gtk.StringFilter el;
593 private ValaProjectSettingsPopover _this;
599 public Xcls_vapi_filter(ValaProjectSettingsPopover _owner )
602 _this.vapi_filter = this;
603 var child_1 = new Xcls_PropertyExpression21( _this );
605 this.el = new Gtk.StringFilter( child_1.el );
609 // set gobject values
612 // user defined functions
614 public class Xcls_PropertyExpression21 : Object
616 public Gtk.PropertyExpression el;
617 private ValaProjectSettingsPopover _this;
623 public Xcls_PropertyExpression21(ValaProjectSettingsPopover _owner )
626 this.el = new Gtk.PropertyExpression( typeof(Project.VapiSelection), null, "sortkey" );
630 // set gobject values
633 // user defined functions
639 public class Xcls_ColumnViewColumn22 : Object
641 public Gtk.ColumnViewColumn el;
642 private ValaProjectSettingsPopover _this;
648 public Xcls_ColumnViewColumn22(ValaProjectSettingsPopover _owner )
651 var child_1 = new Xcls_SignalListItemFactory23( _this );
653 this.el = new Gtk.ColumnViewColumn( "Vapi Package", child_1.el );
657 // set gobject values
658 this.el.expand = true;
661 // user defined functions
663 public class Xcls_SignalListItemFactory23 : Object
665 public Gtk.SignalListItemFactory el;
666 private ValaProjectSettingsPopover _this;
672 public Xcls_SignalListItemFactory23(ValaProjectSettingsPopover _owner )
675 this.el = new Gtk.SignalListItemFactory();
679 // set gobject values
682 this.el.setup.connect( (item) => {
683 //var j = (JsRender.JsRender) item;
684 var gi = (Gtk.ListItem)item;
686 var lbl = new Gtk.Label("");
687 lbl.halign = Gtk.Align.START;
693 this.el.bind.connect( (listitem) => {
695 var lbl = (Gtk.Box) ((Gtk.ListItem)listitem).get_child();
697 var item = (Project.VapiSelection) ((Gtk.ListItem)listitem).get_item();
699 item.bind_property("name",
701 GLib.BindingFlags.SYNC_CREATE);
707 // user defined functions
711 public class Xcls_ColumnViewColumn24 : Object
713 public Gtk.ColumnViewColumn el;
714 private ValaProjectSettingsPopover _this;
720 public Xcls_ColumnViewColumn24(ValaProjectSettingsPopover _owner )
723 var child_1 = new Xcls_SignalListItemFactory25( _this );
725 this.el = new Gtk.ColumnViewColumn( "use", child_1.el );
729 // set gobject values
732 // user defined functions
734 public class Xcls_SignalListItemFactory25 : Object
736 public Gtk.SignalListItemFactory el;
737 private ValaProjectSettingsPopover _this;
743 public Xcls_SignalListItemFactory25(ValaProjectSettingsPopover _owner )
746 this.el = new Gtk.SignalListItemFactory();
750 // set gobject values
753 this.el.setup.connect( (listitem) => {
755 var btn = new Gtk.CheckButton();
757 ((Gtk.ListItem)listitem).set_child(btn);
759 btn.toggled.connect(() => {
761 var jr = (Project.VapiSelection) ((Gtk.ListItem)listitem).get_item();
762 jr.selected = btn.active;
765 this.el.bind.connect( (listitem) => {
766 //GLib.debug("listitme is is %s", ((Gtk.ListItem)listitem).get_type().name());
770 //var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();
771 var btn = (Gtk.CheckButton) ((Gtk.ListItem)listitem).get_child();
774 var vs = (Project.VapiSelection)((Gtk.ListItem)listitem).get_item();
776 //GLib.debug("change %s to %s", lbl.label, np.name);
778 btn.active = vs.selected;
786 // user defined functions
792 public class Xcls_vapi_search : Object
794 public Gtk.SearchEntry el;
795 private ValaProjectSettingsPopover _this;
801 public Xcls_vapi_search(ValaProjectSettingsPopover _owner )
804 _this.vapi_search = this;
805 this.el = new Gtk.SearchEntry();
809 // set gobject values
810 this.el.placeholder_text = "Search Libraries (Vapi)";
811 this.el.search_delay = 500;
814 this.el.search_changed.connect( ( ) => {
816 _this.vapi_filter.el.set_search(this.el.get_text());
821 // user defined functions
825 public class Xcls_Paned27 : Object
828 private ValaProjectSettingsPopover _this;
834 public Xcls_Paned27(ValaProjectSettingsPopover _owner )
837 this.el = new Gtk.Paned( Gtk.Orientation.HORIZONTAL );
841 // set gobject values
842 this.el.vexpand = true;
843 this.el.position = 300;
844 new Xcls_set_vbox( _this );
845 this.el.set_end_child ( _this.set_vbox.el );
846 var child_2 = new Xcls_Box44( _this );
847 this.el.start_child = child_2.el;
850 // user defined functions
852 public class Xcls_set_vbox : Object
855 private ValaProjectSettingsPopover _this;
861 public Xcls_set_vbox(ValaProjectSettingsPopover _owner )
864 _this.set_vbox = this;
865 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
869 // set gobject values
870 this.el.homogeneous = false;
871 var child_1 = new Xcls_ScrolledWindow29( _this );
873 this.el.append( child_1.el );
876 // user defined functions
878 public class Xcls_ScrolledWindow29 : Object
880 public Gtk.ScrolledWindow el;
881 private ValaProjectSettingsPopover _this;
887 public Xcls_ScrolledWindow29(ValaProjectSettingsPopover _owner )
890 this.el = new Gtk.ScrolledWindow();
894 // set gobject values
895 this.el.vexpand = true;
896 new Xcls_treeview( _this );
897 this.el.child = _this.treeview.el;
900 // user defined functions
902 public class Xcls_treeview : Object
904 public Gtk.ColumnView el;
905 private ValaProjectSettingsPopover _this;
911 public Xcls_treeview(ValaProjectSettingsPopover _owner )
914 _this.treeview = this;
915 new Xcls_treeselmodel( _this );
916 this.el = new Gtk.ColumnView( _this.treeselmodel.el );
920 // set gobject values
921 new Xcls_name( _this );
922 this.el.append_column ( _this.name.el );
923 var child_3 = new Xcls_ColumnViewColumn42( _this );
925 this.el.append_column ( child_3.el );
928 // user defined functions
930 public class Xcls_treeselmodel : Object
932 public Gtk.SingleSelection el;
933 private ValaProjectSettingsPopover _this;
939 public Xcls_treeselmodel(ValaProjectSettingsPopover _owner )
942 _this.treeselmodel = this;
943 var child_1 = new Xcls_FilterListModel32( _this );
945 this.el = new Gtk.SingleSelection( child_1.el );
949 // set gobject values
952 // user defined functions
954 public class Xcls_FilterListModel32 : Object
956 public Gtk.FilterListModel el;
957 private ValaProjectSettingsPopover _this;
963 public Xcls_FilterListModel32(ValaProjectSettingsPopover _owner )
966 new Xcls_treelistsort( _this );
967 var child_2 = new Xcls_CustomFilter39( _this );
969 this.el = new Gtk.FilterListModel( _this.treelistsort.el, child_2.el );
973 // set gobject values
976 // user defined functions
978 public class Xcls_treelistsort : Object
980 public Gtk.SortListModel el;
981 private ValaProjectSettingsPopover _this;
987 public Xcls_treelistsort(ValaProjectSettingsPopover _owner )
990 _this.treelistsort = this;
991 new Xcls_treelistmodel( _this );
992 var child_2 = new Xcls_TreeListRowSorter36( _this );
994 this.el = new Gtk.SortListModel( _this.treelistmodel.el, child_2.el );
998 // set gobject values
1003 //this.el.set_sorter(new Gtk.TreeListRowSorter(_this.treeview.el.sorter));
1007 // user defined functions
1009 public class Xcls_treelistmodel : Object
1011 public Gtk.TreeListModel el;
1012 private ValaProjectSettingsPopover _this;
1018 public Xcls_treelistmodel(ValaProjectSettingsPopover _owner )
1021 _this.treelistmodel = this;
1022 new Xcls_treemodel( _this );
1023 this.el = new Gtk.TreeListModel( _this.treemodel.el, false, true, (item) => {
1024 //GLib.debug("liststore got %s", item.get_type().name());
1025 return ((JsRender.JsRender)item).childfiles;
1030 // set gobject values
1033 // user defined functions
1035 public class Xcls_treemodel : Object
1037 public GLib.ListStore el;
1038 private ValaProjectSettingsPopover _this;
1044 public Xcls_treemodel(ValaProjectSettingsPopover _owner )
1047 _this.treemodel = this;
1048 this.el = new GLib.ListStore( typeof(JsRender.JsRender) );
1052 // set gobject values
1055 // user defined functions
1059 public class Xcls_TreeListRowSorter36 : Object
1061 public Gtk.TreeListRowSorter el;
1062 private ValaProjectSettingsPopover _this;
1068 public Xcls_TreeListRowSorter36(ValaProjectSettingsPopover _owner )
1071 var child_1 = new Xcls_StringSorter37( _this );
1073 this.el = new Gtk.TreeListRowSorter( child_1.el );
1077 // set gobject values
1080 // user defined functions
1082 public class Xcls_StringSorter37 : Object
1084 public Gtk.StringSorter el;
1085 private ValaProjectSettingsPopover _this;
1091 public Xcls_StringSorter37(ValaProjectSettingsPopover _owner )
1094 var child_1 = new Xcls_PropertyExpression38( _this );
1096 this.el = new Gtk.StringSorter( child_1.el );
1100 // set gobject values
1103 // user defined functions
1105 public class Xcls_PropertyExpression38 : Object
1107 public Gtk.PropertyExpression el;
1108 private ValaProjectSettingsPopover _this;
1114 public Xcls_PropertyExpression38(ValaProjectSettingsPopover _owner )
1117 this.el = new Gtk.PropertyExpression( typeof(JsRender.JsRender), null, "name" );
1121 // set gobject values
1124 // user defined functions
1130 public class Xcls_CustomFilter39 : Object
1132 public Gtk.CustomFilter el;
1133 private ValaProjectSettingsPopover _this;
1139 public Xcls_CustomFilter39(ValaProjectSettingsPopover _owner )
1142 this.el = new Gtk.CustomFilter( (item) => {
1144 var tr = ((Gtk.TreeListRow)item).get_item();
1145 //GLib.debug("filter %s", tr.get_type().name());
1146 var j = (JsRender.JsRender) tr;
1147 if (j.xtype == "Gtk") {
1150 if (j.xtype != "Dir") {
1151 return j.path.has_suffix(".vala") || j.path.has_suffix(".c");
1155 for (var i =0 ; i < j.childfiles.n_items; i++) {
1156 var f = (JsRender.JsRender) j.childfiles.get_item(i);
1157 if (f.xtype == "Gtk") {
1160 if (f.path.has_suffix(".vala") || f.path.has_suffix(".c")) {
1170 // set gobject values
1173 // user defined functions
1178 public class Xcls_name : Object
1180 public Gtk.ColumnViewColumn el;
1181 private ValaProjectSettingsPopover _this;
1187 public Xcls_name(ValaProjectSettingsPopover _owner )
1191 var child_1 = new Xcls_SignalListItemFactory41( _this );
1193 this.el = new Gtk.ColumnViewColumn( "Other Files", child_1.el );
1197 // set gobject values
1198 this.el.id = "name";
1199 this.el.expand = true;
1200 this.el.resizable = true;
1205 this.el.set_sorter( new Gtk.StringSorter(
1206 new Gtk.PropertyExpression(typeof(JsRender.JsRender), null, "name")
1213 // user defined functions
1215 public class Xcls_SignalListItemFactory41 : Object
1217 public Gtk.SignalListItemFactory el;
1218 private ValaProjectSettingsPopover _this;
1224 public Xcls_SignalListItemFactory41(ValaProjectSettingsPopover _owner )
1227 this.el = new Gtk.SignalListItemFactory();
1231 // set gobject values
1234 this.el.setup.connect( (listitem) => {
1236 var expand = new Gtk.TreeExpander();
1238 expand.set_indent_for_depth(true);
1239 expand.set_indent_for_icon(true);
1241 var lbl = new Gtk.Label("");
1242 lbl.use_markup = true;
1245 lbl.justify = Gtk.Justification.LEFT;
1249 expand.set_child(lbl);
1250 ((Gtk.ListItem)listitem).set_child(expand);
1251 ((Gtk.ListItem)listitem).activatable = false;
1253 this.el.bind.connect( (listitem) => {
1254 //GLib.debug("listitme is is %s", ((Gtk.ListItem)listitem).get_type().name());
1258 //var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();
1259 var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();
1262 var lbl = (Gtk.Label) expand.child;
1264 if (lbl.label != "") { // do not update
1269 var lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();
1270 var jr = (JsRender.JsRender) lr.get_item();
1271 //GLib.debug("change %s to %s", lbl.label, np.name);
1272 lbl.label = jr.name; // for dir's we could hsow the sub path..
1273 lbl.tooltip_markup = jr.path;
1275 expand.set_hide_expander( jr.childfiles.n_items < 1);
1276 expand.set_list_row(lr);
1278 expand.set_hide_expander( jr.xtype != "Dir" );
1279 expand.set_list_row(lr);
1286 // user defined functions
1290 public class Xcls_ColumnViewColumn42 : Object
1292 public Gtk.ColumnViewColumn el;
1293 private ValaProjectSettingsPopover _this;
1299 public Xcls_ColumnViewColumn42(ValaProjectSettingsPopover _owner )
1302 var child_1 = new Xcls_SignalListItemFactory43( _this );
1304 this.el = new Gtk.ColumnViewColumn( "use", child_1.el );
1308 // set gobject values
1311 // user defined functions
1313 public class Xcls_SignalListItemFactory43 : Object
1315 public Gtk.SignalListItemFactory el;
1316 private ValaProjectSettingsPopover _this;
1322 public Xcls_SignalListItemFactory43(ValaProjectSettingsPopover _owner )
1325 this.el = new Gtk.SignalListItemFactory();
1329 // set gobject values
1332 this.el.setup.connect( (listitem) => {
1334 var btn = new Gtk.CheckButton();
1336 ((Gtk.ListItem)listitem).set_child(btn);
1338 btn.toggled.connect(() => {
1340 var lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();
1341 var jr = (JsRender.JsRender) lr.get_item();
1342 jr.compile_group_selected = btn.active;
1347 this.el.bind.connect( (listitem) => {
1348 //GLib.debug("listitme is is %s", ((Gtk.ListItem)listitem).get_type().name());
1352 //var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();
1353 var btn = (Gtk.CheckButton) ((Gtk.ListItem)listitem).get_child();
1356 var lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();
1357 var jr = (JsRender.JsRender) lr.get_item();
1358 //GLib.debug("change %s to %s", lbl.label, np.name);
1362 jr.bind_property("compile_group_selected",
1364 GLib.BindingFlags.SYNC_CREATE);
1370 // user defined functions
1377 public class Xcls_Box44 : Object
1380 private ValaProjectSettingsPopover _this;
1386 public Xcls_Box44(ValaProjectSettingsPopover _owner )
1389 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
1393 // set gobject values
1394 var child_1 = new Xcls_Box45( _this );
1396 this.el.append( child_1.el );
1397 var child_2 = new Xcls_ScrolledWindow48( _this );
1399 this.el.append( child_2.el );
1400 new Xcls_set_vboxb( _this );
1401 this.el.append( _this.set_vboxb.el );
1404 // user defined functions
1406 public class Xcls_Box45 : Object
1409 private ValaProjectSettingsPopover _this;
1415 public Xcls_Box45(ValaProjectSettingsPopover _owner )
1418 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
1422 // set gobject values
1423 this.el.hexpand = true;
1424 var child_1 = new Xcls_Button46( _this );
1426 this.el.append( child_1.el );
1427 var child_2 = new Xcls_Button47( _this );
1429 this.el.append( child_2.el );
1432 // user defined functions
1434 public class Xcls_Button46 : Object
1436 public Gtk.Button el;
1437 private ValaProjectSettingsPopover _this;
1443 public Xcls_Button46(ValaProjectSettingsPopover _owner )
1446 this.el = new Gtk.Button();
1450 // set gobject values
1451 this.el.hexpand = true;
1452 this.el.label = "Add Compile Target";
1455 this.el.clicked.connect( () => {
1457 if (_this.project.compilegroups.has_key("NEW GROUP")) {
1460 var cg = new Project.GtkValaSettings(_this.project, "NEW GROUP");
1461 _this.project.compilegroups.set(cg.name, cg);
1462 _this.project.loadTargetsIntoStore(_this.target_model.el);
1463 // select it.. ?? should load it??
1464 for(var i =0;i < _this.target_model.el.n_items; i++) {
1465 var ncg = (Project.GtkValaSettings) _this.target_model.el.get_item(i);
1466 if (ncg.name == cg.name) {
1467 _this.target_sel.el.selected = i;
1468 _this.target_sel.selectTarget(cg);
1478 // user defined functions
1481 public class Xcls_Button47 : Object
1483 public Gtk.Button el;
1484 private ValaProjectSettingsPopover _this;
1490 public Xcls_Button47(ValaProjectSettingsPopover _owner )
1493 this.el = new Gtk.Button();
1497 // set gobject values
1498 this.el.hexpand = true;
1499 this.el.label = "Remove Target";
1502 this.el.clicked.connect( () => {
1503 // load the new values.
1504 if (_this.target_sel.el.selected == Gtk.INVALID_LIST_POSITION) {
1505 GLib.debug("nothing selected");
1510 // add the directory..
1511 var cg = (Project.GtkValaSettings) _this.target_model.el.get_item(_this.target_sel.el.selected);
1514 GLib.debug("remove: %s\n", cg.name);
1515 if (!_this.project.compilegroups.unset(cg.name)) {
1516 GLib.debug("remove failed");
1518 _this.project.loadTargetsIntoStore(_this.target_model.el);
1522 // user defined functions
1526 public class Xcls_ScrolledWindow48 : Object
1528 public Gtk.ScrolledWindow el;
1529 private ValaProjectSettingsPopover _this;
1535 public Xcls_ScrolledWindow48(ValaProjectSettingsPopover _owner )
1538 this.el = new Gtk.ScrolledWindow();
1542 // set gobject values
1543 this.el.vexpand = true;
1544 var child_1 = new Xcls_ColumnView49( _this );
1545 this.el.child = child_1.el;
1550 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
1555 // user defined functions
1557 public class Xcls_ColumnView49 : Object
1559 public Gtk.ColumnView el;
1560 private ValaProjectSettingsPopover _this;
1566 public Xcls_ColumnView49(ValaProjectSettingsPopover _owner )
1569 new Xcls_target_sel( _this );
1570 this.el = new Gtk.ColumnView( _this.target_sel.el );
1574 // set gobject values
1575 var child_2 = new Xcls_ColumnViewColumn52( _this );
1577 this.el.append_column ( child_2.el );
1580 // user defined functions
1582 public class Xcls_target_sel : Object
1584 public Gtk.SingleSelection el;
1585 private ValaProjectSettingsPopover _this;
1591 public Xcls_target_sel(ValaProjectSettingsPopover _owner )
1594 _this.target_sel = this;
1595 new Xcls_target_model( _this );
1596 this.el = new Gtk.SingleSelection( _this.target_model.el );
1600 // set gobject values
1603 this.el.selection_changed.connect( (position, n_items) => {
1606 // load the new values.
1607 if (this.el.selected == Gtk.INVALID_LIST_POSITION) {
1608 this.selectTarget(null);
1611 this.selectTarget(null);
1615 // add the directory..
1616 var cg = (Project.GtkValaSettings) _this.target_model.el.get_item(this.el.selected);
1618 this.selectTarget(cg);
1623 // user defined functions
1624 public void selectTarget (Project.GtkValaSettings? cg) {
1625 // load the new values
1626 _this.selected_target = cg;
1627 _this.project.active_cg = cg;
1632 _this.set_vbox.el.hide();
1633 _this.set_vboxb.el.hide();
1638 _this.set_vbox.el.show();
1639 _this.set_vboxb.el.show();
1640 // add the directory..
1643 GLib.debug("loading dirs into project list");
1644 cg.loading_ui = true;
1647 _this.treeview.el.set_model(new Gtk.SingleSelection(null));
1648 _this.project.loadDirsIntoStore(_this.treemodel.el);
1649 _this.treeview.el.set_model(_this.treeselmodel.el);
1651 cg.loading_ui = false;
1652 GLib.debug("Set name to %s", cg.name);
1654 _this.build_name.el.buffer.set_text(cg.name.data);
1657 _this.build_execute_args.el.buffer.set_text( cg.execute_args.data );
1662 public class Xcls_target_model : Object
1664 public GLib.ListStore el;
1665 private ValaProjectSettingsPopover _this;
1671 public Xcls_target_model(ValaProjectSettingsPopover _owner )
1674 _this.target_model = this;
1675 this.el = new GLib.ListStore( typeof(Project.GtkValaSettings) );
1679 // set gobject values
1682 // user defined functions
1686 public class Xcls_ColumnViewColumn52 : Object
1688 public Gtk.ColumnViewColumn el;
1689 private ValaProjectSettingsPopover _this;
1695 public Xcls_ColumnViewColumn52(ValaProjectSettingsPopover _owner )
1698 var child_1 = new Xcls_SignalListItemFactory53( _this );
1700 this.el = new Gtk.ColumnViewColumn( "Build Target", child_1.el );
1704 // set gobject values
1705 this.el.expand = true;
1708 // user defined functions
1710 public class Xcls_SignalListItemFactory53 : Object
1712 public Gtk.SignalListItemFactory el;
1713 private ValaProjectSettingsPopover _this;
1719 public Xcls_SignalListItemFactory53(ValaProjectSettingsPopover _owner )
1722 this.el = new Gtk.SignalListItemFactory();
1726 // set gobject values
1729 this.el.setup.connect( (item) => {
1730 //var j = (JsRender.JsRender) item;
1731 var gi = (Gtk.ListItem)item;
1733 var lbl = new Gtk.Label("");
1734 lbl.halign = Gtk.Align.START;
1740 this.el.bind.connect( (listitem) => {
1742 var lbl = (Gtk.Box) ((Gtk.ListItem)listitem).get_child();
1744 var item = (Project.GtkValaSettings) ((Gtk.ListItem)listitem).get_item();
1746 item.bind_property("name",
1748 GLib.BindingFlags.SYNC_CREATE);
1754 // user defined functions
1760 public class Xcls_set_vboxb : Object
1763 private ValaProjectSettingsPopover _this;
1769 public Xcls_set_vboxb(ValaProjectSettingsPopover _owner )
1772 _this.set_vboxb = this;
1773 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
1777 // set gobject values
1778 var child_1 = new Xcls_Label55( _this );
1780 this.el.append( child_1.el );
1781 new Xcls_build_name( _this );
1782 this.el.append( _this.build_name.el );
1783 var child_3 = new Xcls_Label57( _this );
1785 this.el.append( child_3.el );
1786 new Xcls_build_execute_args( _this );
1787 this.el.append( _this.build_execute_args.el );
1790 // user defined functions
1792 public class Xcls_Label55 : Object
1794 public Gtk.Label el;
1795 private ValaProjectSettingsPopover _this;
1801 public Xcls_Label55(ValaProjectSettingsPopover _owner )
1804 this.el = new Gtk.Label( "Build Name (executable name)" );
1808 // set gobject values
1811 // user defined functions
1814 public class Xcls_build_name : Object
1816 public Gtk.Entry el;
1817 private ValaProjectSettingsPopover _this;
1823 public Xcls_build_name(ValaProjectSettingsPopover _owner )
1826 _this.build_name = this;
1827 this.el = new Gtk.Entry();
1831 // set gobject values
1834 this.el.changed.connect( () => {
1835 if (_this.selected_target == null) {
1838 var name = this.el.text;
1839 // name ischanging.. probably always..
1840 if (_this.selected_target.name != name) {
1841 _this.project.compilegroups.unset(_this.selected_target.name);
1842 _this.project.compilegroups.set(name, _this.selected_target);
1845 _this.selected_target.name = this.el.buffer.text;
1849 // user defined functions
1852 public class Xcls_Label57 : Object
1854 public Gtk.Label el;
1855 private ValaProjectSettingsPopover _this;
1861 public Xcls_Label57(ValaProjectSettingsPopover _owner )
1864 this.el = new Gtk.Label( "test argments - when run after a build" );
1868 // set gobject values
1871 // user defined functions
1874 public class Xcls_build_execute_args : Object
1876 public Gtk.Entry el;
1877 private ValaProjectSettingsPopover _this;
1883 public Xcls_build_execute_args(ValaProjectSettingsPopover _owner )
1886 _this.build_execute_args = this;
1887 this.el = new Gtk.Entry();
1891 // set gobject values
1892 this.el.placeholder_text = "eg. -f somefile -g ";
1895 this.el.changed.connect( () => {
1896 if (_this.selected_target == null) {
1899 _this.selected_target.execute_args = this.el.buffer.text;
1904 // user defined functions
1911 public class Xcls_Box59 : Object
1914 private ValaProjectSettingsPopover _this;
1920 public Xcls_Box59(ValaProjectSettingsPopover _owner )
1923 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
1927 // set gobject values
1928 this.el.margin_end = 4;
1929 this.el.margin_start = 4;
1930 this.el.hexpand = true;
1931 this.el.margin_bottom = 4;
1932 this.el.margin_top = 4;
1933 var child_1 = new Xcls_Button60( _this );
1935 this.el.append( child_1.el );
1936 var child_2 = new Xcls_Label61( _this );
1938 this.el.append( child_2.el );
1939 new Xcls_save_btn( _this );
1940 this.el.append( _this.save_btn.el );
1943 // user defined functions
1945 public class Xcls_Button60 : Object
1947 public Gtk.Button el;
1948 private ValaProjectSettingsPopover _this;
1954 public Xcls_Button60(ValaProjectSettingsPopover _owner )
1957 this.el = new Gtk.Button();
1961 // set gobject values
1962 this.el.label = "Cancel";
1965 this.el.clicked.connect( () => {
1972 // user defined functions
1975 public class Xcls_Label61 : Object
1977 public Gtk.Label el;
1978 private ValaProjectSettingsPopover _this;
1984 public Xcls_Label61(ValaProjectSettingsPopover _owner )
1987 this.el = new Gtk.Label( "" );
1991 // set gobject values
1992 this.el.hexpand = true;
1995 // user defined functions
1998 public class Xcls_save_btn : Object
2000 public Gtk.Button el;
2001 private ValaProjectSettingsPopover _this;
2007 public Xcls_save_btn(ValaProjectSettingsPopover _owner )
2010 _this.save_btn = this;
2011 this.el = new Gtk.Button();
2015 // set gobject values
2016 this.el.css_classes = { "suggested-action" };
2017 this.el.label = "Save";
2020 this.el.clicked.connect( ( ) => {
2023 _this.project.save();
2028 if (_this.doneObj != null) {
2029 _this.doneObj.call(_this.project);
2031 // hopefull this will work with bjs files..
2038 // user defined functions