[Monodevelop-patches-list] r2790 - in trunk/MonoDevelop/Core/src/MonoDevelop.Base: . Gui/Dialogs Services

Todd Berman <tberman@sevenl.net> tberman at mono-cvs.ximian.com
Mon Sep 5 16:39:55 EDT 2005


Author: tberman
Date: 2005-09-05 16:39:54 -0400 (Mon, 05 Sep 2005)
New Revision: 2790

Modified:
   trunk/MonoDevelop/Core/src/MonoDevelop.Base/ChangeLog
   trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Dialogs/NewProjectDialog.cs
   trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/MessageService.cs
Log:
2005-09-05  Todd Berman  <tberman at off.net>

	* Services/MessageService.cs: Add a new overload that allows a parent
	Window to be passed in.
	* Gui/Dialogs/NewProjectDialog.cs: Fix bug #75981



Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/ChangeLog
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/ChangeLog	2005-09-04 16:12:40 UTC (rev 2789)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/ChangeLog	2005-09-05 20:39:54 UTC (rev 2790)
@@ -1,3 +1,9 @@
+2005-09-05  Todd Berman  <tberman at off.net>
+
+	* Services/MessageService.cs: Add a new overload that allows a parent
+	Window to be passed in.
+	* Gui/Dialogs/NewProjectDialog.cs: Fix bug #75981
+
 2005-08-23  Lluis Sanchez Gual  <lluis at novell.com>
 
 	* Gui/Dialogs/CommonAboutDialog.c: Load the image for the About dialog

Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Dialogs/NewProjectDialog.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Dialogs/NewProjectDialog.cs	2005-09-04 16:12:40 UTC (rev 2789)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Gui/Dialogs/NewProjectDialog.cs	2005-09-05 20:39:54 UTC (rev 2790)
@@ -190,6 +190,10 @@
 		
 		void OpenEvent(object sender, EventArgs e)
 		{
+			if (!btn_new.Sensitive) {
+				return;
+			}
+			
 			if (TemplateView.CurrentlySelected != null) {
 				Runtime.Properties.SetProperty("Dialogs.NewProjectDialog.LastSelectedCategory", ((ProjectTemplate)TemplateView.CurrentlySelected).Name);
 				//Runtime.Properties.SetProperty("Dialogs.NewProjectDialog.LargeImages", ((RadioButton)ControlDictionary["largeIconsRadioButton"]).Checked);
@@ -203,9 +207,7 @@
 			
 			//The one below seemed to be failing sometimes.
 			if(solution.IndexOfAny("$#@!%^&*/?\\|'\";:}{".ToCharArray()) > -1) {
-				Runtime.MessageService.ShowError(GettextCatalog.GetString ("Illegal project name. \nOnly use letters, digits, space, '.' or '_'."));
-				dialog.Respond(Gtk.ResponseType.Reject);
-				dialog.Hide();
+				Runtime.MessageService.ShowError(dialog, GettextCatalog.GetString ("Illegal project name. \nOnly use letters, digits, space, '.' or '_'."));
 				return;
 			}
 
@@ -213,14 +215,12 @@
 				&& (!fileUtilityService.IsValidFileName (solution) || solution.IndexOf(System.IO.Path.DirectorySeparatorChar) >= 0)) ||
 			    !fileUtilityService.IsValidFileName(name)     || name.IndexOf(System.IO.Path.DirectorySeparatorChar) >= 0 ||
 			    !fileUtilityService.IsValidFileName(location)) {
-				Runtime.MessageService.ShowError(GettextCatalog.GetString ("Illegal project name.\nOnly use letters, digits, space, '.' or '_'."));
+				Runtime.MessageService.ShowError(dialog, GettextCatalog.GetString ("Illegal project name.\nOnly use letters, digits, space, '.' or '_'."));
 				return;
 			}
 
 			if (Runtime.ProjectService.GetProject (name) != null) {
-				Runtime.MessageService.ShowError(GettextCatalog.GetString ("A Project with that name is already in your Project Space"));
-				dialog.Respond(Gtk.ResponseType.Reject);
-				dialog.Hide();
+				Runtime.MessageService.ShowError(dialog, GettextCatalog.GetString ("A Project with that name is already in your Project Space"));
 				return;
 			}
 			
@@ -237,12 +237,12 @@
 				}
 				catch (IOException ioException)
 				{
-					Runtime.MessageService.ShowError (String.Format (GettextCatalog.GetString ("Could not create directory {0}. File already exists."), ProjectSolution));
+					Runtime.MessageService.ShowError (dialog, String.Format (GettextCatalog.GetString ("Could not create directory {0}. File already exists."), ProjectSolution));
 					return;
 				}
 				catch (UnauthorizedAccessException accessException)
 				{
-					Runtime.MessageService.ShowError (String.Format (GettextCatalog.GetString ("You do not have permission to create to {0}"), ProjectSolution));
+					Runtime.MessageService.ShowError (dialog, String.Format (GettextCatalog.GetString ("You do not have permission to create to {0}"), ProjectSolution));
 					return;
 				}
 				

Modified: trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/MessageService.cs
===================================================================
--- trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/MessageService.cs	2005-09-04 16:12:40 UTC (rev 2789)
+++ trunk/MonoDevelop/Core/src/MonoDevelop.Base/Services/MessageService.cs	2005-09-05 20:39:54 UTC (rev 2790)
@@ -26,17 +26,22 @@
 		
 		public void ShowError(Exception ex)
 		{
-			ShowError(ex, null);
+			ShowError(ex, null, (Window) WorkbenchSingleton.Workbench);
 		}
 		
 		public void ShowError(string message)
 		{
-			ShowError(null, message);
+			ShowError(null, message, (Window) WorkbenchSingleton.Workbench);
 		}
+
+		public void ShowError (Window parent, string message)
+		{
+			ShowError (null, message, parent);
+		}
 		
 		public void ShowErrorFormatted(string formatstring, params string[] formatitems)
 		{
-			ShowError(null, String.Format(stringParserService.Parse(formatstring), formatitems));
+			ShowError(null, String.Format(stringParserService.Parse(formatstring), formatitems), (Window) WorkbenchSingleton.Workbench);
 		}
 
 		private struct ErrorContainer
@@ -53,7 +58,12 @@
 
 		public void ShowError (Exception ex, string message)
 		{
-			ErrorDialog dlg = new ErrorDialog ((Window) WorkbenchSingleton.Workbench);
+			ShowError (ex, message, (Window) WorkbenchSingleton.Workbench);
+		}
+
+		public void ShowError (Exception ex, string message, Window parent)
+		{
+			ErrorDialog dlg = new ErrorDialog (parent);
 			
 			if (message != null) {
 				dlg.Message = message;




More information about the Monodevelop-patches-list mailing list