[Monodevelop-patches-list] r2010 - in trunk/MonoDevelop/Core/src: AddIns/DisplayBindings/SourceEditor/Gui/Dialogs AddIns/Nunit/Commands Libraries/MonoDevelop.Gui.Widgets/FileSelector Libraries/MonoDevelop.Gui.Widgets/FolderDialog Main/Base/Commands Main/Base/Commands/ProjectBrowserCommands Main/Base/Gui/Dialogs/CombineConfiguration Main/Base/Gui/Dialogs/OptionPanels/ProjectOptions Main/Base/Gui/Dialogs/ReferenceDialog
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Fri Oct 29 23:32:02 EDT 2004
Author: tberman
Date: 2004-10-29 23:32:01 -0400 (Fri, 29 Oct 2004)
New Revision: 2010
Modified:
trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/Dialogs/ReplaceInFilesDialog.cs
trunk/MonoDevelop/Core/src/AddIns/Nunit/Commands/NunitCommands.cs
trunk/MonoDevelop/Core/src/Libraries/MonoDevelop.Gui.Widgets/FileSelector/FileSelector.cs
trunk/MonoDevelop/Core/src/Libraries/MonoDevelop.Gui.Widgets/FolderDialog/FileEntry.cs
trunk/MonoDevelop/Core/src/Libraries/MonoDevelop.Gui.Widgets/FolderDialog/FolderDialog.cs
trunk/MonoDevelop/Core/src/Libraries/MonoDevelop.Gui.Widgets/FolderDialog/FolderEntry.cs
trunk/MonoDevelop/Core/src/Main/Base/Commands/FileCommands.cs
trunk/MonoDevelop/Core/src/Main/Base/Commands/ProjectBrowserCommands/FolderNodeCommands.cs
trunk/MonoDevelop/Core/src/Main/Base/Commands/ProjectBrowserCommands/ResourceFolderNodeCommands.cs
trunk/MonoDevelop/Core/src/Main/Base/Gui/Dialogs/CombineConfiguration/CombineBuildOptions.cs
trunk/MonoDevelop/Core/src/Main/Base/Gui/Dialogs/OptionPanels/ProjectOptions/DeployFileOptions.cs
trunk/MonoDevelop/Core/src/Main/Base/Gui/Dialogs/ReferenceDialog/AssemblyReferencePanel.cs
Log:
Use the 2.4 FileChooserDialog.
Modified: trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/Dialogs/ReplaceInFilesDialog.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/Dialogs/ReplaceInFilesDialog.cs 2004-10-29 21:55:35 UTC (rev 2009)
+++ trunk/MonoDevelop/Core/src/AddIns/DisplayBindings/SourceEditor/Gui/Dialogs/ReplaceInFilesDialog.cs 2004-10-30 03:32:01 UTC (rev 2010)
@@ -266,7 +266,6 @@
System.Environment.GetEnvironmentVariable ("HOME"),
"Projects")).ToString ();
}
- fd.Complete (defaultFolder);
if (fd.Run() == (int)Gtk.ResponseType.Ok)
{
Modified: trunk/MonoDevelop/Core/src/AddIns/Nunit/Commands/NunitCommands.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/Nunit/Commands/NunitCommands.cs 2004-10-29 21:55:35 UTC (rev 2009)
+++ trunk/MonoDevelop/Core/src/AddIns/Nunit/Commands/NunitCommands.cs 2004-10-30 03:32:01 UTC (rev 2010)
@@ -17,7 +17,6 @@
using (FileSelector fs = new FileSelector ("Load test assembly")) {
string defaultPath = Path.Combine (Environment.GetEnvironmentVariable ("HOME"), "Projects");
- fs.Complete (defaultPath);
if (fs.Run () == (int) Gtk.ResponseType.Ok)
{
Modified: trunk/MonoDevelop/Core/src/Libraries/MonoDevelop.Gui.Widgets/FileSelector/FileSelector.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Libraries/MonoDevelop.Gui.Widgets/FileSelector/FileSelector.cs 2004-10-29 21:55:35 UTC (rev 2009)
+++ trunk/MonoDevelop/Core/src/Libraries/MonoDevelop.Gui.Widgets/FileSelector/FileSelector.cs 2004-10-30 03:32:01 UTC (rev 2010)
@@ -10,22 +10,35 @@
// basically just to remember the last directory
// we could do some if GTK2.4 then use new FileChooser
// but that is probably to be hacky at best
- public class FileSelector : FileSelection
+ public class FileSelector : FileChooserDialog
{
const string LastPathProperty = "MonoDevelop.FileSelector.LastPath";
string lastPath;
PropertyService propertyService = (PropertyService) ServiceManager.GetService (typeof (PropertyService));
- public FileSelector () : base (GettextCatalog.GetString ("Open file ..."))
+ public FileSelector () : base (GettextCatalog.GetString ("Open file ..."), null, FileChooserAction.Open)
{
+ AddButton (Gtk.Stock.Cancel, ResponseType.Cancel);
+ AddButton (Gtk.Stock.Open, ResponseType.Ok);
CommonSetup ();
}
- public FileSelector (string title) : base (title)
+ public FileSelector (string title) : base (title, null, FileChooserAction.Open)
{
+ AddButton (Gtk.Stock.Cancel, ResponseType.Cancel);
+ AddButton (Gtk.Stock.Open, ResponseType.Ok);
CommonSetup ();
}
+ public FileSelector (string title, FileChooserAction action) : base (title, null, action)
+ {
+ if (action == FileChooserAction.SelectFolder) {
+ AddButton (Gtk.Stock.Cancel, ResponseType.Cancel);
+ AddButton ("Select Folder", ResponseType.Ok);
+ }
+ CommonSetup ();
+ }
+
void CommonSetup ()
{
// Restore the last active directory
@@ -44,12 +57,12 @@
}
// Set the dir here, must end in "/" to work right
- this.Filename = lastPath;
+ this.SetFilename (lastPath);
// Basically need to track if the directory has
// been changed in the simplest way possible
// I think that this always changes when the dir does
- this.HistoryPulldown.Changed += OnOptionListChanged;
+ this.CurrentFolderChanged += OnOptionListChanged;
}
void OnOptionListChanged (object o, EventArgs args)
Modified: trunk/MonoDevelop/Core/src/Libraries/MonoDevelop.Gui.Widgets/FolderDialog/FileEntry.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Libraries/MonoDevelop.Gui.Widgets/FolderDialog/FileEntry.cs 2004-10-29 21:55:35 UTC (rev 2009)
+++ trunk/MonoDevelop/Core/src/Libraries/MonoDevelop.Gui.Widgets/FolderDialog/FileEntry.cs 2004-10-30 03:32:01 UTC (rev 2010)
@@ -14,14 +14,17 @@
{
FileSelector fd = new FileSelector (name);
if (start_in != null)
- fd.Filename = start_in;
+ fd.SetFilename (start_in);
int response = fd.Run ();
- fd.Hide ();
- if (response == (int) ResponseType.Ok)
+ if (response == (int) ResponseType.Ok) {
+ fd.Hide ();
return fd.Filename;
-
+ }
+
+ fd.Hide ();
+
return null;
}
}
Modified: trunk/MonoDevelop/Core/src/Libraries/MonoDevelop.Gui.Widgets/FolderDialog/FolderDialog.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Libraries/MonoDevelop.Gui.Widgets/FolderDialog/FolderDialog.cs 2004-10-29 21:55:35 UTC (rev 2009)
+++ trunk/MonoDevelop/Core/src/Libraries/MonoDevelop.Gui.Widgets/FolderDialog/FolderDialog.cs 2004-10-30 03:32:01 UTC (rev 2010)
@@ -10,11 +10,9 @@
{
public class FolderDialog : FileSelector
{
- public FolderDialog (string title) : base (title)
+ public FolderDialog (string title) : base (title, FileChooserAction.SelectFolder)
{
this.SelectMultiple = false;
- this.ShowFileops = false;
- this.FileList.Sensitive = false;
}
}
}
Modified: trunk/MonoDevelop/Core/src/Libraries/MonoDevelop.Gui.Widgets/FolderDialog/FolderEntry.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Libraries/MonoDevelop.Gui.Widgets/FolderDialog/FolderEntry.cs 2004-10-29 21:55:35 UTC (rev 2009)
+++ trunk/MonoDevelop/Core/src/Libraries/MonoDevelop.Gui.Widgets/FolderDialog/FolderEntry.cs 2004-10-30 03:32:01 UTC (rev 2010)
@@ -14,13 +14,15 @@
{
FolderDialog fd = new FolderDialog (name);
if (start_in != null)
- fd.Filename = start_in;
+ fd.SetFilename (start_in);
int response = fd.Run ();
- fd.Hide ();
- if (response == (int) ResponseType.Ok)
+ if (response == (int) ResponseType.Ok) {
+ fd.Hide ();
return fd.Filename;
+ }
+ fd.Hide ();
return null;
}
Modified: trunk/MonoDevelop/Core/src/Main/Base/Commands/FileCommands.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Commands/FileCommands.cs 2004-10-29 21:55:35 UTC (rev 2009)
+++ trunk/MonoDevelop/Core/src/Main/Base/Commands/FileCommands.cs 2004-10-30 03:32:01 UTC (rev 2010)
@@ -155,7 +155,7 @@
}*/
using (FileSelector fdiag = new FileSelector (GettextCatalog.GetString ("Save as..."))) {
- fdiag.Filename = window.ViewContent.ContentName;
+ fdiag.SetFilename (window.ViewContent.ContentName);
int response = fdiag.Run ();
string filename = fdiag.Filename;
fdiag.Hide ();
@@ -200,7 +200,7 @@
{
using (FileSelector fdiag = new FileSelector (GettextCatalog.GetString ("Save File As...")))
{
- fdiag.Filename = System.Environment.GetEnvironmentVariable ("HOME");
+ fdiag.SetFilename (System.Environment.GetEnvironmentVariable ("HOME"));
if (fdiag.Run () == (int) Gtk.ResponseType.Ok)
{
string fileName = fdiag.Filename;
@@ -302,8 +302,8 @@
}*/
using (FileSelector fs = new FileSelector (GettextCatalog.GetString ("File to Open"))) {
int response = fs.Run ();
+ string name = fs.Filename;
fs.Hide ();
- string name = fs.Filename;
if (response == (int)Gtk.ResponseType.Ok) {
IFileService fileService = (IFileService)MonoDevelop.Core.Services.ServiceManager.GetService(typeof(IFileService));
IProjectService proj = (IProjectService)ServiceManager.GetService (typeof (IProjectService));
Modified: trunk/MonoDevelop/Core/src/Main/Base/Commands/ProjectBrowserCommands/FolderNodeCommands.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Commands/ProjectBrowserCommands/FolderNodeCommands.cs 2004-10-29 21:55:35 UTC (rev 2009)
+++ trunk/MonoDevelop/Core/src/Main/Base/Commands/ProjectBrowserCommands/FolderNodeCommands.cs 2004-10-30 03:32:01 UTC (rev 2010)
@@ -47,14 +47,12 @@
string defaultPath = node.Project.BaseDirectory;
- fdiag.Complete(defaultPath);
-
int result = fdiag.Run ();
try {
if (result != (int) ResponseType.Ok)
return;
- foreach (string file in fdiag.Selections) {
+ foreach (string file in fdiag.Filenames) {
if (file.StartsWith(node.Project.BaseDirectory)) {
ProjectBrowserView.MoveCopyFile (file, node, true, true);
} else {
Modified: trunk/MonoDevelop/Core/src/Main/Base/Commands/ProjectBrowserCommands/ResourceFolderNodeCommands.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Commands/ProjectBrowserCommands/ResourceFolderNodeCommands.cs 2004-10-29 21:55:35 UTC (rev 2009)
+++ trunk/MonoDevelop/Core/src/Main/Base/Commands/ProjectBrowserCommands/ResourceFolderNodeCommands.cs 2004-10-30 03:32:01 UTC (rev 2010)
@@ -47,9 +47,9 @@
using (FileSelector fs = new FileSelector (GettextCatalog.GetString ("File to Open"))) {
fs.SelectMultiple = true;
- fs.Filename = project.BaseDirectory;
+ fs.SetFilename (project.BaseDirectory);
int response = fs.Run ();
- string [] files = fs.Selections;
+ string [] files = fs.Filenames;
fs.Hide ();
if (response != (int)Gtk.ResponseType.Ok)
Modified: trunk/MonoDevelop/Core/src/Main/Base/Gui/Dialogs/CombineConfiguration/CombineBuildOptions.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Gui/Dialogs/CombineConfiguration/CombineBuildOptions.cs 2004-10-29 21:55:35 UTC (rev 2009)
+++ trunk/MonoDevelop/Core/src/Main/Base/Gui/Dialogs/CombineConfiguration/CombineBuildOptions.cs 2004-10-30 03:32:01 UTC (rev 2010)
@@ -49,11 +49,11 @@
void onClicked (object o, EventArgs e)
{
FolderDialog fd = new FolderDialog ("Output Directory");
- fd.Filename = buildOutputLoc.Text;
+ fd.SetFilename (buildOutputLoc.Text);
int response = fd.Run ();
- fd.Hide ();
if (response == (int) ResponseType.Ok)
buildOutputLoc.Text = fd.Filename + System.IO.Path.DirectorySeparatorChar;
+ fd.Hide ();
}
public bool Store()
Modified: trunk/MonoDevelop/Core/src/Main/Base/Gui/Dialogs/OptionPanels/ProjectOptions/DeployFileOptions.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Gui/Dialogs/OptionPanels/ProjectOptions/DeployFileOptions.cs 2004-10-29 21:55:35 UTC (rev 2009)
+++ trunk/MonoDevelop/Core/src/Main/Base/Gui/Dialogs/OptionPanels/ProjectOptions/DeployFileOptions.cs 2004-10-30 03:32:01 UTC (rev 2010)
@@ -90,9 +90,8 @@
void SelectScriptFileEvent(object sender, EventArgs e)
{
using (FileSelector fs = new FileSelector (GettextCatalog.GetString ("Select your File"))) { // Put correct title
- fs.Complete("*.txt");
if ( fs.Run () == (int) ResponseType.Ok) {
- deployScriptEntry.Text = fs.SelectionEntry.Text;
+ deployScriptEntry.Text = fs.Filename;
}
fs.Hide ();
}
@@ -102,7 +101,7 @@
{
using (FileSelector fs = new FileSelector (GettextCatalog.GetString ("Select the target directory"))) {
if ( fs.Run () == (int) ResponseType.Ok) {
- deployTargetEntry.Text = fs.SelectionEntry.Text;
+ deployTargetEntry.Text = fs.Filename;
}
fs.Hide ();
}
Modified: trunk/MonoDevelop/Core/src/Main/Base/Gui/Dialogs/ReferenceDialog/AssemblyReferencePanel.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Gui/Dialogs/ReferenceDialog/AssemblyReferencePanel.cs 2004-10-29 21:55:35 UTC (rev 2009)
+++ trunk/MonoDevelop/Core/src/Main/Base/Gui/Dialogs/ReferenceDialog/AssemblyReferencePanel.cs 2004-10-30 03:32:01 UTC (rev 2010)
@@ -39,8 +39,8 @@
// fdiag.Complete("*");
fdiag.SelectMultiple = true;
int response = fdiag.Run();
- string[] selectedFiles = new string[fdiag.Selections.Length];
- fdiag.Selections.CopyTo(selectedFiles, 0);
+ string[] selectedFiles = new string[fdiag.Filenames.Length];
+ fdiag.Filenames.CopyTo(selectedFiles, 0);
fdiag.Hide ();
if (response == (int) ResponseType.Ok) {
More information about the Monodevelop-patches-list
mailing list