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_generate_meson generate_meson;
20 public Xcls_version version;
21 public Xcls_licence licence;
22 public Xcls_vapi_scroll vapi_scroll;
23 public Xcls_vapimodel vapimodel;
24 public Xcls_vapi_filter vapi_filter;
25 public Xcls_vapi_search vapi_search;
26 public Xcls_set_vbox set_vbox;
27 public Xcls_treeview treeview;
28 public Xcls_treeselmodel treeselmodel;
29 public Xcls_treelistsort treelistsort;
30 public Xcls_treelistmodel treelistmodel;
31 public Xcls_treemodel treemodel;
32 public Xcls_name name;
33 public Xcls_target_sel target_sel;
34 public Xcls_target_model target_model;
35 public Xcls_set_vboxb set_vboxb;
36 public Xcls_build_name build_name;
37 public Xcls_build_execute_args build_execute_args;
38 public Xcls_build_as_library build_as_library;
39 public Xcls_save_btn save_btn;
42 public Project.Callback doneObj;
43 public bool cg_loading;
44 public Xcls_MainWindow window;
45 public Project.GtkValaSettings? selected_target;
47 public Project.Gtk project;
48 public uint border_width;
51 public ValaProjectSettingsPopover()
54 this.el = new Gtk.Window();
58 this.cg_loading = false;
60 this.selected_target = null;
63 this.border_width = 0;
67 var child_1 = new Xcls_HeaderBar1( _this );
69 this.el.titlebar = child_1.el;
70 var child_2 = new Xcls_Box3( _this );
72 this.el.set_child ( child_2.el );
75 this.el.close_request.connect( ( ) => {
82 this.el.hide.connect( () => {
89 // user defined functions
90 public void show (Gtk.Window pwin, Project.Gtk project, Project.Callback? doneObj) {
92 //print("ValaProjectSettings show\n");
93 this.doneObj = doneObj;
94 this.project= project;
96 this.compile_flags.el.buffer.set_text(
97 project.compile_flags.data
99 this.version.el.buffer.set_text(
102 this.licence.el.buffer.set_text(
105 project.loadVapiIntoStore(_this.vapimodel.el);
106 GLib.Timeout.add(500, () => {
107 this.vapi_scroll.el.vadjustment.value = 0;
111 this.generate_meson.el.active = this.project.generate_meson;
113 project.loadTargetsIntoStore(this.target_model.el);
115 _this.target_sel.el.selected = Gtk.INVALID_LIST_POSITION;
116 _this.target_sel.selectTarget(null);
117 // Gtk.Allocation rect;
118 //btn.get_allocation(out rect);
119 // this.el.set_pointing_to(rect);
120 this.el.application = pwin.application; // ??? make it modal?
121 this.el.set_transient_for(pwin);
124 // print("SHOWALL - POPIP\n");
125 this.el.set_size_request(800,800);
127 this.notebook.el.page = 0; // first page.
129 //this.view.el.grab_focus();
132 public void save () {
135 public class Xcls_HeaderBar1 : Object
137 public Gtk.HeaderBar el;
138 private ValaProjectSettingsPopover _this;
144 public Xcls_HeaderBar1(ValaProjectSettingsPopover _owner )
147 this.el = new Gtk.HeaderBar();
151 // set gobject values
152 var child_1 = new Xcls_Label2( _this );
154 this.el.title_widget = child_1.el;
157 // user defined functions
159 public class Xcls_Label2 : Object
162 private ValaProjectSettingsPopover _this;
168 public Xcls_Label2(ValaProjectSettingsPopover _owner )
171 this.el = new Gtk.Label( "Change Vala Compile settings" );
175 // set gobject values
178 // user defined functions
182 public class Xcls_Box3 : Object
185 private ValaProjectSettingsPopover _this;
191 public Xcls_Box3(ValaProjectSettingsPopover _owner )
194 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
198 // set gobject values
199 this.el.hexpand = true;
200 this.el.vexpand = true;
201 new Xcls_notebook( _this );
202 this.el.append( _this.notebook.el );
203 var child_2 = new Xcls_Box63( _this );
205 this.el.append( child_2.el );
208 // user defined functions
210 public class Xcls_notebook : Object
212 public Gtk.Notebook el;
213 private ValaProjectSettingsPopover _this;
219 public Xcls_notebook(ValaProjectSettingsPopover _owner )
222 _this.notebook = this;
223 this.el = new Gtk.Notebook();
227 // set gobject values
228 this.el.vexpand = true;
229 new Xcls_label_global( _this );
230 new Xcls_label_targets( _this );
231 var child_3 = new Xcls_Box7( _this );
233 this.el.append_page ( child_3.el , _this.label_global.el );
234 var child_4 = new Xcls_Paned30( _this );
236 this.el.append_page ( child_4.el , _this.label_targets.el );
239 // user defined functions
241 public class Xcls_label_global : Object
244 private ValaProjectSettingsPopover _this;
250 public Xcls_label_global(ValaProjectSettingsPopover _owner )
253 _this.label_global = this;
254 this.el = new Gtk.Label( "Global" );
258 // set gobject values
261 // user defined functions
264 public class Xcls_label_targets : Object
267 private ValaProjectSettingsPopover _this;
273 public Xcls_label_targets(ValaProjectSettingsPopover _owner )
276 _this.label_targets = this;
277 this.el = new Gtk.Label( "Targets" );
281 // set gobject values
284 // user defined functions
287 public class Xcls_Box7 : Object
290 private ValaProjectSettingsPopover _this;
296 public Xcls_Box7(ValaProjectSettingsPopover _owner )
299 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
303 // set gobject values
304 this.el.homogeneous = false;
305 var child_1 = new Xcls_Box8( _this );
307 this.el.append( child_1.el );
308 var child_2 = new Xcls_Box102( _this );
310 this.el.append( child_2.el );
311 new Xcls_vapi_scroll( _this );
312 this.el.append( _this.vapi_scroll.el );
313 new Xcls_vapi_search( _this );
314 this.el.append( _this.vapi_search.el );
317 // user defined functions
319 public class Xcls_Box8 : Object
322 private ValaProjectSettingsPopover _this;
328 public Xcls_Box8(ValaProjectSettingsPopover _owner )
331 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 10 );
335 // set gobject values
336 var child_1 = new Xcls_Label9( _this );
338 this.el.append( child_1.el );
339 new Xcls_compile_flags( _this );
340 this.el.append( _this.compile_flags.el );
341 new Xcls_generate_meson( _this );
342 this.el.append( _this.generate_meson.el );
345 // user defined functions
347 public class Xcls_Label9 : Object
350 private ValaProjectSettingsPopover _this;
356 public Xcls_Label9(ValaProjectSettingsPopover _owner )
359 this.el = new Gtk.Label( "Compile flags:" );
363 // set gobject values
364 this.el.halign = Gtk.Align.START;
365 this.el.hexpand = false;
368 // user defined functions
371 public class Xcls_compile_flags : Object
374 private ValaProjectSettingsPopover _this;
380 public Xcls_compile_flags(ValaProjectSettingsPopover _owner )
383 _this.compile_flags = this;
384 this.el = new Gtk.Entry();
388 // set gobject values
389 this.el.placeholder_text = "eg. -g --valasrc $BASEDIR ";
392 this.el.changed.connect( () => {
394 _this.project.compile_flags = this.el.buffer.text;
395 _this.project.save();
396 // _this.project.save();
401 // user defined functions
404 public class Xcls_generate_meson : Object
406 public Gtk.CheckButton el;
407 private ValaProjectSettingsPopover _this;
413 public Xcls_generate_meson(ValaProjectSettingsPopover _owner )
416 _this.generate_meson = this;
417 this.el = new Gtk.CheckButton();
421 // set gobject values
422 this.el.label = "Generate Meson";
425 this.el.activate.connect( ( ) => {
427 _this.project.generate_meson = this.el.active;
431 // user defined functions
435 public class Xcls_Box102 : Object
438 private ValaProjectSettingsPopover _this;
444 public Xcls_Box102(ValaProjectSettingsPopover _owner )
447 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 10 );
451 // set gobject values
452 var child_1 = new Xcls_Label105( _this );
454 this.el.append( child_1.el );
455 new Xcls_version( _this );
456 this.el.append( _this.version.el );
457 var child_3 = new Xcls_Label107( _this );
459 this.el.append( child_3.el );
460 new Xcls_licence( _this );
461 this.el.append( _this.licence.el );
464 // user defined functions
466 public class Xcls_Label105 : Object
469 private ValaProjectSettingsPopover _this;
475 public Xcls_Label105(ValaProjectSettingsPopover _owner )
478 this.el = new Gtk.Label( "Version:" );
482 // set gobject values
483 this.el.halign = Gtk.Align.START;
484 this.el.hexpand = false;
487 // user defined functions
490 public class Xcls_version : Object
493 private ValaProjectSettingsPopover _this;
499 public Xcls_version(ValaProjectSettingsPopover _owner )
502 _this.version = this;
503 this.el = new Gtk.Entry();
507 // set gobject values
508 this.el.placeholder_text = "eg. 1.5";
511 this.el.changed.connect( () => {
513 _this.project.version = this.el.buffer.text;
514 _this.project.save();
515 // _this.project.save();
520 // user defined functions
523 public class Xcls_Label107 : Object
526 private ValaProjectSettingsPopover _this;
532 public Xcls_Label107(ValaProjectSettingsPopover _owner )
535 this.el = new Gtk.Label( "Licence:" );
539 // set gobject values
540 this.el.halign = Gtk.Align.START;
541 this.el.hexpand = false;
544 // user defined functions
547 public class Xcls_licence : Object
550 private ValaProjectSettingsPopover _this;
556 public Xcls_licence(ValaProjectSettingsPopover _owner )
559 _this.licence = this;
560 this.el = new Gtk.Entry();
564 // set gobject values
565 this.el.placeholder_text = "eg. LGPL";
568 this.el.changed.connect( () => {
570 _this.project.licence = this.el.buffer.text;
571 _this.project.save();
572 // _this.project.save();
577 // user defined functions
581 public class Xcls_vapi_scroll : Object
583 public Gtk.ScrolledWindow el;
584 private ValaProjectSettingsPopover _this;
590 public Xcls_vapi_scroll(ValaProjectSettingsPopover _owner )
593 _this.vapi_scroll = this;
594 this.el = new Gtk.ScrolledWindow();
598 // set gobject values
599 this.el.vscrollbar_policy = Gtk.PolicyType.AUTOMATIC;
600 this.el.has_frame = true;
601 this.el.hexpand = true;
602 this.el.vexpand = true;
603 this.el.hscrollbar_policy = Gtk.PolicyType.AUTOMATIC;
604 var child_1 = new Xcls_ColumnView16( _this );
606 this.el.child = child_1.el;
609 // user defined functions
611 public class Xcls_ColumnView16 : Object
613 public Gtk.ColumnView el;
614 private ValaProjectSettingsPopover _this;
620 public Xcls_ColumnView16(ValaProjectSettingsPopover _owner )
623 var child_1 = new Xcls_NoSelection17( _this );
625 this.el = new Gtk.ColumnView( child_1.el );
629 // set gobject values
630 var child_2 = new Xcls_ColumnViewColumn25( _this );
632 this.el.append_column ( child_2.el );
633 var child_3 = new Xcls_ColumnViewColumn27( _this );
635 this.el.append_column ( child_3.el );
638 // user defined functions
640 public class Xcls_NoSelection17 : Object
642 public Gtk.NoSelection el;
643 private ValaProjectSettingsPopover _this;
649 public Xcls_NoSelection17(ValaProjectSettingsPopover _owner )
652 var child_1 = new Xcls_FilterListModel18( _this );
654 this.el = new Gtk.NoSelection( child_1.el );
658 // set gobject values
661 // user defined functions
663 public class Xcls_FilterListModel18 : Object
665 public Gtk.FilterListModel el;
666 private ValaProjectSettingsPopover _this;
672 public Xcls_FilterListModel18(ValaProjectSettingsPopover _owner )
675 var child_1 = new Xcls_SortListModel19( _this );
677 new Xcls_vapi_filter( _this );
678 this.el = new Gtk.FilterListModel( child_1.el, _this.vapi_filter.el );
682 // set gobject values
685 // user defined functions
687 public class Xcls_SortListModel19 : Object
689 public Gtk.SortListModel el;
690 private ValaProjectSettingsPopover _this;
696 public Xcls_SortListModel19(ValaProjectSettingsPopover _owner )
699 new Xcls_vapimodel( _this );
700 var child_2 = new Xcls_StringSorter21( _this );
702 this.el = new Gtk.SortListModel( _this.vapimodel.el, child_2.el );
706 // set gobject values
709 // user defined functions
711 public class Xcls_vapimodel : Object
713 public GLib.ListStore el;
714 private ValaProjectSettingsPopover _this;
720 public Xcls_vapimodel(ValaProjectSettingsPopover _owner )
723 _this.vapimodel = this;
724 this.el = new GLib.ListStore( typeof(Project.VapiSelection) );
728 // set gobject values
731 // user defined functions
734 public class Xcls_StringSorter21 : Object
736 public Gtk.StringSorter el;
737 private ValaProjectSettingsPopover _this;
743 public Xcls_StringSorter21(ValaProjectSettingsPopover _owner )
746 var child_1 = new Xcls_PropertyExpression22( _this );
748 this.el = new Gtk.StringSorter( child_1.el );
752 // set gobject values
755 // user defined functions
757 public class Xcls_PropertyExpression22 : Object
759 public Gtk.PropertyExpression el;
760 private ValaProjectSettingsPopover _this;
766 public Xcls_PropertyExpression22(ValaProjectSettingsPopover _owner )
769 this.el = new Gtk.PropertyExpression( typeof(Project.VapiSelection), null, "sortkey" );
773 // set gobject values
776 // user defined functions
781 public class Xcls_vapi_filter : Object
783 public Gtk.StringFilter el;
784 private ValaProjectSettingsPopover _this;
790 public Xcls_vapi_filter(ValaProjectSettingsPopover _owner )
793 _this.vapi_filter = this;
794 var child_1 = new Xcls_PropertyExpression24( _this );
796 this.el = new Gtk.StringFilter( child_1.el );
800 // set gobject values
803 // user defined functions
805 public class Xcls_PropertyExpression24 : Object
807 public Gtk.PropertyExpression el;
808 private ValaProjectSettingsPopover _this;
814 public Xcls_PropertyExpression24(ValaProjectSettingsPopover _owner )
817 this.el = new Gtk.PropertyExpression( typeof(Project.VapiSelection), null, "sortkey" );
821 // set gobject values
824 // user defined functions
830 public class Xcls_ColumnViewColumn25 : Object
832 public Gtk.ColumnViewColumn el;
833 private ValaProjectSettingsPopover _this;
839 public Xcls_ColumnViewColumn25(ValaProjectSettingsPopover _owner )
842 var child_1 = new Xcls_SignalListItemFactory26( _this );
844 this.el = new Gtk.ColumnViewColumn( "Vapi Package", child_1.el );
848 // set gobject values
849 this.el.expand = true;
852 // user defined functions
854 public class Xcls_SignalListItemFactory26 : Object
856 public Gtk.SignalListItemFactory el;
857 private ValaProjectSettingsPopover _this;
863 public Xcls_SignalListItemFactory26(ValaProjectSettingsPopover _owner )
866 this.el = new Gtk.SignalListItemFactory();
870 // set gobject values
873 this.el.setup.connect( (item) => {
874 //var j = (JsRender.JsRender) item;
875 var gi = (Gtk.ListItem)item;
877 var lbl = new Gtk.Label("");
878 lbl.halign = Gtk.Align.START;
884 this.el.bind.connect( (listitem) => {
886 var lbl = (Gtk.Label) ((Gtk.ListItem)listitem).get_child();
888 var item = (Project.VapiSelection) ((Gtk.ListItem)listitem).get_item();
890 item.bind_property("name",
892 GLib.BindingFlags.SYNC_CREATE);
898 // user defined functions
902 public class Xcls_ColumnViewColumn27 : Object
904 public Gtk.ColumnViewColumn el;
905 private ValaProjectSettingsPopover _this;
911 public Xcls_ColumnViewColumn27(ValaProjectSettingsPopover _owner )
914 var child_1 = new Xcls_SignalListItemFactory28( _this );
916 this.el = new Gtk.ColumnViewColumn( "use", child_1.el );
920 // set gobject values
923 // user defined functions
925 public class Xcls_SignalListItemFactory28 : Object
927 public Gtk.SignalListItemFactory el;
928 private ValaProjectSettingsPopover _this;
934 public Xcls_SignalListItemFactory28(ValaProjectSettingsPopover _owner )
937 this.el = new Gtk.SignalListItemFactory();
941 // set gobject values
944 this.el.setup.connect( (listitem) => {
946 var btn = new Gtk.CheckButton();
948 ((Gtk.ListItem)listitem).set_child(btn);
950 btn.toggled.connect(() => {
952 var jr = (Project.VapiSelection) ((Gtk.ListItem)listitem).get_item();
953 jr.selected = btn.active;
956 this.el.bind.connect( (listitem) => {
957 //GLib.debug("listitme is is %s", ((Gtk.ListItem)listitem).get_type().name());
961 //var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();
962 var btn = (Gtk.CheckButton) ((Gtk.ListItem)listitem).get_child();
965 var vs = (Project.VapiSelection)((Gtk.ListItem)listitem).get_item();
967 //GLib.debug("change %s to %s", lbl.label, np.name);
969 btn.active = vs.selected;
977 // user defined functions
983 public class Xcls_vapi_search : Object
985 public Gtk.SearchEntry el;
986 private ValaProjectSettingsPopover _this;
992 public Xcls_vapi_search(ValaProjectSettingsPopover _owner )
995 _this.vapi_search = this;
996 this.el = new Gtk.SearchEntry();
1000 // set gobject values
1001 this.el.placeholder_text = "Search Libraries (Vapi)";
1002 this.el.search_delay = 500;
1005 this.el.search_changed.connect( ( ) => {
1007 _this.vapi_filter.el.set_search(this.el.get_text());
1012 // user defined functions
1016 public class Xcls_Paned30 : Object
1018 public Gtk.Paned el;
1019 private ValaProjectSettingsPopover _this;
1025 public Xcls_Paned30(ValaProjectSettingsPopover _owner )
1028 this.el = new Gtk.Paned( Gtk.Orientation.HORIZONTAL );
1032 // set gobject values
1033 this.el.vexpand = true;
1034 this.el.position = 300;
1035 new Xcls_set_vbox( _this );
1036 this.el.set_end_child ( _this.set_vbox.el );
1037 var child_2 = new Xcls_Box47( _this );
1039 this.el.start_child = child_2.el;
1042 // user defined functions
1044 public class Xcls_set_vbox : Object
1047 private ValaProjectSettingsPopover _this;
1053 public Xcls_set_vbox(ValaProjectSettingsPopover _owner )
1056 _this.set_vbox = this;
1057 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
1061 // set gobject values
1062 this.el.homogeneous = false;
1063 var child_1 = new Xcls_ScrolledWindow32( _this );
1065 this.el.append( child_1.el );
1068 // user defined functions
1070 public class Xcls_ScrolledWindow32 : Object
1072 public Gtk.ScrolledWindow el;
1073 private ValaProjectSettingsPopover _this;
1079 public Xcls_ScrolledWindow32(ValaProjectSettingsPopover _owner )
1082 this.el = new Gtk.ScrolledWindow();
1086 // set gobject values
1087 this.el.vexpand = true;
1088 new Xcls_treeview( _this );
1089 this.el.child = _this.treeview.el;
1092 // user defined functions
1094 public class Xcls_treeview : Object
1096 public Gtk.ColumnView el;
1097 private ValaProjectSettingsPopover _this;
1103 public Xcls_treeview(ValaProjectSettingsPopover _owner )
1106 _this.treeview = this;
1107 new Xcls_treeselmodel( _this );
1108 this.el = new Gtk.ColumnView( _this.treeselmodel.el );
1112 // set gobject values
1113 new Xcls_name( _this );
1114 this.el.append_column ( _this.name.el );
1115 var child_3 = new Xcls_ColumnViewColumn45( _this );
1117 this.el.append_column ( child_3.el );
1120 // user defined functions
1122 public class Xcls_treeselmodel : Object
1124 public Gtk.SingleSelection el;
1125 private ValaProjectSettingsPopover _this;
1131 public Xcls_treeselmodel(ValaProjectSettingsPopover _owner )
1134 _this.treeselmodel = this;
1135 var child_1 = new Xcls_FilterListModel35( _this );
1137 this.el = new Gtk.SingleSelection( child_1.el );
1141 // set gobject values
1144 // user defined functions
1146 public class Xcls_FilterListModel35 : Object
1148 public Gtk.FilterListModel el;
1149 private ValaProjectSettingsPopover _this;
1155 public Xcls_FilterListModel35(ValaProjectSettingsPopover _owner )
1158 new Xcls_treelistsort( _this );
1159 var child_2 = new Xcls_CustomFilter42( _this );
1161 this.el = new Gtk.FilterListModel( _this.treelistsort.el, child_2.el );
1165 // set gobject values
1168 // user defined functions
1170 public class Xcls_treelistsort : Object
1172 public Gtk.SortListModel el;
1173 private ValaProjectSettingsPopover _this;
1179 public Xcls_treelistsort(ValaProjectSettingsPopover _owner )
1182 _this.treelistsort = this;
1183 new Xcls_treelistmodel( _this );
1184 var child_2 = new Xcls_TreeListRowSorter39( _this );
1186 this.el = new Gtk.SortListModel( _this.treelistmodel.el, child_2.el );
1190 // set gobject values
1195 //this.el.set_sorter(new Gtk.TreeListRowSorter(_this.treeview.el.sorter));
1199 // user defined functions
1201 public class Xcls_treelistmodel : Object
1203 public Gtk.TreeListModel el;
1204 private ValaProjectSettingsPopover _this;
1210 public Xcls_treelistmodel(ValaProjectSettingsPopover _owner )
1213 _this.treelistmodel = this;
1214 new Xcls_treemodel( _this );
1215 this.el = new Gtk.TreeListModel( _this.treemodel.el, false, true, (item) => {
1216 //GLib.debug("liststore got %s", item.get_type().name());
1217 return ((JsRender.JsRender)item).childfiles;
1222 // set gobject values
1225 // user defined functions
1227 public class Xcls_treemodel : Object
1229 public GLib.ListStore el;
1230 private ValaProjectSettingsPopover _this;
1236 public Xcls_treemodel(ValaProjectSettingsPopover _owner )
1239 _this.treemodel = this;
1240 this.el = new GLib.ListStore( typeof(JsRender.JsRender) );
1244 // set gobject values
1247 // user defined functions
1251 public class Xcls_TreeListRowSorter39 : Object
1253 public Gtk.TreeListRowSorter el;
1254 private ValaProjectSettingsPopover _this;
1260 public Xcls_TreeListRowSorter39(ValaProjectSettingsPopover _owner )
1263 var child_1 = new Xcls_StringSorter40( _this );
1265 this.el = new Gtk.TreeListRowSorter( child_1.el );
1269 // set gobject values
1272 // user defined functions
1274 public class Xcls_StringSorter40 : Object
1276 public Gtk.StringSorter el;
1277 private ValaProjectSettingsPopover _this;
1283 public Xcls_StringSorter40(ValaProjectSettingsPopover _owner )
1286 var child_1 = new Xcls_PropertyExpression41( _this );
1288 this.el = new Gtk.StringSorter( child_1.el );
1292 // set gobject values
1295 // user defined functions
1297 public class Xcls_PropertyExpression41 : Object
1299 public Gtk.PropertyExpression el;
1300 private ValaProjectSettingsPopover _this;
1306 public Xcls_PropertyExpression41(ValaProjectSettingsPopover _owner )
1309 this.el = new Gtk.PropertyExpression( typeof(JsRender.JsRender), null, "name" );
1313 // set gobject values
1316 // user defined functions
1322 public class Xcls_CustomFilter42 : Object
1324 public Gtk.CustomFilter el;
1325 private ValaProjectSettingsPopover _this;
1331 public Xcls_CustomFilter42(ValaProjectSettingsPopover _owner )
1334 this.el = new Gtk.CustomFilter( (item) => {
1336 var tr = ((Gtk.TreeListRow)item).get_item();
1337 //GLib.debug("filter %s", tr.get_type().name());
1338 var j = (JsRender.JsRender) tr;
1339 if (j.xtype == "Gtk") {
1342 if (j.xtype != "Dir") {
1343 return j.path.has_suffix(".vala") || j.path.has_suffix(".c");
1347 for (var i =0 ; i < j.childfiles.n_items; i++) {
1348 var f = (JsRender.JsRender) j.childfiles.get_item(i);
1349 if (f.xtype == "Gtk") {
1352 if (f.path.has_suffix(".vala") || f.path.has_suffix(".c")) {
1362 // set gobject values
1365 // user defined functions
1370 public class Xcls_name : Object
1372 public Gtk.ColumnViewColumn el;
1373 private ValaProjectSettingsPopover _this;
1379 public Xcls_name(ValaProjectSettingsPopover _owner )
1383 var child_1 = new Xcls_SignalListItemFactory44( _this );
1385 this.el = new Gtk.ColumnViewColumn( "Other Files", child_1.el );
1389 // set gobject values
1390 this.el.id = "name";
1391 this.el.expand = true;
1392 this.el.resizable = true;
1397 this.el.set_sorter( new Gtk.StringSorter(
1398 new Gtk.PropertyExpression(typeof(JsRender.JsRender), null, "name")
1405 // user defined functions
1407 public class Xcls_SignalListItemFactory44 : Object
1409 public Gtk.SignalListItemFactory el;
1410 private ValaProjectSettingsPopover _this;
1416 public Xcls_SignalListItemFactory44(ValaProjectSettingsPopover _owner )
1419 this.el = new Gtk.SignalListItemFactory();
1423 // set gobject values
1426 this.el.setup.connect( (listitem) => {
1428 var expand = new Gtk.TreeExpander();
1430 expand.set_indent_for_depth(true);
1431 expand.set_indent_for_icon(true);
1433 var lbl = new Gtk.Label("");
1434 lbl.use_markup = true;
1437 lbl.justify = Gtk.Justification.LEFT;
1441 expand.set_child(lbl);
1442 ((Gtk.ListItem)listitem).set_child(expand);
1443 ((Gtk.ListItem)listitem).activatable = false;
1445 this.el.bind.connect( (listitem) => {
1446 //GLib.debug("listitme is is %s", ((Gtk.ListItem)listitem).get_type().name());
1450 //var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();
1451 var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();
1454 var lbl = (Gtk.Label) expand.child;
1456 if (lbl.label != "") { // do not update
1461 var lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();
1462 var jr = (JsRender.JsRender) lr.get_item();
1463 //GLib.debug("change %s to %s", lbl.label, np.name);
1464 lbl.label = jr.name; // for dir's we could hsow the sub path..
1465 lbl.tooltip_markup = jr.path;
1467 expand.set_hide_expander( jr.childfiles.n_items < 1);
1468 expand.set_list_row(lr);
1470 expand.set_hide_expander( jr.xtype != "Dir" );
1471 expand.set_list_row(lr);
1478 // user defined functions
1482 public class Xcls_ColumnViewColumn45 : Object
1484 public Gtk.ColumnViewColumn el;
1485 private ValaProjectSettingsPopover _this;
1491 public Xcls_ColumnViewColumn45(ValaProjectSettingsPopover _owner )
1494 var child_1 = new Xcls_SignalListItemFactory46( _this );
1496 this.el = new Gtk.ColumnViewColumn( "use", child_1.el );
1500 // set gobject values
1503 // user defined functions
1505 public class Xcls_SignalListItemFactory46 : Object
1507 public Gtk.SignalListItemFactory el;
1508 private ValaProjectSettingsPopover _this;
1514 public Xcls_SignalListItemFactory46(ValaProjectSettingsPopover _owner )
1517 this.el = new Gtk.SignalListItemFactory();
1521 // set gobject values
1524 this.el.setup.connect( (listitem) => {
1526 var btn = new Gtk.CheckButton();
1528 ((Gtk.ListItem)listitem).set_child(btn);
1530 btn.toggled.connect(() => {
1531 if (_this.cg_loading) {
1534 var lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();
1535 var jr = (JsRender.JsRender) lr.get_item();
1536 jr.compile_group_selected = btn.active;
1541 this.el.bind.connect( (listitem) => {
1542 //GLib.debug("listitme is is %s", ((Gtk.ListItem)listitem).get_type().name());
1546 //var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();
1547 var btn = (Gtk.CheckButton) ((Gtk.ListItem)listitem).get_child();
1550 var lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();
1551 var jr = (JsRender.JsRender) lr.get_item();
1552 //GLib.debug("change %s to %s", lbl.label, np.name);
1554 //btn.active = jr.compile_group_selected;
1555 btn.active = _this.selected_target.has_file(jr);
1557 //jr.bind_property("compile_group_selected",
1559 // GLib.BindingFlags.BIDIRECTIONAL);
1565 // user defined functions
1572 public class Xcls_Box47 : Object
1575 private ValaProjectSettingsPopover _this;
1581 public Xcls_Box47(ValaProjectSettingsPopover _owner )
1584 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
1588 // set gobject values
1589 var child_1 = new Xcls_Box48( _this );
1591 this.el.append( child_1.el );
1592 var child_2 = new Xcls_ScrolledWindow51( _this );
1594 this.el.append( child_2.el );
1595 new Xcls_set_vboxb( _this );
1596 this.el.append( _this.set_vboxb.el );
1599 // user defined functions
1601 public class Xcls_Box48 : Object
1604 private ValaProjectSettingsPopover _this;
1610 public Xcls_Box48(ValaProjectSettingsPopover _owner )
1613 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
1617 // set gobject values
1618 this.el.hexpand = true;
1619 var child_1 = new Xcls_Button49( _this );
1621 this.el.append( child_1.el );
1622 var child_2 = new Xcls_Button50( _this );
1624 this.el.append( child_2.el );
1627 // user defined functions
1629 public class Xcls_Button49 : Object
1631 public Gtk.Button el;
1632 private ValaProjectSettingsPopover _this;
1638 public Xcls_Button49(ValaProjectSettingsPopover _owner )
1641 this.el = new Gtk.Button();
1645 // set gobject values
1646 this.el.hexpand = true;
1647 this.el.label = "Add Compile Target";
1650 this.el.clicked.connect( () => {
1652 if (_this.project.compilegroups.has_key("NEW GROUP")) {
1655 var cg = new Project.GtkValaSettings(_this.project, "NEW GROUP");
1656 _this.project.compilegroups.set(cg.name, cg);
1657 _this.project.loadTargetsIntoStore(_this.target_model.el);
1658 // select it.. ?? should load it??
1659 for(var i =0;i < _this.target_model.el.n_items; i++) {
1660 var ncg = (Project.GtkValaSettings) _this.target_model.el.get_item(i);
1661 if (ncg.name == cg.name) {
1662 _this.target_sel.el.selected = i;
1663 _this.target_sel.selectTarget(cg);
1673 // user defined functions
1676 public class Xcls_Button50 : Object
1678 public Gtk.Button el;
1679 private ValaProjectSettingsPopover _this;
1685 public Xcls_Button50(ValaProjectSettingsPopover _owner )
1688 this.el = new Gtk.Button();
1692 // set gobject values
1693 this.el.hexpand = true;
1694 this.el.label = "Remove Target";
1697 this.el.clicked.connect( () => {
1698 // load the new values.
1699 if (_this.target_sel.el.selected == Gtk.INVALID_LIST_POSITION) {
1700 GLib.debug("nothing selected");
1705 // add the directory..
1706 var cg = (Project.GtkValaSettings) _this.target_model.el.get_item(_this.target_sel.el.selected);
1709 GLib.debug("remove: %s\n", cg.name);
1710 if (!_this.project.compilegroups.unset(cg.name)) {
1711 GLib.debug("remove failed");
1713 _this.project.loadTargetsIntoStore(_this.target_model.el);
1717 // user defined functions
1721 public class Xcls_ScrolledWindow51 : Object
1723 public Gtk.ScrolledWindow el;
1724 private ValaProjectSettingsPopover _this;
1730 public Xcls_ScrolledWindow51(ValaProjectSettingsPopover _owner )
1733 this.el = new Gtk.ScrolledWindow();
1737 // set gobject values
1738 this.el.vexpand = true;
1739 var child_1 = new Xcls_ColumnView52( _this );
1741 this.el.child = child_1.el;
1746 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
1751 // user defined functions
1753 public class Xcls_ColumnView52 : Object
1755 public Gtk.ColumnView el;
1756 private ValaProjectSettingsPopover _this;
1762 public Xcls_ColumnView52(ValaProjectSettingsPopover _owner )
1765 new Xcls_target_sel( _this );
1766 this.el = new Gtk.ColumnView( _this.target_sel.el );
1770 // set gobject values
1771 var child_2 = new Xcls_ColumnViewColumn55( _this );
1773 this.el.append_column ( child_2.el );
1776 // user defined functions
1778 public class Xcls_target_sel : Object
1780 public Gtk.SingleSelection el;
1781 private ValaProjectSettingsPopover _this;
1787 public Xcls_target_sel(ValaProjectSettingsPopover _owner )
1790 _this.target_sel = this;
1791 new Xcls_target_model( _this );
1792 this.el = new Gtk.SingleSelection( _this.target_model.el );
1796 // set gobject values
1799 this.el.selection_changed.connect( (position, n_items) => {
1802 // load the new values.
1803 if (this.el.selected == Gtk.INVALID_LIST_POSITION) {
1804 this.selectTarget(null);
1807 this.selectTarget(null);
1811 // add the directory..
1812 var cg = (Project.GtkValaSettings) _this.target_model.el.get_item(this.el.selected);
1814 this.selectTarget(cg);
1819 // user defined functions
1820 public void selectTarget (Project.GtkValaSettings? cg) {
1821 // load the new values
1822 _this.selected_target = cg;
1823 _this.project.active_cg = cg;
1828 _this.set_vbox.el.hide();
1829 _this.set_vboxb.el.hide();
1834 _this.set_vbox.el.show();
1835 _this.set_vboxb.el.show();
1836 // add the directory..
1839 GLib.debug("loading dirs into project list");
1840 cg.loading_ui = true;
1841 _this.cg_loading = true;
1843 _this.treeview.el.set_model(new Gtk.SingleSelection(null));
1844 _this.project.loadDirsIntoStore(_this.treemodel.el);
1845 _this.treeview.el.set_model(_this.treeselmodel.el);
1847 cg.loading_ui = false;
1849 _this.cg_loading = false;
1850 GLib.debug("Set name to %s", cg.name);
1852 _this.build_name.el.buffer.set_text(cg.name.data);
1853 _this.build_as_library.el.active = cg.is_library;
1855 _this.build_execute_args.el.buffer.set_text( cg.execute_args.data );
1859 public class Xcls_target_model : Object
1861 public GLib.ListStore el;
1862 private ValaProjectSettingsPopover _this;
1868 public Xcls_target_model(ValaProjectSettingsPopover _owner )
1871 _this.target_model = this;
1872 this.el = new GLib.ListStore( typeof(Project.GtkValaSettings) );
1876 // set gobject values
1879 // user defined functions
1883 public class Xcls_ColumnViewColumn55 : Object
1885 public Gtk.ColumnViewColumn el;
1886 private ValaProjectSettingsPopover _this;
1892 public Xcls_ColumnViewColumn55(ValaProjectSettingsPopover _owner )
1895 var child_1 = new Xcls_SignalListItemFactory56( _this );
1897 this.el = new Gtk.ColumnViewColumn( "Build Target", child_1.el );
1901 // set gobject values
1902 this.el.expand = true;
1905 // user defined functions
1907 public class Xcls_SignalListItemFactory56 : Object
1909 public Gtk.SignalListItemFactory el;
1910 private ValaProjectSettingsPopover _this;
1916 public Xcls_SignalListItemFactory56(ValaProjectSettingsPopover _owner )
1919 this.el = new Gtk.SignalListItemFactory();
1923 // set gobject values
1926 this.el.setup.connect( (item) => {
1927 //var j = (JsRender.JsRender) item;
1928 var gi = (Gtk.ListItem)item;
1930 var lbl = new Gtk.Label("");
1931 lbl.halign = Gtk.Align.START;
1937 this.el.bind.connect( (listitem) => {
1939 var lbl = (Gtk.Label) ((Gtk.ListItem)listitem).get_child();
1941 var item = (Project.GtkValaSettings) ((Gtk.ListItem)listitem).get_item();
1943 item.bind_property("name",
1945 GLib.BindingFlags.SYNC_CREATE);
1951 // user defined functions
1957 public class Xcls_set_vboxb : Object
1960 private ValaProjectSettingsPopover _this;
1966 public Xcls_set_vboxb(ValaProjectSettingsPopover _owner )
1969 _this.set_vboxb = this;
1970 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
1974 // set gobject values
1975 var child_1 = new Xcls_Label58( _this );
1977 this.el.append( child_1.el );
1978 new Xcls_build_name( _this );
1979 this.el.append( _this.build_name.el );
1980 var child_3 = new Xcls_Label60( _this );
1982 this.el.append( child_3.el );
1983 new Xcls_build_execute_args( _this );
1984 this.el.append( _this.build_execute_args.el );
1985 new Xcls_build_as_library( _this );
1986 this.el.append( _this.build_as_library.el );
1989 // user defined functions
1991 public class Xcls_Label58 : Object
1993 public Gtk.Label el;
1994 private ValaProjectSettingsPopover _this;
2000 public Xcls_Label58(ValaProjectSettingsPopover _owner )
2003 this.el = new Gtk.Label( "Build Name (executable name)" );
2007 // set gobject values
2010 // user defined functions
2013 public class Xcls_build_name : Object
2015 public Gtk.Entry el;
2016 private ValaProjectSettingsPopover _this;
2020 public bool in_insert;
2023 public Xcls_build_name(ValaProjectSettingsPopover _owner )
2026 _this.build_name = this;
2027 this.el = new Gtk.Entry();
2030 this.in_insert = false;
2032 // set gobject values
2036 var ed = (this.el.get_delegate() as Gtk.Editable);
2038 ed.insert_text.connect((text, length, ref position) => {
2039 if (this.in_insert) {
2042 GLib.debug("got insert text %s", text);
2045 for(var i = 0;i < text.length; i++){
2046 if (Posix.isupper(text[i]) ||Posix.islower(text[i]) ) {
2047 nt += text[i].to_string();
2050 if (nt.length < 1) {
2051 GLib.Signal.stop_emission_by_name(ed, "insert_text");
2055 this.in_insert = true;
2057 this.el.insert_text(nt,nt.length, ref position);
2058 this.in_insert = false;
2059 GLib.Signal.stop_emission_by_name(ed, "insert_text");
2065 this.el.insert_text.connect( (text, length, ref position) => {
2066 if (this.in_insert) {
2069 GLib.debug("got insert text %s", text);
2072 for(var i = 0;i < text.length; i++){
2073 if (Posix.isalpha(text[i])) {
2074 nt += text[i].to_string();
2077 if (nt.length < 1) {
2081 this.in_insert = true;
2083 this.el.insert_text(text,length, ref position);
2084 this.in_insert = false;
2086 this.el.changed.connect( () => {
2087 if (_this.selected_target == null) {
2090 var name = this.el.text;
2091 // name ischanging.. probably always..
2092 if (_this.selected_target.name != name) {
2093 _this.project.compilegroups.unset(_this.selected_target.name);
2094 _this.project.compilegroups.set(name, _this.selected_target);
2097 _this.selected_target.name = this.el.buffer.text;
2101 // user defined functions
2104 public class Xcls_Label60 : Object
2106 public Gtk.Label el;
2107 private ValaProjectSettingsPopover _this;
2113 public Xcls_Label60(ValaProjectSettingsPopover _owner )
2116 this.el = new Gtk.Label( "test argments - when run after a build" );
2120 // set gobject values
2123 // user defined functions
2126 public class Xcls_build_execute_args : Object
2128 public Gtk.Entry el;
2129 private ValaProjectSettingsPopover _this;
2135 public Xcls_build_execute_args(ValaProjectSettingsPopover _owner )
2138 _this.build_execute_args = this;
2139 this.el = new Gtk.Entry();
2143 // set gobject values
2144 this.el.placeholder_text = "eg. -f somefile -g ";
2147 this.el.changed.connect( () => {
2148 if (_this.selected_target == null) {
2151 _this.selected_target.execute_args = this.el.buffer.text;
2156 // user defined functions
2159 public class Xcls_build_as_library : Object
2161 public Gtk.CheckButton el;
2162 private ValaProjectSettingsPopover _this;
2168 public Xcls_build_as_library(ValaProjectSettingsPopover _owner )
2171 _this.build_as_library = this;
2172 this.el = new Gtk.CheckButton();
2176 // set gobject values
2177 this.el.label = "build as library";
2180 this.el.notify["active"].connect( () => {
2181 if (_this.selected_target == null) {
2184 _this.selected_target.is_library = this.el.active;
2189 // user defined functions
2196 public class Xcls_Box63 : Object
2199 private ValaProjectSettingsPopover _this;
2205 public Xcls_Box63(ValaProjectSettingsPopover _owner )
2208 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
2212 // set gobject values
2213 this.el.margin_end = 4;
2214 this.el.margin_start = 4;
2215 this.el.hexpand = true;
2216 this.el.margin_bottom = 4;
2217 this.el.margin_top = 4;
2218 var child_1 = new Xcls_Button64( _this );
2220 this.el.append( child_1.el );
2221 var child_2 = new Xcls_Label65( _this );
2223 this.el.append( child_2.el );
2224 new Xcls_save_btn( _this );
2225 this.el.append( _this.save_btn.el );
2228 // user defined functions
2230 public class Xcls_Button64 : Object
2232 public Gtk.Button el;
2233 private ValaProjectSettingsPopover _this;
2239 public Xcls_Button64(ValaProjectSettingsPopover _owner )
2242 this.el = new Gtk.Button();
2246 // set gobject values
2247 this.el.label = "Cancel";
2250 this.el.clicked.connect( () => {
2257 // user defined functions
2260 public class Xcls_Label65 : Object
2262 public Gtk.Label el;
2263 private ValaProjectSettingsPopover _this;
2269 public Xcls_Label65(ValaProjectSettingsPopover _owner )
2272 this.el = new Gtk.Label( "" );
2276 // set gobject values
2277 this.el.hexpand = true;
2280 // user defined functions
2283 public class Xcls_save_btn : Object
2285 public Gtk.Button el;
2286 private ValaProjectSettingsPopover _this;
2292 public Xcls_save_btn(ValaProjectSettingsPopover _owner )
2295 _this.save_btn = this;
2296 this.el = new Gtk.Button();
2300 // set gobject values
2301 this.el.css_classes = { "suggested-action" };
2302 this.el.label = "Save";
2305 this.el.clicked.connect( ( ) => {
2308 _this.project.save();
2313 if (_this.doneObj != null) {
2314 _this.doneObj.call(_this.project);
2321 // user defined functions