[mapguide-commits] r6776 - in trunk/Tools/Maestro: Maestro Maestro.Base/Events Maestro.Base/Properties Maestro.Base/UI Maestro.Shared.UI

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Mon Jun 18 05:18:44 PDT 2012


Author: jng
Date: 2012-06-18 05:18:44 -0700 (Mon, 18 Jun 2012)
New Revision: 6776

Modified:
   trunk/Tools/Maestro/Maestro.Base/Events/EventWatcher.cs
   trunk/Tools/Maestro/Maestro.Base/Properties/Resources.Designer.cs
   trunk/Tools/Maestro/Maestro.Base/Properties/Resources.resx
   trunk/Tools/Maestro/Maestro.Base/UI/ISiteExplorer.cs
   trunk/Tools/Maestro/Maestro.Base/UI/SiteExplorer.Designer.cs
   trunk/Tools/Maestro/Maestro.Base/UI/SiteExplorer.cs
   trunk/Tools/Maestro/Maestro.Base/UI/SiteExplorer.resx
   trunk/Tools/Maestro/Maestro.Shared.UI/WorkbenchBase.cs
   trunk/Tools/Maestro/Maestro/changelog.txt
Log:
#2030: Show the active site connection in the status bar

Modified: trunk/Tools/Maestro/Maestro/changelog.txt
===================================================================
--- trunk/Tools/Maestro/Maestro/changelog.txt	2012-06-18 12:11:07 UTC (rev 6775)
+++ trunk/Tools/Maestro/Maestro/changelog.txt	2012-06-18 12:18:44 UTC (rev 6776)
@@ -1,4 +1,6 @@
-5.0 Beta 2
+ - Status bar now shows the active site connection
+
+5.0 Beta 2
 ----------
  - New standalone Live Map Definition editor
  - New RuntimeMap viewer SDK component

Modified: trunk/Tools/Maestro/Maestro.Base/Events/EventWatcher.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Events/EventWatcher.cs	2012-06-18 12:11:07 UTC (rev 6775)
+++ trunk/Tools/Maestro/Maestro.Base/Events/EventWatcher.cs	2012-06-18 12:18:44 UTC (rev 6776)
@@ -108,6 +108,8 @@
                                         Properties.Resources.Content_SiteExplorer, 
                                         ViewRegion.Left, 
                                         () => { return new SiteExplorer(); });
+
+                wb.ActiveSiteExplorer.ActiveConnectionChanged += new EventHandler(OnActiveConnectionChanged);
             }
 
             wb.ActiveSiteExplorer.RefreshModel(name);
@@ -118,5 +120,19 @@
 
             LoggingService.Info("There are now " + svc.GetConnectionNames().Count + " active connections"); //LOCALIZEME
         }
+
+        static void OnActiveConnectionChanged(object sender, EventArgs e)
+        {
+            var wb = Workbench.Instance;
+            var exp = wb.ActiveSiteExplorer;
+            if (exp != null)
+            {
+                wb.SetStatusLabel(string.Format(Properties.Resources.StatusActiveConnection, exp.ConnectionName));
+            }
+            else
+            {
+                wb.SetStatusLabel("");
+            }
+        }
     }
 }

Modified: trunk/Tools/Maestro/Maestro.Base/Properties/Resources.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Properties/Resources.Designer.cs	2012-06-18 12:11:07 UTC (rev 6775)
+++ trunk/Tools/Maestro/Maestro.Base/Properties/Resources.Designer.cs	2012-06-18 12:18:44 UTC (rev 6776)
@@ -2435,6 +2435,15 @@
             }
         }
         
