Author: lluis
Date: 2005-11-15 05:23:35 -0500 (Tue, 15 Nov 2005)
New Revision: 53041

Modified:
   trunk/monodevelop/Core/src/MonoDevelop.Core.Gui/ChangeLog
   
trunk/monodevelop/Core/src/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui.Components/FileBrowser.cs
   
trunk/monodevelop/Core/src/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui.Dialogs/ErrorDialog.cs
   
trunk/monodevelop/Core/src/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui/MessageService.cs
Log:
2005-11-14  Lluis Sanchez Gual  <[EMAIL PROTECTED]>

        * MonoDevelop.Core.Gui/MessageService.cs:
        * MonoDevelop.Core.Gui.Dialogs/ErrorDialog.cs: Don't show the details
        text view if there are no details to show.
        * MonoDevelop.Core.Gui.Components/FileBrowser.cs: Catch some access
        errors.



Modified: trunk/monodevelop/Core/src/MonoDevelop.Core.Gui/ChangeLog
===================================================================
--- trunk/monodevelop/Core/src/MonoDevelop.Core.Gui/ChangeLog   2005-11-15 
09:18:59 UTC (rev 53040)
+++ trunk/monodevelop/Core/src/MonoDevelop.Core.Gui/ChangeLog   2005-11-15 
10:23:35 UTC (rev 53041)
@@ -1,3 +1,11 @@
+2005-11-14  Lluis Sanchez Gual  <[EMAIL PROTECTED]>
+
+       * MonoDevelop.Core.Gui/MessageService.cs:
+       * MonoDevelop.Core.Gui.Dialogs/ErrorDialog.cs: Don't show the details
+       text view if there are no details to show.
+       * MonoDevelop.Core.Gui.Components/FileBrowser.cs: Catch some access
+       errors.
+
 2005-11-10  Lluis Sanchez Gual  <[EMAIL PROTECTED]>
 
        * Base.glade:

Modified: 
trunk/monodevelop/Core/src/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui/MessageService.cs
===================================================================
--- 
trunk/monodevelop/Core/src/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui/MessageService.cs
      2005-11-15 09:18:59 UTC (rev 53040)
+++ 
trunk/monodevelop/Core/src/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui/MessageService.cs
      2005-11-15 10:23:35 UTC (rev 53041)
@@ -85,8 +85,6 @@
                                        dlg.Message = ex.Message;
                                dlg.AddDetails ("Exception occurred: " + 
ex.Message + "\n\n", true);
                                dlg.AddDetails (ex.ToString (), false);
