[Monodevelop-patches-list] r773 - in trunk/MonoDevelop/src: Libraries/MonoDevelop.Gui.Widgets/FileBrowser Main/Base/Gui/Pads
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Tue Feb 3 20:29:20 EST 2004
Author: jluke
Date: 2004-02-03 20:29:20 -0500 (Tue, 03 Feb 2004)
New Revision: 773
Modified:
trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/FileBrowser/FileBrowser.cs
trunk/MonoDevelop/src/Main/Base/Gui/Pads/FileScout.cs
Log:
fix filelist not updating
add a path entry and a home button
Modified: trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/FileBrowser/FileBrowser.cs
===================================================================
--- trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/FileBrowser/FileBrowser.cs 2004-02-04 01:16:33 UTC (rev 772)
+++ trunk/MonoDevelop/src/Libraries/MonoDevelop.Gui.Widgets/FileBrowser/FileBrowser.cs 2004-02-04 01:29:20 UTC (rev 773)
@@ -22,7 +22,7 @@
tv = new Gtk.TreeView ();
tv.RulesHint = true;
- tv.AppendColumn ("Name", new CellRendererText (), "text", 0);
+ tv.AppendColumn ("Directories", new CellRendererText (), "text", 0);
store = new ListStore (typeof (string));
currentDir = Environment.GetEnvironmentVariable ("HOME");
Populate ();
@@ -49,6 +49,8 @@
public string CurrentDir
{
get { return System.IO.Path.GetFullPath (currentDir); }
+ set { currentDir = value;
+ Populate (); }
}
public string[] Files
Modified: trunk/MonoDevelop/src/Main/Base/Gui/Pads/FileScout.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Pads/FileScout.cs 2004-02-04 01:16:33 UTC (rev 772)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Pads/FileScout.cs 2004-02-04 01:29:20 UTC (rev 773)
@@ -38,10 +38,6 @@
ResourceManager resources = new ResourceManager("ProjectComponentResources", this.GetType().Module.Assembly);
FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.Services.GetService(typeof(FileUtilityService));
- //Columns.Add("File", 100, HorizontalAlignment.Left);
- //Columns.Add("Size", -2, HorizontalAlignment.Right);
- //Columns.Add("Last modified", -2, HorizontalAlignment.Left);
-
store = new Gtk.ListStore (typeof (string), typeof (string), typeof(string), typeof(FileListItem), typeof (Gdk.Pixbuf));
Model = store;
@@ -80,7 +76,6 @@
AppendColumn(size_column);
AppendColumn(modi_column);
-
// menu = new MagicMenus.PopupMenu();
// menu.MenuCommands.Add(new MagicMenus.MenuCommand("Delete file", new EventHandler(deleteFiles)));
// menu.MenuCommands.Add(new MagicMenus.MenuCommand("Rename", new EventHandler(renameFile)));
@@ -108,7 +103,7 @@
// TODO
}
- void Clear() {
+ internal void Clear() {
store.Clear();
}
@@ -385,6 +380,7 @@
FileList filelister = new FileList();
FileBrowser fb = new FileBrowser ();
+ Gtk.Entry pathEntry;
public FileScout()
{
@@ -392,7 +388,17 @@
filelister.RowActivated += new GtkSharp.RowActivatedHandler(FileSelected);
Gtk.Frame treef = new Gtk.Frame();
- treef.Add(fb);
+ Gtk.VBox utilVBox = new Gtk.VBox (false, 0);
+ Gtk.HBox hbox = new Gtk.HBox (false, 0);
+ pathEntry = new Gtk.Entry (fb.CurrentDir);
+ //pathEntry.Activated += new EventHandler (OnPathEntryActivated);
+ hbox.PackStart (pathEntry);
+ Gtk.Button homeButton = new Gtk.Button ("Home");
+ homeButton.Clicked += new EventHandler (OnHomeClicked);
+ hbox.PackStart (homeButton);
+ utilVBox.PackStart (hbox, false, true, 0);
+ utilVBox.PackStart (fb);
+ treef.Add(utilVBox);
Gtk.ScrolledWindow listsw = new Gtk.ScrolledWindow ();
listsw.Add(filelister);
@@ -402,9 +408,27 @@
Pack1(treef, true, true);
Pack2(listf, true, true);
}
+
+ void OnHomeClicked (object sender, EventArgs args)
+ {
+ fb.CurrentDir = Environment.GetEnvironmentVariable ("HOME");
+ OnDirChanged (sender, args);
+ }
+
+ void OnPathEntryActivated (object sender, EventArgs args)
+ {
+ if (Directory.Exists (pathEntry.Text))
+ {
+ fb.CurrentDir = pathEntry.Text;
+ OnDirChanged (sender, args);
+ }
+ }
void OnDirChanged(object sender, EventArgs args)
{
+ pathEntry.Text = fb.CurrentDir;
+ filelister.Clear ();
+
foreach (string f in fb.Files)
{
//FIXME: hack to ignore . files
More information about the Monodevelop-patches-list
mailing list