1 static RepoStatusPopover _RepoStatusPopover;
3 public class RepoStatusPopover : Object
6 private RepoStatusPopover _this;
8 public static RepoStatusPopover singleton()
10 if (_RepoStatusPopover == null) {
11 _RepoStatusPopover= new RepoStatusPopover();
13 return _RepoStatusPopover;
15 public Xcls_label_status label_status;
16 public Xcls_label_diff label_diff;
17 public Xcls_status_view status_view;
18 public Xcls_diff_view diff_view;
24 public RepoStatusPopover()
27 this.el = new Gtk.Popover( null );
32 this.el.border_width = 0;
34 this.el.position = Gtk.PositionType.RIGHT;
35 var child_0 = new Xcls_Box2( _this );
37 this.el.add ( child_0.el );
40 // user defined functions
41 public void show (Gtk.Widget btn, Gdk.Rectangle rect, GitRepo repo) {
43 // get the active project.
44 var lm = Gtk.SourceLanguageManager.get_default();
46 // ((Gtk.SourceBuffer)(_this.view.el.get_buffer())) .set_language(
47 // lm.get_language("html")
51 //project.runhtml = project.runhtml || '';
52 _this.diff_view.el.get_buffer().set_text(repo.git_diff);
53 _this.status_view.el.get_buffer().set_text(repo.git_status);
55 //console.log('show all');
56 this.el.set_modal(true);
57 this.el.set_relative_to(btn);
58 this.el.set_pointing_to(rect);
60 //this.el.set_position(Gtk.PositionType.RIGHT);
63 GLib.debug("SHOWALL - POPIP\n");
65 //this.el.set_size_request(800,500);
66 // this.diff_view.el.grab_focus();
70 public class Xcls_Box2 : Object
73 private RepoStatusPopover _this;
79 public Xcls_Box2(RepoStatusPopover _owner )
82 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
87 this.el.homogeneous = false;
88 this.el.border_width = 5;
89 var child_0 = new Xcls_Box3( _this );
91 this.el.pack_end ( child_0.el , false,false,0 );
92 var child_1 = new Xcls_Notebook9( _this );
94 this.el.pack_start ( child_1.el , true,true,0 );
95 var child_2 = new Xcls_Box18( _this );
97 this.el.pack_end ( child_2.el , false,false,0 );
100 // user defined functions
102 public class Xcls_Box3 : Object
105 private RepoStatusPopover _this;
111 public Xcls_Box3(RepoStatusPopover _owner )
114 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
118 // set gobject values
119 this.el.homogeneous = true;
120 this.el.expand = false;
121 this.el.vexpand = false;
122 var child_0 = new Xcls_Toolbar4( _this );
124 this.el.add ( child_0.el );
127 // user defined functions
129 public class Xcls_Toolbar4 : Object
131 public Gtk.Toolbar el;
132 private RepoStatusPopover _this;
138 public Xcls_Toolbar4(RepoStatusPopover _owner )
141 this.el = new Gtk.Toolbar();
145 // set gobject values
146 this.el.toolbar_style = Gtk.ToolbarStyle.BOTH_HORIZ;
147 var child_0 = new Xcls_ToolButton5( _this );
149 this.el.add ( child_0.el );
150 var child_1 = new Xcls_ToolButton6( _this );
152 this.el.add ( child_1.el );
153 var child_2 = new Xcls_ToolButton7( _this );
155 this.el.add ( child_2.el );
156 var child_3 = new Xcls_ToolButton8( _this );
158 this.el.add ( child_3.el );
161 // user defined functions
163 public class Xcls_ToolButton5 : Object
165 public Gtk.ToolButton el;
166 private RepoStatusPopover _this;
172 public Xcls_ToolButton5(RepoStatusPopover _owner )
175 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-undo", Gtk.IconSize.SMALL_TOOLBAR), null);;
179 // set gobject values
180 this.el.label = "Stash Changes";
181 this.el.is_important = true;
184 this.el.button_press_event.connect( () => {
187 GitMonitor.gitmonitor.stop();
188 _this.repo.git({ "stash" , "--all" });
189 _this.repo.loadStatus();
190 GitMonitor.gitmonitor.start();
191 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
192 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
193 Clones.singleton().reposStore.load();
200 // user defined functions
203 public class Xcls_ToolButton6 : Object
205 public Gtk.ToolButton el;
206 private RepoStatusPopover _this;
212 public Xcls_ToolButton6(RepoStatusPopover _owner )
215 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-save", Gtk.IconSize.SMALL_TOOLBAR), null);;
219 // set gobject values
220 this.el.label = "Commit Changes";
221 this.el.is_important = true;
224 this.el.button_press_event.connect( () => {
225 _this.repo.git({ "commit" , "-a" ,"-m", "Uncommited changes synced" });
227 _this.repo.loadStatus();
229 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
230 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
233 Clones.singleton().reposStore.load();
239 // user defined functions
242 public class Xcls_ToolButton7 : Object
244 public Gtk.ToolButton el;
245 private RepoStatusPopover _this;
251 public Xcls_ToolButton7(RepoStatusPopover _owner )
254 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-revert-to-saved", Gtk.IconSize.SMALL_TOOLBAR), null);;
258 // set gobject values
259 this.el.label = "Reset / clear changes";
260 this.el.is_important = true;
263 this.el.button_press_event.connect( () => {
266 GitMonitor.gitmonitor.stop();
267 _this.repo.git({ "reset" , "--hard" });
268 _this.repo.loadStatus();
269 GitMonitor.gitmonitor.start();
270 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
271 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
272 Clones.singleton().reposStore.load();
279 // user defined functions
282 public class Xcls_ToolButton8 : Object
284 public Gtk.ToolButton el;
285 private RepoStatusPopover _this;
291 public Xcls_ToolButton8(RepoStatusPopover _owner )
294 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-goto-bottom", Gtk.IconSize.SMALL_TOOLBAR), null);;
298 // set gobject values
299 this.el.label = "Pull updates";
300 this.el.is_important = true;
303 this.el.button_press_event.connect( () => {
306 GitMonitor.gitmonitor.stop();
307 _this.repo.git({ "pull" , "--all" });
308 _this.repo.loadStatus();
309 GitMonitor.gitmonitor.start();
310 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
311 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
312 Clones.singleton().reposStore.load();
319 // user defined functions
324 public class Xcls_Notebook9 : Object
326 public Gtk.Notebook el;
327 private RepoStatusPopover _this;
333 public Xcls_Notebook9(RepoStatusPopover _owner )
336 this.el = new Gtk.Notebook();
340 // set gobject values
341 var child_0 = new Xcls_label_status( _this );
343 var child_1 = new Xcls_label_diff( _this );
345 var child_2 = new Xcls_Box12( _this );
347 this.el.append_page ( child_2.el , _this.label_status.el );
348 var child_3 = new Xcls_Box15( _this );
350 this.el.append_page ( child_3.el , _this.label_diff.el );
353 // user defined functions
355 public class Xcls_label_status : Object
358 private RepoStatusPopover _this;
364 public Xcls_label_status(RepoStatusPopover _owner )
367 _this.label_status = this;
368 this.el = new Gtk.Label( "Status" );
372 // set gobject values
375 // user defined functions
378 public class Xcls_label_diff : Object
381 private RepoStatusPopover _this;
387 public Xcls_label_diff(RepoStatusPopover _owner )
390 _this.label_diff = this;
391 this.el = new Gtk.Label( "Diff" );
395 // set gobject values
398 // user defined functions
401 public class Xcls_Box12 : Object
404 private RepoStatusPopover _this;
410 public Xcls_Box12(RepoStatusPopover _owner )
413 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
417 // set gobject values
418 this.el.homogeneous = false;
419 var child_0 = new Xcls_ScrolledWindow13( _this );
421 this.el.pack_start ( child_0.el , true,true,0 );
424 // user defined functions
426 public class Xcls_ScrolledWindow13 : Object
428 public Gtk.ScrolledWindow el;
429 private RepoStatusPopover _this;
435 public Xcls_ScrolledWindow13(RepoStatusPopover _owner )
438 this.el = new Gtk.ScrolledWindow( null, null );
442 // set gobject values
443 var child_0 = new Xcls_status_view( _this );
445 this.el.add ( child_0.el );
448 // user defined functions
450 public class Xcls_status_view : Object
452 public Gtk.SourceView el;
453 private RepoStatusPopover _this;
459 public Xcls_status_view(RepoStatusPopover _owner )
462 _this.status_view = this;
463 this.el = new Gtk.SourceView();
469 var description = Pango.FontDescription.from_string("monospace");
470 description.set_size(9000);
471 this.el.override_font(description);
474 // user defined functions
479 public class Xcls_Box15 : Object
482 private RepoStatusPopover _this;
488 public Xcls_Box15(RepoStatusPopover _owner )
491 this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
495 // set gobject values
496 this.el.homogeneous = false;
497 var child_0 = new Xcls_ScrolledWindow16( _this );
499 this.el.pack_start ( child_0.el , true,true,0 );
502 // user defined functions
504 public class Xcls_ScrolledWindow16 : Object
506 public Gtk.ScrolledWindow el;
507 private RepoStatusPopover _this;
513 public Xcls_ScrolledWindow16(RepoStatusPopover _owner )
516 this.el = new Gtk.ScrolledWindow( null, null );
520 // set gobject values
521 this.el.height_request = 400;
522 var child_0 = new Xcls_diff_view( _this );
524 this.el.add ( child_0.el );
527 // user defined functions
529 public class Xcls_diff_view : Object
531 public Gtk.SourceView el;
532 private RepoStatusPopover _this;
538 public Xcls_diff_view(RepoStatusPopover _owner )
541 _this.diff_view = this;
542 this.el = new Gtk.SourceView();
548 var description = Pango.FontDescription.from_string("monospace");
549 description.set_size(9000);
550 this.el.override_font(description);
553 // user defined functions
559 public class Xcls_Box18 : Object
562 private RepoStatusPopover _this;
568 public Xcls_Box18(RepoStatusPopover _owner )
571 this.el = new Gtk.Box( Gtk.Orientation.HORIZONTAL, 0 );
575 // set gobject values
576 this.el.homogeneous = true;
577 this.el.expand = false;
578 this.el.vexpand = false;
579 var child_0 = new Xcls_Toolbar19( _this );
581 this.el.add ( child_0.el );
584 // user defined functions
586 public class Xcls_Toolbar19 : Object
588 public Gtk.Toolbar el;
589 private RepoStatusPopover _this;
595 public Xcls_Toolbar19(RepoStatusPopover _owner )
598 this.el = new Gtk.Toolbar();
602 // set gobject values
603 this.el.toolbar_style = Gtk.ToolbarStyle.BOTH_HORIZ;
604 var child_0 = new Xcls_ToolButton20( _this );
606 this.el.add ( child_0.el );
607 var child_1 = new Xcls_ToolButton21( _this );
609 this.el.add ( child_1.el );
610 var child_2 = new Xcls_ToolButton22( _this );
612 this.el.add ( child_2.el );
615 // user defined functions
617 public class Xcls_ToolButton20 : Object
619 public Gtk.ToolButton el;
620 private RepoStatusPopover _this;
626 public Xcls_ToolButton20(RepoStatusPopover _owner )
629 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-add", Gtk.IconSize.SMALL_TOOLBAR), null);;
633 // set gobject values
634 this.el.label = "Create Branch / Start ticket";
635 this.el.is_important = true;
638 this.el.button_press_event.connect( () => {
639 var oldq = new Gee.ArrayList<GitMonitorQueue>();
641 Clones.singleton().el.response(-1);
642 NewBranch.singleton().show(_this.repo, oldq);
648 // user defined functions
651 public class Xcls_ToolButton21 : Object
653 public Gtk.ToolButton el;
654 private RepoStatusPopover _this;
660 public Xcls_ToolButton21(RepoStatusPopover _owner )
663 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-goto-top", Gtk.IconSize.SMALL_TOOLBAR), null);;
667 // set gobject values
668 this.el.label = "Merge branch/ ticket";
669 this.el.is_important = true;
672 this.el.button_press_event.connect( () => {
675 Clones.singleton().el.response(-1);
676 if (_this.repo.activeTicket != null) {
677 MergeBranch.singleton().show(_this.repo.activeTicket, null);
683 // user defined functions
686 public class Xcls_ToolButton22 : Object
688 public Gtk.ToolButton el;
689 private RepoStatusPopover _this;
695 public Xcls_ToolButton22(RepoStatusPopover _owner )
698 this.el = new Gtk.ToolButton(new Gtk.Image.from_icon_name ("gtk-new", Gtk.IconSize.SMALL_TOOLBAR), null);;
702 // set gobject values
703 this.el.label = "Create Ticket";
704 this.el.is_important = true;
707 this.el.button_press_event.connect( () => {
711 Clones.singleton().el.response(-1);
714 Ticket.singleton().show( _this.repo);
720 // user defined functions