Changeset e20be4a7bb7f7ce258435a7e11766c564c2abbc0
- Timestamp:
- 11/05/10 23:44:37 (3 years ago)
- Children:
- e172a31dcdd83fd6284b46e00609da847eb596bf
- Parents:
- fed76872db57be25180c04c6856972ef1e8ef8ff
- git-committer:
- Matias De la Puente <mfpuente.ar@…> (11/05/10 23:44:37)
- Files:
-
- 16 edited
-
libi4uc/i4ucaddprofiledialogpresenter.vala (modified) (2 diffs)
-
libi4uc/i4ucbuilder.vala (modified) (2 diffs)
-
libi4uc/i4ucbuilderdevicetype.vala (modified) (1 diff)
-
libi4uc/i4ucbuildersourcetype.vala (modified) (1 diff)
-
libi4uc/i4ucdocumentpagepresenter.vala (modified) (3 diffs)
-
libi4uc/i4ucdocumentpageview.vala (modified) (1 diff)
-
libi4uc/i4ucdocumentsview.vala (modified) (1 diff)
-
libi4uc/i4ucmainwindowview.vala (modified) (2 diffs)
-
libi4uc/i4ucprofilebuilder.vala (modified) (3 diffs)
-
libi4uc/i4ucprogrammer.vala (modified) (2 diffs)
-
libi4uc/i4ucproject.vala (modified) (1 diff)
-
libi4uc/i4ucprojectprofile.vala (modified) (1 diff)
-
libi4uc/i4ucprojectspresenter.vala (modified) (3 diffs)
-
libi4uc/i4ucprojectsview.vala (modified) (1 diff)
-
libi4uc/i4ucsettings.vala (modified) (3 diffs)
-
src/main.vala (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libi4uc/i4ucaddprofiledialogpresenter.vala
r4b2dcca re20be4a 61 61 { 62 62 var import_project = new Project (); 63 import_project.open (project_uri); 63 try 64 { 65 import_project.open (project_uri); 66 } 67 catch (GLib.Error e) 68 { 69 print (_("Error trying to open %s: %s\n").printf (project_uri, e.message)); 70 } 64 71 if (_project.folder_uri != import_project.folder_uri) 65 72 { … … 146 153 { 147 154 var import_project = new Project (); 148 if (!import_project.open (_view.project_uri)) 155 try 156 { 157 if (!import_project.open (_view.project_uri)) 158 { 159 _view.warning_message = _("Can't open the project"); 160 _view.warning_message_visible = true; 161 return; 162 } 163 } 164 catch (GLib.Error e) 149 165 { 150 166 _view.warning_message = _("Can't open the project"); -
libi4uc/i4ucbuilder.vala
r917df8d re20be4a 31 31 public Gee.Map<string, BuilderDeviceType> device_types { get { return _device_types; } } 32 32 33 public bool open (string uri) 33 public bool open (string uri) throws GLib.Error, GLib.KeyFileError 34 34 { 35 35 var builder_content = _builder_file.load_contents (uri); … … 48 48 } 49 49 50 public void save (string? uri = null) 50 public void save (string? uri = null) throws GLib.Error 51 51 { 52 52 var key_file = new KeyFile (); -
libi4uc/i4ucbuilderdevicetype.vala
r0b4fc3c re20be4a 33 33 public Gee.Map<string, BuilderSourceType> source_types { get { return _source_types; } } 34 34 35 public BuilderDeviceType.from_key_file (KeyFile key_file, string group) 35 public BuilderDeviceType.from_key_file (KeyFile key_file, string group) throws GLib.Error, GLib.KeyFileError 36 36 { 37 37 _device_type = key_file.get_string (group, "device_type"); -
libi4uc/i4ucbuildersourcetype.vala
r917df8d re20be4a 30 30 public Gee.List<string> clean_types { get { return _clean_types; } } 31 31 32 public BuilderSourceType.from_key_file (KeyFile key_file, string group) 32 public BuilderSourceType.from_key_file (KeyFile key_file, string group) throws GLib.Error, GLib.KeyFileError 33 33 { 34 34 _source_type = key_file.get_string (group, "source_type"); -
libi4uc/i4ucdocumentpagepresenter.vala
reed29f7 re20be4a 71 71 public void open (string uri) 72 72 { 73 _view.title = uri; 74 var contents = _document.load_contents (uri); 75 _view.tab_title = _document.display_name; 76 _view.tab_tooltip = "<b>%s</b> %s".printf (_("Name:"), _document.parse_name); 77 _view.content = contents; 78 _view.tab_mark = false; 79 _view.guess_language_id (_document.content_type); 73 try 74 { 75 _view.title = uri; 76 var contents = _document.load_contents (uri); 77 _view.tab_title = _document.display_name; 78 _view.tab_tooltip = "<b>%s</b> %s".printf (_("Name:"), _document.parse_name); 79 _view.content = contents; 80 _view.tab_mark = false; 81 _view.guess_language_id (_document.content_type); 82 } 83 catch (GLib.Error e) 84 { 85 _view.show_error_message (_("Error trying to open %s: %s").printf (_document.uri, e.message)); 86 } 80 87 } 81 88 … … 86 93 else if (_view.tab_mark) 87 94 { 88 _document.save_contents (_view.content); 89 _view.tab_mark = false; 95 try 96 { 97 _document.save_contents (_view.content); 98 _view.tab_mark = false; 99 } 100 catch (GLib.Error e) 101 { 102 _view.show_error_message (_("Error trying to save %s: %s").printf (_document.uri, e.message)); 103 } 90 104 } 91 105 } … … 111 125 catch (GLib.Error e) 112 126 { 113 _view.show_error_message ( e.message);127 _view.show_error_message (_("Error trying to save as %s:%s").printf (_document.uri, e.message)); 114 128 } 115 129 } -
libi4uc/i4ucdocumentpageview.vala
reed29f7 re20be4a 216 216 }); 217 217 218 operation.run (PrintOperationAction.PRINT_DIALOG, null); 218 try 219 { 220 operation.run (PrintOperationAction.PRINT_DIALOG, null); 221 } 222 catch (GLib.Error e) 223 { 224 show_error_message (e.message); 225 } 219 226 } 220 227 -
libi4uc/i4ucdocumentsview.vala
r4bb5472 re20be4a 129 129 130 130 _ui_manager.insert_action_group (_action_group, -1); 131 _ui_manager.add_ui_from_string (_UI, -1); 131 132 try 133 { 134 _ui_manager.add_ui_from_string (_UI, -1); 135 } 136 catch (GLib.Error e) 137 { 138 warning (e.message); 139 } 132 140 133 141 _save_action = _action_group.get_action ("SaveDocumentAction"); -
libi4uc/i4ucmainwindowview.vala
rb7c312b re20be4a 66 66 this.delete_event.connect (() => { return this.exit_clicked (); }); 67 67 68 this.icon = new Gdk.Pixbuf.from_file (Path.build_filename (Config.PIXMAPS_DIR, "icon.png"));69 70 68 _action_group = new ActionGroup ("I4ucMainWindowActions"); 71 69 _action_group.add_actions (_action_entries, this); … … 73 71 74 72 _ui_manager.insert_action_group (_action_group, 0); 75 _ui_manager.add_ui_from_string (_UI, -1); 73 74 try 75 { 76 _ui_manager.add_ui_from_string (_UI, -1); 77 this.icon = new Gdk.Pixbuf.from_file (Path.build_filename (Config.PIXMAPS_DIR, "icon.png")); 78 } 79 catch (GLib.Error e) 80 { 81 warning (e.message); 82 } 76 83 77 84 _show_side_panel_action = _action_group.get_action ("ShowSidePanelAction") as ToggleAction; -
libi4uc/i4ucprofilebuilder.vala
rc69cac3 re20be4a 47 47 } 48 48 49 public void build () 49 public void build () throws GLib.Error 50 50 { 51 51 if (_is_building) … … 103 103 } 104 104 105 public void clean () 105 public void clean () throws GLib.Error 106 106 { 107 107 if (_is_building) … … 168 168 } 169 169 170 private bool check_mtime (string newer_uri, string older_uri) 170 private bool check_mtime (string newer_uri, string older_uri) throws GLib.Error 171 171 { 172 172 var newer_file = File.new_for_uri (newer_uri); -
libi4uc/i4ucprogrammer.vala
r381478a re20be4a 52 52 public Gee.List<string> devices { get { return _devices; } } 53 53 54 public bool open (string uri) 54 public bool open (string uri) throws GLib.Error, GLib.KeyFileError 55 55 { 56 56 var programmer_content = _programmer_file.load_contents (uri); … … 97 97 } 98 98 99 public void save (string? uri = null) 99 public void save (string? uri = null) throws GLib.Error, GLib.FileError 100 100 { 101 101 var key_file = new KeyFile (); -
libi4uc/i4ucproject.vala
r7759ee2 re20be4a 37 37 public Gee.Map<string, ProjectProfile> profiles { get { return _profiles; } } 38 38 39 public bool open (string uri) 39 public bool open (string uri) throws GLib.Error, GLib.KeyFileError 40 40 { 41 41 var project_content = _project_file.load_contents (uri); -
libi4uc/i4ucprojectprofile.vala
rc94fa49 re20be4a 31 31 public Gee.List<string> files { get { return _files; } } 32 32 33 public ProjectProfile.from_key_file (KeyFile key_file, string group) 33 public ProjectProfile.from_key_file (KeyFile key_file, string group) throws GLib.KeyFileError 34 34 { 35 35 _name = key_file.get_string (group, "name"); -
libi4uc/i4ucprojectspresenter.vala
r8a71947 re20be4a 70 70 { 71 71 var project = new Project (); 72 if (project.open (project_uri)) 73 _side_page_presenter.add_project (project); 74 else 75 _view.show_error_message (_("Error trying to open <<%s>>").printf (project_uri)); 72 try 73 { 74 if (project.open (project_uri)) 75 _side_page_presenter.add_project (project); 76 else 77 _view.show_error_message (_("Error trying to open <<%s>>").printf (project_uri)); 78 } 79 catch (GLib.Error e) 80 { 81 _view.show_error_message (_("Error trying to open <<%s>>: %s").printf (project_uri, e.message)); 82 } 76 83 } 77 84 … … 201 208 _profile_builder.profile = current_profile.name; 202 209 _view.show_build_log_page (); 203 _profile_builder.build (); 210 211 try 212 { 213 _profile_builder.build (); 214 } 215 catch (GLib.Error e) 216 { 217 _view.show_error_message (_("Error trying to build profile %s: %s").printf (current_profile.name, e.message)); 218 } 204 219 } 205 220 … … 219 234 _profile_builder.project = current_project; 220 235 _profile_builder.profile = current_profile.name; 221 _profile_builder.clean (); 236 237 try 238 { 239 _profile_builder.clean (); 240 } 241 catch (GLib.Error e) 242 { 243 _view.show_error_message (_("Error trying to clean profile %s: %s").printf (current_profile.name, e.message)); 244 } 222 245 } 223 246 -
libi4uc/i4ucprojectsview.vala
r4bb5472 re20be4a 108 108 109 109 _ui_manager.insert_action_group (_action_group, -1); 110 _ui_manager.add_ui_from_string (_UI, -1); 110 111 try 112 { 113 _ui_manager.add_ui_from_string (_UI, -1); 114 } 115 catch (GLib.Error e) 116 { 117 warning (e.message); 118 } 111 119 112 120 _add_file_action = _action_group.get_action ("AddFileProjectAction"); -
libi4uc/i4ucsettings.vala
rf6e03d7 re20be4a 79 79 public Settings () 80 80 { 81 _working_folder = File name.to_uri (Environment.get_home_dir ());81 _working_folder = File.new_for_path (Environment.get_home_dir ()).get_uri (); 82 82 } 83 83 84 public void open (string filename) 84 public void open (string filename) throws GLib.Error, GLib.KeyFileError 85 85 { 86 86 _filename = filename; … … 120 120 } 121 121 122 public void save () 122 public void save () throws GLib.FileError 123 123 { 124 124 var key_file = new KeyFile (); … … 153 153 } 154 154 155 private void load_entries (KeyFile key_file, string group, string key, Gee.Map<string, string> map) 155 private void load_entries (KeyFile key_file, string group, string key, Gee.Map<string, string> map) throws GLib.KeyFileError 156 156 { 157 157 foreach (var entry in key_file.get_string_list (group, key)) -
src/main.vala
rf6e03d7 re20be4a 25 25 Gtk.init (ref args); 26 26 27 load_settings (); 28 load_builders (); 29 load_programmers (); 27 try 28 { 29 load_settings (); 30 load_builders (); 31 load_programmers (); 32 } 33 catch (GLib.Error e) 34 { 35 warning (e.message); 36 } 30 37 31 38 var main_window_view = new MainWindowView (); … … 49 56 50 57 Gtk.main (); 51 I4uc.Settings.instance.save (); 58 59 try 60 { 61 I4uc.Settings.instance.save (); 62 } 63 catch (GLib.FileError e) 64 { 65 warning (e.message); 66 } 52 67 } 53 68 54 void load_settings () 69 void load_settings () throws GLib.KeyFileError 55 70 { 56 71 var settings_folder = Path.build_filename (Environment.get_home_dir (), ".i4uc"); … … 61 76 } 62 77 63 void load_builders () 78 void load_builders () throws GLib.Error, GLib.KeyFileError 64 79 { 65 80 //Load builders in $(pkgdatadir)/builders/ … … 98 113 } 99 114 100 void load_programmers () 115 void load_programmers () throws GLib.Error, GLib.KeyFileError 101 116 { 102 117 //Load programmers in $(pkgdatadir)/programmers/
Note: See TracChangeset
for help on using the changeset viewer.

