Fix #5615 - gitlive - force all roojs projects to autobranch
authorAlan Knowles <alan@roojs.com>
Wed, 19 Dec 2018 05:56:57 +0000 (13:56 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 19 Dec 2018 05:56:57 +0000 (13:56 +0800)
Clones.bjs
RepoStatusPopover.bjs
RepoStatusPopover.vala

index 36a6091..78d1cb2 100644 (file)
@@ -30,8 +30,8 @@
      "items" : [
       {
        "bool homogeneous" : true,
-       "xtype" : "Box",
        "* pack" : "pack_start,false,false,0",
+       "xtype" : "Box",
        "$ xns" : "Gtk",
        "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
        "items" : [
@@ -49,8 +49,8 @@
       },
       {
        "* init" : "  {\n  \n   this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);\n}\n",
-       "bool expand" : true,
        "bool hexpand" : true,
+       "bool expand" : true,
        "xtype" : "ScrolledWindow",
        "* pack" : "pack_end,true,true,0",
        "Gtk.ShadowType shadow_type" : "Gtk.ShadowType.IN",
@@ -62,8 +62,8 @@
           "cursor_changed" : "()  => {\n  // SEE SELECTION.CHANGED\n  /*\n  \n  return;\n  \n    if (this.el.get_selection().count_selected_rows() < 1) {\n        //nothing? - clea it?\n        return;\n    }\n        var ret = {};         \n    var model = this.get('/changedFilesStore');\n\n     var s = this.el.get_selection();\n     var files = [];\n    s.selected_foreach(function(model,p,iter) {\n    \n       files.push( model.get_value(iter, 0).value.get_string());\n     \n    });\n    this.get('/patchview').showDiff(files); \n    //var value = ''+ ret.model.get_value(ret.iter, 1).value.get_string();\n     //print(\"OUT?\" + value);// id..\n    // load the list in the right grid..\n     \n    return true;\n*/\n}"
          },
          "id" : "reposView",
-         "* init" : " \n{\n    var selection = this.el.get_selection();\n    selection.set_mode( Gtk.SelectionMode.SINGLE);\n\n\n    var description = new Pango.FontDescription();\n    description.set_size(10000);\n    this.el.override_font(description);\n \n}\n",
          "bool activate_on_single_click" : true,
+         "* init" : " \n{\n    var selection = this.el.get_selection();\n    selection.set_mode( Gtk.SelectionMode.SINGLE);\n\n\n    var description = new Pango.FontDescription();\n    description.set_size(10000);\n    this.el.override_font(description);\n \n}\n",
          "xtype" : "TreeView",
          "* pack" : "add",
          "int search_column" : 0,
@@ -94,8 +94,8 @@
               "toggled" : "  (self, path)  => {\n  \n  \tGtk.TreeIter iter;\n  \t_this.reposStore.el.get_iter_from_string(out iter, path);\n  \t\n  \tGLib.Value val;\n  \tGLib.Value rval;\n  \t_this.reposStore.el.get_value(iter, 4, out val);\n  \t_this.reposStore.el.get_value(iter, 6, out rval);\n  \t\n  \tvar repopath = (string)rval;\n  \tvar bval = (bool)val;\n  \t_this.reposStore.el.set_value(iter, 4, !bval);\n  \tGLib.debug(\"got repopath? %s\", repopath);\n  \t\n  \tvar repo = GitRepo.get(repopath);\n  \trepo.set_autocommit(!bval);\n  \t\n  \t\n  \t\n  \n}"
              },
              "id" : "cr_autocommit",
-             "xtype" : "CellRendererToggle",
              "* pack" : "pack_start,false",
+             "xtype" : "CellRendererToggle",
              "$ xns" : "Gtk",
              "$ mode" : "Gtk.CellRendererMode.ACTIVATABLE"
             }
               "toggled" : "  (self, path)  => {\n  \n  \tGtk.TreeIter iter;\n  \t_this.reposStore.el.get_iter_from_string(out iter, path);\n  \t\n  \tGLib.Value val;\n  \tGLib.Value rval;\n  \t_this.reposStore.el.get_value(iter, 5, out val);\n  \t_this.reposStore.el.get_value(iter, 6, out rval);\n  \t\n  \tvar repopath = (string)rval;\n  \tvar bval = (bool)val;\n  \t_this.reposStore.el.set_value(iter, 5, !bval);\n  \tvar repo = GitRepo.get(repopath);\n  \trepo.set_autopush(!bval);\n  \t\n  \t\n  \t\n  \n}"
              },
              "id" : "cr_autopush",
