{ "id": "file-gtk-4", "name": "Remotes", "parent": "", "title": false, "path": "/home/alan/gitlive/gitlive/Remotes.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": "Remotes", "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('/remotesStore').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 \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": "Add", "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": "remotesView", "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": "remotesStore", "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 = Remotes.repo.remotes();\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 \n \n this.el.set_value(ret.iter, 0, '' + tr[i].name );\n this.el.set_value(ret.iter, 1, '' + tr[i].url );\n this.el.set_value(ret.iter, 2, '' + tr[i].type );\n \n \n } \n}", "|xns": "Gtk" }, { "min_width": 70, "pack": "append_column", "resizable": true, "title": "Name", "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": "Type", "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" } ] }, { "min_width": 200, "pack": "append_column", "title": "URL", "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" } ] } ] }, { "|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": "0" }