[Monodevelop-patches-list] r1485 - in trunk/MonoDevelop/src/Main/Base: . Commands Gui/Workbench
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Tue Apr 20 15:01:27 EDT 2004
Author: tberman
Date: 2004-04-20 15:01:27 -0400 (Tue, 20 Apr 2004)
New Revision: 1485
Modified:
trunk/MonoDevelop/src/Main/Base/ChangeLog
trunk/MonoDevelop/src/Main/Base/Commands/AutostartCommands.cs
trunk/MonoDevelop/src/Main/Base/Gui/Workbench/DefaultWorkbench.cs
Log:
fix saving/loading of window state again.
Modified: trunk/MonoDevelop/src/Main/Base/ChangeLog
===================================================================
--- trunk/MonoDevelop/src/Main/Base/ChangeLog 2004-04-20 14:34:57 UTC (rev 1484)
+++ trunk/MonoDevelop/src/Main/Base/ChangeLog 2004-04-20 19:01:27 UTC (rev 1485)
@@ -1,3 +1,9 @@
+2004-04-20 Todd Berman <tberman at sevenl.net>
+
+ * Commands/AutostartCommands.cs: Move stuff around so workbench memento
+ works.
+ * Gui/Workbench/DefaultWorkbench.cs: Same as above.
+
2004-04-19 Todd Berman <tberman at sevenl.net>
* Commands/AutostartCommands.cs: Match new ReflectionLayer api.
Modified: trunk/MonoDevelop/src/Main/Base/Commands/AutostartCommands.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Commands/AutostartCommands.cs 2004-04-20 14:34:57 UTC (rev 1484)
+++ trunk/MonoDevelop/src/Main/Base/Commands/AutostartCommands.cs 2004-04-20 19:01:27 UTC (rev 1485)
@@ -32,20 +32,16 @@
{
public class InitializeWorkbenchCommand : AbstractCommand
{
- const string workbenchMemento = "SharpDevelop.Workbench.WorkbenchMemento";
-
+
public override void Run()
{
DefaultWorkbench w = new DefaultWorkbench();
WorkbenchSingleton.Workbench = w;
-
w.InitializeWorkspace();
PropertyService propertyService = (PropertyService)ServiceManager.Services.GetService(typeof(PropertyService));
w.UpdateViews(null, null);
WorkbenchSingleton.CreateWorkspace();
((Gtk.Window)w).Visible = false;
- w.SetMemento ((IXmlConvertable)propertyService.GetProperty (workbenchMemento, new WorkbenchMemento ()));
-
}
}
@@ -200,6 +196,7 @@
}
((Gtk.Window)WorkbenchSingleton.Workbench).ShowAll ();
+ WorkbenchSingleton.Workbench.SetMemento ((IXmlConvertable)propertyService.GetProperty (workbenchMemento, new WorkbenchMemento ()));
((Gtk.Window)WorkbenchSingleton.Workbench).Visible = true;
WorkbenchSingleton.Workbench.RedrawAllComponents ();
Modified: trunk/MonoDevelop/src/Main/Base/Gui/Workbench/DefaultWorkbench.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Workbench/DefaultWorkbench.cs 2004-04-20 14:34:57 UTC (rev 1484)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Workbench/DefaultWorkbench.cs 2004-04-20 19:01:27 UTC (rev 1485)
@@ -396,14 +396,16 @@
public IXmlConvertable CreateMemento()
{
WorkbenchMemento memento = new WorkbenchMemento();
- int x, y, width, height, depth;
- GdkWindow.GetGeometry (out x, out y, out width, out height, out depth);
+ int x, y, width, height;
+ GetPosition (out x, out y);
+ GetSize (out width, out height);
if (GdkWindow.State == 0) {
memento.Bounds = new Rectangle (x, y, width, height);
} else {
memento.Bounds = normalBounds;
}
memento.WindowState = GdkWindow.State;
+ Console.WriteLine (memento.WindowState);
memento.FullScreen = fullscreen;
return memento;
@@ -417,11 +419,14 @@
normalBounds = memento.Bounds;
Move (normalBounds.X, normalBounds.Y);
Resize (normalBounds.Width, normalBounds.Height);
+ Console.WriteLine (memento.WindowState);
if (memento.WindowState == Gdk.WindowState.Maximized) {
+ Console.WriteLine ("About to maximize");
Maximize ();
} else if (memento.WindowState == Gdk.WindowState.Iconified) {
Iconify ();
}
+ //GdkWindow.State = memento.WindowState;
FullScreen = memento.FullScreen;
}
Decorated = true;
@@ -491,7 +496,7 @@
protected /*override*/ void OnClosing(object o, Gtk.DeleteEventArgs e)
{
if (Close()) {
- propertyService.SetProperty("SharpDevelop.Workbench.WorkbenchMemento", WorkbenchSingleton.Workbench.CreateMemento());
+ // propertyService.SetProperty("SharpDevelop.Workbench.WorkbenchMemento", WorkbenchSingleton.Workbench.CreateMemento());
Gtk.Application.Quit ();
} else {
e.RetVal = true;
@@ -527,12 +532,13 @@
// TODO : Dirty Files Dialog
// foreach (IViewContent content in ViewContentCollection) {
- // if (content.IsDirty) {
- // MonoDevelop.Gui.Dialogs.DirtyFilesDialog dfd = new MonoDevelop.Gui.Dialogs.DirtyFilesDialog();
+ // if (content.IsDirty) {
+ // MonoDevelop.Gui.Dialogs.DirtyFilesDialog dfd = new MonoDevelop.Gui.Dialogs.DirtyFilesDialog();
// e.Cancel = dfd.ShowDialog() == DialogResult.Cancel;
// return;
// }
// }
+ propertyService.SetProperty("SharpDevelop.Workbench.WorkbenchMemento", WorkbenchSingleton.Workbench.CreateMemento());
OnClosed (null);
return true;
}
More information about the Monodevelop-patches-list
mailing list