+        /// <summary>
+        ///   Looks up a localized string similar to Active Connection: {0}.
+        /// </summary>
+        internal static string StatusActiveConnection {
+            get {
+                return ResourceManager.GetString("StatusActiveConnection", resourceCulture);
+            }
+        }
+        
         internal static System.Drawing.Bitmap system_monitor {
             get {
                 object obj = ResourceManager.GetObject("system_monitor", resourceCulture);

Modified: trunk/Tools/Maestro/Maestro.Base/Properties/Resources.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Properties/Resources.resx	2012-06-18 12:11:07 UTC (rev 6775)
+++ trunk/Tools/Maestro/Maestro.Base/Properties/Resources.resx	2012-06-18 12:18:44 UTC (rev 6776)
@@ -2685,4 +2685,7 @@
   <data name="TextReloadNewResource" xml:space="preserve">
     <value>Sorry, this is a newly created resource. The editor will close instead</value>
   </data>
+  <data name="StatusActiveConnection" xml:space="preserve">
+    <value>Active Connection: {0}</value>
+  </data>
 </root>
\ No newline at end of file

Modified: trunk/Tools/Maestro/Maestro.Base/UI/ISiteExplorer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/UI/ISiteExplorer.cs	2012-06-18 12:11:07 UTC (rev 6775)
+++ trunk/Tools/Maestro/Maestro.Base/UI/ISiteExplorer.cs	2012-06-18 12:18:44 UTC (rev 6776)
@@ -29,6 +29,10 @@
     public interface ISiteExplorer : IViewContent
     {
         /// <summary>
+        /// Raised when the active connection has changed
+        /// </summary>
+        event EventHandler ActiveConnectionChanged;
+        /// <summary>
         /// The name of the active <see cref="IServerConnection"/> associated with this site explorer. The active connection
         /// is the connection whose node or child nodes is currently selected
         /// </summary>

Modified: trunk/Tools/Maestro/Maestro.Base/UI/SiteExplorer.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/UI/SiteExplorer.Designer.cs	2012-06-18 12:11:07 UTC (rev 6775)
+++ trunk/Tools/Maestro/Maestro.Base/UI/SiteExplorer.Designer.cs	2012-06-18 12:18:44 UTC (rev 6776)
@@ -58,16 +58,17 @@
             this.trvResources.SelectedNode = null;
             this.trvResources.SelectionMode = Aga.Controls.Tree.TreeSelectionMode.MultiSameParent;
             this.trvResources.ShowNodeToolTips = true;
-            this.trvResources.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.trvResources_MouseDoubleClick);
-            this.trvResources.DragOver += new System.Windows.Forms.DragEventHandler(this.trvResources_DragOver);
-            this.trvResources.MouseClick += new System.Windows.Forms.MouseEventHandler(this.trvResources_MouseClick);
+            this.trvResources.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.trvResources_ItemDrag);
+            this.trvResources.SelectionChanged += new System.EventHandler(this.trvResources_SelectionChanged);
+            this.trvResources.Expanding += new System.EventHandler<Aga.Controls.Tree.TreeViewAdvEventArgs>(this.trvResources_Expanding);
+            this.trvResources.Expanded += new System.EventHandler<Aga.Controls.Tree.TreeViewAdvEventArgs>(this.trvResources_Expanded);
             this.trvResources.DragDrop += new System.Windows.Forms.DragEventHandler(this.trvResources_DragDrop);
-            this.trvResources.Expanding += new System.EventHandler<Aga.Controls.Tree.TreeViewAdvEventArgs>(this.trvResources_Expanding);
             this.trvResources.DragEnter += new System.Windows.Forms.DragEventHandler(this.trvResources_DragEnter);
+            this.trvResources.DragOver += new System.Windows.Forms.DragEventHandler(this.trvResources_DragOver);
+            this.trvResources.KeyDown += new System.Windows.Forms.KeyEventHandler(this.trvResources_KeyDown);
             this.trvResources.KeyUp += new System.Windows.Forms.KeyEventHandler(this.trvResources_KeyUp);
-            this.trvResources.KeyDown += new System.Windows.Forms.KeyEventHandler(this.trvResources_KeyDown);
-            this.trvResources.Expanded += new System.EventHandler<Aga.Controls.Tree.TreeViewAdvEventArgs>(this.trvResources_Expanded);
-            this.trvResources.ItemDrag += new System.Windows.Forms.ItemDragEventHandler(this.trvResources_ItemDrag);
+            this.trvResources.MouseClick += new System.Windows.Forms.MouseEventHandler(this.trvResources_MouseClick);
+            this.trvResources.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.trvResources_MouseDoubleClick);
             // 
             // rdResourceIcon
             // 

Modified: trunk/Tools/Maestro/Maestro.Base/UI/SiteExplorer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/UI/SiteExplorer.cs	2012-06-18 12:11:07 UTC (rev 6775)
+++ trunk/Tools/Maestro/Maestro.Base/UI/SiteExplorer.cs	2012-06-18 12:18:44 UTC (rev 6776)
@@ -72,6 +72,32 @@
             }
         }
 
