[Monodevelop-patches-list] r2164 - in trunk/MonoDevelop/Core/src/MonoDevelop.Base: . Internal/ProgressMonitoring Internal/Project Internal/Project/Project Services/ParserService Services/Project Services/Tasks
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Tue Jan 25 21:08:22 EST 2005
Author: lluis
Date: 2005-01-25 21:08:22 -0500 (Tue, 25 Jan 2005)
New Revision: 2164
Modified:
trunk/MonoDevelop/Core/src/MonoDevelop.Base/ChangeLog
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/BaseProgressMonitor.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/CmbxFileFormat.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/PrjxFileFormat.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Project/UnknownProjectVersionException.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ParserService/CodeCompletionDatabase.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ParserService/DefaultParserService.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Project/DefaultProjectService.cs
trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Tasks/StatusProgressMonitor.cs
Log:
2005-01-26 Lluis Sanchez Gual <lluis at novell.com>
* Services/Tasks/StatusProgressMonitor.cs: Forgot to save the
showErrorDialogs parameter.
* Services/Project/DefaultProjectService.cs: Catch and report combine
load errors.
* Internal/Project/CmbxFileFormat.cs:
* Internal/Project/PrjxFileFormat.cs: Version '1' is the same as '1.0.
* Internal/Project/Project/UnknownProjectVersionException.cs: Improved
error message.
* Internal/ProgressMonitoring/BaseProgressMonitor.cs: \n is not nice
in the status bar.
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/ChangeLog
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/ChangeLog 2005-01-25 21:19:41 UTC (rev 2163)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/ChangeLog 2005-01-26 02:08:22 UTC (rev 2164)
@@ -1,3 +1,16 @@
+2005-01-26 Lluis Sanchez Gual <lluis at novell.com>
+
+ * Services/Tasks/StatusProgressMonitor.cs: Forgot to save the
+ showErrorDialogs parameter.
+ * Services/Project/DefaultProjectService.cs: Catch and report combine
+ load errors.
+ * Internal/Project/CmbxFileFormat.cs:
+ * Internal/Project/PrjxFileFormat.cs: Version '1' is the same as '1.0.
+ * Internal/Project/Project/UnknownProjectVersionException.cs: Improved
+ error message.
+ * Internal/ProgressMonitoring/BaseProgressMonitor.cs: \n is not nice
+ in the status bar.
+
2005-01-25 Todd Berman <tberman at off.net>
* Gui/Workbench/Layouts/SdiWorkspaceWindow.cs: Add ShowNotification
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/BaseProgressMonitor.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/BaseProgressMonitor.cs 2005-01-25 21:19:41 UTC (rev 2163)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/ProgressMonitoring/BaseProgressMonitor.cs 2005-01-26 02:08:22 UTC (rev 2164)
@@ -102,7 +102,7 @@
if (message == null && ex != null)
message = ex.Message;
else if (message != null && ex != null)
- message += "\n" + ex.Message;
+ message += ". " + ex.Message;
errorsMessages.Add (message);
}
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/CmbxFileFormat.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/CmbxFileFormat.cs 2005-01-25 21:19:41 UTC (rev 2163)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/CmbxFileFormat.cs 2005-01-26 02:08:22 UTC (rev 2164)
@@ -89,8 +89,10 @@
DataSerializer serializer = new DataSerializer (Runtime.ProjectService.DataContext, file);
ICombineReader combineReader = null;
- if (version == "1.0")
+ if (version == "1.0" || version == "1") {
combineReader = new CombineReaderV1 (serializer, monitor);
+ monitor.ReportWarning (string.Format (GettextCatalog.GetString ("The file '{0}' is using an old combine file format. It will be automatically converted to the current format."), file));
+ }
else if (version == "2.0")
combineReader = new CombineReaderV2 (serializer, monitor);
@@ -98,7 +100,7 @@
if (combineReader != null)
return combineReader.ReadCombine (reader);
else
- throw new UnknownProjectVersionException (version);
+ throw new UnknownProjectVersionException (file, version);
} finally {
reader.Close ();
}
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/PrjxFileFormat.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/PrjxFileFormat.cs 2005-01-25 21:19:41 UTC (rev 2163)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/PrjxFileFormat.cs 2005-01-26 02:08:22 UTC (rev 2164)
@@ -86,7 +86,7 @@
DataSerializer serializer = new DataSerializer (Runtime.ProjectService.DataContext, fileName);
IProjectReader projectReader = null;
- if (version == "1.0") {
+ if (version == "1.0" || version == "1") {
string tempFile = Path.GetTempFileName();
ConvertXml.Convert(fileName,
@@ -101,22 +101,23 @@
File.Delete (tempFile);
reader = new XmlTextReader (new StringReader (fdata));
projectReader = new ProjectReaderV1 (serializer);
- monitor.ReportWarning (string.Format (GettextCatalog.GetString ("The format of the project '{0}' is an old file format. It will be automatically converted to the current format."), fileName));
}
else if (version == "1.1") {
- monitor.ReportWarning (string.Format (GettextCatalog.GetString ("The format of the project '{0}' is an old file format. It will be automatically converted to the current format."), fileName));
projectReader = new ProjectReaderV1 (serializer);
}
else if (version == "2.0") {
projectReader = new ProjectReaderV2 (serializer);
}
+ if (version != "2.0")
+ monitor.ReportWarning (string.Format (GettextCatalog.GetString ("The file '{0}' is using an old project file format. It will be automatically converted to the current format."), fileName));
+
try {
monitor.BeginTask (string.Format (GettextCatalog.GetString ("Loading project: {0}"), fileName), 1);
if (projectReader != null)
return projectReader.ReadProject (reader);
else
- throw new UnknownProjectVersionException (version);
+ throw new UnknownProjectVersionException (fileName, version);
} catch (Exception ex) {
monitor.ReportError (string.Format (GettextCatalog.GetString ("Could not load project: {0}"), fileName), ex);
throw;
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Project/UnknownProjectVersionException.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Project/UnknownProjectVersionException.cs 2005-01-25 21:19:41 UTC (rev 2163)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Internal/Project/Project/UnknownProjectVersionException.cs 2005-01-26 02:08:22 UTC (rev 2164)
@@ -6,12 +6,14 @@
// </file>
using System;
+using MonoDevelop.Services;
namespace MonoDevelop.Internal.Project
{
public class UnknownProjectVersionException : Exception
{
- public UnknownProjectVersionException(string version) : base(version)
+ public UnknownProjectVersionException (string file, string version)
+ : base (string.Format (GettextCatalog.GetString ("The file '{0}' has an unknown format version (version '{1}')'."), file, version))
{
}
}
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ParserService/CodeCompletionDatabase.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ParserService/CodeCompletionDatabase.cs 2005-01-25 21:19:41 UTC (rev 2163)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ParserService/CodeCompletionDatabase.cs 2005-01-26 02:08:22 UTC (rev 2164)
@@ -24,7 +24,7 @@
namespace MonoDevelop.Services
{
- internal class CodeCompletionDatabase
+ internal class CodeCompletionDatabase: IDisposable
{
static readonly int MAX_ACTIVE_COUNT = 100;
static readonly int MIN_ACTIVE_COUNT = 50;
@@ -55,6 +55,10 @@
headers = new Hashtable ();
}
+ public virtual void Dispose ()
+ {
+ }
+
public string DataFile
{
get { return dataFile; }
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ParserService/DefaultParserService.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ParserService/DefaultParserService.cs 2005-01-25 21:19:41 UTC (rev 2163)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/ParserService/DefaultParserService.cs 2005-01-26 02:08:22 UTC (rev 2164)
@@ -381,6 +381,7 @@
if (db != null) {
db.Write ();
databases.Remove (uri);
+ db.Dispose ();
}
}
}
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Project/DefaultProjectService.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Project/DefaultProjectService.cs 2005-01-25 21:19:41 UTC (rev 2163)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Project/DefaultProjectService.cs 2005-01-26 02:08:22 UTC (rev 2164)
@@ -232,7 +232,8 @@
filename = validcombine;
}
- using (IProgressMonitor monitor = Runtime.TaskService.GetLoadProgressMonitor ()) {
+ IProgressMonitor monitor = Runtime.TaskService.GetLoadProgressMonitor ();
+ try {
CombineEntry entry = ReadFile (filename, monitor);
if (!(entry is Combine)) {
Combine loadingCombine = new Combine();
@@ -256,6 +257,10 @@
monitor.ReportSuccess (GettextCatalog.GetString ("Combine loaded."));
OnCombineOpened(new CombineEventArgs(openCombine));
+ } catch (Exception ex) {
+ monitor.ReportError ("Load operation failed.", ex);
+ } finally {
+ monitor.Dispose ();
}
}
Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Tasks/StatusProgressMonitor.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Tasks/StatusProgressMonitor.cs 2005-01-25 21:19:41 UTC (rev 2163)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/Tasks/StatusProgressMonitor.cs 2005-01-26 02:08:22 UTC (rev 2164)
@@ -42,6 +42,7 @@
public StatusProgressMonitor (string title, string iconName, bool showErrorDialogs)
{
this.title = title;
+ this.showErrorDialogs = showErrorDialogs;
icon = Runtime.Gui.Resources.GetImage (iconName, Gtk.IconSize.Menu);
Runtime.Gui.StatusBar.BeginProgress (title);
Runtime.Gui.StatusBar.SetMessage (icon, title);
More information about the Monodevelop-patches-list
mailing list