-             "xtype" : "CellRendererToggle",
              "* pack" : "pack_start,false",
+             "xtype" : "CellRendererToggle",
              "$ xns" : "Gtk",
              "$ mode" : "Gtk.CellRendererMode.ACTIVATABLE"
             }
               "toggled" : "  (self, path)  => {\n  \n  \tGtk.TreeIter iter;\n  \t_this.reposStore.el.get_iter_from_string(out iter, path);\n  \t\n  \tGLib.Value val;\n  \tGLib.Value rval;\n  \t_this.reposStore.el.get_value(iter, 8, out val);\n  \t_this.reposStore.el.get_value(iter, 6, out rval);\n  \t\n  \tvar repopath = (string)rval;\n  \tvar bval = (bool)val;\n  \t_this.reposStore.el.set_value(iter, 8, !bval);\n  \tvar repo = GitRepo.get(repopath);\n  \trepo.set_auto_branch(!bval);\n  \t\n  \t\n  \t\n  \n}"
              },
              "id" : "cr_autobranch",
-             "* pack" : "pack_start,false",
              "xtype" : "CellRendererToggle",
+             "* pack" : "pack_start,false",
              "$ xns" : "Gtk",
              "$ mode" : "Gtk.CellRendererMode.ACTIVATABLE"
             }
           },
           {
            "id" : "tv_repo",
-           "Gtk.SortType sort_order" : "Gtk.SortType.ASCENDING",
            "* init" : "\n    this.el.add_attribute(_this.cr_repo.el , \"markup\", 0 );\n",
+           "Gtk.SortType sort_order" : "Gtk.SortType.ASCENDING",
            "title" : "Repo",
            "* pack" : "append_column",
            "xtype" : "TreeViewColumn",
            "items" : [
             {
              "id" : "cr_repo",
-             "xtype" : "CellRendererText",
              "* pack" : "pack_start,false",
+             "xtype" : "CellRendererText",
              "$ xns" : "Gtk"
             }
            ]
            "items" : [
             {
              "id" : "cr_active_ticket",
-             "* pack" : "pack_start,false",
              "xtype" : "CellRendererText",
+             "* pack" : "pack_start,false",
              "$ xns" : "Gtk"
             }
            ]
            "items" : [
             {
              "id" : "cr_current_branch",
-             "xtype" : "CellRendererText",
              "* pack" : "pack_start,false",
+             "xtype" : "CellRendererText",
              "$ xns" : "Gtk"
             }
            ]
            "items" : [
             {
              "id" : "cr_last_updated",
-             "xtype" : "CellRendererText",
              "* pack" : "pack_start,false",
+             "xtype" : "CellRendererText",
              "$ xns" : "Gtk"
             }
            ]
            "items" : [
             {
              "id" : "cr_all_branches",
-             "xtype" : "CellRendererText",
              "* pack" : "pack_start,false",
+             "xtype" : "CellRendererText",
              "$ xns" : "Gtk"
             }
            ]
index 1e7e58f..08c53b5 100644 (file)
@@ -41,7 +41,7 @@
          "items" : [
           {
            "listeners" : {
-            "button_press_event" : "() => {\n  \n   \n   GitMonitor.gitmonitor.stop();\n   _this.repo.git({ \"stash\" , \"--all\" });\n   _this.repo.loadStatus();\n   GitMonitor.gitmonitor.start();\n    _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);\n    _this.status_view.el.get_buffer().set_text(_this.repo.git_status);\n    Clones.singleton().reposStore.load();\n  \n   _this.el.hide();\n    return false;\n}"
+            "clicked" : "() => {\n  \n   \n   GitMonitor.gitmonitor.stop();\n   _this.repo.git({ \"stash\" , \"--all\" });\n   _this.repo.loadStatus();\n   GitMonitor.gitmonitor.start();\n    _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);\n    _this.status_view.el.get_buffer().set_text(_this.repo.git_status);\n    Clones.singleton().reposStore.load();\n  \n   _this.el.hide();\n     \n}"
            },
            "label" : "Stash Changes",
            "* ctor" : "new Gtk.ToolButton(new Gtk.Image.from_icon_name (\"gtk-undo\", Gtk.IconSize.SMALL_TOOLBAR), null);",
@@ -53,7 +53,7 @@
           },
           {
            "listeners" : {
-            "button_press_event" : "() => {\n   _this.repo.git({ \"commit\" , \"-a\" ,\"-m\", \"Uncommited changes synced\" });\n   _this.repo.push();\n   _this.repo.loadStatus();\n   \n    _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);\n    _this.status_view.el.get_buffer().set_text(_this.repo.git_status);\n    \n   _this.el.hide();\n   Clones.singleton().reposStore.load();\n   \n    return false;\n}"
+            "clicked" : "() => {\n   _this.el.hide();\n    GitMonitor.gitmonitor.stop();\n   _this.repo.git({ \"commit\" , \"-a\" ,\"-m\", \"Uncommited changes synced\" });\n   _this.repo.push();\n   _this.repo.loadStatus();\n   \n    _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);\n    _this.status_view.el.get_buffer().set_text(_this.repo.git_status);\n    \n\n   Clones.singleton().reposStore.load();\n    GitMonitor.gitmonitor.start();\n    \n}"
            },
            "label" : "Commit Changes",
            "* ctor" : "new Gtk.ToolButton(new Gtk.Image.from_icon_name (\"gtk-save\", Gtk.IconSize.SMALL_TOOLBAR), null);",
@@ -65,7 +65,7 @@
           },
           {
            "listeners" : {
-            "button_press_event" : "() => {\n  \n   \n   GitMonitor.gitmonitor.stop();\n   _this.repo.git({ \"reset\" , \"--hard\" });\n   _this.repo.loadStatus();\n   GitMonitor.gitmonitor.start();\n    _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);\n    _this.status_view.el.get_buffer().set_text(_this.repo.git_status);\n    Clones.singleton().reposStore.load();\n  \n   _this.el.hide();\n    return false;\n}"
+            "clicked" : "() => {\n  \n   \n   GitMonitor.gitmonitor.stop();\n   _this.repo.git({ \"reset\" , \"--hard\" });\n   _this.repo.loadStatus();\n   GitMonitor.gitmonitor.start();\n    _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);\n    _this.status_view.el.get_buffer().set_text(_this.repo.git_status);\n    Clones.singleton().reposStore.load();\n  \n   _this.el.hide();\n \n}"
            },
            "label" : "Reset / clear changes",
            "* ctor" : "new Gtk.ToolButton(new Gtk.Image.from_icon_name (\"gtk-revert-to-saved\", Gtk.IconSize.SMALL_TOOLBAR), null);",
@@ -77,7 +77,7 @@
           },
           {
            "listeners" : {
-            "button_press_event" : "() => {\n  \n   \n   GitMonitor.gitmonitor.stop();\n   _this.repo.git({ \"pull\" , \"--all\" });\n   _this.repo.loadStatus();\n   GitMonitor.gitmonitor.start();\n    _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);\n    _this.status_view.el.get_buffer().set_text(_this.repo.git_status);\n    Clones.singleton().reposStore.load();\n  \n   _this.el.hide();\n    return false;\n}"
+            "clicked" : "() => {\n  \n   \n   GitMonitor.gitmonitor.stop();\n   _this.repo.git({ \"pull\" , \"--all\" });\n   _this.repo.loadStatus();\n   GitMonitor.gitmonitor.start();\n    _this.diff_view.el.get_buffer().set_text(_this.repo.git_diff);\n    _this.status_view.el.get_buffer().set_text(_this.repo.git_status);\n    Clones.singleton().reposStore.load();\n  \n   _this.el.hide();\n    \n}"
            },
            "label" : "Pull updates",
            "* ctor" : "new Gtk.ToolButton(new Gtk.Image.from_icon_name (\"gtk-goto-bottom\", Gtk.IconSize.SMALL_TOOLBAR), null);",
          "items" : [
           {
            "listeners" : {
-            "button_press_event" : "() => {\n   var oldq = new Gee.ArrayList<GitMonitorQueue>();  \n\n\tClones.singleton().el.response(-1);\n\tNewBranch.singleton().show(_this.repo, oldq);\n\n    return false;\n}"
+            "clicked" : "() => {\n   var oldq = new Gee.ArrayList<GitMonitorQueue>();  \n\n\tClones.singleton().el.response(-1);\n\tNewBranch.singleton().show(_this.repo, oldq);\n\n    \n}"
            },
            "label" : "Create Branch / Start ticket",
            "* ctor" : "new Gtk.ToolButton(new Gtk.Image.from_icon_name (\"gtk-add\", Gtk.IconSize.SMALL_TOOLBAR), null);",
           },
           {
            "listeners" : {
-            "clicked" : "() => {\n\n   _this.el.hide();\n   Clones.singleton().el.response(-1);\n   if (_this.repo.activeTicket != null) {\n\t   MergeBranch.singleton().show(_this.repo.activeTicket, null);   \n   }\n    return ;\n}"
+            "clicked" : "() => {\n\n   _this.el.hide();\n   Clones.singleton().el.response(-1);\n   if (_this.repo.activeTicket != null) {\n\t   MergeBranch.singleton().show(_this.repo.activeTicket, null);   \n   }\n \n}"
            },
            "label" : "Merge branch /  Complete ticket",
            "* ctor" : "new Gtk.ToolButton(new Gtk.Image.from_icon_name (\"gtk-goto-top\", Gtk.IconSize.SMALL_TOOLBAR), null);",
           },
           {
            "listeners" : {
-            "button_press_event" : "() => {\n  \n\n\n      Clones.singleton().el.response(-1);\n  \n   _this.el.hide();\n   Ticket.singleton().show( _this.repo);\n   \n    return false;\n}"
+            "clicked" : "() => {\n  \n\n\n      Clones.singleton().el.response(-1);\n  \n   _this.el.hide();\n   Ticket.singleton().show( _this.repo);\n    \n}"
            },
            "label" : "Create Ticket",
            "* ctor" : "new Gtk.ToolButton(new Gtk.Image.from_icon_name (\"gtk-new\", Gtk.IconSize.SMALL_TOOLBAR), null);",
index 9c20936..d48f618 100644 (file)
@@ -200,7 +200,7 @@ public class RepoStatusPopover : Object
             this.el.is_important = true;
 
             //listeners
-            this.el.button_press_event.connect( () => {
+            this.el.clicked.connect( () => {
               
                
                GitMonitor.gitmonitor.stop();
@@ -212,7 +212,7 @@ public class RepoStatusPopover : Object
                 Clones.singleton().reposStore.load();
               
                _this.el.hide();
-                return false;
+                 
             });
         }
 
@@ -241,7 +241,9 @@ public class RepoStatusPopover : Object
             this.el.is_important = true;
 
             //listeners
-            this.el.button_press_event.connect( () => {
+            this.el.clicked.connect( () => {
+               _this.el.hide();
+                GitMonitor.gitmonitor.stop();
                _this.repo.git({ "commit" , "-a" ,"-m", "Uncommited changes synced" });
                _this.repo.push();
                _this.repo.loadStatus();
@@ -249,10 +251,10 @@ public class RepoStatusPopover : Object
                 _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();
-               
-                return false;
+                GitMonitor.gitmonitor.start();
+                
             });
         }
 
@@ -281,7 +283,7 @@ public class RepoStatusPopover : Object
             this.el.is_important = true;
 
             //listeners
-            this.el.button_press_event.connect( () => {
+            this.el.clicked.connect( () => {
               
                
                GitMonitor.gitmonitor.stop();
@@ -293,7 +295,7 @@ public class RepoStatusPopover : Object
                 Clones.singleton().reposStore.load();
               
                _this.el.hide();
-                return false;
+             
             });
         }
 
@@ -322,7 +324,7 @@ public class RepoStatusPopover : Object
             this.el.is_important = true;
 
             //listeners
-            this.el.button_press_event.connect( () => {
+            this.el.clicked.connect( () => {
               
                
                GitMonitor.gitmonitor.stop();
@@ -334,7 +336,7 @@ public class RepoStatusPopover : Object
                 Clones.singleton().reposStore.load();
               
                _this.el.hide();
-                return false;
+                
             });
         }
 
@@ -659,13 +661,13 @@ public class RepoStatusPopover : Object
             this.el.is_important = true;
 
             //listeners
-            this.el.button_press_event.connect( () => {
+            this.el.clicked.connect( () => {
                var oldq = new Gee.ArrayList<GitMonitorQueue>();  
             
                Clones.singleton().el.response(-1);
                NewBranch.singleton().show(_this.repo, oldq);
             
-                return false;
+                
             });
         }
 
@@ -701,7 +703,7 @@ public class RepoStatusPopover : Object
                if (_this.repo.activeTicket != null) {
                   MergeBranch.singleton().show(_this.repo.activeTicket, null);   
                }
-                return ;
+             
             });
         }
 
@@ -729,7 +731,7 @@ public class RepoStatusPopover : Object
             this.el.is_important = true;
 
             //listeners
-            this.el.button_press_event.connect( () => {
+            this.el.clicked.connect( () => {
               
             
             
@@ -737,8 +739,7 @@ public class RepoStatusPopover : Object
               
                _this.el.hide();
                Ticket.singleton().show( _this.repo);
-               
-                return false;
+                
             });
         }