+        public event EventHandler ActiveConnectionChanged;
+
+        private void OnActiveConnectionChanged()
+        {
+            var h = this.ActiveConnectionChanged;
+            if (h != null)
+                h(this, EventArgs.Empty);
+        }
+
+        private string _currentConnectionName;
+
+        private void trvResources_SelectionChanged(object sender, EventArgs e)
+        {
+            var connName = this.ConnectionName;
+            if (_currentConnectionName == null)
+            {
+                _currentConnectionName = connName;
+                OnActiveConnectionChanged();
+            }
+            else if (_currentConnectionName != connName)
+            {
+                _currentConnectionName = connName;
+                OnActiveConnectionChanged();
+            }
+        }
+
         public string ConnectionName
         {
             get

Modified: trunk/Tools/Maestro/Maestro.Base/UI/SiteExplorer.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/UI/SiteExplorer.resx	2012-06-18 12:11:07 UTC (rev 6775)
+++ trunk/Tools/Maestro/Maestro.Base/UI/SiteExplorer.resx	2012-06-18 12:18:44 UTC (rev 6776)
@@ -112,22 +112,22 @@
     <value>2.0</value>
   </resheader>
   <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
   <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
-  <metadata name="tsSiteExplorer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+  <metadata name="tsSiteExplorer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>0, 0</value>
   </metadata>
-  <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
   <data name="tsSiteExplorer.Location" type="System.Drawing.Point, System.Drawing">
     <value>0, 0</value>
   </data>
   <data name="tsSiteExplorer.Size" type="System.Drawing.Size, System.Drawing">
     <value>233, 25</value>
   </data>
-  <assembly alias="mscorlib" name="mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+  <assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
   <data name="tsSiteExplorer.TabIndex" type="System.Int32, mscorlib">
     <value>1</value>
   </data>
@@ -138,7 +138,7 @@
     <value>tsSiteExplorer</value>
   </data>
   <data name=">>tsSiteExplorer.Type" xml:space="preserve">
-    <value>System.Windows.Forms.ToolStrip, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Windows.Forms.ToolStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
   <data name=">>tsSiteExplorer.Parent" xml:space="preserve">
     <value>$this</value>
@@ -146,7 +146,7 @@
   <data name=">>tsSiteExplorer.ZOrder" xml:space="preserve">
     <value>1</value>
   </data>
-  <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+  <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
   <data name="trvResources.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
     <value>Fill</value>
   </data>
@@ -171,7 +171,7 @@
   <data name=">>trvResources.ZOrder" xml:space="preserve">
     <value>0</value>
   </data>
-  <metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
   <data name="$this.Size" type="System.Drawing.Size, System.Drawing">
@@ -193,6 +193,6 @@
     <value>SiteExplorer</value>
   </data>
   <data name=">>$this.Type" xml:space="preserve">
-    <value>Maestro.Base.ViewContentBase, Maestro.Base, Version=3.0.0.5610, Culture=neutral, PublicKeyToken=null</value>
+    <value>Maestro.Shared.UI.ViewContentBase, Maestro.Shared.UI, Version=5.0.0.6640, Culture=neutral, PublicKeyToken=f526c48929fda856</value>
   </data>
 </root>
\ No newline at end of file

Modified: trunk/Tools/Maestro/Maestro.Shared.UI/WorkbenchBase.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Shared.UI/WorkbenchBase.cs	2012-06-18 12:11:07 UTC (rev 6775)
+++ trunk/Tools/Maestro/Maestro.Shared.UI/WorkbenchBase.cs	2012-06-18 12:18:44 UTC (rev 6776)
@@ -43,9 +43,13 @@
 
         private IWorkbenchInitializer _workbenchInitializer;
 
-        protected WorkbenchBase(IWorkbenchInitializer init)
+        private WorkbenchBase()
         {
             InitializeComponent();
+        }
+
+        protected WorkbenchBase(IWorkbenchInitializer init) : this()
+        {
             _workbenchInitializer = init;
             _toolstrips = new Dictionary<string, ToolStrip>();
             _toolstripRegions = new Dictionary<string, ToolbarRegion>();



More information about the mapguide-commits mailing list