From 42d2392701d5f3d1ccda8383e6f52b826c6c5c30 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Fri, 11 Aug 2017 12:59:52 +0800 Subject: [PATCH] sync --- .anjuta/default.profile | 8 + .anjuta/session/anjuta.session | 20 + .anjuta/session/dock-layout.xml | 4 + .anjuta_sym_db.db | Bin 0 -> 917504 bytes .gitignore | 29 + old_seed_version/Branches.js | 281 ++++++++++ old_seed_version/Clones.js | 581 +++++++++++++++++++ old_seed_version/Commit.js | 313 +++++++++++ old_seed_version/Date.js | 839 ++++++++++++++++++++++++++++ old_seed_version/File.js | 262 +++++++++ old_seed_version/FixBug.js | 682 ++++++++++++++++++++++ old_seed_version/GitLogParser.js | 362 ++++++++++++ old_seed_version/GitMonitor.js | 489 ++++++++++++++++ old_seed_version/Merger.js | 793 ++++++++++++++++++++++++++ old_seed_version/Monitor.js | 286 ++++++++++ old_seed_version/Netrc.js | 60 ++ old_seed_version/Projects.js | 81 +++ old_seed_version/RemoteEdit.js | 207 +++++++ old_seed_version/Remotes.js | 272 +++++++++ old_seed_version/Request.js | 69 +++ old_seed_version/Spawn.js | 437 +++++++++++++++ old_seed_version/StatusIcon.js | 292 ++++++++++ old_seed_version/Tasks.js | 421 ++++++++++++++ old_seed_version/WindowLog.js | 135 +++++ old_seed_version/XMLHttpRequest.js | 177 ++++++ old_seed_version/XObject.js | 837 +++++++++++++++++++++++++++ old_seed_version/git_tool_notes.txt | 44 ++ old_seed_version/gitlive.js | 80 +++ old_seed_version/test.js | 72 +++ old_seed_version/test_fixbug.js | 66 +++ old_seed_version/test_git.js | 22 + old_seed_version/test_merger.js | 69 +++ 32 files changed, 8290 insertions(+) create mode 100644 .anjuta/default.profile create mode 100644 .anjuta/session/anjuta.session create mode 100644 .anjuta/session/dock-layout.xml create mode 100644 .anjuta_sym_db.db create mode 100644 .gitignore create mode 100644 old_seed_version/Branches.js create mode 100644 old_seed_version/Clones.js create mode 100644 old_seed_version/Commit.js create mode 100644 old_seed_version/Date.js create mode 100644 old_seed_version/File.js create mode 100644 old_seed_version/FixBug.js create mode 100644 old_seed_version/GitLogParser.js create mode 100644 old_seed_version/GitMonitor.js create mode 100644 old_seed_version/Merger.js create mode 100644 old_seed_version/Monitor.js create mode 100644 old_seed_version/Netrc.js create mode 100644 old_seed_version/Projects.js create mode 100644 old_seed_version/RemoteEdit.js create mode 100644 old_seed_version/Remotes.js create mode 100644 old_seed_version/Request.js create mode 100644 old_seed_version/Spawn.js create mode 100644 old_seed_version/StatusIcon.js create mode 100644 old_seed_version/Tasks.js create mode 100644 old_seed_version/WindowLog.js create mode 100644 old_seed_version/XMLHttpRequest.js create mode 100644 old_seed_version/XObject.js create mode 100644 old_seed_version/git_tool_notes.txt create mode 100644 old_seed_version/gitlive.js create mode 100644 old_seed_version/test.js create mode 100644 old_seed_version/test_fixbug.js create mode 100644 old_seed_version/test_git.js create mode 100644 old_seed_version/test_merger.js diff --git a/.anjuta/default.profile b/.anjuta/default.profile new file mode 100644 index 00000000..054294fc --- /dev/null +++ b/.anjuta/default.profile @@ -0,0 +1,8 @@ + + + + + + diff --git a/.anjuta/session/anjuta.session b/.anjuta/session/anjuta.session new file mode 100644 index 00000000..f4c322b0 --- /dev/null +++ b/.anjuta/session/anjuta.session @@ -0,0 +1,20 @@ +[Anjuta] +Geometry=976x744+448+143 + +[Document Manager] +bookmarks=\n\n + +[Execution] +Run in terminal=2 +Working directories=../../. + +[Build] +Configuration list=1:Default:%%%1:Debug:Debug%%%1:Profiling:Profiling%%%1:Optimized:Optimized +Selected Configuration=Default +BuildArgs/Default=--enable-maintainer-mode +BuildArgs/Debug=--enable-maintainer-mode 'CFLAGS=-g -O0' 'CXXFLAGS=-g -O0' 'JFLAGS=-g -O0' 'FFLAGS=-g -O0' +BuildArgs/Profiling=--enable-maintainer-mode 'CFLAGS=-g -pg' 'CXXFLAGS=-g -pg' 'JFLAGS=-g -pg' 'FFLAGS=-g -pg' +BuildArgs/Optimized=--enable-maintainer-mode 'CFLAGS=-O2' 'CXXFLAGS=-O2' 'JFLAGS=-O2' 'FFLAGS=-O2' + +[Debugger] +Stop at beginning=2 diff --git a/.anjuta/session/dock-layout.xml b/.anjuta/session/dock-layout.xml new file mode 100644 index 00000000..883d44e4 --- /dev/null +++ b/.anjuta/session/dock-layout.xml @@ -0,0 +1,4 @@ + + + + diff --git a/.anjuta_sym_db.db b/.anjuta_sym_db.db new file mode 100644 index 0000000000000000000000000000000000000000..4bafd30f01a51dee2a4bab1c6c037573447e13eb GIT binary patch literal 917504 zcmeI*&2Jm$od96ccBF_6n>2~Sx{8nqwt+>&jzuW}774st#ikv%j_fK<(_EHdBwC?O zku*ugNm@jd)7>75_Rv3~|3ojnF0jDf_tHa)T=ufqV|NdIXZT@KBApN4!e>B{FW;H@ z&HH=aj~V*ncYb=U+Nngh8m+x@Ct6Q+Q|WZ-M^ThYr53~A^Wkr>Jsk?C24BKwdZaw9 zxR^Tk#a#B_|5MAgcIvY~AN>1gzy0MOKl_(oy!Ff9e|qm1xsMJ%{qcU~qZ^&Q{nhqA zc2@5GcYD71e|P`X{IvNWjXyMAt$$Jf&E8+asWt)x2oNAZfB*pk1PBlyK!5-N0t5&U zAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C7 z2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pkvnp_ZZ+U*{ z{OQO4b-B~3?(SAvJC$0cQz^AS+54bTD|K4Cz0$?4;>OKlbaU(Kl`F-q=-5%wo5jo5 zw~EoF;-AYziq zmxhcsHZS!<4UdifDO&Aa>gwh@#jTss)ygJ{5 z&--p6QrQ2X@1vE@C(V#mcsm;<#d>+KlE3zYxj1z7XymnCZ(hH;8G^iB+`M@<8S?SenY8sg=)oWy z2CO$aQGLHwd+6!;8_&(wo0NvglWaVZZZ1Y4D}KzgKBhw?`YF zKbM=!Z7iizy>7W%3;(fUsl4B5B;N;TmJ0n4-#>iw+4)>9m%hK9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009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C7 Z2oNAZfB*pk1PBlyK!5-N0t9AI;P0-ZMH&DA literal 0 HcmV?d00001 diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..ad6a8802 --- /dev/null +++ b/.gitignore @@ -0,0 +1,29 @@ +*.c +*.o +c/*.o +Makefile +Gitlive +*.stamp +*.stamp-t + +Makefile +Makefile.in +aclocal.m4 +autom4te.cache +config.* +configure +depcomp +install-sh +libtool +ltmain.sh +m4/ +missing +stamp-h? +.deps/ +.dirstamp +.libs/ +*.l[ao] +*~ +compile +fontconfig/* + diff --git a/old_seed_version/Branches.js b/old_seed_version/Branches.js new file mode 100644 index 00000000..5e617c79 --- /dev/null +++ b/old_seed_version/Branches.js @@ -0,0 +1,281 @@ +Gtk = imports.gi.Gtk; +Gdk = imports.gi.Gdk; +Pango = imports.gi.Pango; +GLib = imports.gi.GLib; +Gio = imports.gi.Gio; +GObject = imports.gi.GObject; +GtkSource = imports.gi.GtkSource; +WebKit = imports.gi.WebKit; +Vte = imports.gi.Vte; +console = imports.console; +XObject = imports.XObject.XObject; +Branches=new XObject({ + xtype: Gtk.Dialog, + listeners : { + destroy_event : function (self, event) { + this.el.hide(); + return false; + }, + response : function (self, id) { + // hide + //if (id < 1) { + this.el.hide(); + return; + //} + if (typeof(this.get('bug').getValue()) != 'object') { + print("ERROR"); + return; + } + + this.el.hide(); + + //var val = this.get('bug').getValue(); + // Seed.print(val); + } + }, + ' modal' : true, + border_width : 3, + default_height : 300, + default_width : 500, + title : "Branches", + deletable : true, + modal : true, + show : function(c) { + + if (!this.el) { + this.init(); + } + var _this = this; + this.get('/branchStore').load(); + this.el.show_all(); + + var run_ret = this.el.run(); + if (run_ret < 1 ) { + return "DONE"; + } + print("RUN RETURN : " + run_ret); + return "DONE"; + + }, + items : [ + { + xtype: Gtk.VBox, + pack : function(p,e) { + p.el.get_content_area().pack_start(e.el,true,true,0) + }, + items : [ + { + xtype: Gtk.HBox, + pack : "pack_start,false,true", + items : [ + { + xtype: Gtk.Button, + listeners : { + clicked : function (self) { + + return; + var RemoteEdit= imports.RemoteEdit.RemoteEdit + RemoteEdit.repo = Remotes.repo; + RemoteEdit.el.set_transient_for(Remotes.el); + + var res = RemoteEdit.show(); + + if (res != false) { + Remotes.repo.remotes(res); + } + + this.get('/remotesStore').load(); + + + } + }, + label : "Pull", + pack : "add" + } + ] + }, + { + xtype: Gtk.ScrolledWindow, + init : function() { + XObject.prototype.init.call(this); + this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) + }, + items : [ + { + xtype: Gtk.TreeView, + listeners : { + cursor_changed : function (self) + { + + return; + // SEE SELECTION.CHANGED + if (this.el.get_selection().count_selected_rows() < 1) { + //nothing? - clea it? + return; + } + var ret = {}; + var model = this.get('/changedFilesStore'); + + var s = this.el.get_selection(); + var files = []; + s.selected_foreach(function(model,p,iter) { + + files.push( model.get_value(iter, 0).value.get_string()); + + }); + this.get('/patchview').showDiff(files); + //var value = ''+ ret.model.get_value(ret.iter, 1).value.get_string(); + //print("OUT?" + value);// id.. + // load the list in the right grid.. + + return true; + + } + }, + id : "branchView", + pack : "add", + init : function() { + XObject.prototype.init.call(this); + var description = new Pango.FontDescription.c_new(); + description.set_size(8000); + this.el.modify_font(description); + + this.selection = this.el.get_selection(); + this.selection.set_mode( Gtk.SelectionMode.MULTIPLE); + var _this = this; + this.selection.signal['changed'].connect(function() { + _this.listeners.cursor_changed.apply( + _this, [ _this, ''] + ); + }); + }, + items : [ + { + xtype: Gtk.ListStore, + id : "branchStore", + pack : "set_model", + init : function() { + XObject.prototype.init.call(this); + this.el.set_column_types ( 3, [ + GObject.TYPE_STRING, // file + GObject.TYPE_STRING, // added + GObject.TYPE_STRING, // removed + ] ); + }, + load : function(tr) + { + //this.insert(citer,iter,0); + this.el.clear(); + + var tr = Branches.repo.getBranches(); + + + for(var i =0 ; i < tr.length; i++) { + var ret = { }; + + this.el.append(ret); + + //print(JSON.stringify(ret,null,4)); + var lastrev = tr[i].lastrev; + var remoterev = tr[i].remoterev; + + var lastrev = lastrev.length ? lastrev : remoterev; + + if (lastrev != remoterev) { + lastrev = "Out of sync: remote=" + remoterev + ", local=" + lastrev; + } + + + + this.el.set_value(ret.iter, 0, '' + tr[i].name ); + this.el.set_value(ret.iter, 1, '' + tr[i].remote ); + this.el.set_value(ret.iter, 2, '' + lastrev ); + + + } + } + }, + { + xtype: Gtk.TreeViewColumn, + min_width : 70, + pack : "append_column", + resizable : true, + title : "Local", + init : function() { + XObject.prototype.init.call(this); + this.el.add_attribute(this.items[0].el , 'markup', 0 ); + + }, + items : [ + { + xtype: Gtk.CellRendererText, + pack : "pack_start" + } + ] + }, + { + xtype: Gtk.TreeViewColumn, + min_width : 70, + pack : "append_column", + resizable : true, + title : "Remote", + init : function() { + XObject.prototype.init.call(this); + this.el.add_attribute(this.items[0].el , 'markup', 1 ); + + }, + items : [ + { + xtype: Gtk.CellRendererText, + pack : "pack_start" + } + ] + }, + { + xtype: Gtk.TreeViewColumn, + min_width : 200, + pack : "append_column", + title : "Status", + init : function() { + XObject.prototype.init.call(this); + this.el.add_attribute(this.items[0].el , 'markup', 2 ); + + }, + items : [ + { + xtype: Gtk.CellRendererText, + pack : "pack_start" + } + ] + } + ] + }, + { + xtype: Gtk.TreeView, + pack : false, + items : [ + { + xtype: Gtk.ListStore, + pack : false + } + ] + } + ] + } + ] + }, + { + xtype: Gtk.Button, + label : "Cancel", + pack : "add_action_widget,0" + }, + { + xtype: Gtk.Button, + id : "ok_button", + label : "OK", + pack : "add_action_widget,1" + } + ] +}); +Branches.init(); +XObject.cache['/Branches'] = Branches; diff --git a/old_seed_version/Clones.js b/old_seed_version/Clones.js new file mode 100644 index 00000000..43723415 --- /dev/null +++ b/old_seed_version/Clones.js @@ -0,0 +1,581 @@ +Gtk = imports.gi.Gtk; +Gdk = imports.gi.Gdk; +Pango = imports.gi.Pango; +GLib = imports.gi.GLib; +Gio = imports.gi.Gio; +GObject = imports.gi.GObject; +GtkSource = imports.gi.GtkSource; +WebKit = imports.gi.WebKit; +Vte = imports.gi.Vte; +console = imports.console; +XObject = imports.XObject.XObject; +Clones=new XObject({ + xtype: Gtk.Dialog, + listeners : { + destroy_event : function (self, event) { + print("DESTROY?!"); + return true; + }, + response : function (self, id) { + // hide + //if (id < 1) { + this.el.hide(); + return; + //} + if (typeof(this.get('bug').getValue()) != 'object') { + print("ERROR"); + return; + } + + this.el.hide(); + + //var val = this.get('bug').getValue(); + // Seed.print(val); + } + }, + border_width : 3, + default_height : 500, + default_width : 600, + title : "Manage Clones", + deletable : true, + modal : true, + show : function(c) { + + if (!this.el) { + this.init(); + } + var _this = this; + /*[ 'xtype' ].forEach(function(k) { + _this.get(k).setValue(typeof(c[k]) == 'undefined' ? '' : c[k]); + }); + // shouild set path.. + */ + this.el.set_deletable(false); + this.el.show_all(); + // load clones.. + this.get('/reposStore').load(); + + //this.get('/ok_button').el.set_sensitive(false); + + // block until we return. + var run_ret = this.el.run(); + if (run_ret < 1 ) { + return "DONE"; + } + print("RUN RETURN : " + run_ret); + return "DONE"; + //print(JSON.stringify(this.get('bug').getValue())); + // return this.get('bug').getValue(); + //this.success = c.success; + }, + items : [ + { + xtype: Gtk.VBox, + id : "Clones", + pack : function(p,e) { + p.el.get_content_area().pack_start(e.el,true,true,0) + }, + items : [ + { + xtype: Gtk.HBox, + pack : "pack_start,false,true", + items : [ + { + xtype: Gtk.Button, + listeners : { + clicked : function (self) { + + var rv = this.get('/reposView'); + var rs = this.get('/reposStore'); + if (rv.el.get_selection().count_selected_rows() != 1) { + //nothing? + // error condition. + return; + } + var Remotes = imports.Remotes.Remotes; + + + var ret = {}; + var s = rv.el.get_selection(); + var path = ''; + s.selected_foreach(function(model,p,iter) { + + path = model.get_value(iter, 6).value.get_string(); + + }); + + var repo = false; + rs.repos.forEach(function(r) { + if (r.repopath == path) { + repo = r; + + } + + }); + Remotes.repo = repo; + Remotes.el.set_transient_for(Clones.el); + Clones.el.set_title("Manage Clones - " + repo.repopath); + Remotes.show(); + Clones.el.set_title("Manage Clones"); + + + + + + + + + + } + }, + label : "Remotes / Clones", + pack : "add" + }, + { + xtype: Gtk.Button, + listeners : { + clicked : function (self) { + + var rv = this.get('/reposView'); + var rs = this.get('/reposStore'); + if (rv.el.get_selection().count_selected_rows() != 1) { + //nothing? + // error condition. + return; + } + var Branches = imports.Branches.Branches; + + + var ret = {}; + var s = rv.el.get_selection(); + var path = ''; + s.selected_foreach(function(model,p,iter) { + + path = model.get_value(iter, 6).value.get_string(); + + }); + + var repo = false; + rs.repos.forEach(function(r) { + if (r.repopath == path) { + repo = r; + + } + + }); + Branches.repo = repo; + Branches.el.set_transient_for(Clones.el); + Clones.el.set_title("Manage Clones - " + repo.repopath); + Branches.show(); + Clones.el.set_title("Manage Clones"); + + + + + + + + + + } + }, + label : "Branches", + pack : "add" + }, + { + xtype: Gtk.Button, + listeners : { + clicked : function (self) { + + var rv = this.get('/reposView'); + var rs = this.get('/reposStore'); + if (rv.el.get_selection().count_selected_rows() != 1) { + //nothing? + // error condition. + return; + } + var Merger = imports.Merger.Merger; + + + var ret = {}; + var s = rv.el.get_selection(); + var path = ''; + s.selected_foreach(function(model,p,iter) { + + path = model.get_value(iter, 6).value.get_string(); + + }); + + var repo = false; + rs.repos.forEach(function(r) { + if (r.repopath == path) { + repo = r; + + } + + }); + Merger.repo = repo; + Merger.el.set_transient_for(Clones.el); + Clones.el.set_title("Manage Clones - " + repo.repopath); + Merger.show(); + Clones.el.set_title("Manage Clones"); + + + + + + + + + + + + + + + } + }, + label : "Run Merger", + pack : "add" + }, + { + xtype: Gtk.Button, + listeners : { + clicked : function (self) { + + + + + + + } + }, + label : "Switch Branch", + pack : "add" + }, + { + xtype: Gtk.Button, + listeners : { + clicked : function (self) { + + + + + + + } + }, + label : "Pull", + pack : "add" + } + ] + }, + { + xtype: Gtk.ScrolledWindow, + init : function() { + XObject.prototype.init.call(this); + this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) + }, + items : [ + { + xtype: Gtk.TreeView, + listeners : { + cursor_changed : function (self) { + // SEE SELECTION.CHANGED + + + return; + + if (this.el.get_selection().count_selected_rows() < 1) { + //nothing? - clea it? + return; + } + var ret = {}; + var model = this.get('/changedFilesStore'); + + var s = this.el.get_selection(); + var files = []; + s.selected_foreach(function(model,p,iter) { + + files.push( model.get_value(iter, 0).value.get_string()); + + }); + this.get('/patchview').showDiff(files); + //var value = ''+ ret.model.get_value(ret.iter, 1).value.get_string(); + //print("OUT?" + value);// id.. + // load the list in the right grid.. + + return true; + + } + }, + id : "reposView", + pack : "add", + init : function() { + XObject.prototype.init.call(this); + var description = new Pango.FontDescription.c_new(); + description.set_size(10000); + this.el.modify_font(description); + + this.selection = this.el.get_selection(); + this.selection.set_mode( Gtk.SelectionMode.MULTIPLE); + var _this = this; + + + this.selection.signal['changed'].connect(function() { + _this.listeners.cursor_changed.apply( + _this, [ _this, ''] + ); + }); + }, + items : [ + { + xtype: Gtk.ListStore, + id : "reposStore", + pack : "set_model", + init : function() { + XObject.prototype.init.call(this); + this.el.set_column_types ( 8, [ + GObject.TYPE_STRING, // repo + GObject.TYPE_STRING, // current branch + GObject.TYPE_STRING, // all branch + GObject.TYPE_STRING, // updated + GObject.TYPE_BOOLEAN, // auto-commit + GObject.TYPE_BOOLEAN, // auto-push + GObject.TYPE_STRING, // repopath + GObject.TYPE_STRING // color highighling + ] ); + }, + load : function() + { + //this.insert(citer,iter,0); + print("getting list"); + this.repos = imports.Scm.Repo.Repo.list(); + var tr= this.repos; + this.el.clear(); + + for(var i =0 ; i < tr.length; i++) { + var ret = { }; + + this.el.append(ret); + + //print(JSON.stringify(ret,null,4)); + tr[i].getBranches(); + tr[i].getStatus(); + var hi; + try { + //tr[i].debug=1; + hi = tr[i].history('/', 1, 'branch', tr[i].currentBranch.name ); + // print(JSON.stringify(hi,null,4)); + } catch(e) { print(e);} + + this.el.set_value(ret.iter, 0, '' + tr[i].repopath.split('/').pop() ); + this.el.set_value(ret.iter, 1, '' + tr[i].currentBranch.name ); + this.el.set_value(ret.iter, 2, '' + tr[i].branches.map( + function(e) { return e.name; + }).join(', ') + ); + this.el.set_value(ret.iter, 3, '' + (!hi ? '??' : hi[0].changed_raw)); + this.el.set_value(ret.iter, 4, tr[i].autocommit() ); + this.el.set_value(ret.iter, 5, tr[i].autopush() ); + this.el.set_value(ret.iter, 6, tr[i].repopath ); + // highlight color. + var cb = tr[i].currentBranch; + //print(JSON.stringify(cb,null,4)); + var col = '#ffffff'; + if (cb.lastrev != cb.remoterev) { + col = '#ff0000'; + } + if (tr[i].hasLocalChanges) { + col = '#0000ff'; + } + if ((cb.lastrev != cb.remoterev) && (tr[i].hasLocalChanges)) { + col = '#ff00ff'; + } + + this.el.set_value(ret.iter, 7, col ); + + } + }, + pathToRepo : function(path) { + + var tr= this.repos; + + + for(var i =0 ; i < tr.length; i++) { + if (tr[i].repopath == path) { + return tr[i]; + } + } + return false; + } + }, + { + xtype: Gtk.TreeViewColumn, + min_width : 50, + pack : "append_column", + title : "Auto Commit", + init : function() { + XObject.prototype.init.call(this); + this.el.add_attribute(this.items[0].el , 'active', 4 ); + this.items[0].el.set_activatable(true); + + }, + items : [ + { + xtype: Gtk.CellRendererToggle, + listeners : { + toggled : function (self, path) { + var ret ={} ; + var store = this.get('/reposStore'); + store.el.get_iter_from_string(ret, path); + + var value = store.el.get_value(ret.iter,4).value.get_boolean(); + + //print(JSON.stringify(value)); + store.el.set_value(ret.iter,4, !value); + + var path = store.el.get_value(ret.iter, 6).value.get_string(); + var repo = imports.Scm.Repo.Repo.get(path); + repo.autocommit(!value); + + + + } + }, + pack : "pack_start", + mode : Gtk.CellRendererMode.ACTIVATABLE + } + ] + }, + { + xtype: Gtk.TreeViewColumn, + min_width : 50, + pack : "append_column", + title : "Auto Push", + init : function() { + XObject.prototype.init.call(this); + this.el.add_attribute(this.items[0].el , 'active', 5 ); + this.items[0].el.set_activatable(true); + }, + items : [ + { + xtype: Gtk.CellRendererToggle, + listeners : { + toggled : function (self, path) { + var ret ={} ; + var store = this.get('/reposStore'); + store.el.get_iter_from_string(ret, path); + + var value = store.el.get_value(ret.iter,5).value.get_boolean(); + + //print(JSON.stringify(value)); + store.el.set_value(ret.iter,5, !value); + var path = store.el.get_value(ret.iter, 6).value.get_string(); + var repo = imports.Scm.Repo.Repo.get(path); + repo.autopush(!value); + + } + }, + pack : "pack_start", + mode : Gtk.CellRendererMode.ACTIVATABLE + } + ] + }, + { + xtype: Gtk.TreeViewColumn, + min_width : 200, + pack : "append_column", + resizable : true, + title : "Repo", + init : function() { + XObject.prototype.init.call(this); + this.el.add_attribute(this.items[0].el , 'markup', 0 ); + + }, + items : [ + { + xtype: Gtk.CellRendererText, + pack : "pack_start" + } + ] + }, + { + xtype: Gtk.TreeViewColumn, + min_width : 50, + pack : "append_column", + title : "Current Branch", + init : function() { + XObject.prototype.init.call(this); + this.el.add_attribute(this.items[0].el , 'markup', 1 ); + this.el.add_attribute(this.items[0].el , 'cell-background', 7 ); + + }, + items : [ + { + xtype: Gtk.CellRendererText, + pack : "pack_start" + } + ] + }, + { + xtype: Gtk.TreeViewColumn, + min_width : 50, + pack : "append_column", + title : "Last updated", + init : function() { + XObject.prototype.init.call(this); + this.el.add_attribute(this.items[0].el , 'markup', 3 ); + + }, + items : [ + { + xtype: Gtk.CellRendererText, + pack : "pack_start" + } + ] + }, + { + xtype: Gtk.TreeViewColumn, + min_width : 50, + pack : "append_column", + resizable : false, + title : "All Branches", + init : function() { + XObject.prototype.init.call(this); + this.el.add_attribute(this.items[0].el , 'markup', 2 ); + + }, + items : [ + { + xtype: Gtk.CellRendererText, + pack : "pack_start" + } + ] + } + ] + }, + { + xtype: Gtk.TreeView, + pack : false, + items : [ + { + xtype: Gtk.ListStore, + pack : false + } + ] + } + ] + } + ] + }, + { + xtype: Gtk.Button, + id : "ok_button", + label : "Close", + pack : "add_action_widget,1" + } + ] +}); +Clones.init(); +XObject.cache['/Clones'] = Clones; diff --git a/old_seed_version/Commit.js b/old_seed_version/Commit.js new file mode 100644 index 00000000..e56a48e1 --- /dev/null +++ b/old_seed_version/Commit.js @@ -0,0 +1,313 @@ +Gtk = imports.gi.Gtk; +Gdk = imports.gi.Gdk; +Pango = imports.gi.Pango; +GLib = imports.gi.GLib; +Gio = imports.gi.Gio; +GObject = imports.gi.GObject; +GtkSource = imports.gi.GtkSource; +WebKit = imports.gi.WebKit; +Vte = imports.gi.Vte; +console = imports.console; +XObject = imports.XObject.XObject; +Commit=new XObject({ + xtype: Gtk.Dialog, + listeners : { + destroy_event : function (self, event) { + this.el.hide(); + return false; + }, + response : function (self, id) { + // hide + //if (id < 1) { + this.el.hide(); + return; + //} + if (typeof(this.get('bug').getValue()) != 'object') { + print("ERROR"); + return; + } + + this.el.hide(); + + //var val = this.get('bug').getValue(); + // Seed.print(val); + } + }, + ' modal' : true, + border_width : 3, + default_height : 500, + default_width : 800, + title : "Commit", + deletable : true, + modal : true, + show : function(c) { + + if (!this.el) { + this.init(); + } + var _this = this; + + + this.files = c.files; + this.release = c.release; + this.rev = c.rev; + + this.repo = c.repo; + + this.get('/commitDate').el.set_text(c.changed); + this.get('/commitAuthor').el.set_text(c.author); + this.get('/commitMsg').el.get_buffer().set_text(''); + this.get('/commitPatch').showDiff(c.files); + + this.el.show_all(); + + var run_ret = this.el.run(); + if (run_ret < 1 ) { + return false; + } + var buf = this.get('/commitMsg').el.get_buffer(); + var e = {}; + var s = {}; + buf.get_start_iter(s); + buf.get_end_iter(e); + + var ret= { + date : this.get('/commitDate').el.get_text(), + author : this.get('/commitAuthor').el.get_text(), + message : buf.get_text(s.value, e.value, false) + }; + + return ret; + + + + }, + items : [ + { + xtype: Gtk.VBox, + pack : function(p,e) { + p.el.get_content_area().pack_start(e.el,true,true,10); + }, + items : [ + { + xtype: Gtk.HBox, + pack : "pack_start,false,true,2", + items : [ + { + xtype: Gtk.Label, + label : "Fixes", + pack : "pack_start,false,false,10", + width_request : 50 + }, + { + xtype: Gtk.ComboBox, + listeners : { + changed : function (self) { + var val = this.el.get_child().get_text(); + print(JSON.stringify(val)); + if (!val.length) { + return; + } + + var name = this.get('/remoteName').el.get_text(); + if (name.length) { + return; + } + // fill in name + var val = imports.Scm.Git.Repo.Repo.parseURL(val); + if ((typeof(val.host) != 'undefined') && val.host.length) { + var host = val.host; + // need to add github owner... + if (host.match(/github.com$/)) { + host += '.' + val.path.split('/').shift(); + } + + + this.get('/remoteName').el.set_text(host); + } + + + } + }, + id : "commitFixes", + init : function() { + this.el = new Gtk.ComboBox.with_entry(); + + + this.model = new XObject(this.model); + this.model.init(); + this.el.set_model(this.model.el); + this.el.set_entry_text_column (0); + XObject.prototype.init.call(this); + + }, + load : function(tr) + { + //this.insert(citer,iter,0); + this.model.el.clear(); + + var master = false; + var working = false; + + for(var i =0 ; i < tr.length; i++) { + var ret = { }; + this.model.el.append(ret); + //print(JSON.stringify(ret,null,4)); + if (tr[i].name == 'master') { + master = i; + } + if (tr[i].name == 'working') { + working = i; + } + this.model.el.set_value(ret.iter, 0, '' + tr[i].name ); + this.model.el.set_value(ret.iter, 1, '' + tr[i].rev ); + + + } + if (master !== false) { + this.el.set_active(master); + } + if (working !== false) { + this.el.set_active(working); + } + + }, + model : { + xtype: Gtk.ListStore, + init : function() { + XObject.prototype.init.call(this); + this.el.set_column_types ( 3, [ + GObject.TYPE_STRING, // file + GObject.TYPE_STRING, // added + GObject.TYPE_STRING, // removed + ] ); + } + } + } + ] + }, + { + xtype: Gtk.HBox, + pack : "pack_start,false,true,2", + items : [ + { + xtype: Gtk.Label, + label : "Date", + pack : "pack_start,false,false,10", + width_request : 50, + xalign : 1 + }, + { + xtype: Gtk.Entry, + id : "commitDate" + } + ] + }, + { + xtype: Gtk.HBox, + pack : "pack_start,false,true,2", + items : [ + { + xtype: Gtk.Label, + label : "Author", + pack : "pack_start,false,false,10", + width_request : 50, + xalign : 1 + }, + { + xtype: Gtk.Entry, + id : "commitAuthor" + } + ] + }, + { + xtype: Gtk.HBox, + pack : "pack_start,false,false,2", + items : [ + { + xtype: Gtk.Label, + label : "Message", + pack : "pack_start,false,false,10", + width_request : 50, + xalign : 1 + }, + { + xtype: Gtk.TextView, + height_request : 100, + id : "commitMsg", + pack : "add" + } + ] + }, + { + xtype: Gtk.ScrolledWindow, + height_request : 200, + pack : "pack_end,true,true,0", + init : function() { + XObject.prototype.init.call(this); + this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) + }, + items : [ + { + xtype: WebKit.WebView, + id : "commitPatch", + pack : "add", + clear : function() { + + + + + // remove.. + var s = "document.body.textContent='';" + + this.el.execute_script(s); + + + + + + }, + showDiff : function(files) { + this.clear(); + + + + if (Commit.release === false) { + return; + } + + var diff = Commit.repo.diff(files, Commit.release, Commit.rev); + + // remove.. + var s = "var pre = document.createElement('pre'); document.body.appendChild(pre);"; + s += "pre.textContent = " + + JSON.stringify(Commit.repo.lastCmd + "\n") + '+ ' + + JSON.stringify(diff) + ";"; + + this.el.execute_script(s); + + + + + + } + } + ] + } + ] + }, + { + xtype: Gtk.Button, + label : "Cancel", + pack : "add_action_widget,0" + }, + { + xtype: Gtk.Button, + id : "ok_button", + label : "Add", + pack : "add_action_widget,1" + } + ] +}); +Commit.init(); +XObject.cache['/Commit'] = Commit; diff --git a/old_seed_version/Date.js b/old_seed_version/Date.js new file mode 100644 index 00000000..907df59a --- /dev/null +++ b/old_seed_version/Date.js @@ -0,0 +1,839 @@ +/* + * Based on: + * Ext JS Library 1.1.1 + * Copyright(c) 2006-2007, Ext JS, LLC. + * + * Originally Released Under LGPL - original licence link has changed is not relivant. + * + * Fork - LGPL + *