[Monodevelop-patches-list] r1941 - in branches/MonoDevelop-plan-43/src/Plugins: Content Editor
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Sat Aug 14 23:07:30 EDT 2004
Author: tberman
Date: 2004-08-14 23:07:30 -0400 (Sat, 14 Aug 2004)
New Revision: 1941
Modified:
branches/MonoDevelop-plan-43/src/Plugins/Content/ContentManager.cs
branches/MonoDevelop-plan-43/src/Plugins/Editor/EditorNodeViewer.cs
Log:
some small fixes.
Modified: branches/MonoDevelop-plan-43/src/Plugins/Content/ContentManager.cs
===================================================================
--- branches/MonoDevelop-plan-43/src/Plugins/Content/ContentManager.cs 2004-08-14 22:38:02 UTC (rev 1940)
+++ branches/MonoDevelop-plan-43/src/Plugins/Content/ContentManager.cs 2004-08-15 03:07:30 UTC (rev 1941)
@@ -57,6 +57,7 @@
fcd.AddButton (Stock.Cancel, ResponseType.Cancel);
fcd.AddButton (Stock.Open, ResponseType.Ok);
fcd.DefaultResponse = ResponseType.Ok;
+ fcd.WindowPosition = WindowPosition.Center;
int resp = fcd.Run ();
fcd.Hide ();
Modified: branches/MonoDevelop-plan-43/src/Plugins/Editor/EditorNodeViewer.cs
===================================================================
--- branches/MonoDevelop-plan-43/src/Plugins/Editor/EditorNodeViewer.cs 2004-08-14 22:38:02 UTC (rev 1940)
+++ branches/MonoDevelop-plan-43/src/Plugins/Editor/EditorNodeViewer.cs 2004-08-15 03:07:30 UTC (rev 1941)
@@ -42,7 +42,7 @@
viewer.Add (editor);
TextFileNode node = (TextFileNode)context.Node;
- InsertText (node.Buffer.Reader);
+ LoadText (node.Buffer.Reader);
}
public override Widget StructureWidget {
@@ -75,19 +75,17 @@
}
}
- private void InsertText (Stream reader)
+ private void LoadText (Stream reader)
{
byte[] buf = new byte[2048];
int read = -1;
+ StreamReader sr = new StreamReader (reader);
+ string line;
buffer.Text = "";
- do {
- read = reader.Read (buf, 0, buf.Length);
- log.Debug ("bytes read: " + read);
- TextIter iter = buffer.GetIterAtMark (buffer.InsertMark);
- string text = Encoding.UTF8.GetString (buf);
- log.Debug (text);
- buffer.Text += text;
- } while (read == buf.Length);
+ while ((line = sr.ReadLine ()) != null) {
+ log.Debug (line);
+ buffer.Text += line + "\n";
+ }
}
public static void InitializePlugin (byte major, byte minor)
More information about the Monodevelop-patches-list
mailing list