diff options
author | Michael Hutchinson <mhutchinson@novell.com> | 2007-11-20 22:27:20 +0300 |
---|---|---|
committer | Michael Hutchinson <mhutchinson@novell.com> | 2007-11-20 22:27:20 +0300 |
commit | 3952ab7653c05737c78ce723d56a6d2e5b6bacff (patch) | |
tree | 578a9663046aafde477018ca65ed8297a2838aba /Core/src | |
parent | 7997ef03f43ff07aa02475350d390c78a527efda (diff) |
* MonoDevelop.Core.Gui.Components/FileBrowser.cs: Log errors as well as
reporting them to the user.
* Freedesktop.RecentFiles/RecentItem.cs: Use UTC for Unix timestamps.
svn path=/trunk/monodevelop/; revision=90014
Diffstat (limited to 'Core/src')
3 files changed, 24 insertions, 10 deletions
diff --git a/Core/src/MonoDevelop.Core.Gui/ChangeLog b/Core/src/MonoDevelop.Core.Gui/ChangeLog index 70e5ed6552..5b46bd1957 100644 --- a/Core/src/MonoDevelop.Core.Gui/ChangeLog +++ b/Core/src/MonoDevelop.Core.Gui/ChangeLog @@ -1,3 +1,9 @@ +2007-11-20 Michael Hutchinson <mhutchinson@novell.com> + + * MonoDevelop.Core.Gui.Components/FileBrowser.cs: Log errors as well as + reporting them to the user. + * Freedesktop.RecentFiles/RecentItem.cs: Use UTC for Unix timestamps. + 2007-11-17 Lluis Sanchez Gual <lluis@novell.com> * MonoDevelop.Core.Gui.mdp, MonoDevelop.Core.Gui/StockIcons.cs, Makefile.am, diff --git a/Core/src/MonoDevelop.Core.Gui/Freedesktop.RecentFiles/RecentItem.cs b/Core/src/MonoDevelop.Core.Gui/Freedesktop.RecentFiles/RecentItem.cs index 9558824b4f..a5406329fe 100644 --- a/Core/src/MonoDevelop.Core.Gui/Freedesktop.RecentFiles/RecentItem.cs +++ b/Core/src/MonoDevelop.Core.Gui/Freedesktop.RecentFiles/RecentItem.cs @@ -147,7 +147,7 @@ namespace Freedesktop.RecentFiles public void NewTimeStamp () { - this.timestamp = DateTime.Now; + this.timestamp = DateTime.UtcNow; } public bool IsInGroup (string group) @@ -169,7 +169,7 @@ namespace Freedesktop.RecentFiles } #region Unix Time functions - static readonly DateTime UnixStartTime = new DateTime (1970, 1, 1, 0, 0, 0, 0); + static readonly DateTime UnixStartTime = new DateTime (1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc); static int ToUnixTime (DateTime time) { return (int)(time - UnixStartTime).TotalSeconds; diff --git a/Core/src/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui.Components/FileBrowser.cs b/Core/src/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui.Components/FileBrowser.cs index 6ccc2a27d5..e9f636177d 100644 --- a/Core/src/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui.Components/FileBrowser.cs +++ b/Core/src/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui.Components/FileBrowser.cs @@ -202,7 +202,9 @@ namespace MonoDevelop.Core.Gui.Components store.Clear (); store.AppendValues (null, GettextCatalog.GetString ("Access denied")); } catch (Exception ex) { - Services.MessageService.ShowError (ex, GettextCatalog.GetString ("Could not access to directory: ") + CurrentDir); + string message = GettextCatalog.GetString ("Could not access to directory: ") + CurrentDir; + LoggingService.LogError (message, ex); + Services.MessageService.ShowError (ex, message); } } @@ -305,16 +307,16 @@ namespace MonoDevelop.Core.Gui.Components private void OnEntryActivated (object sender, EventArgs args) { - Exception error = null; try { if (Directory.Exists (entry.Text.Trim ())) { CurrentDir = entry.Text.Trim (); return; } } catch (Exception ex) { - error = ex; + string message = GettextCatalog.GetString ("Cannot enter '{0}' folder", entry.Text); + LoggingService.LogError (message, ex); + Services.MessageService.ShowError (message); } - Services.MessageService.ShowError (error, GettextCatalog.GetString ("Cannot enter '{0}' folder", entry.Text)); } private void OnDirRename (object o, EventArgs args) @@ -349,7 +351,9 @@ namespace MonoDevelop.Core.Gui.Components } catch (Exception ex) { - Services.MessageService.ShowError (ex, GettextCatalog.GetString ("Could not rename folder '{0}' to '{1}'", oldpath, args.NewText)); + string message = GettextCatalog.GetString ("Could not rename folder '{0}' to '{1}'", oldpath, args.NewText); + LoggingService.LogError (message, ex); + Services.MessageService.ShowError (ex, message); } finally { @@ -367,7 +371,9 @@ namespace MonoDevelop.Core.Gui.Components } catch (Exception ex) { - Services.MessageService.ShowError (ex, GettextCatalog.GetString ("Could not create new folder '{0}'", args.NewText)); + string message = GettextCatalog.GetString ("Could not create new folder '{0}'", args.NewText); + LoggingService.LogError (message, ex); + Services.MessageService.ShowError (ex, message); } finally { @@ -377,7 +383,7 @@ namespace MonoDevelop.Core.Gui.Components break; default: - Console.WriteLine ("This should not be happening"); + LoggingService.LogError ("FileBrowser: Reached unknown case in OnDirEdited"); break; } @@ -399,7 +405,9 @@ namespace MonoDevelop.Core.Gui.Components } catch (Exception ex) { - Services.MessageService.ShowError (ex, GettextCatalog.GetString ("Could not delete folder '{0}'", System.IO.Path.Combine (CurrentDir, (string) store.GetValue (iter, 1)))); + string message = GettextCatalog.GetString ("Could not delete folder '{0}'", System.IO.Path.Combine (CurrentDir, (string) store.GetValue (iter, 1))); + LoggingService.LogError (message, ex); + Services.MessageService.ShowError (ex, message); } finally { |