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;
36 public Xcls_statusbar_compile_icon statusbar_compile_icon;
39 public WindowState windowstate;
40 public Project.Project project;
43 public Xcls_MainWindow()
46 this.el = new Gtk.ApplicationWindow(BuilderApplication.singleton({}));
52 this.el.title = "Roo Application Builder";
53 this.el.default_height = 850;
54 this.el.default_width = 1200;
55 new Xcls_headerbar( _this );
56 this.el.set_titlebar ( _this.headerbar.el );
57 new Xcls_vbox( _this );
58 this.el.set_child ( _this.vbox.el );
62 this.el.set_icon_name("roobuilder");
65 this.el.close_request.connect( ( ) => {
66 Resources.singleton().disconnect(_this.statusbar.handler_id);
69 this.windowstate.file.getLanguageServer().document_close(
73 BuilderApplication.removeWindow(this);
75 if (BuilderApplication.windows.size < 1) {
76 this.windowstate.file.getLanguageServer().exit();
77 BuilderApplication.singleton( null ).quit();
81 this.el.show.connect( ( ) => {
82 // hide the file editing..
84 //this.hideViewEditing();
85 // this is updated by windowstate - we try and fill it in..
86 _this.statusbar.el.hide();
87 //_this.statusbar_errors.el.hide();
88 //_this.statusbar_warnings.el.hide();
89 //_this.statusbar_depricated.el.hide();
90 _this.statusbar_compile_spinner.el.hide();
92 Resources.singleton().checkResources();
97 this.el.hide.connect( () => {
104 // user defined functions
105 public void updateErrors () {
108 GLib.debug("updateErrors");
110 var pr = this.windowstate.project.getErrors("ERR");
112 this.statusbar_errors.setNotices(
114 this.windowstate.file.getErrors("ERR")
117 this.statusbar_warnings.setNotices(
118 this.windowstate.project.getErrors("WARN"),
119 this.windowstate.file.getErrors("WARN")
121 this.statusbar_depricated.setNotices(
122 this.windowstate.project.getErrors("DEPR"),
123 this.windowstate.file.getErrors("DEPR")
126 _this.statusbar_run.el.hide();
128 if (pr.get_n_items() < 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 );
894 new Xcls_statusbar_compile_icon( _this );
895 this.el.append( _this.statusbar_compile_icon.el );
898 // user defined functions
900 public class Xcls_Button24 : Object
902 public Gtk.Button el;
903 private Xcls_MainWindow _this;
907 public bool always_show_image;
910 public Xcls_Button24(Xcls_MainWindow _owner )
913 this.el = new Gtk.Button();
916 this.always_show_image = true;
918 // set gobject values
919 this.el.icon_name = "emblem-system";
920 this.el.tooltip_text = "Project Details";
921 this.el.label = "Edit Project Settings";
924 this.el.clicked.connect( ( ) => {
926 _this.windowstate.projectPopoverShow(_this.el, null, null);
932 // user defined functions
935 public class Xcls_Button25 : Object
937 public Gtk.Button el;
938 private Xcls_MainWindow _this;
942 public bool always_show_image;
945 public Xcls_Button25(Xcls_MainWindow _owner )
948 this.el = new Gtk.Button();
951 this.always_show_image = true;
953 // set gobject values
954 this.el.icon_name = "document-properties";
955 this.el.tooltip_text = "File Details";
956 this.el.label = "Edit File Properties";
959 this.el.clicked.connect( ( ) => {
961 // create a new file in project..
962 if (_this.project == null || _this.windowstate.file == null) {
965 _this.windowstate.file_details.show(
966 _this.windowstate.file, _this.el, false
975 // user defined functions
978 public class Xcls_MenuButton26 : Object
980 public Gtk.MenuButton el;
981 private Xcls_MainWindow _this;
985 public bool always_show_image;
988 public Xcls_MenuButton26(Xcls_MainWindow _owner )
991 this.el = new Gtk.MenuButton();
994 this.always_show_image = true;
996 // set gobject values
997 this.el.icon_name = "dialog-information";
998 this.el.label = "About";
999 new Xcls_topbarmenu( _this );
1000 this.el.popover = _this.topbarmenu.el;
1003 // user defined functions
1005 public class Xcls_topbarmenu : Object
1007 public Gtk.PopoverMenu el;
1008 private Xcls_MainWindow _this;
1014 public Xcls_topbarmenu(Xcls_MainWindow _owner )
1017 _this.topbarmenu = this;
1018 this.el = new Gtk.PopoverMenu.from_model(null);
1022 // set gobject values
1023 var child_1 = new Xcls_Box28( _this );
1025 this.el.set_child ( child_1.el );
1034 // user defined functions
1036 public class Xcls_Box28 : Object
1039 private Xcls_MainWindow _this;
1045 public Xcls_Box28(Xcls_MainWindow _owner )
1048 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
1052 // set gobject values
1053 var child_1 = new Xcls_Button29( _this );
1055 this.el.append( child_1.el );
1056 var child_2 = new Xcls_Button30( _this );
1058 this.el.append( child_2.el );
1061 // user defined functions
1063 public class Xcls_Button29 : Object
1065 public Gtk.Button el;
1066 private Xcls_MainWindow _this;
1072 public Xcls_Button29(Xcls_MainWindow _owner )
1075 this.el = new Gtk.Button();
1079 // set gobject values
1080 this.el.label = "Download updated Resources";
1083 this.el.activate.connect( ( ) => {
1084 Resources.singleton().fetchStart();
1088 // user defined functions
1091 public class Xcls_Button30 : Object
1093 public Gtk.Button el;
1094 private Xcls_MainWindow _this;
1100 public Xcls_Button30(Xcls_MainWindow _owner )
1103 this.el = new Gtk.Button();
1107 // set gobject values
1108 this.el.label = "About the Builder";
1111 this.el.clicked.connect( () => {
1112 About.singleton().el.show();
1116 // user defined functions
1122 public class Xcls_Label31 : Object
1124 public Gtk.Label el;
1125 private Xcls_MainWindow _this;
1131 public Xcls_Label31(Xcls_MainWindow _owner )
1134 this.el = new Gtk.Label( " " );
1138 // set gobject values
1139 this.el.hexpand = true;
1142 // user defined functions
1145 public class Xcls_statusbar : Object
1147 public Gtk.ProgressBar el;
1148 private Xcls_MainWindow _this;
1152 public ulong handler_id;
1155 public Xcls_statusbar(Xcls_MainWindow _owner )
1158 _this.statusbar = this;
1159 this.el = new Gtk.ProgressBar();
1162 this.handler_id = -1;
1164 // set gobject values
1165 this.el.show_text = true;
1170 this.handler_id = Resources.singleton().updateProgress.connect((pos,total) => {
1173 _this.mainpane.el.set_sensitive(true);
1177 _this.mainpane.el.set_sensitive(false);
1179 this.el.set_fraction ((1.0f * pos) / (1.0f * total));
1180 this.el.set_text("Fetching Resource : %s/%s".printf(pos.to_string(), total.to_string()));
1186 // user defined functions
1189 public class Xcls_Box33 : Object
1192 private Xcls_MainWindow _this;
1198 public Xcls_Box33(Xcls_MainWindow _owner )
1201 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
1205 // set gobject values
1206 new Xcls_statusbar_compilestatus_label( _this );
1207 this.el.append( _this.statusbar_compilestatus_label.el );
1208 new Xcls_statusbar_errors( _this );
1209 this.el.append( _this.statusbar_errors.el );
1210 new Xcls_statusbar_warnings( _this );
1211 this.el.append( _this.statusbar_warnings.el );
1212 new Xcls_statusbar_depricated( _this );
1213 this.el.append( _this.statusbar_depricated.el );
1214 new Xcls_statusbar_run( _this );
1215 this.el.append( _this.statusbar_run.el );
1218 // user defined functions
1220 public class Xcls_statusbar_compilestatus_label : Object
1222 public Gtk.Label el;
1223 private Xcls_MainWindow _this;
1229 public Xcls_statusbar_compilestatus_label(Xcls_MainWindow _owner )
1232 _this.statusbar_compilestatus_label = this;
1233 this.el = new Gtk.Label( "Compile Status:" );
1237 // set gobject values
1238 this.el.margin_end = 4;
1239 this.el.margin_start = 4;
1242 // user defined functions
1245 public class Xcls_statusbar_errors : Object
1247 public Gtk.Button el;
1248 private Xcls_MainWindow _this;
1252 public Xcls_ValaCompileErrors popup;
1255 public Xcls_statusbar_errors(Xcls_MainWindow _owner )
1258 _this.statusbar_errors = this;
1259 this.el = new Gtk.Button();
1263 // set gobject values
1264 this.el.icon_name = "dialog-error";
1265 this.el.label = "0 Errors";
1268 this.el.clicked.connect( () => {
1270 if (this.popup == null) {
1279 // user defined functions
1280 public void setNotices (GLib.ListStore nots, GLib.ListStore fe ) {
1281 BuilderApplication.showSpinner("");
1282 if (nots.get_n_items() < 1 ) {
1284 if (this.popup != null) {
1285 this.popup.el.hide();
1291 this.el.label = "%d/%d Errors".printf((int)fe.get_n_items(),(int)nots.get_n_items());
1295 if (this.popup == null) {
1296 this.popup = new Xcls_ValaCompileErrors();
1297 this.popup.window = _this;
1298 // this.popup.el.set_transient_for( _this.el );
1299 this.popup.el.set_parent(this.el);
1302 this.popup.updateNotices(nots);
1307 public class Xcls_statusbar_warnings : Object
1309 public Gtk.Button el;
1310 private Xcls_MainWindow _this;
1314 public Xcls_ValaCompileErrors popup;
1317 public Xcls_statusbar_warnings(Xcls_MainWindow _owner )
1320 _this.statusbar_warnings = this;
1321 this.el = new Gtk.Button();
1325 // set gobject values
1326 this.el.icon_name = "dialog-warning";
1327 this.el.label = "0 Warnings";
1330 this.el.clicked.connect( () => {
1332 if (this.popup == null) {
1341 // user defined functions
1342 public void setNotices (GLib.ListStore nots, GLib.ListStore fe ) {
1344 if (nots.get_n_items() < 1 ) {
1346 if (this.popup != null) {
1347 this.popup.el.hide();
1353 this.el.label = "%d/%d Warnings".printf((int)fe.get_n_items(),(int)nots.get_n_items());
1357 if (this.popup == null) {
1358 this.popup = new Xcls_ValaCompileErrors();
1359 this.popup.window = _this;
1360 // this.popup.el.set_transient_for( _this.el );
1361 this.popup.el.set_parent(this.el);
1363 this.popup.updateNotices(nots);
1368 public class Xcls_statusbar_depricated : Object
1370 public Gtk.Button el;
1371 private Xcls_MainWindow _this;
1375 public Xcls_ValaCompileErrors popup;
1376 public GLib.ListStore notices;
1379 public Xcls_statusbar_depricated(Xcls_MainWindow _owner )
1382 _this.statusbar_depricated = this;
1383 this.el = new Gtk.Button();
1386 this.notices = null;
1388 // set gobject values
1389 this.el.icon_name = "dialog-information";
1390 this.el.label = "0 Depricated";
1393 this.el.clicked.connect( () => {
1395 if (this.popup == null) {
1404 // user defined functions
1405 public void setNotices (GLib.ListStore nots, GLib.ListStore fe ) {
1407 if (nots.get_n_items() < 1 ) {
1409 if (this.popup != null) {
1410 this.popup.el.hide();
1416 this.el.label = "%d/%d Depricated".printf((int)fe.get_n_items(),(int)nots.get_n_items());
1420 if (this.popup == null) {
1421 this.popup = new Xcls_ValaCompileErrors();
1422 this.popup.window = _this;
1423 // this.popup.el.set_transient_for( _this.el );
1424 this.popup.el.set_parent(this.el);
1426 this.popup.updateNotices(nots);
1431 public class Xcls_statusbar_run : Object
1433 public Gtk.Button el;
1434 private Xcls_MainWindow _this;
1438 public Xcls_ValaCompileErrors popup;
1439 public Palete.ValaCompileRequest? last_request;
1442 public Xcls_statusbar_run(Xcls_MainWindow _owner )
1445 _this.statusbar_run = this;
1446 this.el = new Gtk.Button();
1449 this.last_request = null;
1451 // set gobject values
1452 this.el.icon_name = "media-playback-start";
1453 this.el.label = "Run";
1454 this.el.visible = false;
1457 this.el.clicked.connect( () => {
1459 if (_this.windowstate.file == null) {
1462 if (_this.statusbar_compile_spinner.el.spinning) {
1463 _this.windowstate.compile_results.el.set_parent(this.el);
1464 _this.windowstate.compile_results.el.show(); // show currently running.
1468 if (this.last_request != null) {
1469 this.last_request.cancel();
1470 if (this.last_request.terminal_pid > 0) {
1471 this.last_request.killChildren(this.last_request.terminal_pid);
1474 var pr = _this.windowstate.project as Project.Gtk;
1480 this.last_request= new Palete.ValaCompileRequest(
1482 pr.firstBuildModuleWith(_this.windowstate.file)
1484 this.last_request.onOutput.connect( ( str) => {
1485 _this.windowstate.compile_results.addLine(str);
1487 this.last_request.run.begin( ( a, r) => {
1488 this.last_request.run.end(r);
1490 if (_this.windowstate.compile_results.el.parent == null) {
1491 _this.windowstate.compile_results.el.set_parent(this.el);
1493 _this.windowstate.compile_results.show(this.el,true);
1498 // user defined functions
1502 public class Xcls_statusbar_compile_spinner : Object
1504 public Gtk.Spinner el;
1505 private Xcls_MainWindow _this;
1511 public Xcls_statusbar_compile_spinner(Xcls_MainWindow _owner )
1514 _this.statusbar_compile_spinner = this;
1515 this.el = new Gtk.Spinner();
1519 // set gobject values
1520 this.el.margin_end = 4;
1521 this.el.margin_start = 4;
1522 this.el.tooltip_text = "Compiling";
1525 // user defined functions
1526 public void start (string icon, string tooltip) {
1528 if (icon == "spinner") {
1531 this.el.tooltip_text = tooltip;
1532 _this.statusbar_compile_icon.el.hide();
1535 // GLib.debug("set status icon %s, %s", icon, tooltip);
1536 _this.statusbar_compile_icon.el.tooltip_text = tooltip;
1537 _this.statusbar_compile_icon.el.icon_name = icon;
1538 _this.statusbar_compile_icon.el.show();
1543 public void stop () {
1546 _this.statusbar_compile_icon.el.hide();
1550 public class Xcls_statusbar_compile_icon : Object
1552 public Gtk.Image el;
1553 private Xcls_MainWindow _this;
1559 public Xcls_statusbar_compile_icon(Xcls_MainWindow _owner )
1562 _this.statusbar_compile_icon = this;
1563 this.el = new Gtk.Image();
1567 // set gobject values
1568 this.el.margin_end = 4;
1569 this.el.margin_start = 4;
1570 this.el.icon_size = Gtk.IconSize.NORMAL;
1573 // user defined functions