[Monodevelop-patches-list] r1005 - trunk/MonoDevelop/src/Main/Base/Gui/Pads/ProjectBrowser/BrowserNode
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Mon Feb 23 14:43:43 EST 2004
Author: tberman
Date: 2004-02-23 14:43:43 -0500 (Mon, 23 Feb 2004)
New Revision: 1005
Modified:
trunk/MonoDevelop/src/Main/Base/Gui/Pads/ProjectBrowser/BrowserNode/DirectoryNode.cs
trunk/MonoDevelop/src/Main/Base/Gui/Pads/ProjectBrowser/BrowserNode/FileNode.cs
Log:
more added dialogs, we need to change the string resources a bit on these, cause they imply a third option that we dont have.
Modified: trunk/MonoDevelop/src/Main/Base/Gui/Pads/ProjectBrowser/BrowserNode/DirectoryNode.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Pads/ProjectBrowser/BrowserNode/DirectoryNode.cs 2004-02-23 19:29:15 UTC (rev 1004)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Pads/ProjectBrowser/BrowserNode/DirectoryNode.cs 2004-02-23 19:43:43 UTC (rev 1005)
@@ -128,26 +128,24 @@
ResourceService resourceService = (ResourceService)ServiceManager.Services.GetService(typeof(IResourceService));
StringParserService stringParserService = (StringParserService)ServiceManager.Services.GetService(typeof(StringParserService));
- /*int ret = new SharpMessageBox(resourceService.GetString("ProjectComponent.RemoveFolder.Title"),
- stringParserService.Parse(resourceService.GetString("ProjectComponent.RemoveFolder.Question"), new string[,] { {"FOLDER", Text}, {"PROJECT", Project.Name}}),
- resourceService.GetString("Global.RemoveButtonText"),
- resourceService.GetString("Global.DeleteButtonText"),
- resourceService.GetString("Global.CancelButtonText")).ShowMessageBox();*/
- Console.WriteLine ("unported dialog at DirectoryNode.cs");
- int ret = -1;
+ Gtk.MessageDialog dialog = new Gtk.MessageDialog ((Gtk.Window)WorkbenchSingleton.Workbench, Gtk.DialogFlags.DestroyWithParent, Gtk.MessageType.Question, Gtk.ButtonsType.OkCancel, stringParserService.Parse(resourceService.GetString("ProjectComponent.RemoveFolder.Question"), new string[,] { {"FOLDER", Text}, {"PROJECT", Project.Name}}));
+
+ if (dialog.Run() != (int)Gtk.ResponseType.Ok) {
+ dialog.Destroy ();
+ return false;
+ }
+ dialog.Destroy ();
+
IFileService fileService = (IFileService)ICSharpCode.Core.Services.ServiceManager.Services.GetService(typeof(IFileService));
IProjectService projectService = (IProjectService)ICSharpCode.Core.Services.ServiceManager.Services.GetService(typeof(IProjectService));
- switch (ret) {
- case -1:
- case 2:
- return false;
- case 0:
+ //switch (ret) {
+ //case 0:
projectService.RemoveFileFromProject(FolderName);
- break;
- case 1:
- fileService.RemoveFile(FolderName);
- break;
- }
+ // break;
+ //case 1:
+ // fileService.RemoveFile(FolderName);
+ // break;
+ //}
return true;
}
}
Modified: trunk/MonoDevelop/src/Main/Base/Gui/Pads/ProjectBrowser/BrowserNode/FileNode.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Pads/ProjectBrowser/BrowserNode/FileNode.cs 2004-02-23 19:29:15 UTC (rev 1004)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Pads/ProjectBrowser/BrowserNode/FileNode.cs 2004-02-23 19:43:43 UTC (rev 1005)
@@ -140,28 +140,28 @@
DateTime old = DateTime.Now;
ResourceService resourceService = (ResourceService)ServiceManager.Services.GetService(typeof(IResourceService));
StringParserService stringParserService = (StringParserService)ServiceManager.Services.GetService(typeof(StringParserService));
- Console.WriteLine ("Unported dialog in FileNode.cs");
- /*using (SharpMessageBox sharpMessageBox = new SharpMessageBox(resourceService.GetString("ProjectComponent.RemoveFile.Title"),
- stringParserService.Parse(resourceService.GetString("ProjectComponent.RemoveFile.Question"), new string[,] { {"FILE", Path.GetFileName(((ProjectFile)userData).Name)}, {"PROJECT", Project.Name}}),
- resourceService.GetString("Global.RemoveButtonText"),
- resourceService.GetString("Global.DeleteButtonText"),
- resourceService.GetString("Global.CancelButtonText"))) {
- Console.WriteLine("Messagebox created at : " + (DateTime.Now - old).Milliseconds);
- switch (sharpMessageBox.ShowMessageBox()) {
- case -1:
- case 2:
- return false;
- case 0:
- IProjectService projectService = (IProjectService)ICSharpCode.Core.Services.ServiceManager.Services.GetService(typeof(IProjectService));
- projectService.RemoveFileFromProject(((ProjectFile)userData).Name);
- break;
- case 1:
- IFileService fileService = (IFileService)ICSharpCode.Core.Services.ServiceManager.Services.GetService(typeof(IFileService));
- fileService.RemoveFile(((ProjectFile)userData).Name);
- break;
- }
- }*/
+ Gtk.MessageDialog dialog = new Gtk.MessageDialog ((Gtk.Window)WorkbenchSingleton.Workbench, Gtk.DialogFlags.DestroyWithParent, Gtk.MessageType.Question, Gtk.ButtonsType.OkCancel, stringParserService.Parse(resourceService.GetString("ProjectComponent.RemoveFile.Question"), new string[,] { {"FILE", Path.GetFileName (((ProjectFile)userData).Name)}, {"PROJECT", Project.Name}}));
+
+ if (dialog.Run() != (int)Gtk.ResponseType.Ok) {
+ dialog.Destroy ();
+ return false;
+ }
+
+ dialog.Destroy ();
+ //switch (sharpMessageBox.ShowMessageBox()) {
+ // case -1:
+ // case 2:
+ // return false;
+ // case 0:
+ IProjectService projectService = (IProjectService)ICSharpCode.Core.Services.ServiceManager.Services.GetService(typeof(IProjectService));
+ projectService.RemoveFileFromProject(((ProjectFile)userData).Name);
+ // break;
+ // case 1:
+ // IFileService fileService = (IFileService)ICSharpCode.Core.Services.ServiceManager.Services.GetService(typeof(IFileService));
+ // fileService.RemoveFile(((ProjectFile)userData).Name);
+ // break;
+ //}
return true;
}
}
More information about the Monodevelop-patches-list
mailing list