"build_module" : "gitlive",
"items" : [
{
- "@ void buttonPressed" : "(string btn)",
- "id" : "RooProjectSettings",
- "| void show" : " (Gtk.Widget btn, Project.Project project) {\n _this.project = project;\n _this.path.el.label = project.firstPath();\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.view.el.get_buffer().set_text(project.runhtml);\n \n \n \n _this.rootURL.el.set_text( _this.project.rootURL );\n \n _this.html_gen_model.loadData(_this.project.html_gen);\n\n _this.base_template_model.loadData();\n \n var js = _this.project;\n _this.database_DBTYPE.el.set_text( js.get_string_member(\"DBTYPE\") );\n _this.database_DBNAME.el.set_text( js.get_string_member(\"DBNAME\") );\n _this.database_DBUSERNAME.el.set_text( js.get_string_member(\"DBUSERNAME\") );\n _this.database_DBPASSWORD.el.set_text( js.get_string_member(\"DBPASSWORD\") );\n \n \t//console.log('show all');\n\tthis.el.set_modal(true);\n\tthis.el.set_relative_to(btn);\n\n\tthis.el.set_position(Gtk.PositionType.RIGHT);\n\n\t// window + header?\n\t print(\"SHOWALL - POPIP\\n\");\n\tthis.el.show_all();\n\tthis.el.set_size_request(800,500);\n\tthis.view.el.grab_focus();\n\t\n \n //this.el.show_all();\n}\n",
+ "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",
"xtype" : "Popover",
"Gtk.PositionType position" : "Gtk.PositionType.RIGHT",
- "| void save" : "() {\n var buf = _this.view.el.get_buffer();\n Gtk.TextIter s;\n Gtk.TextIter e;\n buf.get_start_iter(out s);\n buf.get_end_iter(out e);\n\t_this.project.runhtml = buf.get_text(s,e,true);\n \n _this.project.rootURL = _this.rootURL.el.get_text();\n \n \n Gtk.TreeIter iter;\n Value html_gen_val;\n _this.html_gen.el.get_active_iter(out iter);\n _this.html_gen_model.el.get_value (iter, 0, out html_gen_val);\n \n _this.project.html_gen = (string)html_gen_val;\n \n // set by event changed...\n //_this.project.base_template = _this.base_template.el.get_text(); \n \n var js = _this.project.json_project_data;\n js.set_string_member(\"DBTYPE\", _this.database_DBTYPE.el.get_text());\n js.set_string_member(\"DBNAME\", _this.database_DBNAME.el.get_text());\n js.set_string_member(\"DBUSERNAME\", _this.database_DBUSERNAME.el.get_text());\n js.set_string_member(\"DBPASSWORD\", _this.database_DBPASSWORD.el.get_text());\n// _this.project.set_string_member(\"DBHOST\", _this.DBTYPE.el.get_text()); \n \n // need to re-init the database \n \n _this.project.initRooDatabase();\n \n \n}",
"$ xns" : "Gtk",
- "Project.Project project" : "",
"bool modal" : true,
"uint border_width" : 0,
"items" : [
"utf8 label" : "Diff"
},
{
- "* pack" : "append_page,_this.label_global.el",
+ "* pack" : "append_page,_this.label_status.el",
"xtype" : "Box",
"gboolean homogeneous" : false,
"$ xns" : "Gtk",
"Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
"items" : [
- {
- "id" : "grid",
- "int margin_right" : 4,
- "* pack" : "pack_start,false,false,4",
- "xtype" : "Grid",
- "uint row_spacing" : 2,
- "n_columns" : 2,
- "$ xns" : "Gtk",
- "n_rows" : 7,
- "$ homogeneous" : true,
- "int margin_left" : 4,
- "items" : [
- {
- "label" : "Filename",
- "xalign" : 0,
- "* pack" : "attach,0,0,1,1",
- "xtype" : "Label",
- "gint margin" : 3,
- "$ xns" : "Gtk"
- },
- {
- "label" : "filename",
- "id" : "path",
- "xalign" : 0,
- "* pack" : "attach,1,0,1,1",
- "xtype" : "Label",
- "gint margin" : 3,
- "$ xns" : "Gtk"
- },
- {
- "label" : "HTML template file",
- "xtype" : "Label",
- "* pack" : "attach,0,1,1,1",
- "gint margin" : 3,
- "$ xns" : "Gtk"
- },
- {
- "listeners" : {
- "changed" : "() => {\n\tGtk.TreeIter iter;\n \n\t// this get's called when we are filling in the data... ???\n\tif (this.loading) {\n\t\treturn;\n\t}\n\t\n \n\tif (this.el.get_active_iter(out iter)) {\n\t\tValue vfname;\n\t\t_this.base_template_model.el.get_value (iter, 0, out vfname);\n\t\t_this.project.base_template = ((string)vfname) ;\n\t\t\n\t\t print(\"\\nSET base template to %s\\n\", _this.project.base_template );\n\t\t// is_bjs = ((string)vfname) == \"bjs\";\n\t}\n \n \n // directory is only available for non-bjs \n \n\n\n}\n"
- },
- "id" : "base_template",
- "* init" : "this.el.add_attribute(_this.base_template_cellrenderer.el , \"markup\", 0 );",
- "bool loading" : false,
- "* pack" : "attach,1,1,1,1",
- "xtype" : "ComboBox",
- "$ xns" : "Gtk",
- "items" : [
- {
- "id" : "base_template_cellrenderer",
- "* pack" : "pack_start,true",
- "xtype" : "CellRendererText",
- "$ xns" : "Gtk"
- },
- {
- "id" : "base_template_model",
- "* pack" : "set_model",
- "xtype" : "ListStore",
- "$ columns" : "typeof(string)",
- "n_columns" : 1,
- "$ xns" : "Gtk",
- "| void loadData" : " () {\n\t_this.base_template.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.append(out iter);\n el.set_value(iter, 0, \"roo.builder.html\");\n _this.base_template.el.set_active_iter(iter);\n\tif (_this.project.base_template == \"roo.builder.html\") {\n\t _this.base_template.el.set_active_iter(iter);\n }\n\n el.append(out iter);\n el.set_value(iter, 0, \"bootstrap.builder.html\");\n \n\tprint(\"\\ncur template = %s\\n\", _this.project.base_template);\n \n if (_this.project.base_template == \"bootstrap.builder.html\") {\n\t _this.base_template.el.set_active_iter(iter);\n }\n\n\tel.append(out iter);\n el.set_value(iter, 0, \"mailer.builder.html\");\n\n\tif (_this.project.base_template == \"mailer.builder.html\") {\n\t _this.base_template.el.set_active_iter(iter);\n }\n\t_this.base_template.loading = false;\n \n}\n"
- }
- ]
- },
- {
- "label" : "root URL",
- "xtype" : "Label",
- "* pack" : "attach,0,2,1,1",
- "gint margin" : 3,
- "$ xns" : "Gtk"
- },
- {
- "id" : "rootURL",
- "xtype" : "Entry",
- "* pack" : "attach,1,2,1,1",
- "$ xns" : "Gtk"
- },
- {
- "label" : "Generate HTML in",
- "* pack" : "attach,0,3,1,1",
- "xtype" : "Label",
- "gint margin" : 3,
- "$ xns" : "Gtk"
- },
- {
- "id" : "html_gen",
- "* init" : "this.el.add_attribute(_this.html_gen_cellrenderer.el , \"markup\", 1 );",
- "* pack" : "attach,1,3,1,1",
- "xtype" : "ComboBox",
- "$ xns" : "Gtk",
- "items" : [
- {
- "id" : "html_gen_cellrenderer",
- "xtype" : "CellRendererText",
- "* pack" : "pack_start,true",
- "$ xns" : "Gtk"
- },
- {
- "id" : "html_gen_model",
- "xtype" : "ListStore",
- "* pack" : "set_model",
- "$ columns" : "typeof(string),typeof(string)",
- "n_columns" : 2,
- "$ xns" : "Gtk",
- "| void loadData" : " (string cur) {\n this.el.clear(); \n Gtk.TreeIter iter;\n var el = this.el;\n \n \n el.append(out iter);\n\n \n el.set_value(iter, 0, \"\");\n el.set_value(iter, 1, \"Do not Generate\");\n _this.html_gen.el.set_active_iter(iter);\n\n el.append(out iter);\n \n el.set_value(iter, 0, \"bjs\");\n el.set_value(iter, 1, \"same directory as BJS file\");\n\tif (cur == \"bjs\") {\n\t _this.html_gen.el.set_active_iter(iter);\n }\n\n\n\n el.append(out iter);\n \n el.set_value(iter, 0, \"templates\");\n el.set_value(iter, 1, \"in templates subdirectory\");\n\n\tif (cur == \"template\") {\n\t _this.html_gen.el.set_active_iter(iter);\n }\n\n \n}\n"
- }
- ]
- }
- ]
- },
- {
- "label" : "HTML To insert at end of <HEAD>",
- "xtype" : "Label",
- "* pack" : "pack_start,false,false,0",
- "$ xns" : "Gtk"
- },
{
"* pack" : "pack_start,true,true,0",
"xtype" : "ScrolledWindow",
"$ xns" : "Gtk",
"items" : [
{
- "listeners" : {
- "key_release_event" : " ( event) =>{\n if (event.keyval != 115) {\n return false;\n \n }\n if ( (event.state & Gdk.ModifierType.CONTROL_MASK ) < 1 ) {\n return false;\n }\n var buf = this.el.get_buffer();\n Gtk.TextIter s;\n Gtk.TextIter e;\n buf.get_start_iter(out s);\n buf.get_end_iter(out e);\n _this.project.runhtml = buf.get_text(s,e,true);\n \n \n _this.buttonPressed(\"save\");\n \n return false;\n \n}"
- },
- "id" : "view",
+ "id" : "status_view",
"* init" : " \n var description = Pango.FontDescription.from_string(\"monospace\");\n description.set_size(9000);\n this.el.override_font(description);",
"xtype" : "View",
"* pack" : "add",
]
},
{
- "* pack" : "append_page,_this.label_database.el",
+ "* pack" : "append_page,_this.label_diff.el",
"xtype" : "Box",
"gboolean homogeneous" : false,
"$ xns" : "Gtk",
"Gtk.Orientation orientation" : "Gtk.Orientation.VERTICAL",
"items" : [
{
- "label" : "Type (eg. MySQL or PostgreSQL)",
- "xalign" : 0,
- "* pack" : "pack_start,false,false,0",
- "xtype" : "Label",
- "$ xns" : "Gtk"
- },
- {
- "listeners" : {
- "key_press_event" : "(ev) => {\n\n if (ev.keyval == Gdk.Key.Tab) {\n _this.database_DBNAME.el.grab_focus();\n return true;\n }\n\n\n return false;\n}\n"
- },
- "id" : "database_DBTYPE",
- "xtype" : "Entry",
- "* pack" : "pack_start,false,false,0",
- "$ xns" : "Gtk"
- },
- {
- "label" : "Name",
- "xalign" : 0,
- "* pack" : "pack_start,false,false,0",
- "xtype" : "Label",
- "$ xns" : "Gtk"
- },
- {
- "listeners" : {
- "key_press_event" : "(ev) => {\n\n if (ev.keyval == Gdk.Key.Tab) {\n _this.database_DBUSERNAME.el.grab_focus();\n return true;\n }\n\n\n return false;\n}\n"
- },
- "id" : "database_DBNAME",
- "* pack" : "pack_start,false,false,0",
- "xtype" : "Entry",
- "$ xns" : "Gtk"
- },
- {
- "label" : "Username",
- "xalign" : 0,
- "* pack" : "pack_start,false,false,0",
- "xtype" : "Label",
- "$ xns" : "Gtk"
- },
- {
- "listeners" : {
- "key_press_event" : "(ev) => {\n\n if (ev.keyval == Gdk.Key.Tab) {\n _this.database_DBPASSWORD.el.grab_focus();\n return true;\n }\n\n\n return false;\n}\n"
- },
- "id" : "database_DBUSERNAME",
- "xtype" : "Entry",
- "* pack" : "pack_start,false,false,0",
- "$ xns" : "Gtk"
- },
- {
- "label" : "Password",
- "xalign" : 0,
- "* pack" : "pack_start,false,false,0",
- "xtype" : "Label",
- "$ xns" : "Gtk"
- },
- {
- "id" : "database_DBPASSWORD",
- "* pack" : "pack_start,false,false,0",
- "xtype" : "Entry",
- "$ xns" : "Gtk"
- },
- {
- "listeners" : {
- "clicked" : "() => {\n\n\n _this.database_ERROR.el.label = \"\";\n Gda.Connection cnc;\n try {\n // assumes localhost...\n cnc = Gda.Connection.open_from_string (\n\t\t\t_this.database_DBTYPE.el.get_text(),\n\t\t\t\"DB_NAME=\" + _this.database_DBNAME.el.get_text(), \n\t\t\t\"USERNAME=\" + _this.database_DBUSERNAME.el.get_text() + \n\t\t\t\";PASSWORD=\" + _this.database_DBPASSWORD.el.get_text(),\n\t\t\tGda.ConnectionOptions.NONE\n\t\t);\n //} catch (Gda.ConnectionError ce) { \n // _this.database_ERROR.el.label = ce.message; \n } catch(Gda.ConnectionError ue) {\n _this.database_ERROR.el.label = ue.message;\n return;\n } catch(Gda.ConfigError ue) {\n _this.database_ERROR.el.label = ue.message;\n return;\n }\n _this.database_ERROR.el.label = \"Connection Succeeded\";\n cnc.close();\n}"
- },
- "* pack" : "pack_start,false,false,0",
- "xtype" : "Button",
+ "int height_request" : 400,
+ "* pack" : "pack_start,true,true,0",
+ "xtype" : "ScrolledWindow",
"$ xns" : "Gtk",
- "utf8 label" : "Check Connection"
- },
- {
- "label" : " ",
- "id" : "database_ERROR",
- "xalign" : 0,
- "* pack" : "pack_start,false,false,0",
- "xtype" : "Label",
- "gint margin" : 3,
- "$ xns" : "Gtk"
+ "items" : [
+ {
+ "id" : "diff_view",
+ "* init" : " \n var description = Pango.FontDescription.from_string(\"monospace\");\n description.set_size(9000);\n this.el.override_font(description);",
+ "xtype" : "View",
+ "* pack" : "add",
+ "$ xns" : "GtkSource"
+ }
+ ]
}
]
}
"items" : [
{
"listeners" : {
- "button_press_event" : "() => {\n _this.save();\n \n _this.buttonPressed(\"apply\");\n return false;\n}"
+ "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" : "Apply",
+ "label" : "Stash Changes",
"xtype" : "Button",
"* pack" : "add",
"$ xns" : "Gtk"
},
{
"listeners" : {
- "button_press_event" : "() => {\n _this.save();\n \n _this.buttonPressed(\"save\");\n return false;\n}"
+ "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" : "Save",
+ "label" : "Commit Changes",
"xtype" : "Button",
"* pack" : "add",
"$ 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",
+ "* pack" : "add",
+ "xtype" : "Button",
+ "$ xns" : "Gtk"
+ },
+ {
+ "listeners" : {
+ "button_press_event" : "() => {\n _this.el.hide();\n return false;\n}"
+ },
+ "label" : "Ignore for now",
+ "* pack" : "add",
+ "xtype" : "Button",
+ "$ xns" : "Gtk"
}
]
}