return new AppSettings();
}
string data;
- FileUtils.get_contents(setting_file, out data);
- return Json.gobject_from_data (typeof (AppSettings), data) as AppSettings;
+ try {
+ FileUtils.get_contents(setting_file, out data);
+ return Json.gobject_from_data (typeof (AppSettings), data) as AppSettings;
+ } catch (Error e) {
+ }
+ return new AppSettings();
}
public void save()
{
var dirname = GLib.Environment.get_home_dir() + "/.Builder";
var setting_file = dirname + "/builder.settings";
string data = Json.gobject_to_data (this, null);
- print("saving application settings\n");
- FileUtils.set_contents(setting_file, data);
+ GLib.debug("saving application settings\n");
+ try {
+ FileUtils.set_contents(setting_file, data);
+ } catch (Error e) {
+ print("Error saving app settings");
+ }
}
public BuilderApplication ( string[] args)
{
-
- _self = FileUtils.read_link("/proc/self/exe");
+ try {
+ _self = FileUtils.read_link("/proc/self/exe");
+ } catch (Error e) {
+ // this should nto happen!!?
+ GLib.error("could not read /proc/self/exe");
+ }
GLib.debug("SELF = %s", _self);
Object(
if (!FileUtils.test(dirname,FileTest.IS_DIR)) {
var dir = File.new_for_path(dirname);
- dir.make_directory();
+ try {
+ dir.make_directory();
+ } catch (Error e) {
+ GLib.error("Failed to make directory %s", dirname);
+ }
}
if (!FileUtils.test(dirname + "/resources",FileTest.IS_DIR)) {
var dir = File.new_for_path(dirname + "/resources");
- dir.make_directory();
+ try {
+ dir.make_directory();
+ } catch (Error e) {
+ GLib.error("Failed to make directory %s", dirname + "/resources");
+ }
}
GLib.error("missing project, use --project to select which project");
}
print("Checking files\n");
- var ar = cur_project.sortedFiles();
- foreach(var file in ar) {
- string oldstr;
+ try {
+ var ar = cur_project.sortedFiles();
+ foreach(var file in ar) {
+ string oldstr;
- file.loadItems();
- GLib.FileUtils.get_contents(file.path, out oldstr);
- var outstr = file.toJsonString();
- if (outstr != oldstr) {
+ file.loadItems();
+ GLib.FileUtils.get_contents(file.path, out oldstr);
+ var outstr = file.toJsonString();
+ if (outstr != oldstr) {
+
+ GLib.FileUtils.set_contents("/tmp/" + file.name , outstr);
+ print("meld %s /tmp/%s\n", file.path, file.name);
+ //GLib.Process.exit(Posix.EXIT_SUCCESS);
+ }
+ print("# Files match %s\n", file.name);
- GLib.FileUtils.set_contents("/tmp/" + file.name , outstr);
- print("meld %s /tmp/%s\n", file.path, file.name);
- //GLib.Process.exit(Posix.EXIT_SUCCESS);
}
- print("# Files match %s\n", file.name);
-
+ } catch (FileError e) {
+ GLib.debug("Got error %s", e.message);
+ } catch (Error e) {
+ GLib.debug("Got error %s", e.message);
}
-
+
print("All files pass");
GLib.Process.exit(Posix.EXIT_SUCCESS);
}
}
if (BuilderApplication.opt_bjs_compile == "all") {
- var ar = cur_project.sortedFiles();
- foreach(var file in ar) {
- string oldstr;
-
- file.loadItems();
- var oldfn = file.targetName();
- GLib.FileUtils.get_contents(oldfn, out oldstr);
-
- var outstr = file.toSourceCode();
- if (outstr != oldstr) {
-
- GLib.FileUtils.set_contents("/tmp/" + file.name + ".out", outstr);
- print("meld %s /tmp/%s\n", oldfn, file.name + ".out");
- //GLib.Process.exit(Posix.EXIT_SUCCESS);
- }
- print("# Files match %s\n", file.name);
+ try {
+ var ar = cur_project.sortedFiles();
+ foreach(var file in ar) {
+ string oldstr;
+
+ file.loadItems();
+ var oldfn = file.targetName();
+ GLib.FileUtils.get_contents(oldfn, out oldstr);
+
+ var outstr = file.toSourceCode();
+ if (outstr != oldstr) {
+
+ GLib.FileUtils.set_contents("/tmp/" + file.name + ".out", outstr);
+ print("meld %s /tmp/%s\n", oldfn, file.name + ".out");
+ //GLib.Process.exit(Posix.EXIT_SUCCESS);
+ }
+ print("# Files match %s\n", file.name);
+ }
+ } catch (FileError e) {
+ GLib.debug("Got error %s", e.message);
+ } catch (Error e) {
+ GLib.debug("got error %s", e.message);
}
+
GLib.Process.exit(Posix.EXIT_SUCCESS);
}
GLib.error("missing file %s in project %s", BuilderApplication.opt_bjs_compile, cur_project.name);
}
- file.loadItems();
-
+ try {
+ file.loadItems();
+ } catch(Error e) {
+ GLib.debug("Load items failed");
+ }
+
if (BuilderApplication.opt_bjs_compile_glade) {
var str = file.toGlade();
print("%s", str);
break;
case "flutter-project":
Project.Project.loadAll();
- var p = Project.Project.factory("Flutter", "/tmp/test-flutter");
+ //var p = Project.Project.factory("Flutter", "/tmp/test-flutter");
/*var pa = p.palete as Palete.Flutter;
pa.dumpusage();
var ar = pa.getChildList("material.Scaffold");
" ",
" var fn = _this.dir.el.get_filename();",
" print(\"add %s\\n\" , fn);",
- " ",
- " var project = Project.Project.factory(_this.xtype.getValue(), fn);",
- " project.save();",
- " Project.projects.set(project.name,project);",
- " ",
+ " try {",
+ "\t\tvar project = Project.Project.factory(_this.xtype.getValue(), fn);",
+ "\t\tproject.save();",
+ "\t\tProject.projects.set(project.name,project);",
+ "\t\treturn project;",
+ "\t} catch (Error e) {",
+ "\t\tGLib.debug(\"got error? %s\" , e.message);",
+ "\t}",
" //var pr = imports.Builder.Provider.ProjectManager.ProjectManager.update(this.project);",
+ " return null;",
" ",
- " return project;",
"",
" ",
" //this.success = c.success;",
this.el.modal = true;
var child_0 = new Xcls_Box2( _this );
child_0.ref();
- this.el.get_content_area().add ( child_0.el );
+ this.el.get_content_area().add( child_0.el );
var child_1 = new Xcls_Button9( _this );
child_1.ref();
this.el.add_action_widget ( child_1.el , 1 );
var fn = _this.dir.el.get_filename();
print("add %s\n" , fn);
-
- var project = Project.Project.factory(_this.xtype.getValue(), fn);
- project.save();
- Project.projects.set(project.name,project);
-
+ try {
+ var project = Project.Project.factory(_this.xtype.getValue(), fn);
+ project.save();
+ Project.projects.set(project.name,project);
+ return project;
+ } catch (Error e) {
+ GLib.debug("got error? %s" , e.message);
+ }
//var pr = imports.Builder.Provider.ProjectManager.ProjectManager.update(this.project);
+ return null;
- return project;
//this.success = c.success;
{
_this = _owner;
_this.model = this;
- this.el = new Gtk.ListStore( 2, typeof(string),typeof(string) );
+ this.el = new Gtk.ListStore.newv( { typeof(string),typeof(string) } );
// my vars (dec)
" ",
" ",
" \tif (event.keyval == Gdk.Key.Return && this.el.text.length > 0) {",
- "\t\tvar res = _this.search(this.el.text);",
+ "\t\t//var res =",
+ "\t\t _this.search(this.el.text);",
"\t\t _this.search_results.updateResults();",
"",
"\t\tGLib.Timeout.add_seconds(2,() => {",
if (event.keyval == Gdk.Key.Return && this.el.text.length > 0) {
- var res = _this.search(this.el.text);
+ //var res =
+ _this.search(this.el.text);
_this.search_results.updateResults();
GLib.Timeout.add_seconds(2,() => {
" ",
" ",
" \tif (event.keyval == Gdk.Key.Return && this.el.text.length > 0) {",
- "\t\tvar res = _this.search(this.el.text);",
+ "\t\t_this.search(this.el.text);",
"\t\t _this.search_results.updateResults();",
"",
"\t\tGLib.Timeout.add_seconds(2,() => {",
" var win = this.el.get_parent_window();",
" var width = win.get_width();",
" var height = win.get_height();",
- " try {",
+ " //try {",
" Gdk.Pixbuf screenshot = Gdk.pixbuf_get_from_window(win, 0, 0, width, height); // this.el.position?",
" this.file.writeIcon(screenshot);",
- " } catch (Error e) {",
+ " //} catch (Error e) {",
" ",
- " }",
+ " //}",
"",
" ",
" return;",
"\t\treturn;",
"\t}",
"\tthis.notebook.el.page = 1;",
- "\tGtk.TextIter beg, st,en, stl;",
+ "\tGtk.TextIter beg, st,en;",
"\t",
"\tvar buf = this.sourceview.el.get_buffer();",
"\tbuf.get_iter_at_offset(out beg, this.last_search_end);",
return;
}
this.notebook.el.page = 1;
- Gtk.TextIter beg, st,en, stl;
+ Gtk.TextIter beg, st,en;
var buf = this.sourceview.el.get_buffer();
buf.get_iter_at_offset(out beg, this.last_search_end);
var win = this.el.get_parent_window();
var width = win.get_width();
var height = win.get_height();
- try {
+ //try {
Gdk.Pixbuf screenshot = Gdk.pixbuf_get_from_window(win, 0, 0, width, height); // this.el.position?
this.file.writeIcon(screenshot);
- } catch (Error e) {
+ //} catch (Error e) {
- }
+ //}
return;
if (event.keyval == Gdk.Key.Return && this.el.text.length > 0) {
- var res = _this.search(this.el.text);
+ _this.search(this.el.text);
_this.search_results.updateResults();
GLib.Timeout.add_seconds(2,() => {
"xtype" : "ScrolledWindow"
}
],
- "listeners" : {
- "hide" : [
- "( ) => {",
- "",
- "}",
- ""
- ]
- },
"xtype" : "Popover",
"| void clear" : [
"() {",
"",
" ",
" ",
- " ",
"",
" var tr = pal.getChildList(cls);",
" this.model.el.clear();",
"",
" Gtk.TreeIter citer;",
" var ic = Gtk.IconTheme.get_default();",
- "\tvar pixdef = ic.load_icon(\"emblem-new\", 16,0);",
+ " Gdk.Pixbuf pixdef = null;",
+ " try {",
+ "\t\tpixdef = ic.load_icon(\"emblem-new\", 16,0);",
+ "\t} catch (Error e) {",
+ "\t}",
"",
" for(var i =0 ; i < tr.length; i++) {",
" this.model.el.append(out citer); ",
" ",
" ",
" ",
- " ",
- " ",
" // set size up...",
" ",
" this.model.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);",
var child_0 = new Xcls_ScrolledWindow2( _this );
child_0.ref();
this.el.add ( child_0.el );
-
- //listeners
- this.el.hide.connect( ( ) => {
-
- });
}
// user defined functions
-
var tr = pal.getChildList(cls);
this.model.el.clear();
Gtk.TreeIter citer;
var ic = Gtk.IconTheme.get_default();
- var pixdef = ic.load_icon("emblem-new", 16,0);
+ Gdk.Pixbuf pixdef = null;
+ try {
+ pixdef = ic.load_icon("emblem-new", 16,0);
+ } catch (Error e) {
+ }
for(var i =0 ; i < tr.length; i++) {
this.model.el.append(out citer);
-
-
// set size up...
this.model.el.set_sort_column_id(0,Gtk.SortType.ASCENDING);
var named = child.has("stack_name") ? child.get_prop("stack_name").val.escape() : "";
var title = child.has("stack_title") ? child.get_prop("stack_title").val.escape() : "";
if (title.length > 0) {
- this.addLine(this.ipad + "this.el.add_titled( child_%d.el, \"%\", \"%s\" );".printf(i,named,title));
+ this.addLine(this.ipad + "this.el.add_titled( child_%d.el, \"%s\", \"%s\" );".printf(i,named,title));
} else {
this.addLine(this.ipad + "this.el.add_named( child_%d.el, \"%s\" );".printf(i,named));
}
# - not sure if needed....
-AM_CPPFLAGS = $(ROOBUILDER_CFLAGS) $(WEBKIT_CFLAGS) $(GDA_CFLAGS) $(LIBVALA_CFLAGS) $(JAVASCRIPTCOREGTK_CFLAGS) $(VTE_CFLAGS)
-
+AM_CPPFLAGS = $(ROOBUILDER_CFLAGS) $(WEBKIT_CFLAGS) $(GDA_CFLAGS) $(LIBVALA_CFLAGS) $(JAVASCRIPTCOREGTK_CFLAGS) $(VTE_CFLAGS) \
+ -Wno-incompatible-pointer-types \
+ -Wno-discarded-qualifiers \
+ -Wno-deprecated-declarations \
+ -Wno-pointer-to-int-cast
bin_PROGRAMS = roobuilder