Clone.bjs
[gitlive] / Clone.bjs
index ba8074f..54598ef 100644 (file)
--- a/Clone.bjs
+++ b/Clone.bjs
@@ -9,7 +9,7 @@
  "items" : [
   {
    "GitRepo repo" : "",
-   "| void show" : " (Gtk.Widget btn, Gdk.Rectangle rect, GitRepo repo) {\n    _this.repo = repo;\n    // get the active project.\n     var lm = Gtk.SourceLanguageManager.get_default();\n                \n//    ((Gtk.SourceBuffer)(_this.view.el.get_buffer())) .set_language(\n  //      lm.get_language(\"html\")\n //   );\n  \n    //print (project.fn);\n    //project.runhtml = project.runhtml || '';\n    _this.diff_view.el.get_buffer().set_text(repo.git_diff);\n    _this.status_view.el.get_buffer().set_text(repo.git_status);\n       \n    \t//console.log('show all');\n\tthis.el.set_modal(true);\n\tthis.el.set_relative_to(btn);\n    this.el.set_pointing_to(rect);\n  \n\t//this.el.set_position(Gtk.PositionType.RIGHT);\n\n\t// window + header?\n\t GLib.debug(\"SHOWALL - POPIP\\n\");\n\tthis.el.show_all();\n\t//this.el.set_size_request(800,500);\n//\tthis.diff_view.el.grab_focus();\n\t\n    //this.el.show_all();\n}\n",
+   "| void show" : " (Gtk.Widget btn, GitRepo repo) {\n \n    \t//console.log('show all');\n\tthis.el.set_modal(true);\n\tthis.el.set_relative_to(btn);\n  \n\t//this.el.set_position(Gtk.PositionType.RIGHT);\n\n\t// window + header?\n\t GLib.debug(\"SHOWALL - POPIP\\n\");\n\tthis.el.show_all();\n;\n}\n",
    "xtype" : "Popover",
    "Gtk.PositionType position" : "Gtk.PositionType.RIGHT",
    "$ xns" : "Gtk",
    "uint border_width" : 0,
    "items" : [
     {
+     "* pack" : "pack_end,false,false,0",
      "xtype" : "Box",
-     "* pack" : "add",
+     "gboolean expand" : false,
      "$ xns" : "Gtk",
-     "Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
-     "border_width" : 5,
-     "$ homogeneous" : false,
+     "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
+     "gboolean vexpand" : false,
      "items" : [
       {
-       "* pack" : "pack_end,false,false,0",
-       "xtype" : "Box",
-       "gboolean expand" : false,
+       "* ctor" : "new Gtk.ComboBox.with_entry()",
+       "| string selectedRepo" : "() {\n\tGtk.TreeIter iter;\n\tValue val1;\n \n \n\tthis.el.get_active_iter (out iter);\n\t_this.repomodel.el.get_value (iter, 0, out val1);\n \n\n\treturn  (string) val1;\n\t\n\t\n\t\n\t\n}\n",
+       "id" : "reposel",
+       "* init" : "this.el.set_entry_text_column(1);",
+       "bool hexpand" : true,
+       "* pack" : "attach_defaults,0,1,1,2",
+       "xtype" : "ComboBox",
+       "# bool loading" : false,
        "$ xns" : "Gtk",
-       "Gtk.Orientation orientation" : "Gtk.Orientation.HORIZONTAL",
-       "$ homogeneous" : true,
-       "gboolean vexpand" : false,
        "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}"
-         },
-         "label" : "Stash Changes",
-         "* pack" : "add",
-         "xtype" : "Button",
+         "id" : "prcellrenderer",
+         "* pack" : "pack_start,true",
+         "xtype" : "CellRendererText",
          "$ xns" : "Gtk"
         },
         {
-         "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}"
-         },
-         "label" : "Commit Changes",
-         "* pack" : "add",
-         "xtype" : "Button",
-         "$ xns" : "Gtk"
-        },
-        {
-         "listeners" : {
-          "button_press_event" : "() => {\n   var oldq = new Gee.ArrayList<GitMonitorQueue>();  \n\t \n\tNewBranch.singleton().show(_this.repo, oldq);\n\n    return false;\n}"
-         },
-         "label" : "Create Branch",
-         "xtype" : "Button",
-         "* pack" : "add",
-         "$ xns" : "Gtk"
-        },
-        {
-         "listeners" : {
-          "button_press_event" : "() => {\n       _this.el.hide();\n        return false;\n}"
-         },
-         "label" : "Ignore for now",
-         "xtype" : "Button",
-         "* pack" : "add",
+         "| void loadProjects" : "  (string id) {\n\n    var rt = RooTicket.singleton();\n    var gr = GitRepo.singleton();\n    _this.reposel.loading = true;\n\n    this.el.clear();                                    \n    Gtk.TreeIter iter;\n    var el = this.el;\n    \n    el.append(out iter);\n\n    \n    el.set_value(iter, 0, \"\");\n    el.set_value(iter, 1, \"-- select a repo --\");\n \n\t_this.reposel.el.set_active_iter(iter);\n    \n    var projects = rt.projects;\n    foreach(var newrepo in rt.repos) {\n    \tvar has_repo = false;\n    \tforeach(var repo in gr.cache.values) {\n    \t\tif (newrepo.name == repo.name) {\n    \t\t\thas_repo = true;\n    \t}\n    \tif (has_repo) {\n    \t\tcontinue;\n\t\t}\n        el.append(out iter);\n        \n        el.set_value(iter, 0, project.id);\n        el.set_value(iter, 1,  project.name );\n        if (id == project.id) {\n\t \t   _this.projectsel.el.set_active_iter(iter);\n\t    }   \n        \n    }\n    \n    _this.reposel.loading = false;\n     //this.el.set_sort_column_id(0, Gtk.SortType.ASCENDING);          \n                                     \n}\n",
+         "id" : "prmodel",
+         "* pack" : "set_model",
+         "xtype" : "ListStore",
+         "$ columns" : "typeof(string),typeof(string)",
+         "n_columns" : 2,
          "$ xns" : "Gtk"
         }
        ]
+      },
+      {
+       "listeners" : {
+        "button_press_event" : "() => {\n       _this.el.hide();\n        return false;\n}"
+       },
+       "label" : "Checkout",
+       "* pack" : "add",
+       "xtype" : "Button",
+       "$ xns" : "Gtk"
       }
      ]
     }