-                       } else {
-                               dlg.AddDetails ("No more details available.", 
true);
                        }
                        if (modal) {
                                dlg.Run ();

Modified: 
trunk/monodevelop/Core/src/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui.Components/FileBrowser.cs
===================================================================
--- 
trunk/monodevelop/Core/src/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui.Components/FileBrowser.cs
      2005-11-15 09:18:59 UTC (rev 53040)
+++ 
trunk/monodevelop/Core/src/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui.Components/FileBrowser.cs
      2005-11-15 10:23:35 UTC (rev 53041)
@@ -164,41 +164,50 @@
                                goUp.Sensitive = true;
 
                        DirectoryInfo di = new DirectoryInfo (CurrentDir);
-                       DirectoryInfo[] dirs = di.GetDirectories ();
                        
-                       foreach (DirectoryInfo d in dirs)
-                       {
-                               if (ignoreHidden)
+                       try {
+                               DirectoryInfo[] dirs = di.GetDirectories ();
+                               
+                               foreach (DirectoryInfo d in dirs)
                                {
-                                       if (!d.Name.StartsWith (".") && 
NotHidden (d.Name))
+                                       if (ignoreHidden)
+                                       {
+                                               if (!d.Name.StartsWith (".") && 
NotHidden (d.Name))
+                                                       store.AppendValues 
(FileIconLoader.GetPixbufForFile (System.IO.Path.Combine (CurrentDir, d.Name), 
24), d.Name);
+                                       }
+                                       else
+                                       {
                                                store.AppendValues 
(FileIconLoader.GetPixbufForFile (System.IO.Path.Combine (CurrentDir, d.Name), 
24), d.Name);
+                                       }
                                }
-                               else
-                               {
-                                       store.AppendValues 
(FileIconLoader.GetPixbufForFile (System.IO.Path.Combine (CurrentDir, d.Name), 
24), d.Name);
-                               }
-                       }
 
-                       if (init == true)
-                               tv.Selection.SelectPath (new Gtk.TreePath 
("0"));
+                               if (init == true)
+                                       tv.Selection.SelectPath (new 
Gtk.TreePath ("0"));
 
-                       entry.Text = CurrentDir;
-                       string[] filesaux = Directory.GetFiles (CurrentDir);
+                               entry.Text = CurrentDir;
+                               string[] filesaux = Directory.GetFiles 
(CurrentDir);
 
-                       files.Clear ();
-                       for (int cont = 0; cont < filesaux.Length; cont++)
-                       {
-                               if (ignoreHidden)
+                               files.Clear ();
+                               for (int cont = 0; cont < filesaux.Length; 
cont++)
                                {
-                                       if (NotHidden 
(System.IO.Path.GetFileName (filesaux[cont])))
+                                       if (ignoreHidden)
                                        {
+                                               if (NotHidden 
(System.IO.Path.GetFileName (filesaux[cont])))
+                                               {
+                                                       files.Add 
(filesaux[cont]);
+                                               }
+                                       }
+                                       else
+                                       {
                                                files.Add (filesaux[cont]);
                                        }
                                }
-                               else
-                               {
-                                       files.Add (filesaux[cont]);
-                               }
+                       } catch (System.UnauthorizedAccessException) {
+                               files.Clear ();
+                               store.Clear ();
+                               store.AppendValues (null, 
GettextCatalog.GetString ("Access denied"));
+                       } catch (Exception ex) {
+                               Services.MessageService.ShowError (ex, 
GettextCatalog.GetString ("Could not access to directory: ") + CurrentDir); 
                        }
                }
 
@@ -208,8 +217,10 @@
                        if (store.GetIter (out iter, args.Path))
                        {
                                string newDir = System.IO.Path.Combine 
(currentDir, (string) store.GetValue (iter, 1));
-                               if (Directory.Exists (newDir))
-                                       CurrentDir = newDir;
+                               try {
+                                       if (Directory.Exists (newDir))
+                                               CurrentDir = newDir;
+                               } catch {}
                        }
                }
                
@@ -299,10 +310,16 @@
 
                private void OnEntryActivated (object sender, EventArgs args)
                {
-                       if (Directory.Exists (entry.Text.Trim ()))
-                               CurrentDir = entry.Text.Trim ();
-                       else
-                       messageService.ShowError (null, String.Format 
(GettextCatalog.GetString ("Cannot enter '{0}' folder"), entry.Text));
+                       Exception error = null;
+                       try {
+                               if (Directory.Exists (entry.Text.Trim ())) {
+                                       CurrentDir = entry.Text.Trim ();
+                                       return;
+                               }
+                       } catch (Exception ex) {
+                               error = ex;
+                       }
+                       messageService.ShowError (error, String.Format 
(GettextCatalog.GetString ("Cannot enter '{0}' folder"), entry.Text));
                }
 
                private void OnDirRename (object o, EventArgs args)

Modified: 
trunk/monodevelop/Core/src/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui.Dialogs/ErrorDialog.cs
===================================================================
--- 
trunk/monodevelop/Core/src/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui.Dialogs/ErrorDialog.cs
 2005-11-15 09:18:59 UTC (rev 53040)
+++ 
trunk/monodevelop/Core/src/MonoDevelop.Core.Gui/MonoDevelop.Core.Gui.Dialogs/ErrorDialog.cs
 2005-11-15 10:23:35 UTC (rev 53041)
@@ -58,6 +58,8 @@
                        tagWrap = new TextTag ("wrap");
                        tagWrap.WrapMode = WrapMode.Word;
                        detailsTextView.Buffer.TagTable.Add (tagWrap);
+                       
+                       expander.Visible = false;
                }
                
                public string Message {
@@ -78,16 +80,17 @@
                                detailsTextView.Buffer.InsertWithTags (ref it, 
text, tagWrap);
                        else
                                detailsTextView.Buffer.InsertWithTags (ref it, 
text, tagNoWrap);
+                       expander.Visible = true;
                }
                
                public void Show ()
                {
-                       dialog.ShowAll ();
+                       dialog.Show ();
                }
                
                public void Run ()
                {
-                       dialog.ShowAll ();
+                       dialog.Show ();
                        dialog.Run ();
                }
                

_______________________________________________
Mono-patches maillist  -  Mono-patches@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to