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.project.loading = true;
98 this.compile_flags.el.buffer.set_text(
99 project.compile_flags.data
101 this.version.el.buffer.set_text(
104 this.licence.el.buffer.set_text(
110 GLib.Idle.add(() => {
111 project.loadVapiIntoStore(_this.vapimodel.el);
112 GLib.Timeout.add(500, () => {
113 this.vapi_scroll.el.vadjustment.value = 0;
116 project.loadTargetsIntoStore(this.target_model.el);
117 _this.target_sel.el.selected = Gtk.INVALID_LIST_POSITION;
118 _this.target_sel.selectTarget(null);
119 this.project.loading = false;
123 this.generate_meson.el.active = this.project.generate_meson;
128 // Gtk.Allocation rect;
129 //btn.get_allocation(out rect);
130 // this.el.set_pointing_to(rect);
131 this.el.application = pwin.application; // ??? make it modal?
132 this.el.set_transient_for(pwin);
135 // print("SHOWALL - POPIP\n");
136 this.el.set_size_request(800,800);
138 this.notebook.el.page = 0; // first page.
140 //this.view.el.grab_focus();
143 public void save () {
146 public class Xcls_HeaderBar1 : Object
148 public Gtk.HeaderBar el;
149 private ValaProjectSettingsPopover _this;
155 public Xcls_HeaderBar1(ValaProjectSettingsPopover _owner )
158 this.el = new Gtk.HeaderBar();
162 // set gobject values
163 var child_1 = new Xcls_Label2( _this );
165 this.el.title_widget = child_1.el;
168 // user defined functions
170 public class Xcls_Label2 : Object
173 private ValaProjectSettingsPopover _this;
179 public Xcls_Label2(ValaProjectSettingsPopover _owner )
182 this.el = new Gtk.Label( "Change Vala Compile settings" );
186 // set gobject values
189 // user defined functions
193 public class Xcls_Box3 : Object
196 private ValaProjectSettingsPopover _this;
202 public Xcls_Box3(ValaProjectSettingsPopover _owner )
205 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
209 // set gobject values
210 this.el.hexpand = true;
211 this.el.vexpand = true;
212 new Xcls_notebook( _this );
213 this.el.append( _this.notebook.el );
214 var child_2 = new Xcls_Box65( _this );
216 this.el.append( child_2.el );
219 // user defined functions
221 public class Xcls_notebook : Object
223 public Gtk.Notebook el;
224 private ValaProjectSettingsPopover _this;
230 public Xcls_notebook(ValaProjectSettingsPopover _owner )
233 _this.notebook = this;
234 this.el = new Gtk.Notebook();
238 // set gobject values
239 this.el.vexpand = true;
240 new Xcls_label_global( _this );
241 new Xcls_label_targets( _this );
242 var child_3 = new Xcls_Box7( _this );
244 this.el.append_page ( child_3.el , _this.label_global.el );
245 var child_4 = new Xcls_Paned32( _this );
247 this.el.append_page ( child_4.el , _this.label_targets.el );
250 // user defined functions
252 public class Xcls_label_global : Object
255 private ValaProjectSettingsPopover _this;
261 public Xcls_label_global(ValaProjectSettingsPopover _owner )
264 _this.label_global = this;
265 this.el = new Gtk.Label( "Global" );
269 // set gobject values
272 // user defined functions
275 public class Xcls_label_targets : Object
278 private ValaProjectSettingsPopover _this;
284 public Xcls_label_targets(ValaProjectSettingsPopover _owner )
287 _this.label_targets = this;
288 this.el = new Gtk.Label( "Targets" );
292 // set gobject values
295 // user defined functions
298 public class Xcls_Box7 : Object
301 private ValaProjectSettingsPopover _this;
307 public Xcls_Box7(ValaProjectSettingsPopover _owner )
310 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
314 // set gobject values
315 this.el.homogeneous = false;
316 var child_1 = new Xcls_Box8( _this );
318 this.el.append( child_1.el );
319 var child_2 = new Xcls_Box12( _this );
321 this.el.append( child_2.el );
322 new Xcls_vapi_scroll( _this );
323 this.el.append( _this.vapi_scroll.el );
324 new Xcls_vapi_search( _this );
325 this.el.append( _this.vapi_search.el );
328 // user defined functions
330 public class Xcls_Box8 : Object
333 private ValaProjectSettingsPopover _this;
339 public Xcls_Box8(ValaProjectSettingsPopover _owner )
342 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 10 );
346 // set gobject values
347 var child_1 = new Xcls_Label9( _this );
349 this.el.append( child_1.el );
350 new Xcls_compile_flags( _this );
351 this.el.append( _this.compile_flags.el );
352 new Xcls_generate_meson( _this );
353 this.el.append( _this.generate_meson.el );
356 // user defined functions
358 public class Xcls_Label9 : Object
361 private ValaProjectSettingsPopover _this;
367 public Xcls_Label9(ValaProjectSettingsPopover _owner )
370 this.el = new Gtk.Label( "Compile flags:" );
374 // set gobject values
375 this.el.halign = Gtk.Align.START;
376 this.el.hexpand = false;
379 // user defined functions
382 public class Xcls_compile_flags : Object
385 private ValaProjectSettingsPopover _this;
391 public Xcls_compile_flags(ValaProjectSettingsPopover _owner )
394 _this.compile_flags = this;
395 this.el = new Gtk.Entry();
399 // set gobject values
400 this.el.placeholder_text = "eg. -g --valasrc $BASEDIR ";
403 this.el.changed.connect( () => {
405 _this.project.compile_flags = this.el.buffer.text;
406 _this.project.save();
407 // _this.project.save();
412 // user defined functions
415 public class Xcls_generate_meson : Object
417 public Gtk.CheckButton el;
418 private ValaProjectSettingsPopover _this;
424 public Xcls_generate_meson(ValaProjectSettingsPopover _owner )
427 _this.generate_meson = this;
428 this.el = new Gtk.CheckButton();
432 // set gobject values
433 this.el.label = "Generate Meson";
436 this.el.toggled.connect( ( ) => {
438 _this.project.generate_meson = this.el.active;
442 // user defined functions
446 public class Xcls_Box12 : Object
449 private ValaProjectSettingsPopover _this;
455 public Xcls_Box12(ValaProjectSettingsPopover _owner )
458 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 10 );
462 // set gobject values
463 var child_1 = new Xcls_Label13( _this );
465 this.el.append( child_1.el );
466 new Xcls_version( _this );
467 this.el.append( _this.version.el );
468 var child_3 = new Xcls_Label15( _this );
470 this.el.append( child_3.el );
471 new Xcls_licence( _this );
472 this.el.append( _this.licence.el );
475 // user defined functions
477 public class Xcls_Label13 : Object
480 private ValaProjectSettingsPopover _this;
486 public Xcls_Label13(ValaProjectSettingsPopover _owner )
489 this.el = new Gtk.Label( "Version:" );
493 // set gobject values
494 this.el.halign = Gtk.Align.START;
495 this.el.hexpand = false;
498 // user defined functions
501 public class Xcls_version : Object
504 private ValaProjectSettingsPopover _this;
510 public Xcls_version(ValaProjectSettingsPopover _owner )
513 _this.version = this;
514 this.el = new Gtk.Entry();
518 // set gobject values
519 this.el.placeholder_text = "eg. 1.5";
522 this.el.changed.connect( () => {
524 _this.project.version = this.el.buffer.text;
525 _this.project.save();
526 // _this.project.save();
531 // user defined functions
534 public class Xcls_Label15 : Object
537 private ValaProjectSettingsPopover _this;
543 public Xcls_Label15(ValaProjectSettingsPopover _owner )
546 this.el = new Gtk.Label( "Licence:" );
550 // set gobject values
551 this.el.halign = Gtk.Align.START;
552 this.el.hexpand = false;
555 // user defined functions
558 public class Xcls_licence : Object
561 private ValaProjectSettingsPopover _this;
567 public Xcls_licence(ValaProjectSettingsPopover _owner )
570 _this.licence = this;
571 this.el = new Gtk.Entry();
575 // set gobject values
576 this.el.placeholder_text = "eg. LGPL";
579 this.el.changed.connect( () => {
581 _this.project.licence = this.el.buffer.text;
582 _this.project.save();
583 // _this.project.save();
588 // user defined functions
592 public class Xcls_vapi_scroll : Object
594 public Gtk.ScrolledWindow el;
595 private ValaProjectSettingsPopover _this;
601 public Xcls_vapi_scroll(ValaProjectSettingsPopover _owner )
604 _this.vapi_scroll = this;
605 this.el = new Gtk.ScrolledWindow();
609 // set gobject values
610 this.el.vscrollbar_policy = Gtk.PolicyType.AUTOMATIC;
611 this.el.has_frame = true;
612 this.el.hexpand = true;
613 this.el.vexpand = true;
614 this.el.hscrollbar_policy = Gtk.PolicyType.AUTOMATIC;
615 var child_1 = new Xcls_ColumnView18( _this );
617 this.el.child = child_1.el;
620 // user defined functions
622 public class Xcls_ColumnView18 : Object
624 public Gtk.ColumnView el;
625 private ValaProjectSettingsPopover _this;
631 public Xcls_ColumnView18(ValaProjectSettingsPopover _owner )
634 var child_1 = new Xcls_NoSelection19( _this );
636 this.el = new Gtk.ColumnView( child_1.el );
640 // set gobject values
641 var child_2 = new Xcls_ColumnViewColumn27( _this );
643 this.el.append_column ( child_2.el );
644 var child_3 = new Xcls_ColumnViewColumn29( _this );
646 this.el.append_column ( child_3.el );
649 // user defined functions
651 public class Xcls_NoSelection19 : Object
653 public Gtk.NoSelection el;
654 private ValaProjectSettingsPopover _this;
660 public Xcls_NoSelection19(ValaProjectSettingsPopover _owner )
663 var child_1 = new Xcls_FilterListModel20( _this );
665 this.el = new Gtk.NoSelection( child_1.el );
669 // set gobject values
672 // user defined functions
674 public class Xcls_FilterListModel20 : Object
676 public Gtk.FilterListModel el;
677 private ValaProjectSettingsPopover _this;
683 public Xcls_FilterListModel20(ValaProjectSettingsPopover _owner )
686 var child_1 = new Xcls_SortListModel21( _this );
688 new Xcls_vapi_filter( _this );
689 this.el = new Gtk.FilterListModel( child_1.el, _this.vapi_filter.el );
693 // set gobject values
696 // user defined functions
698 public class Xcls_SortListModel21 : Object
700 public Gtk.SortListModel el;
701 private ValaProjectSettingsPopover _this;
707 public Xcls_SortListModel21(ValaProjectSettingsPopover _owner )
710 new Xcls_vapimodel( _this );
711 var child_2 = new Xcls_StringSorter23( _this );
713 this.el = new Gtk.SortListModel( _this.vapimodel.el, child_2.el );
717 // set gobject values
720 // user defined functions
722 public class Xcls_vapimodel : Object
724 public GLib.ListStore el;
725 private ValaProjectSettingsPopover _this;
731 public Xcls_vapimodel(ValaProjectSettingsPopover _owner )
734 _this.vapimodel = this;
735 this.el = new GLib.ListStore( typeof(Project.VapiSelection) );
739 // set gobject values
742 // user defined functions
745 public class Xcls_StringSorter23 : Object
747 public Gtk.StringSorter el;
748 private ValaProjectSettingsPopover _this;
754 public Xcls_StringSorter23(ValaProjectSettingsPopover _owner )
757 var child_1 = new Xcls_PropertyExpression24( _this );
759 this.el = new Gtk.StringSorter( child_1.el );
763 // set gobject values
766 // user defined functions
768 public class Xcls_PropertyExpression24 : Object
770 public Gtk.PropertyExpression el;
771 private ValaProjectSettingsPopover _this;
777 public Xcls_PropertyExpression24(ValaProjectSettingsPopover _owner )
780 this.el = new Gtk.PropertyExpression( typeof(Project.VapiSelection), null, "sortkey" );
784 // set gobject values
787 // user defined functions
792 public class Xcls_vapi_filter : Object
794 public Gtk.StringFilter el;
795 private ValaProjectSettingsPopover _this;
801 public Xcls_vapi_filter(ValaProjectSettingsPopover _owner )
804 _this.vapi_filter = this;
805 var child_1 = new Xcls_PropertyExpression26( _this );
807 this.el = new Gtk.StringFilter( child_1.el );
811 // set gobject values
814 // user defined functions
816 public class Xcls_PropertyExpression26 : Object
818 public Gtk.PropertyExpression el;
819 private ValaProjectSettingsPopover _this;
825 public Xcls_PropertyExpression26(ValaProjectSettingsPopover _owner )
828 this.el = new Gtk.PropertyExpression( typeof(Project.VapiSelection), null, "sortkey" );
832 // set gobject values
835 // user defined functions
841 public class Xcls_ColumnViewColumn27 : Object
843 public Gtk.ColumnViewColumn el;
844 private ValaProjectSettingsPopover _this;
850 public Xcls_ColumnViewColumn27(ValaProjectSettingsPopover _owner )
853 var child_1 = new Xcls_SignalListItemFactory28( _this );
855 this.el = new Gtk.ColumnViewColumn( "Vapi Package", child_1.el );
859 // set gobject values
860 this.el.expand = true;
863 // user defined functions
865 public class Xcls_SignalListItemFactory28 : Object
867 public Gtk.SignalListItemFactory el;
868 private ValaProjectSettingsPopover _this;
874 public Xcls_SignalListItemFactory28(ValaProjectSettingsPopover _owner )
877 this.el = new Gtk.SignalListItemFactory();
881 // set gobject values
884 this.el.setup.connect( (item) => {
885 //var j = (JsRender.JsRender) item;
886 var gi = (Gtk.ListItem)item;
888 var lbl = new Gtk.Label("");
889 lbl.halign = Gtk.Align.START;
895 this.el.bind.connect( (listitem) => {
897 var lbl = (Gtk.Label) ((Gtk.ListItem)listitem).get_child();
899 var item = (Project.VapiSelection) ((Gtk.ListItem)listitem).get_item();
901 item.bind_property("name",
903 GLib.BindingFlags.SYNC_CREATE);
909 // user defined functions
913 public class Xcls_ColumnViewColumn29 : Object
915 public Gtk.ColumnViewColumn el;
916 private ValaProjectSettingsPopover _this;
922 public Xcls_ColumnViewColumn29(ValaProjectSettingsPopover _owner )
925 var child_1 = new Xcls_SignalListItemFactory30( _this );
927 this.el = new Gtk.ColumnViewColumn( "use", child_1.el );
931 // set gobject values
934 // user defined functions
936 public class Xcls_SignalListItemFactory30 : Object
938 public Gtk.SignalListItemFactory el;
939 private ValaProjectSettingsPopover _this;
945 public Xcls_SignalListItemFactory30(ValaProjectSettingsPopover _owner )
948 this.el = new Gtk.SignalListItemFactory();
952 // set gobject values
955 this.el.setup.connect( (listitem) => {
957 var btn = new Gtk.CheckButton();
959 ((Gtk.ListItem)listitem).set_child(btn);
961 btn.toggled.connect(() => {
963 var jr = (Project.VapiSelection) ((Gtk.ListItem)listitem).get_item();
964 jr.selected = btn.active;
967 this.el.bind.connect( (listitem) => {
968 //GLib.debug("listitme is is %s", ((Gtk.ListItem)listitem).get_type().name());
972 //var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();
973 var btn = (Gtk.CheckButton) ((Gtk.ListItem)listitem).get_child();
976 var vs = (Project.VapiSelection)((Gtk.ListItem)listitem).get_item();
978 //GLib.debug("change %s to %s", lbl.label, np.name);
980 btn.active = vs.selected;
988 // user defined functions
994 public class Xcls_vapi_search : Object
996 public Gtk.SearchEntry el;
997 private ValaProjectSettingsPopover _this;
1003 public Xcls_vapi_search(ValaProjectSettingsPopover _owner )
1006 _this.vapi_search = this;
1007 this.el = new Gtk.SearchEntry();
1011 // set gobject values
1012 this.el.placeholder_text = "Search Libraries (Vapi)";
1013 this.el.search_delay = 500;
1016 this.el.search_changed.connect( ( ) => {
1018 _this.vapi_filter.el.set_search(this.el.get_text());
1023 // user defined functions
1027 public class Xcls_Paned32 : Object
1029 public Gtk.Paned el;
1030 private ValaProjectSettingsPopover _this;
1036 public Xcls_Paned32(ValaProjectSettingsPopover _owner )
1039 this.el = new Gtk.Paned( Gtk.Orientation.HORIZONTAL );
1043 // set gobject values
1044 this.el.vexpand = true;
1045 this.el.position = 300;
1046 new Xcls_set_vbox( _this );
1047 this.el.set_end_child ( _this.set_vbox.el );
1048 var child_2 = new Xcls_Box49( _this );
1050 this.el.start_child = child_2.el;
1053 // user defined functions
1055 public class Xcls_set_vbox : Object
1058 private ValaProjectSettingsPopover _this;
1064 public Xcls_set_vbox(ValaProjectSettingsPopover _owner )
1067 _this.set_vbox = this;
1068 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
1072 // set gobject values
1073 this.el.homogeneous = false;
1074 var child_1 = new Xcls_ScrolledWindow34( _this );
1076 this.el.append( child_1.el );
1079 // user defined functions
1081 public class Xcls_ScrolledWindow34 : Object
1083 public Gtk.ScrolledWindow el;
1084 private ValaProjectSettingsPopover _this;
1090 public Xcls_ScrolledWindow34(ValaProjectSettingsPopover _owner )
1093 this.el = new Gtk.ScrolledWindow();
1097 // set gobject values
1098 this.el.vexpand = true;
1099 new Xcls_treeview( _this );
1100 this.el.child = _this.treeview.el;
1103 // user defined functions
1105 public class Xcls_treeview : Object
1107 public Gtk.ColumnView el;
1108 private ValaProjectSettingsPopover _this;
1114 public Xcls_treeview(ValaProjectSettingsPopover _owner )
1117 _this.treeview = this;
1118 new Xcls_treeselmodel( _this );
1119 this.el = new Gtk.ColumnView( _this.treeselmodel.el );
1123 // set gobject values
1124 new Xcls_name( _this );
1125 this.el.append_column ( _this.name.el );
1126 var child_3 = new Xcls_ColumnViewColumn47( _this );
1128 this.el.append_column ( child_3.el );
1131 // user defined functions
1133 public class Xcls_treeselmodel : Object
1135 public Gtk.SingleSelection el;
1136 private ValaProjectSettingsPopover _this;
1142 public Xcls_treeselmodel(ValaProjectSettingsPopover _owner )
1145 _this.treeselmodel = this;
1146 var child_1 = new Xcls_FilterListModel37( _this );
1148 this.el = new Gtk.SingleSelection( child_1.el );
1152 // set gobject values
1155 // user defined functions
1157 public class Xcls_FilterListModel37 : Object
1159 public Gtk.FilterListModel el;
1160 private ValaProjectSettingsPopover _this;
1166 public Xcls_FilterListModel37(ValaProjectSettingsPopover _owner )
1169 new Xcls_treelistsort( _this );
1170 var child_2 = new Xcls_CustomFilter44( _this );
1172 this.el = new Gtk.FilterListModel( _this.treelistsort.el, child_2.el );
1176 // set gobject values
1179 // user defined functions
1181 public class Xcls_treelistsort : Object
1183 public Gtk.SortListModel el;
1184 private ValaProjectSettingsPopover _this;
1190 public Xcls_treelistsort(ValaProjectSettingsPopover _owner )
1193 _this.treelistsort = this;
1194 new Xcls_treelistmodel( _this );
1195 var child_2 = new Xcls_TreeListRowSorter41( _this );
1197 this.el = new Gtk.SortListModel( _this.treelistmodel.el, child_2.el );
1201 // set gobject values
1206 //this.el.set_sorter(new Gtk.TreeListRowSorter(_this.treeview.el.sorter));
1210 // user defined functions
1212 public class Xcls_treelistmodel : Object
1214 public Gtk.TreeListModel el;
1215 private ValaProjectSettingsPopover _this;
1221 public Xcls_treelistmodel(ValaProjectSettingsPopover _owner )
1224 _this.treelistmodel = this;
1225 new Xcls_treemodel( _this );
1226 this.el = new Gtk.TreeListModel( _this.treemodel.el, false, true, (item) => {
1227 //GLib.debug("liststore got %s", item.get_type().name());
1228 return ((JsRender.JsRender)item).childfiles;
1233 // set gobject values
1236 // user defined functions
1238 public class Xcls_treemodel : Object
1240 public GLib.ListStore el;
1241 private ValaProjectSettingsPopover _this;
1247 public Xcls_treemodel(ValaProjectSettingsPopover _owner )
1250 _this.treemodel = this;
1251 this.el = new GLib.ListStore( typeof(JsRender.JsRender) );
1255 // set gobject values
1258 // user defined functions
1262 public class Xcls_TreeListRowSorter41 : Object
1264 public Gtk.TreeListRowSorter el;
1265 private ValaProjectSettingsPopover _this;
1271 public Xcls_TreeListRowSorter41(ValaProjectSettingsPopover _owner )
1274 var child_1 = new Xcls_StringSorter42( _this );
1276 this.el = new Gtk.TreeListRowSorter( child_1.el );
1280 // set gobject values
1283 // user defined functions
1285 public class Xcls_StringSorter42 : Object
1287 public Gtk.StringSorter el;
1288 private ValaProjectSettingsPopover _this;
1294 public Xcls_StringSorter42(ValaProjectSettingsPopover _owner )
1297 var child_1 = new Xcls_PropertyExpression43( _this );
1299 this.el = new Gtk.StringSorter( child_1.el );
1303 // set gobject values
1306 // user defined functions
1308 public class Xcls_PropertyExpression43 : Object
1310 public Gtk.PropertyExpression el;
1311 private ValaProjectSettingsPopover _this;
1317 public Xcls_PropertyExpression43(ValaProjectSettingsPopover _owner )
1320 this.el = new Gtk.PropertyExpression( typeof(JsRender.JsRender), null, "name" );
1324 // set gobject values
1327 // user defined functions
1333 public class Xcls_CustomFilter44 : Object
1335 public Gtk.CustomFilter el;
1336 private ValaProjectSettingsPopover _this;
1342 public Xcls_CustomFilter44(ValaProjectSettingsPopover _owner )
1345 this.el = new Gtk.CustomFilter( (item) => {
1347 var tr = ((Gtk.TreeListRow)item).get_item();
1348 //GLib.debug("filter %s", tr.get_type().name());
1349 var j = (JsRender.JsRender) tr;
1350 if (j.xtype == "Gtk") {
1353 if (j.xtype != "Dir") {
1354 return j.path.has_suffix(".vala") || j.path.has_suffix(".c");
1358 for (var i =0 ; i < j.childfiles.n_items; i++) {
1359 var f = (JsRender.JsRender) j.childfiles.get_item(i);
1360 if (f.xtype == "Gtk") {
1363 if (f.path.has_suffix(".vala") || f.path.has_suffix(".c")) {
1373 // set gobject values
1376 // user defined functions
1381 public class Xcls_name : Object
1383 public Gtk.ColumnViewColumn el;
1384 private ValaProjectSettingsPopover _this;
1390 public Xcls_name(ValaProjectSettingsPopover _owner )
1394 var child_1 = new Xcls_SignalListItemFactory46( _this );
1396 this.el = new Gtk.ColumnViewColumn( "Other Files", child_1.el );
1400 // set gobject values
1401 this.el.id = "name";
1402 this.el.expand = true;
1403 this.el.resizable = true;
1408 this.el.set_sorter( new Gtk.StringSorter(
1409 new Gtk.PropertyExpression(typeof(JsRender.JsRender), null, "name")
1416 // user defined functions
1418 public class Xcls_SignalListItemFactory46 : Object
1420 public Gtk.SignalListItemFactory el;
1421 private ValaProjectSettingsPopover _this;
1427 public Xcls_SignalListItemFactory46(ValaProjectSettingsPopover _owner )
1430 this.el = new Gtk.SignalListItemFactory();
1434 // set gobject values
1437 this.el.setup.connect( (listitem) => {
1439 var expand = new Gtk.TreeExpander();
1441 expand.set_indent_for_depth(true);
1442 expand.set_indent_for_icon(true);
1444 var lbl = new Gtk.Label("");
1445 lbl.use_markup = true;
1448 lbl.justify = Gtk.Justification.LEFT;
1452 expand.set_child(lbl);
1453 ((Gtk.ListItem)listitem).set_child(expand);
1454 ((Gtk.ListItem)listitem).activatable = false;
1456 this.el.bind.connect( (listitem) => {
1457 //GLib.debug("listitme is is %s", ((Gtk.ListItem)listitem).get_type().name());
1461 //var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();
1462 var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();
1465 var lbl = (Gtk.Label) expand.child;
1467 if (lbl.label != "") { // do not update
1472 var lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();
1473 var jr = (JsRender.JsRender) lr.get_item();
1474 //GLib.debug("change %s to %s", lbl.label, np.name);
1475 lbl.label = jr.name; // for dir's we could hsow the sub path..
1476 lbl.tooltip_markup = jr.path;
1478 expand.set_hide_expander( jr.childfiles.n_items < 1);
1479 expand.set_list_row(lr);
1481 expand.set_hide_expander( jr.xtype != "Dir" );
1482 expand.set_list_row(lr);
1489 // user defined functions
1493 public class Xcls_ColumnViewColumn47 : Object
1495 public Gtk.ColumnViewColumn el;
1496 private ValaProjectSettingsPopover _this;
1502 public Xcls_ColumnViewColumn47(ValaProjectSettingsPopover _owner )
1505 var child_1 = new Xcls_SignalListItemFactory48( _this );
1507 this.el = new Gtk.ColumnViewColumn( "use", child_1.el );
1511 // set gobject values
1514 // user defined functions
1516 public class Xcls_SignalListItemFactory48 : Object
1518 public Gtk.SignalListItemFactory el;
1519 private ValaProjectSettingsPopover _this;
1525 public Xcls_SignalListItemFactory48(ValaProjectSettingsPopover _owner )
1528 this.el = new Gtk.SignalListItemFactory();
1532 // set gobject values
1535 this.el.setup.connect( (listitem) => {
1537 var btn = new Gtk.CheckButton();
1539 ((Gtk.ListItem)listitem).set_child(btn);
1541 btn.toggled.connect(() => {
1542 if (_this.cg_loading) {
1545 var lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();
1546 var jr = (JsRender.JsRender) lr.get_item();
1547 jr.compile_group_selected = btn.active;
1552 this.el.bind.connect( (listitem) => {
1553 //GLib.debug("listitme is is %s", ((Gtk.ListItem)listitem).get_type().name());
1557 //var expand = (Gtk.TreeExpander) ((Gtk.ListItem)listitem).get_child();
1558 var btn = (Gtk.CheckButton) ((Gtk.ListItem)listitem).get_child();
1561 var lr = (Gtk.TreeListRow)((Gtk.ListItem)listitem).get_item();
1562 var jr = (JsRender.JsRender) lr.get_item();
1563 //GLib.debug("change %s to %s", lbl.label, np.name);
1565 //btn.active = jr.compile_group_selected;
1566 btn.active = _this.selected_target.has_file(jr);
1568 //jr.bind_property("compile_group_selected",
1570 // GLib.BindingFlags.BIDIRECTIONAL);
1576 // user defined functions
1583 public class Xcls_Box49 : Object
1586 private ValaProjectSettingsPopover _this;
1592 public Xcls_Box49(ValaProjectSettingsPopover _owner )
1595 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
1599 // set gobject values
1600 var child_1 = new Xcls_Box50( _this );
1602 this.el.append( child_1.el );
1603 var child_2 = new Xcls_ScrolledWindow53( _this );
1605 this.el.append( child_2.el );
1606 new Xcls_set_vboxb( _this );
1607 this.el.append( _this.set_vboxb.el );
1610 // user defined functions
1612 public class Xcls_Box50 : Object
1615 private ValaProjectSettingsPopover _this;
1621 public Xcls_Box50(ValaProjectSettingsPopover _owner )
1624 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
1628 // set gobject values
1629 this.el.hexpand = true;
1630 var child_1 = new Xcls_Button51( _this );
1632 this.el.append( child_1.el );
1633 var child_2 = new Xcls_Button52( _this );
1635 this.el.append( child_2.el );
1638 // user defined functions
1640 public class Xcls_Button51 : Object
1642 public Gtk.Button el;
1643 private ValaProjectSettingsPopover _this;
1649 public Xcls_Button51(ValaProjectSettingsPopover _owner )
1652 this.el = new Gtk.Button();
1656 // set gobject values
1657 this.el.hexpand = true;
1658 this.el.label = "Add Compile Target";
1661 this.el.clicked.connect( () => {
1663 if (_this.project.compilegroups.has_key("NEW GROUP")) {
1666 var cg = new Project.GtkValaSettings(_this.project, "NEW GROUP");
1667 _this.project.compilegroups.set(cg.name, cg);
1668 _this.project.loadTargetsIntoStore(_this.target_model.el);
1669 // select it.. ?? should load it??
1670 for(var i =0;i < _this.target_model.el.n_items; i++) {
1671 var ncg = (Project.GtkValaSettings) _this.target_model.el.get_item(i);
1672 if (ncg.name == cg.name) {
1673 _this.target_sel.el.selected = i;
1674 _this.target_sel.selectTarget(cg);
1684 // user defined functions
1687 public class Xcls_Button52 : Object
1689 public Gtk.Button el;
1690 private ValaProjectSettingsPopover _this;
1696 public Xcls_Button52(ValaProjectSettingsPopover _owner )
1699 this.el = new Gtk.Button();
1703 // set gobject values
1704 this.el.hexpand = true;
1705 this.el.label = "Remove Target";
1708 this.el.clicked.connect( () => {
1709 // load the new values.
1710 if (_this.target_sel.el.selected == Gtk.INVALID_LIST_POSITION) {
1711 GLib.debug("nothing selected");
1716 // add the directory..
1717 var cg = (Project.GtkValaSettings) _this.target_model.el.get_item(_this.target_sel.el.selected);
1720 GLib.debug("remove: %s\n", cg.name);
1721 if (!_this.project.compilegroups.unset(cg.name)) {
1722 GLib.debug("remove failed");
1724 _this.project.loadTargetsIntoStore(_this.target_model.el);
1728 // user defined functions
1732 public class Xcls_ScrolledWindow53 : Object
1734 public Gtk.ScrolledWindow el;
1735 private ValaProjectSettingsPopover _this;
1741 public Xcls_ScrolledWindow53(ValaProjectSettingsPopover _owner )
1744 this.el = new Gtk.ScrolledWindow();
1748 // set gobject values
1749 this.el.vexpand = true;
1750 var child_1 = new Xcls_ColumnView54( _this );
1752 this.el.child = child_1.el;
1757 this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
1762 // user defined functions
1764 public class Xcls_ColumnView54 : Object
1766 public Gtk.ColumnView el;
1767 private ValaProjectSettingsPopover _this;
1773 public Xcls_ColumnView54(ValaProjectSettingsPopover _owner )
1776 new Xcls_target_sel( _this );
1777 this.el = new Gtk.ColumnView( _this.target_sel.el );
1781 // set gobject values
1782 var child_2 = new Xcls_ColumnViewColumn57( _this );
1784 this.el.append_column ( child_2.el );
1787 // user defined functions
1789 public class Xcls_target_sel : Object
1791 public Gtk.SingleSelection el;
1792 private ValaProjectSettingsPopover _this;
1798 public Xcls_target_sel(ValaProjectSettingsPopover _owner )
1801 _this.target_sel = this;
1802 new Xcls_target_model( _this );
1803 this.el = new Gtk.SingleSelection( _this.target_model.el );
1807 // set gobject values
1810 this.el.selection_changed.connect( (position, n_items) => {
1813 // load the new values.
1814 if (this.el.selected == Gtk.INVALID_LIST_POSITION) {
1815 this.selectTarget(null);
1818 this.selectTarget(null);
1822 // add the directory..
1823 var cg = (Project.GtkValaSettings) _this.target_model.el.get_item(this.el.selected);
1825 this.selectTarget(cg);
1830 // user defined functions
1831 public void selectTarget (Project.GtkValaSettings? cg) {
1832 // load the new values
1833 _this.selected_target = cg;
1834 _this.project.active_cg = cg;
1839 _this.set_vbox.el.hide();
1840 _this.set_vboxb.el.hide();
1845 _this.set_vbox.el.show();
1846 _this.set_vboxb.el.show();
1847 // add the directory..
1850 GLib.debug("loading dirs into project list");
1851 cg.loading_ui = true;
1852 _this.cg_loading = true;
1854 _this.treeview.el.set_model(new Gtk.SingleSelection(null));
1855 _this.project.loadDirsIntoStore(_this.treemodel.el);
1856 _this.treeview.el.set_model(_this.treeselmodel.el);
1858 cg.loading_ui = false;
1860 _this.cg_loading = false;
1861 GLib.debug("Set name to %s", cg.name);
1863 _this.build_name.el.buffer.set_text(cg.name.data);
1864 _this.build_as_library.el.active = cg.is_library;
1866 _this.build_execute_args.el.buffer.set_text( cg.execute_args.data );
1870 public class Xcls_target_model : Object
1872 public GLib.ListStore el;
1873 private ValaProjectSettingsPopover _this;
1879 public Xcls_target_model(ValaProjectSettingsPopover _owner )
1882 _this.target_model = this;
1883 this.el = new GLib.ListStore( typeof(Project.GtkValaSettings) );
1887 // set gobject values
1890 // user defined functions
1894 public class Xcls_ColumnViewColumn57 : Object
1896 public Gtk.ColumnViewColumn el;
1897 private ValaProjectSettingsPopover _this;
1903 public Xcls_ColumnViewColumn57(ValaProjectSettingsPopover _owner )
1906 var child_1 = new Xcls_SignalListItemFactory58( _this );
1908 this.el = new Gtk.ColumnViewColumn( "Build Target", child_1.el );
1912 // set gobject values
1913 this.el.expand = true;
1916 // user defined functions
1918 public class Xcls_SignalListItemFactory58 : Object
1920 public Gtk.SignalListItemFactory el;
1921 private ValaProjectSettingsPopover _this;
1927 public Xcls_SignalListItemFactory58(ValaProjectSettingsPopover _owner )
1930 this.el = new Gtk.SignalListItemFactory();
1934 // set gobject values
1937 this.el.setup.connect( (item) => {
1938 //var j = (JsRender.JsRender) item;
1939 var gi = (Gtk.ListItem)item;
1941 var lbl = new Gtk.Label("");
1942 lbl.halign = Gtk.Align.START;
1948 this.el.bind.connect( (listitem) => {
1950 var lbl = (Gtk.Label) ((Gtk.ListItem)listitem).get_child();
1952 var item = (Project.GtkValaSettings) ((Gtk.ListItem)listitem).get_item();
1954 item.bind_property("name",
1956 GLib.BindingFlags.SYNC_CREATE);
1962 // user defined functions
1968 public class Xcls_set_vboxb : Object
1971 private ValaProjectSettingsPopover _this;
1977 public Xcls_set_vboxb(ValaProjectSettingsPopover _owner )
1980 _this.set_vboxb = this;
1981 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
1985 // set gobject values
1986 var child_1 = new Xcls_Label60( _this );
1988 this.el.append( child_1.el );
1989 new Xcls_build_name( _this );
1990 this.el.append( _this.build_name.el );
1991 var child_3 = new Xcls_Label62( _this );
1993 this.el.append( child_3.el );
1994 new Xcls_build_execute_args( _this );
1995 this.el.append( _this.build_execute_args.el );
1996 new Xcls_build_as_library( _this );
1997 this.el.append( _this.build_as_library.el );
2000 // user defined functions
2002 public class Xcls_Label60 : Object
2004 public Gtk.Label el;
2005 private ValaProjectSettingsPopover _this;
2011 public Xcls_Label60(ValaProjectSettingsPopover _owner )
2014 this.el = new Gtk.Label( "Build Name (executable name)" );
2018 // set gobject values
2021 // user defined functions
2024 public class Xcls_build_name : Object
2026 public Gtk.Entry el;
2027 private ValaProjectSettingsPopover _this;
2031 public bool in_insert;
2034 public Xcls_build_name(ValaProjectSettingsPopover _owner )
2037 _this.build_name = this;
2038 this.el = new Gtk.Entry();
2041 this.in_insert = false;
2043 // set gobject values
2047 var ed = (this.el.get_delegate() as Gtk.Editable);
2049 ed.insert_text.connect((text, length, ref position) => {
2050 if (this.in_insert) {
2053 GLib.debug("got insert text %s", text);
2056 for(var i = 0;i < text.length; i++){
2057 if (Posix.isupper(text[i]) ||Posix.islower(text[i]) ) {
2058 nt += text[i].to_string();
2061 if (nt.length < 1) {
2062 GLib.Signal.stop_emission_by_name(ed, "insert_text");
2066 this.in_insert = true;
2068 this.el.insert_text(nt,nt.length, ref position);
2069 this.in_insert = false;
2070 GLib.Signal.stop_emission_by_name(ed, "insert_text");
2076 this.el.insert_text.connect( (text, length, ref position) => {
2077 if (this.in_insert) {
2080 GLib.debug("got insert text %s", text);
2083 for(var i = 0;i < text.length; i++){
2084 if (Posix.isalpha(text[i])) {
2085 nt += text[i].to_string();
2088 if (nt.length < 1) {
2092 this.in_insert = true;
2094 this.el.insert_text(text,length, ref position);
2095 this.in_insert = false;
2097 this.el.changed.connect( () => {
2098 if (_this.selected_target == null) {
2101 var name = this.el.text;
2102 // name ischanging.. probably always..
2103 if (_this.selected_target.name != name) {
2104 _this.project.compilegroups.unset(_this.selected_target.name);
2105 _this.project.compilegroups.set(name, _this.selected_target);
2108 _this.selected_target.name = this.el.buffer.text;
2112 // user defined functions
2115 public class Xcls_Label62 : Object
2117 public Gtk.Label el;
2118 private ValaProjectSettingsPopover _this;
2124 public Xcls_Label62(ValaProjectSettingsPopover _owner )
2127 this.el = new Gtk.Label( "test argments - when run after a build" );
2131 // set gobject values
2134 // user defined functions
2137 public class Xcls_build_execute_args : Object
2139 public Gtk.Entry el;
2140 private ValaProjectSettingsPopover _this;
2146 public Xcls_build_execute_args(ValaProjectSettingsPopover _owner )
2149 _this.build_execute_args = this;
2150 this.el = new Gtk.Entry();
2154 // set gobject values
2155 this.el.placeholder_text = "eg. -f somefile -g ";
2158 this.el.changed.connect( () => {
2159 if (_this.selected_target == null) {
2162 _this.selected_target.execute_args = this.el.buffer.text;
2167 // user defined functions
2170 public class Xcls_build_as_library : Object
2172 public Gtk.CheckButton el;
2173 private ValaProjectSettingsPopover _this;
2179 public Xcls_build_as_library(ValaProjectSettingsPopover _owner )
2182 _this.build_as_library = this;
2183 this.el = new Gtk.CheckButton();
2187 // set gobject values
2188 this.el.label = "build as library";
2191 this.el.notify["active"].connect( () => {
2192 if (_this.selected_target == null) {
2195 _this.selected_target.is_library = this.el.active;
2200 // user defined functions
2207 public class Xcls_Box65 : Object
2210 private ValaProjectSettingsPopover _this;
2216 public Xcls_Box65(ValaProjectSettingsPopover _owner )
2219 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
2223 // set gobject values
2224 this.el.margin_end = 4;
2225 this.el.margin_start = 4;
2226 this.el.hexpand = true;
2227 this.el.margin_bottom = 4;
2228 this.el.margin_top = 4;
2229 var child_1 = new Xcls_Button66( _this );
2231 this.el.append( child_1.el );
2232 var child_2 = new Xcls_Label67( _this );
2234 this.el.append( child_2.el );
2235 new Xcls_save_btn( _this );
2236 this.el.append( _this.save_btn.el );
2239 // user defined functions
2241 public class Xcls_Button66 : Object
2243 public Gtk.Button el;
2244 private ValaProjectSettingsPopover _this;
2250 public Xcls_Button66(ValaProjectSettingsPopover _owner )
2253 this.el = new Gtk.Button();
2257 // set gobject values
2258 this.el.label = "Cancel";
2261 this.el.clicked.connect( () => {
2268 // user defined functions
2271 public class Xcls_Label67 : Object
2273 public Gtk.Label el;
2274 private ValaProjectSettingsPopover _this;
2280 public Xcls_Label67(ValaProjectSettingsPopover _owner )
2283 this.el = new Gtk.Label( "" );
2287 // set gobject values
2288 this.el.hexpand = true;
2291 // user defined functions
2294 public class Xcls_save_btn : Object
2296 public Gtk.Button el;
2297 private ValaProjectSettingsPopover _this;
2303 public Xcls_save_btn(ValaProjectSettingsPopover _owner )
2306 _this.save_btn = this;
2307 this.el = new Gtk.Button();
2311 // set gobject values
2312 this.el.css_classes = { "suggested-action" };
2313 this.el.label = "Save";
2316 this.el.clicked.connect( ( ) => {
2319 _this.project.save();
2324 if (_this.doneObj != null) {
2325 _this.doneObj.call(_this.project);
2332 // user defined functions