[Monodevelop-patches-list] r1008 - in trunk/MonoDevelop/src/Main/Base: Commands Internal/Project/Combine Internal/Project/Project

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Mon Feb 23 16:05:30 EST 2004


Author: tberman
Date: 2004-02-23 16:05:30 -0500 (Mon, 23 Feb 2004)
New Revision: 1008

Modified:
   trunk/MonoDevelop/src/Main/Base/Commands/FileCommands.cs
   trunk/MonoDevelop/src/Main/Base/Internal/Project/Combine/Combine.cs
   trunk/MonoDevelop/src/Main/Base/Internal/Project/Project/AbstractProject.cs
Log:
found another unported save dialog, and close the FileSelection when you are done.



Modified: trunk/MonoDevelop/src/Main/Base/Commands/FileCommands.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Commands/FileCommands.cs	2004-02-23 20:59:08 UTC (rev 1007)
+++ trunk/MonoDevelop/src/Main/Base/Commands/FileCommands.cs	2004-02-23 21:05:30 UTC (rev 1008)
@@ -194,26 +194,21 @@
 				}
 				
 				if (content.ContentName == null) {
-					/*using (SaveFileDialog fdiag = new SaveFileDialog()) {
-						fdiag.OverwritePrompt = true;
-						fdiag.AddExtension    = true;
-						
-						fdiag.Filter          = String.Join("|", (string[])(AddInTreeSingleton.AddInTree.GetTreeNode("/SharpDevelop/Workbench/FileFilter").BuildChildItems(this)).ToArray(typeof(string)));
-						
-						if (fdiag.ShowDialog() == DialogResult.OK) {
-							string fileName = fdiag.FileName;
-							// currently useless, because the fdiag.FileName can't
-							// handle wildcard extensions :(
-							if (Path.GetExtension(fileName).StartsWith("?") || Path.GetExtension(fileName) == "*") {
-								fileName = Path.ChangeExtension(fileName, "");
-							}
-							if (fileUtilityService.ObservedSave(new NamedFileOperationDelegate(content.Save), fileName) == FileOperationResult.OK) {
-								IMessageService messageService =(IMessageService)ServiceManager.Services.GetService(typeof(IMessageService));
-								messageService.ShowMessage(fileName, "File saved");
-							}
+					Gtk.FileSelection fdiag = new Gtk.FileSelection ("Save File As...");
+					fdiag.Filename = System.Environment.GetEnvironmentVariable ("HOME");
+					if (fdiag.Run () == (int)Gtk.ResponseType.Ok) {
+						string fileName = fdiag.Filename;
+						// currently useless, because the fdiag.FileName can't
+						// handle wildcard extensions :(
+						if (Path.GetExtension(fileName).StartsWith("?") || Path.GetExtension(fileName) == "*") {
+							fileName = Path.ChangeExtension(fileName, "");
 						}
-					}*/
-					Console.WriteLine ("unported dialog in FileCommands.cs");
+						if (fileUtilityService.ObservedSave(new NamedFileOperationDelegate(content.Save), fileName) == FileOperationResult.OK) {
+							IMessageService messageService =(IMessageService)ServiceManager.Services.GetService(typeof(IMessageService));
+							messageService.ShowMessage(fileName, "File saved");
+						}
+					}
+					fdiag.Destroy ();
 				} else {
 					fileUtilityService.ObservedSave(new FileOperationDelegate(content.Save), content.ContentName);
 				}

Modified: trunk/MonoDevelop/src/Main/Base/Internal/Project/Combine/Combine.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Internal/Project/Combine/Combine.cs	2004-02-23 20:59:08 UTC (rev 1007)
+++ trunk/MonoDevelop/src/Main/Base/Internal/Project/Combine/Combine.cs	2004-02-23 21:05:30 UTC (rev 1008)
@@ -312,6 +312,7 @@
 				IMessageService messageService =(IMessageService)ServiceManager.Services.GetService(typeof(IMessageService));
 				messageService.ShowMessage(filename, resourceService.GetString("Internal.Project.Combine.CombineSavedMessage"));
 			}
+			fdiag.Destroy ();
 		}
 
 		public object AddEntry(string filename)

Modified: trunk/MonoDevelop/src/Main/Base/Internal/Project/Project/AbstractProject.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Internal/Project/Project/AbstractProject.cs	2004-02-23 20:59:08 UTC (rev 1007)
+++ trunk/MonoDevelop/src/Main/Base/Internal/Project/Project/AbstractProject.cs	2004-02-23 21:05:30 UTC (rev 1008)
@@ -522,6 +522,7 @@
 				IMessageService messageService =(IMessageService)ServiceManager.Services.GetService(typeof(IMessageService));
 				messageService.ShowMessage(filename, resourceService.GetString("Internal.Project.DefaultProject.ProjectSavedMessage"));
 			}
+			fdiag.Destroy ();
 		}
 		
 		public void CopyReferencesToOutputPath(bool force)




More information about the Monodevelop-patches-list mailing list