sync
[gitlive] / old_seed_version / Branches.bjs
diff --git a/old_seed_version/Branches.bjs b/old_seed_version/Branches.bjs
new file mode 100644 (file)
index 0000000..74bf62f
--- /dev/null
@@ -0,0 +1,152 @@
+{
+    "id": "file-gtk-1",
+    "name": "Branches",
+    "parent": "",
+    "title": false,
+    "path": "/home/alan/gitlive/gitlive/Branches.bjs",
+    "items": [
+        {
+            "listeners": {
+                "destroy_event": "function (self, event) {\n     this.el.hide();\n                return false;\n}",
+                "response": "function (self, id) {\n  // hide\n     //if (id < 1) {\n        this.el.hide();\n        return;\n    //}\n    if (typeof(this.get('bug').getValue()) != 'object') {\n        print(\"ERROR\");\n        return;\n    }\n \n    this.el.hide();\n        \n    //var val = this.get('bug').getValue();\n     //   Seed.print(val);\n}"
+            },
+            " modal": true,
+            "border_width": 3,
+            "default_height": 300,
+            "default_width": 500,
+            "title": "Branches",
+            "xtype": "Dialog",
+            "|deletable": "true",
+            "|modal": "true",
+            "|show": "function(c) {\n    \n    if (!this.el) {\n        this.init();\n    }\n    var _this = this;\n    this.get('/branchStore').load();\n    this.el.show_all();\n    \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    \n}\n",
+            "|xns": "Gtk",
+            "items": [
+                {
+                    "xtype": "VBox",
+                    "|pack": " function(p,e) {\n        p.el.get_content_area().pack_start(e.el,true,true,0)\n    }\n",
+                    "|xns": "Gtk",
+                    "items": [
+                        {
+                            "pack": "pack_start,false,true",
+                            "xtype": "HBox",
+                            "|xns": "Gtk",
+                            "items": [
+                                {
+                                    "listeners": {
+                                        "clicked": "function (self) {\n\n     return;\n    var RemoteEdit=    imports.RemoteEdit.RemoteEdit\n     RemoteEdit.repo = Remotes.repo;\n    RemoteEdit.el.set_transient_for(Remotes.el);\n\n    var res =  RemoteEdit.show();\n    \n    if (res != false) {\n        Remotes.repo.remotes(res);\n    }\n    \n    this.get('/remotesStore').load();\n\n    \n}"
+                                    },
+                                    "label": "Pull",
+                                    "pack": "add",
+                                    "xtype": "Button",
+                                    "|xns": "Gtk"
+                                }
+                            ]
+                        },
+                        {
+                            "xtype": "ScrolledWindow",
+                            "|init": "function() {\n    XObject.prototype.init.call(this);\n      this.el.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)\n}\n",
+                            "|xns": "Gtk",
+                            "items": [
+                                {
+                                    "listeners": {
+                                        "cursor_changed": "function (self)\n{\n\n   return;\n  // SEE SELECTION.CHANGED\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": "branchView",
+                                    "pack": "add",
+                                    "xtype": "TreeView",
+                                    "|init": "function() {\n    XObject.prototype.init.call(this);\n        var description = new Pango.FontDescription.c_new();\n   description.set_size(8000);\n     this.el.modify_font(description);\n\n     this.selection = this.el.get_selection();\n      this.selection.set_mode( Gtk.SelectionMode.MULTIPLE);\n    var _this = this;\n  this.selection.signal['changed'].connect(function() {\n     _this.listeners.cursor_changed.apply(\n          _this, [ _this, '']\n       );\n             });\n  }\n",
+                                    "|xns": "Gtk",
+                                    "items": [
+                                        {
+                                            "id": "branchStore",
+                                            "pack": "set_model",
+                                            "xtype": "ListStore",
+                                            "|init": "function() {\n    XObject.prototype.init.call(this);\n    this.el.set_column_types ( 3, [\n       GObject.TYPE_STRING, // file  \n      GObject.TYPE_STRING, // added\n      GObject.TYPE_STRING, // removed\n  ] );\n}\n",
+                                            "|load": "function(tr)\n{\n    //this.insert(citer,iter,0);\n    this.el.clear();\n    \n    var tr = Branches.repo.getBranches();\n    \n    \n    for(var i =0 ; i < tr.length; i++) {\n        var ret = {  };\n       \n        this.el.append(ret);\n        \n        //print(JSON.stringify(ret,null,4));\n        var lastrev = tr[i].lastrev;\n        var remoterev = tr[i].remoterev;\n        \n        var lastrev = lastrev.length ? lastrev : remoterev;\n        \n        if (lastrev != remoterev) {\n            lastrev = \"Out of sync: remote=\" + remoterev + \", local=\" + lastrev;\n        }\n        \n \n          \n        this.el.set_value(ret.iter, 0, ''  +  tr[i].name );\n        this.el.set_value(ret.iter, 1, '' + tr[i].remote );\n        this.el.set_value(ret.iter, 2, '' + lastrev );\n \n        \n    }     \n}",
+                                            "|xns": "Gtk"
+                                        },
+                                        {
+                                            "min_width": 70,
+                                            "pack": "append_column",
+                                            "resizable": true,
+                                            "title": "Local",
+                                            "xtype": "TreeViewColumn",
+                                            "|init": "function() {\n    XObject.prototype.init.call(this);\n    this.el.add_attribute(this.items[0].el , 'markup', 0 );\n\n}\n",
+                                            "|xns": "Gtk",
+                                            "items": [
+                                                {
+                                                    "pack": "pack_start",
+                                                    "xtype": "CellRendererText",
+                                                    "|xns": "Gtk"
+                                                }
+                                            ]
+                                        },
+                                        {
+                                            "min_width": 70,
+                                            "pack": "append_column",
+                                            "resizable": true,
+                                            "title": "Remote",
+                                            "xtype": "TreeViewColumn",
+                                            "|init": "function() {\n    XObject.prototype.init.call(this);\n    this.el.add_attribute(this.items[0].el , 'markup', 1 );\n\n}\n",
+                                            "|xns": "Gtk",
+                                            "items": [
+                                                {
+                                                    "pack": "pack_start",
+                                                    "xtype": "CellRendererText",
+                                                    "|xns": "Gtk"
+                                                }
+                                            ]
+                                        },
+                                        {
+                                            "min_width": 200,
+                                            "pack": "append_column",
+                                            "title": "Status",
+                                            "xtype": "TreeViewColumn",
+                                            "|init": "function() {\n    XObject.prototype.init.call(this);\n    this.el.add_attribute(this.items[0].el , 'markup', 2 );\n\n}\n",
+                                            "|xns": "Gtk",
+                                            "items": [
+                                                {
+                                                    "pack": "pack_start",
+                                                    "xtype": "CellRendererText",
+                                                    "|xns": "Gtk"
+                                                }
+                                            ]
+                                        }
+                                    ]
+                                },
+                                {
+                                    "|xns": "Gtk",
+                                    "xtype": "TreeView",
+                                    "pack": false,
+                                    "items": [
+                                        {
+                                            "|xns": "Gtk",
+                                            "xtype": "ListStore",
+                                            "pack": false
+                                        }
+                                    ]
+                                }
+                            ]
+                        }
+                    ]
+                },
+                {
+                    "label": "Cancel",
+                    "pack": "add_action_widget,0",
+                    "xtype": "Button",
+                    "|xns": "Gtk",
+                    "listeners": {}
+                },
+                {
+                    "id": "ok_button",
+                    "label": "OK",
+                    "pack": "add_action_widget,1",
+                    "xtype": "Button",
+                    "|xns": "Gtk"
+                }
+            ]
+        }
+    ],
+    "permname": "",
+    "modOrder": ""
+}
\ No newline at end of file