X-Git-Url: http://git.roojs.org/?p=gitlive;a=blobdiff_plain;f=Clones.bjs;h=66620121168033462c620af3cf4ecdd7965cf670;hp=fea00e02a03bdce6f0275e4646405fc62151e251;hb=2ac46b7e5e54b5382df0c55b865e47a9937e15f8;hpb=2d3bb6db4cf59fb23b8774360ee0f15ffb7dc975 diff --git a/Clones.bjs b/Clones.bjs index fea00e02..66620121 100644 --- a/Clones.bjs +++ b/Clones.bjs @@ -14,7 +14,7 @@ }, "boolean deletable" : true, "default_width" : 1024, - "| void show" : "() {\n\n \n this.el.set_deletable(true);\n this.el.set_gravity(Gdk.Gravity.NORTH);\n this.el.move((Gdk.Screen.width() / 2 ) -400 ,0);\n \n this.el.set_default_size(\n\t\t\tint.min(1024,Gdk.Screen.width()),\n\t\t\tint.max(500,Gdk.Screen.width() - 300)\n\t);\n \n this.el.show_all();\n _this.reposStore.load();\n this.el.set_keep_above(true);\n this.el.run();\n // load clones..\n// this.get('/reposStore').load();\n \n //this.get('/ok_button').el.set_sensitive(false);\n \n // block until we return.\n// var run_ret = this.el.run();\n// if (run_ret < 1 ) {\n// return \"DONE\";\n// }\n// print(\"RUN RETURN : \" + run_ret);\n// return \"DONE\";\n //print(JSON.stringify(this.get('bug').getValue()));\n // return this.get('bug').getValue();\n //this.success = c.success;\n}\n", + "| void show" : "() {\n\n \n this.el.set_deletable(true);\n this.el.set_gravity(Gdk.Gravity.NORTH);\n this.el.move((Gdk.Screen.width() / 2 ) -400 ,0);\n \n this.el.set_default_size(\n\t\t\tint.min(1024,Gdk.Screen.width()),\n\t\t\tint.max(500,Gdk.Screen.height() - 300)\n\t);\n \n this.el.show_all();\n _this.reposStore.load();\n this.el.set_keep_above(true);\n this.el.run();\n // load clones..\n// this.get('/reposStore').load();\n \n //this.get('/ok_button').el.set_sensitive(false);\n \n // block until we return.\n// var run_ret = this.el.run();\n// if (run_ret < 1 ) {\n// return \"DONE\";\n// }\n// print(\"RUN RETURN : \" + run_ret);\n// return \"DONE\";\n //print(JSON.stringify(this.get('bug').getValue()));\n // return this.get('bug').getValue();\n //this.success = c.success;\n}\n", "title" : "Manage Clones", "xtype" : "Dialog", "default_height" : 500, @@ -30,64 +30,26 @@ "items" : [ { "bool homogeneous" : true, - "xtype" : "Box", "* pack" : "pack_start,false,false,0", + "xtype" : "Box", "$ xns" : "Gtk", "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL", "items" : [ { "listeners" : { - "clicked" : "() => {\n\n/* var rv = this.get('/reposView');\n var rs = this.get('/reposStore');\n if (rv.el.get_selection().count_selected_rows() != 1) {\n //nothing?\n // error condition.\n return;\n }\n var Remotes = imports.Remotes.Remotes;\n \n \n var ret = {}; \n var s = rv.el.get_selection();\n var path = '';\n s.selected_foreach(function(model,p,iter) {\n \n path = model.get_value(iter, 6).value.get_string();\n \n }); \n\n var repo = false;\n rs.repos.forEach(function(r) {\n if (r.repopath == path) {\n repo = r;\n \n }\n \n });\n Remotes.repo = repo;\n Remotes.el.set_transient_for(Clones.el);\n Clones.el.set_title(\"Manage Clones - \" + repo.repopath);\n Remotes.show();\n Clones.el.set_title(\"Manage Clones\");\n\n */ \n \n \n\n \n \n \n}" + "clicked" : "() => {\n\t\tClone.singleton().show(this.el);\n \n \n \n}" }, "label" : "Add Repository", - "xtype" : "Button", - "* pack" : "add", - "$ xns" : "Gtk" - }, - { - "listeners" : { - "clicked" : "() => {\n// \n\n\t//NewBranch.singleton().show();\n\n/*\n var rv = this.get('/reposView');\n var rs = this.get('/reposStore');\n if (rv.el.get_selection().count_selected_rows() != 1) {\n //nothing?\n // error condition.\n return;\n }\n var Branches = imports.Branches.Branches;\n \n \n var ret = {}; \n var s = rv.el.get_selection();\n var path = '';\n s.selected_foreach(function(model,p,iter) {\n \n path = model.get_value(iter, 6).value.get_string();\n \n }); \n\n var repo = false;\n rs.repos.forEach(function(r) {\n if (r.repopath == path) {\n repo = r;\n \n }\n \n });\n Branches.repo = repo;\n Branches.el.set_transient_for(Clones.el);\n Clones.el.set_title(\"Manage Clones - \" + repo.repopath);\n Branches.show();\n Clones.el.set_title(\"Manage Clones\");\n\n \n \n \n \n\n \n */ \n \n}" - }, - "label" : "Branches", - "xtype" : "Button", - "* pack" : "add", - "$ xns" : "Gtk", - "bool visible" : false - }, - { - "listeners" : { - "clicked" : "() => {\n\n\tvar rv = _this.reposView;\n\tvar rs = _this.reposStore;\n\tvar s =rv.el.get_selection();\n\tif (s.count_selected_rows() != 1) {\n\t\treturn;\n\t}\n\tGtk.TreeIter iter;\n\tGtk.TreeModel tm;\n\ts.get_selected(out tm, out iter);\n\tGLib.Value val;\n tm.get_value(iter, 6, out val);\n var git_working_dir = (string)val;\n \n var repo = GitRepo.singleton().get(git_working_dir);\n \n // if you hit merge.... in master..\n // ignore..\n if (repo.currentBranch.name == \"master\") {\n \treturn;\n\t}\n\tMergeBranch.singleton().show(repo.activeTicket, repo);\n\t_this.reposStore.load();\n\t\n \n \n}\n\n" - }, - "label" : "Merge", - "xtype" : "Button", - "* pack" : "add", - "$ xns" : "Gtk" - }, - { - "listeners" : { - "clicked" : "() => {\n \n \n \n \n \n \n}" - }, - "label" : "Switch Branch", - "xtype" : "Button", "* pack" : "add", - "$ xns" : "Gtk", - "bool visible" : false - }, - { - "listeners" : { - "clicked" : "() => {\n\n\tvar rv = _this.reposView;\n\tvar rs = _this.reposStore;\n\tvar s =rv.el.get_selection();\n\tif (s.count_selected_rows() != 1) {\n\t\treturn;\n\t}\n\tGtk.TreeIter iter;\n\tGtk.TreeModel tm;\n\ts.get_selected(out tm, out iter);\n\tGLib.Value val;\n tm.get_value(iter, 6, out val);\n var git_working_dir = (string)val;\n \n var repo = GitRepo.singleton().get(git_working_dir);\n GitMonitor.gitmonitor.pause(); \n repo.pull();\n repo.loadStatus();\n _this.reposStore.load();\n GitMonitor.gitmonitor.start(); \n\n \n \n}\n\n" - }, - "label" : "Pull", "xtype" : "Button", - "* pack" : "add", "$ xns" : "Gtk" } ] }, { "* 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", @@ -99,8 +61,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, @@ -131,8 +93,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" } @@ -152,8 +114,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, 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" } @@ -173,8 +135,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, 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" } @@ -182,8 +144,8 @@ }, { "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", @@ -194,8 +156,8 @@ "items" : [ { "id" : "cr_repo", - "xtype" : "CellRendererText", "* pack" : "pack_start,false", + "xtype" : "CellRendererText", "$ xns" : "Gtk" } ] @@ -211,8 +173,8 @@ "items" : [ { "id" : "cr_active_ticket", - "* pack" : "pack_start,false", "xtype" : "CellRendererText", + "* pack" : "pack_start,false", "$ xns" : "Gtk" } ] @@ -228,8 +190,8 @@ "items" : [ { "id" : "cr_current_branch", - "xtype" : "CellRendererText", "* pack" : "pack_start,false", + "xtype" : "CellRendererText", "$ xns" : "Gtk" } ] @@ -245,8 +207,8 @@ "items" : [ { "id" : "cr_last_updated", - "xtype" : "CellRendererText", "* pack" : "pack_start,false", + "xtype" : "CellRendererText", "$ xns" : "Gtk" } ] @@ -263,8 +225,8 @@ "items" : [ { "id" : "cr_all_branches", - "xtype" : "CellRendererText", "* pack" : "pack_start,false", + "xtype" : "CellRendererText", "$ xns" : "Gtk" } ]