RepoStatusPopover.bjs
[gitlive] / RepoStatusPopover.vala
index e077365..3149810 100644 (file)
@@ -351,9 +351,9 @@ public class RepoStatusPopover : Object
             this.el.homogeneous = true;
             this.el.expand = false;
             this.el.vexpand = false;
-            var child_0 = new Xcls_Button13( _this );
+            var child_0 = new Xcls_Toolbar13( _this );
             child_0.ref();
-            this.el.add (  child_0.el  );
+            this.el.pack_start (  child_0.el , ?bool?,?bool?,?uint? );
             var child_1 = new Xcls_Button14( _this );
             child_1.ref();
             this.el.add (  child_1.el  );
@@ -379,40 +379,23 @@ public class RepoStatusPopover : Object
 
         // user defined functions
     }
-    public class Xcls_Button13 : Object
+    public class Xcls_Toolbar13 : Object
     {
-        public Gtk.Button el;
+        public Gtk.Toolbar el;
         private RepoStatusPopover  _this;
 
 
             // my vars (def)
 
         // ctor
-        public Xcls_Button13(RepoStatusPopover _owner )
+        public Xcls_Toolbar13(RepoStatusPopover _owner )
         {
             _this = _owner;
-            this.el = new Gtk.Button();
+            this.el = new Gtk.Toolbar();
 
             // my vars (dec)
 
             // set gobject values
-            this.el.label = "Reset to remote";
-
-            //listeners
-            this.el.button_press_event.connect( () => {
-              
-               
-               GitMonitor.gitmonitor.stop();
-               _this.repo.git({ "reset" , "--hard" });
-               _this.repo.loadStatus();
-               GitMonitor.gitmonitor.start();
-                _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
-                _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
-                Clones.singleton().reposStore.load();
-              
-               _this.el.hide();
-                return false;
-            });
         }
 
         // user defined functions
@@ -435,14 +418,14 @@ public class RepoStatusPopover : Object
             // my vars (dec)
 
             // set gobject values
-            this.el.label = "Reset to remote";
+            this.el.label = "Stash Changes";
 
             //listeners
             this.el.button_press_event.connect( () => {
               
                
                GitMonitor.gitmonitor.stop();
-               _this.repo.git({ "reset" , "--hard" });
+               _this.repo.git({ "stash" , "--all" });
                _this.repo.loadStatus();
                GitMonitor.gitmonitor.start();
                 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
@@ -474,21 +457,20 @@ public class RepoStatusPopover : Object
             // my vars (dec)
 
             // set gobject values
-            this.el.label = "Stash Changes";
+            this.el.label = "Commit Changes";
 
             //listeners
             this.el.button_press_event.connect( () => {
-              
-               
-               GitMonitor.gitmonitor.stop();
-               _this.repo.git({ "stash" , "--all" });
+               _this.repo.git({ "commit" , "-a" ,"-m", "Uncommited changes synced" });
+               _this.repo.push();
                _this.repo.loadStatus();
-               GitMonitor.gitmonitor.start();
+               
                 _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
                 _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
-                Clones.singleton().reposStore.load();
-              
+                
                _this.el.hide();
+               Clones.singleton().reposStore.load();
+               
                 return false;
             });
         }
@@ -513,20 +495,15 @@ public class RepoStatusPopover : Object
             // my vars (dec)
 
             // set gobject values
-            this.el.label = "Commit Changes";
+            this.el.label = "Create Branch / Start ticket";
 
             //listeners
             this.el.button_press_event.connect( () => {
-               _this.repo.git({ "commit" , "-a" ,"-m", "Uncommited changes synced" });
-               _this.repo.push();
-               _this.repo.loadStatus();
-               
-                _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
-                _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
-                
-               _this.el.hide();
-               Clones.singleton().reposStore.load();
-               
+               var oldq = new Gee.ArrayList<GitMonitorQueue>();  
+            
+               Clones.singleton().el.response(-1);
+               NewBranch.singleton().show(_this.repo, oldq);
+            
                 return false;
             });
         }
@@ -551,15 +528,21 @@ public class RepoStatusPopover : Object
             // my vars (dec)
 
             // set gobject values
-            this.el.label = "Create Branch";
+            this.el.label = "Reset to remote";
 
             //listeners
             this.el.button_press_event.connect( () => {
-               var oldq = new Gee.ArrayList<GitMonitorQueue>();  
-            
-               Clones.singleton().el.response(-1);
-               NewBranch.singleton().show(_this.repo, oldq);
-            
+              
+               
+               GitMonitor.gitmonitor.stop();
+               _this.repo.git({ "reset" , "--hard" });
+               _this.repo.loadStatus();
+               GitMonitor.gitmonitor.start();
+                _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
+                _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
+                Clones.singleton().reposStore.load();
+              
+               _this.el.hide();
                 return false;
             });
         }
@@ -584,12 +567,22 @@ public class RepoStatusPopover : Object
             // my vars (dec)
 
             // set gobject values
-            this.el.label = "Ignore for now";
+            this.el.label = "Pull updates";
 
             //listeners
             this.el.button_press_event.connect( () => {
-                   _this.el.hide();
-                    return false;
+              
+               
+               GitMonitor.gitmonitor.stop();
+               _this.repo.git({ "pull" , "--all" });
+               _this.repo.loadStatus();
+               GitMonitor.gitmonitor.start();
+                _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
+                _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
+                Clones.singleton().reposStore.load();
+              
+               _this.el.hide();
+                return false;
             });
         }
 
@@ -613,21 +606,16 @@ public class RepoStatusPopover : Object
             // my vars (dec)
 
             // set gobject values
-            this.el.label = "Reset to remote";
+            this.el.label = "Merge branch/  ticket";
 
             //listeners
             this.el.button_press_event.connect( () => {
-              
-               
-               GitMonitor.gitmonitor.stop();
-               _this.repo.git({ "reset" , "--hard" });
-               _this.repo.loadStatus();
-               GitMonitor.gitmonitor.start();
-                _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
-                _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
-                Clones.singleton().reposStore.load();
-              
+            
                _this.el.hide();
+               Clones.singleton().el.response(-1);
+               if (_this.repo.activeTicket != null) {
+                  MergeBranch.singleton().show(_this.repo.activeTicket, null);   
+               }
                 return false;
             });
         }
@@ -647,26 +635,23 @@ public class RepoStatusPopover : Object
         public Xcls_Button20(RepoStatusPopover _owner )
         {
             _this = _owner;
-            this.el = new Gtk.Button();
+            this.el = new GtkButton.new_from_stock();
 
             // my vars (dec)
 
             // set gobject values
-            this.el.label = "Stash Changes";
+            this.el.label = "Create Ticket";
 
             //listeners
             this.el.button_press_event.connect( () => {
               
-               
-               GitMonitor.gitmonitor.stop();
-               _this.repo.git({ "stash" , "--all" });
-               _this.repo.loadStatus();
-               GitMonitor.gitmonitor.start();
-                _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);
-                _this.status_view.el.get_buffer().set_text(_this.repo.git_status);
-                Clones.singleton().reposStore.load();
+            
+            
+                  Clones.singleton().el.response(-1);
               
                _this.el.hide();
+               Ticket.singleton().show( _this.repo);
+               
                 return false;
             });
         }