1 static Xcls_MainWindow _MainWindow;
3 public class Xcls_MainWindow : Object
5 public Gtk.ApplicationWindow el;
6 private Xcls_MainWindow _this;
8 public static Xcls_MainWindow singleton()
10 if (_MainWindow == null) {
11 _MainWindow= new Xcls_MainWindow();
15 public Xcls_headerbar headerbar;
16 public Xcls_windowbtn windowbtn;
17 public Xcls_windowspopup windowspopup;
18 public Xcls_popover_menu popover_menu;
19 public Xcls_open_projects_btn open_projects_btn;
20 public Xcls_vbox vbox;
21 public Xcls_mainpane mainpane;
22 public Xcls_leftpane leftpane;
23 public Xcls_editpane editpane;
24 public Xcls_tree tree;
25 public Xcls_props props;
26 public Xcls_rooviewbox rooviewbox;
27 public Xcls_codeeditviewbox codeeditviewbox;
28 public Xcls_topbarmenu topbarmenu;
29 public Xcls_statusbar statusbar;
30 public Xcls_statusbar_compilestatus_label statusbar_compilestatus_label;
31 public Xcls_statusbar_errors statusbar_errors;
32 public Xcls_statusbar_warnings statusbar_warnings;
33 public Xcls_statusbar_depricated statusbar_depricated;
34 public Xcls_statusbar_run statusbar_run;
35 public Xcls_statusbar_compile_spinner statusbar_compile_spinner;
38 public WindowState windowstate;
39 public Project.Project project;
42 public Xcls_MainWindow()
45 this.el = new Gtk.ApplicationWindow(BuilderApplication.singleton({}));
51 this.el.title = "Roo Application Builder";
52 this.el.default_height = 850;
53 this.el.default_width = 1200;
54 new Xcls_headerbar( _this );
55 this.el.set_titlebar ( _this.headerbar.el );
56 new Xcls_vbox( _this );
57 this.el.set_child ( _this.vbox.el );
61 this.el.set_icon_name("roobuilder");
64 this.el.close_request.connect( ( ) => {
65 Resources.singleton().disconnect(_this.statusbar.handler_id);
67 BuilderApplication.removeWindow(this);
69 if (BuilderApplication.windows.size < 1) {
71 BuilderApplication.singleton( null ).quit();
75 this.el.show.connect( ( ) => {
76 // hide the file editing..
78 //this.hideViewEditing();
79 // this is updated by windowstate - we try and fill it in..
80 _this.statusbar.el.hide();
81 //_this.statusbar_errors.el.hide();
82 //_this.statusbar_warnings.el.hide();
83 //_this.statusbar_depricated.el.hide();
84 _this.statusbar_compile_spinner.el.hide();
86 Resources.singleton().checkResources();
91 this.el.hide.connect( () => {
98 // user defined functions
99 public void updateErrors (Palete.ValaCompileRequest? req) {
103 _this.statusbar_errors.el.hide();
104 _this.statusbar_warnings.el.hide();
105 _this.statusbar_depricated.el.hide();
110 this.statusbar_errors.setNotices(
111 req.errorByType.get("ERR"),
112 req.totalErrors("ERR"),
113 req.totalErrors("ERR", this.windowstate.file)
115 this.statusbar_warnings.setNotices(
116 req.errorByType.get("WARN"),
117 req.totalErrors("WARN"),
118 req.totalErrors("WARN", this.windowstate.file)
120 this.statusbar_depricated.setNotices(
121 req.errorByType.get("DEPR"),
122 req.totalErrors("DEPR"),
123 req.totalErrors("DEPR", this.windowstate.file)
126 _this.statusbar_run.el.hide();
128 if (req.totalErrors("ERR") < 1) {
129 _this.statusbar_run.el.show();
133 public void initChildren () {
134 // this needs putting in a better place..
135 this.windowstate = new WindowState(this);
145 public void show () {
148 if (this.windowstate.file == null) {
149 this.windowstate.showPopoverFiles(this.open_projects_btn.el, null, false);
152 public void setTitle () {
153 if (_this.windowstate.project == null ||
154 _this.windowstate.file == null
156 this.el.set_title("Select File");
160 _this.windowstate.project.name +
162 _this.windowstate.file.relpath);
164 public void openNewWindow () {
166 var w = new Xcls_MainWindow();
168 BuilderApplication.addWindow(w);
171 w.windowstate.showPopoverFiles(w.open_projects_btn.el, _this.project, false);
174 public class Xcls_headerbar : Object
176 public Gtk.HeaderBar el;
177 private Xcls_MainWindow _this;
181 public bool show_close_button;
185 public Xcls_headerbar(Xcls_MainWindow _owner )
188 _this.headerbar = this;
189 this.el = new Gtk.HeaderBar();
192 this.show_close_button = true;
193 this.title = "Application Builder";
195 // set gobject values
196 var child_1 = new Xcls_Box3( _this );
198 this.el.pack_start ( child_1.el );
201 // user defined functions
203 public class Xcls_Box3 : Object
206 private Xcls_MainWindow _this;
212 public Xcls_Box3(Xcls_MainWindow _owner )
215 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
219 // set gobject values
220 new Xcls_windowbtn( _this );
221 this.el.append( _this.windowbtn.el );
222 new Xcls_open_projects_btn( _this );
223 this.el.append ( _this.open_projects_btn.el );
226 // user defined functions
228 public class Xcls_windowbtn : Object
230 public Gtk.Button el;
231 private Xcls_MainWindow _this;
235 public Gee.ArrayList<Gtk.Widget> mitems;
238 public Xcls_windowbtn(Xcls_MainWindow _owner )
241 _this.windowbtn = this;
242 this.el = new Gtk.Button();
246 // set gobject values
247 this.el.margin_end = 4;
248 this.el.halign = Gtk.Align.START;
249 new Xcls_windowspopup( _this );
250 var child_2 = new Xcls_Box10( _this );
251 this.el.child = child_2.el;
256 this.mitems = new Gee.ArrayList<Gtk.Button>();
260 this.el.clicked.connect( ( ) => {
263 _this.windowspopup.el.set_parent(this.el);
265 _this.windowspopup.el.set_position(Gtk.PositionType.BOTTOM);
266 _this.windowspopup.el.popup();
270 // user defined functions
271 public void updateMenu () {
272 foreach(var m in this.mitems) {
273 _this.popover_menu.el.remove(m);
277 BuilderApplication.windows.sort((a,b) => {
278 if (a.windowstate == null ||
279 a.windowstate.file == null ||
280 b.windowstate == null ||
281 b.windowstate.file == null
286 var ap = a.windowstate.file.project.name;
287 var bp = b.windowstate.file.project.name;
292 return ap.collate(bp);
294 var af = a.windowstate.file == null ? "" : a.windowstate.file.getTitle();
295 var bf = b.windowstate.file == null ? "" : b.windowstate.file.getTitle();
296 return af.collate(bf);
301 foreach(var w in BuilderApplication.windows) {
302 var wid = BuilderApplication.windows.index_of(w);
303 // fixme find a better way to display this.
304 if (w.windowstate == null ||
305 w.windowstate.file == null ||
306 _this.windowstate == null ||
307 _this.windowstate.file == null
311 // should not happen...
312 if (w.windowstate.file.path == _this.windowstate.file.path) {
315 if (w.windowstate.file.project.name != p || p != "") {
316 var ms = new Gtk.Separator(Gtk.Orientation.HORIZONTAL);
317 _this.popover_menu.el.append(ms);
322 p = w.windowstate.file.project.name;
325 GLib.debug("add menuitem %s", w.windowstate.file.path);
329 var m = new Gtk.Button.with_label(
330 w.windowstate.file.project.name + " : " + w.windowstate.file.relpath
332 m.halign = Gtk.Align.START;
335 //w.windowstate.file.path);
336 m.clicked.connect(() => {
337 _this.windowspopup.el.hide();
338 BuilderApplication.windows.get(wid).el.present();
340 _this.popover_menu.el.append(m);
346 public class Xcls_windowspopup : Object
348 public Gtk.Popover el;
349 private Xcls_MainWindow _this;
355 public Xcls_windowspopup(Xcls_MainWindow _owner )
358 _this.windowspopup = this;
359 this.el = new Gtk.Popover();
363 // set gobject values
364 new Xcls_popover_menu( _this );
365 this.el.set_child ( _this.popover_menu.el );
368 // user defined functions
370 public class Xcls_popover_menu : Object
373 private Xcls_MainWindow _this;
379 public Xcls_popover_menu(Xcls_MainWindow _owner )
382 _this.popover_menu = this;
383 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
387 // set gobject values
388 var child_1 = new Xcls_Button7( _this );
390 this.el.append ( child_1.el );
391 var child_2 = new Xcls_Separator9( _this );
393 this.el.append ( child_2.el );
396 // user defined functions
398 public class Xcls_Button7 : Object
400 public Gtk.Button el;
401 private Xcls_MainWindow _this;
407 public Xcls_Button7(Xcls_MainWindow _owner )
410 this.el = new Gtk.Button();
414 // set gobject values
415 this.el.label = "New Window";
416 var child_1 = new Xcls_ShortcutController8( _this );
418 this.el.add_controller( child_1.el );
421 this.el.clicked.connect( ( ) => {
422 _this.windowspopup.el.hide();
423 _this.windowstate.showPopoverFiles(_this.windowbtn.el, _this.project, true);
427 // user defined functions
429 public class Xcls_ShortcutController8 : Object
431 public Gtk.ShortcutController el;
432 private Xcls_MainWindow _this;
438 public Xcls_ShortcutController8(Xcls_MainWindow _owner )
441 this.el = new Gtk.ShortcutController();
445 // set gobject values
446 this.el.scope = Gtk.ShortcutScope.GLOBAL;
451 this.el.add_shortcut(
453 new Gtk.KeyvalTrigger(Gdk.Key.N,Gdk.ModifierType.CONTROL_MASK),
454 new Gtk.SignalAction("clicked")
460 // user defined functions
464 public class Xcls_Separator9 : Object
466 public Gtk.Separator el;
467 private Xcls_MainWindow _this;
473 public Xcls_Separator9(Xcls_MainWindow _owner )
476 this.el = new Gtk.Separator( Gtk.Orientation.HORIZONTAL );
480 // set gobject values
483 // user defined functions
488 public class Xcls_Box10 : Object
491 private Xcls_MainWindow _this;
497 public Xcls_Box10(Xcls_MainWindow _owner )
500 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
504 // set gobject values
505 var child_1 = new Xcls_Image11( _this );
507 this.el.append( child_1.el );
508 var child_2 = new Xcls_Label12( _this );
510 this.el.append( child_2.el );
513 // user defined functions
515 public class Xcls_Image11 : Object
518 private Xcls_MainWindow _this;
524 public Xcls_Image11(Xcls_MainWindow _owner )
527 this.el = new Gtk.Image();
531 // set gobject values
532 this.el.icon_name = "window-new";
533 this.el.margin_start = 4;
536 // user defined functions
539 public class Xcls_Label12 : Object
542 private Xcls_MainWindow _this;
548 public Xcls_Label12(Xcls_MainWindow _owner )
551 this.el = new Gtk.Label( "Windows (Add/List)" );
555 // set gobject values
558 // user defined functions
563 public class Xcls_open_projects_btn : Object
565 public Gtk.Button el;
566 private Xcls_MainWindow _this;
570 public bool always_show_image;
573 public Xcls_open_projects_btn(Xcls_MainWindow _owner )
576 _this.open_projects_btn = this;
577 this.el = new Gtk.Button();
580 this.always_show_image = true;
582 // set gobject values
583 this.el.icon_name = "system-file-manager";
584 this.el.label = "Files / Projects";
587 this.el.clicked.connect( ( ) => {
588 _this.windowstate.showPopoverFiles(this.el, _this.project, false);
592 // user defined functions
597 public class Xcls_vbox : Object
600 private Xcls_MainWindow _this;
606 public Xcls_vbox(Xcls_MainWindow _owner )
610 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
614 // set gobject values
615 this.el.homogeneous = false;
616 this.el.vexpand = true;
617 new Xcls_mainpane( _this );
618 this.el.append( _this.mainpane.el );
619 var child_2 = new Xcls_Box23( _this );
621 this.el.append( child_2.el );
624 // user defined functions
626 public class Xcls_mainpane : Object
629 private Xcls_MainWindow _this;
633 public int lastWidth;
636 public Xcls_mainpane(Xcls_MainWindow _owner )
639 _this.mainpane = this;
640 this.el = new Gtk.Paned( Gtk.Orientation.HORIZONTAL );
645 // set gobject values
646 this.el.hexpand = true;
647 this.el.vexpand = true;
648 this.el.position = 400;
649 new Xcls_leftpane( _this );
650 this.el.start_child = _this.leftpane.el;
651 var child_2 = new Xcls_Box20( _this );
652 this.el.end_child = child_2.el;
655 this.el.accept_position.connect( ( ) => {
656 _this.windowstate.left_tree.onresize();
661 // user defined functions
663 public class Xcls_leftpane : Object
666 private Xcls_MainWindow _this;
672 public Xcls_leftpane(Xcls_MainWindow _owner )
675 _this.leftpane = this;
676 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
680 // set gobject values
681 this.el.hexpand = true;
682 this.el.vexpand = true;
683 new Xcls_editpane( _this );
684 this.el.append( _this.editpane.el );
687 // user defined functions
689 public class Xcls_editpane : Object
692 private Xcls_MainWindow _this;
698 public Xcls_editpane(Xcls_MainWindow _owner )
701 _this.editpane = this;
702 this.el = new Gtk.Paned( Gtk.Orientation.HORIZONTAL );
706 // set gobject values
707 new Xcls_tree( _this );
708 this.el.start_child = _this.tree.el;
709 new Xcls_props( _this );
710 this.el.end_child = _this.props.el;
713 this.el.accept_position.connect( ( ) => {
714 _this.windowstate.left_tree.onresize();
717 this.el.move_handle.connect( (scroll) => {
718 GLib.debug("Move handle");
723 // user defined functions
725 public class Xcls_tree : Object
728 private Xcls_MainWindow _this;
734 public Xcls_tree(Xcls_MainWindow _owner )
738 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
742 // set gobject values
743 this.el.hexpand = true;
744 this.el.vexpand = true;
747 // user defined functions
750 public class Xcls_props : Object
753 private Xcls_MainWindow _this;
759 public Xcls_props(Xcls_MainWindow _owner )
763 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
767 // set gobject values
768 this.el.hexpand = true;
769 this.el.vexpand = true;
772 // user defined functions
777 public class Xcls_Box20 : Object
780 private Xcls_MainWindow _this;
786 public Xcls_Box20(Xcls_MainWindow _owner )
789 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
793 // set gobject values
794 this.el.hexpand = true;
795 this.el.vexpand = true;
796 new Xcls_rooviewbox( _this );
797 this.el.append( _this.rooviewbox.el );
798 new Xcls_codeeditviewbox( _this );
799 this.el.append( _this.codeeditviewbox.el );
802 // user defined functions
804 public class Xcls_rooviewbox : Object
807 private Xcls_MainWindow _this;
813 public Xcls_rooviewbox(Xcls_MainWindow _owner )
816 _this.rooviewbox = this;
817 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
821 // set gobject values
822 this.el.hexpand = true;
823 this.el.vexpand = true;
826 // user defined functions
829 public class Xcls_codeeditviewbox : Object
832 private Xcls_MainWindow _this;
838 public Xcls_codeeditviewbox(Xcls_MainWindow _owner )
841 _this.codeeditviewbox = this;
842 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
846 // set gobject values
847 this.el.hexpand = true;
848 this.el.vexpand = true;
851 // user defined functions
856 public class Xcls_Box23 : Object
859 private Xcls_MainWindow _this;
865 public Xcls_Box23(Xcls_MainWindow _owner )
868 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
872 // set gobject values
873 this.el.homogeneous = false;
874 this.el.vexpand = false;
875 var child_1 = new Xcls_Button24( _this );
877 this.el.append( child_1.el );
878 var child_2 = new Xcls_Button25( _this );
880 this.el.append( child_2.el );
881 var child_3 = new Xcls_MenuButton26( _this );
883 this.el.append( child_3.el );
884 var child_4 = new Xcls_Label31( _this );
886 this.el.append( child_4.el );
887 new Xcls_statusbar( _this );
888 this.el.append( _this.statusbar.el );
889 var child_6 = new Xcls_Box33( _this );
891 this.el.append( child_6.el );
892 new Xcls_statusbar_compile_spinner( _this );
893 this.el.append( _this.statusbar_compile_spinner.el );
896 // user defined functions
898 public class Xcls_Button24 : Object
900 public Gtk.Button el;
901 private Xcls_MainWindow _this;
905 public bool always_show_image;
908 public Xcls_Button24(Xcls_MainWindow _owner )
911 this.el = new Gtk.Button();
914 this.always_show_image = true;
916 // set gobject values
917 this.el.icon_name = "emblem-system";
918 this.el.tooltip_text = "Project Details";
919 this.el.label = "Edit Project Settings";
922 this.el.clicked.connect( ( ) => {
924 _this.windowstate.projectPopoverShow(_this.el, null, null);
930 // user defined functions
933 public class Xcls_Button25 : Object
935 public Gtk.Button el;
936 private Xcls_MainWindow _this;
940 public bool always_show_image;
943 public Xcls_Button25(Xcls_MainWindow _owner )
946 this.el = new Gtk.Button();
949 this.always_show_image = true;
951 // set gobject values
952 this.el.icon_name = "document-properties";
953 this.el.tooltip_text = "File Details";
954 this.el.label = "Edit File Properties";
957 this.el.clicked.connect( ( ) => {
959 // create a new file in project..
960 if (_this.project == null || _this.windowstate.file == null) {
963 _this.windowstate.file_details.show(
964 _this.windowstate.file, _this.el, false
973 // user defined functions
976 public class Xcls_MenuButton26 : Object
978 public Gtk.MenuButton el;
979 private Xcls_MainWindow _this;
983 public bool always_show_image;
986 public Xcls_MenuButton26(Xcls_MainWindow _owner )
989 this.el = new Gtk.MenuButton();
992 this.always_show_image = true;
994 // set gobject values
995 this.el.icon_name = "dialog-information";
996 this.el.label = "About";
997 new Xcls_topbarmenu( _this );
998 this.el.popover = _this.topbarmenu.el;
1001 // user defined functions
1003 public class Xcls_topbarmenu : Object
1005 public Gtk.PopoverMenu el;
1006 private Xcls_MainWindow _this;
1012 public Xcls_topbarmenu(Xcls_MainWindow _owner )
1015 _this.topbarmenu = this;
1016 this.el = new Gtk.PopoverMenu.from_model(null);
1020 // set gobject values
1021 var child_1 = new Xcls_Box28( _this );
1023 this.el.set_child ( child_1.el );
1032 // user defined functions
1034 public class Xcls_Box28 : Object
1037 private Xcls_MainWindow _this;
1043 public Xcls_Box28(Xcls_MainWindow _owner )
1046 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
1050 // set gobject values
1051 var child_1 = new Xcls_Button29( _this );
1053 this.el.append( child_1.el );
1054 var child_2 = new Xcls_Button30( _this );
1056 this.el.append( child_2.el );
1059 // user defined functions
1061 public class Xcls_Button29 : Object
1063 public Gtk.Button el;
1064 private Xcls_MainWindow _this;
1070 public Xcls_Button29(Xcls_MainWindow _owner )
1073 this.el = new Gtk.Button();
1077 // set gobject values
1078 this.el.label = "Download updated Resources";
1081 this.el.activate.connect( ( ) => {
1082 Resources.singleton().fetchStart();
1086 // user defined functions
1089 public class Xcls_Button30 : Object
1091 public Gtk.Button el;
1092 private Xcls_MainWindow _this;
1098 public Xcls_Button30(Xcls_MainWindow _owner )
1101 this.el = new Gtk.Button();
1105 // set gobject values
1106 this.el.label = "About the Builder";
1109 this.el.clicked.connect( () => {
1110 About.singleton().el.show();
1114 // user defined functions
1120 public class Xcls_Label31 : Object
1122 public Gtk.Label el;
1123 private Xcls_MainWindow _this;
1129 public Xcls_Label31(Xcls_MainWindow _owner )
1132 this.el = new Gtk.Label( " " );
1136 // set gobject values
1137 this.el.hexpand = true;
1140 // user defined functions
1143 public class Xcls_statusbar : Object
1145 public Gtk.ProgressBar el;
1146 private Xcls_MainWindow _this;
1150 public ulong handler_id;
1153 public Xcls_statusbar(Xcls_MainWindow _owner )
1156 _this.statusbar = this;
1157 this.el = new Gtk.ProgressBar();
1160 this.handler_id = -1;
1162 // set gobject values
1163 this.el.show_text = true;
1168 this.handler_id = Resources.singleton().updateProgress.connect((pos,total) => {
1171 _this.mainpane.el.set_sensitive(true);
1175 _this.mainpane.el.set_sensitive(false);
1177 this.el.set_fraction ((1.0f * pos) / (1.0f * total));
1178 this.el.set_text("Fetching Resource : %s/%s".printf(pos.to_string(), total.to_string()));
1184 // user defined functions
1187 public class Xcls_Box33 : Object
1190 private Xcls_MainWindow _this;
1196 public Xcls_Box33(Xcls_MainWindow _owner )
1199 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
1203 // set gobject values
1204 new Xcls_statusbar_compilestatus_label( _this );
1205 this.el.append( _this.statusbar_compilestatus_label.el );
1206 new Xcls_statusbar_errors( _this );
1207 this.el.append( _this.statusbar_errors.el );
1208 new Xcls_statusbar_warnings( _this );
1209 this.el.append( _this.statusbar_warnings.el );
1210 new Xcls_statusbar_depricated( _this );
1211 this.el.append( _this.statusbar_depricated.el );
1212 new Xcls_statusbar_run( _this );
1213 this.el.append( _this.statusbar_run.el );
1216 // user defined functions
1218 public class Xcls_statusbar_compilestatus_label : Object
1220 public Gtk.Label el;
1221 private Xcls_MainWindow _this;
1227 public Xcls_statusbar_compilestatus_label(Xcls_MainWindow _owner )
1230 _this.statusbar_compilestatus_label = this;
1231 this.el = new Gtk.Label( "Compile Status:" );
1235 // set gobject values
1236 this.el.margin_end = 4;
1237 this.el.margin_start = 4;
1240 // user defined functions
1243 public class Xcls_statusbar_errors : Object
1245 public Gtk.Button el;
1246 private Xcls_MainWindow _this;
1250 public Xcls_ValaCompileErrors popup;
1251 public GLib.ListStore notices;
1254 public Xcls_statusbar_errors(Xcls_MainWindow _owner )
1257 _this.statusbar_errors = this;
1258 this.el = new Gtk.Button();
1261 this.notices = null;
1263 // set gobject values
1264 this.el.icon_name = "dialog-error";
1265 this.el.label = "0 Errors";
1268 this.el.clicked.connect( () => {
1272 if (this.popup == null) {
1273 this.popup = new Xcls_ValaCompileErrors();
1274 this.popup.window = _this;
1275 //this.popup.el.application = _this.el.application;
1276 // this.popup.el.set_transient_for( _this.el );
1277 this.popup.el.set_parent(this.el);
1279 if (_this.statusbar_compile_spinner.el.spinning) {
1280 this.popup.el.show();
1283 this.popup.show(this.notices, this.el);
1288 // user defined functions
1289 public void setNotices (GLib.ListStore nots, int qty, int tf) {
1293 if (this.popup != null && this.popup.el.visible) {
1294 this.popup.el.hide();
1300 this.el.label = "%d/%d Errors".printf(tf,qty);
1301 this.notices = nots;
1302 if (this.popup != null && this.popup.el.visible) {
1303 this.popup.show(this.notices, this.el);
1308 public class Xcls_statusbar_warnings : Object
1310 public Gtk.Button el;
1311 private Xcls_MainWindow _this;
1315 public Xcls_ValaCompileErrors popup;
1316 public GLib.ListStore notices;
1319 public Xcls_statusbar_warnings(Xcls_MainWindow _owner )
1322 _this.statusbar_warnings = this;
1323 this.el = new Gtk.Button();
1326 this.notices = null;
1328 // set gobject values
1329 this.el.icon_name = "dialog-warning";
1330 this.el.label = "0 Warnings";
1333 this.el.clicked.connect( () => {
1335 if (this.popup == null) {
1336 this.popup = new Xcls_ValaCompileErrors();
1337 this.popup.window = _this;
1338 // this.popup.el.set_transient_for( _this.el );
1339 this.popup.el.set_parent(this.el);
1341 if (_this.statusbar_compile_spinner.el.spinning) {
1342 this.popup.el.show();
1345 this.popup.show(this.notices, this.el);
1350 // user defined functions
1351 public void setNotices (GLib.ListStore nots, int qty, int tf) {
1355 if (this.popup != null && this.popup.el.visible) {
1356 this.popup.el.hide();
1361 this.el.label = "%d/%d Warnings".printf(tf,qty);
1362 this.notices = nots;
1363 if (this.popup != null && this.popup.el.visible) {
1364 this.popup.show(this.notices, this.el);
1371 public class Xcls_statusbar_depricated : Object
1373 public Gtk.Button el;
1374 private Xcls_MainWindow _this;
1378 public Xcls_ValaCompileErrors popup;
1379 public GLib.ListStore notices;
1382 public Xcls_statusbar_depricated(Xcls_MainWindow _owner )
1385 _this.statusbar_depricated = this;
1386 this.el = new Gtk.Button();
1389 this.notices = null;
1391 // set gobject values
1392 this.el.icon_name = "dialog-information";
1393 this.el.label = "0 Depricated";
1396 this.el.clicked.connect( () => {
1398 if (this.popup == null) {
1399 this.popup = new Xcls_ValaCompileErrors();
1400 this.popup.window = _this;
1401 // this.popup.el.set_transient_for( _this.el );
1402 this.popup.el.set_parent(this.el);
1404 if (_this.statusbar_compile_spinner.el.spinning) {
1405 this.popup.el.show();
1409 this.popup.show(this.notices, this.el);
1414 // user defined functions
1415 public void setNotices (GLib.ListStore nots, int qty, int tf) {
1418 if (this.popup != null && this.popup.el.visible) {
1419 this.popup.el.hide();
1427 this.el.label = "%d/%d Depricated".printf(tf,qty);
1428 this.notices = nots;
1429 if (this.popup != null && this.popup.el.visible) {
1430 this.popup.show(this.notices, this.el);
1435 public class Xcls_statusbar_run : Object
1437 public Gtk.Button el;
1438 private Xcls_MainWindow _this;
1442 public Xcls_ValaCompileErrors popup;
1445 public Xcls_statusbar_run(Xcls_MainWindow _owner )
1448 _this.statusbar_run = this;
1449 this.el = new Gtk.Button();
1453 // set gobject values
1454 this.el.icon_name = "media-playback-start";
1455 this.el.label = "Run";
1458 this.el.clicked.connect( () => {
1460 if (_this.windowstate.file == null) {
1463 if (_this.statusbar_compile_spinner.el.spinning) {
1464 _this.windowstate.compile_results.el.set_parent(this.el);
1465 _this.windowstate.compile_results.el.show(); // show currently running.
1468 BuilderApplication.valacompilequeue.addFile(
1469 Palete.ValaCompileRequestType.RUN,
1470 _this.windowstate.file, "", true ) ;
1472 _this.windowstate.compile_results.el.set_parent(this.el);
1473 _this.windowstate.compile_results.show(this.el,true);
1478 // user defined functions
1482 public class Xcls_statusbar_compile_spinner : Object
1484 public Gtk.Spinner el;
1485 private Xcls_MainWindow _this;
1491 public Xcls_statusbar_compile_spinner(Xcls_MainWindow _owner )
1494 _this.statusbar_compile_spinner = this;
1495 this.el = new Gtk.Spinner();
1499 // set gobject values
1500 this.el.margin_end = 4;
1501 this.el.margin_start = 4;
1502 this.el.tooltip_text = "Compiling";
1505 // user defined functions
1506 public void start () {
1512 public void stop () {