[mapguide-commits] r5635 - in trunk/Tools/Maestro: Maestro.Base
Maestro.Base/Commands/Test Maestro.Editors/Common
Maestro.Editors/FeatureSource/Providers/Gdal
Maestro.Editors/Properties OSGeo.MapGuide.MaestroAPI/Properties
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Thu Mar 17 07:05:38 EDT 2011
Author: jng
Date: 2011-03-17 04:05:38 -0700 (Thu, 17 Mar 2011)
New Revision: 5635
Modified:
trunk/Tools/Maestro/Maestro.Base/Commands/Test/OpenUnmanagedResourceCommand.cs
trunk/Tools/Maestro/Maestro.Base/Maestro.Base.addin
trunk/Tools/Maestro/Maestro.Editors/Common/UnmanagedFileBrowser.cs
trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Gdal/CompositeFileCtrl.Designer.cs
trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Gdal/CompositeFileCtrl.resx
trunk/Tools/Maestro/Maestro.Editors/Properties/Resources.Designer.cs
trunk/Tools/Maestro/Maestro.Editors/Properties/Resources.resx
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Properties/Resources.Designer.cs
trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Properties/Resources.resx
Log:
This submission includes the following changes:
- Fix #1632: Support selection of multiple files in the Unmanaged file browser. Add a test command to verify this functionality
- Small visual tweak for the GDAL raster feature source editor
- Clean up the default spatial context warning validation message
Modified: trunk/Tools/Maestro/Maestro.Base/Commands/Test/OpenUnmanagedResourceCommand.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Commands/Test/OpenUnmanagedResourceCommand.cs 2011-03-17 10:07:18 UTC (rev 5634)
+++ trunk/Tools/Maestro/Maestro.Base/Commands/Test/OpenUnmanagedResourceCommand.cs 2011-03-17 11:05:38 UTC (rev 5635)
@@ -46,4 +46,26 @@
}
}
}
+
+ public class OpenUnmanagedResourceMultipleCommand : AbstractMenuCommand
+ {
+ public override void Run()
+ {
+ var wb = Workbench.Instance;
+ var exp = wb.ActiveSiteExplorer;
+ var mgr = ServiceRegistry.GetService<ServerConnectionManager>();
+ var conn = mgr.GetConnection(exp.ConnectionName);
+
+ var picker = new UnmanagedFileBrowser(conn.ResourceService);
+ picker.AllowMultipleSelection = true;
+ if (picker.ShowDialog(wb) == System.Windows.Forms.DialogResult.OK)
+ {
+ MessageService.ShowMessage(string.Join(Environment.NewLine, picker.SelectedItems));
+ }
+ else
+ {
+ MessageService.ShowMessage("Cancelled");
+ }
+ }
+ }
}
Modified: trunk/Tools/Maestro/Maestro.Base/Maestro.Base.addin
===================================================================
--- trunk/Tools/Maestro/Maestro.Base/Maestro.Base.addin 2011-03-17 10:07:18 UTC (rev 5634)
+++ trunk/Tools/Maestro/Maestro.Base/Maestro.Base.addin 2011-03-17 11:05:38 UTC (rev 5635)
@@ -165,6 +165,9 @@
<MenuItem id="Menu_Test_OpenUnmanagedFile"
label="Open Unmanaged Resource"
class="Maestro.Base.Commands.Test.OpenUnmanagedResourceCommand" />
+ <MenuItem id="Menu_Test_OpenUnmanagedFileMultiple"
+ label="Open Multiple Unmanaged Resources"
+ class="Maestro.Base.Commands.Test.OpenUnmanagedResourceMultipleCommand" />
<MenuItem id="Menu_Test_SelectCoordSys"
label="Select Coordinate System"
class="Maestro.Base.Commands.Test.OpenCoordinateSystemPickerCommand" />
Modified: trunk/Tools/Maestro/Maestro.Editors/Common/UnmanagedFileBrowser.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Common/UnmanagedFileBrowser.cs 2011-03-17 10:07:18 UTC (rev 5634)
+++ trunk/Tools/Maestro/Maestro.Editors/Common/UnmanagedFileBrowser.cs 2011-03-17 11:05:38 UTC (rev 5635)
@@ -139,6 +139,21 @@
}
}
+ /// <summary>
+ /// Gets or sets whether multiple selections are allowed
+ /// </summary>
+ public bool AllowMultipleSelection
+ {
+ get { return lstResources.MultiSelect; }
+ set
+ {
+ if (value && this.SelectFoldersOnly)
+ throw new InvalidOperationException(Properties.Resources.UnmanagedBrowserMultiSelectionNotAllowed);
+
+ lstResources.MultiSelect = value;
+ }
+ }
+
private UnmanagedFileBrowser()
{
InitializeComponent();
@@ -165,13 +180,29 @@
{
get
{
- var path = txtItem.Text;
- var leftpart = path.Substring(0, path.IndexOf("]"));
- var rightpart = path.Substring(path.IndexOf("]") + 1);
- return "%MG_DATA_PATH_ALIAS" + leftpart + "]%" + rightpart;
+ return SelectedItems[0];
}
}
+ /// <summary>
+ /// Gets the selected items
+ /// </summary>
+ public string[] SelectedItems
+ {
+ get
+ {
+ List<string> items = new List<string>();
+ string[] tokens = txtItem.Text.Split('\t');
+ foreach (var path in tokens)
+ {
+ var leftpart = path.Substring(0, path.IndexOf("]"));
+ var rightpart = path.Substring(path.IndexOf("]") + 1);
+ items.Add("%MG_DATA_PATH_ALIAS" + leftpart + "]%" + rightpart);
+ }
+ return items.ToArray();
+ }
+ }
+
private void trvFolders_SelectionChanged(object sender, EventArgs e)
{
if (trvFolders.SelectedNode != null)
@@ -294,6 +325,15 @@
{
txtItem.Text = lstResources.SelectedItems[0].Name;
}
+ else
+ {
+ List<string> names = new List<string>();
+ foreach (ListViewItem item in lstResources.SelectedItems)
+ {
+ names.Add(item.Name);
+ }
+ txtItem.Text = string.Join("\t", names.ToArray());
+ }
}
private void txtFile_TextChanged(object sender, EventArgs e)
Modified: trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Gdal/CompositeFileCtrl.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Gdal/CompositeFileCtrl.Designer.cs 2011-03-17 10:07:18 UTC (rev 5634)
+++ trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Gdal/CompositeFileCtrl.Designer.cs 2011-03-17 11:05:38 UTC (rev 5635)
@@ -31,9 +31,6 @@
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CompositeFileCtrl));
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
- this.btnAdd = new System.Windows.Forms.ToolStripSplitButton();
- this.browseFilesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
- this.browseFolderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.btnDelete = new System.Windows.Forms.ToolStripButton();
this.lstView = new System.Windows.Forms.ListView();
this.imgList = new System.Windows.Forms.ImageList(this.components);
@@ -41,6 +38,9 @@
this.btnRebuild = new System.Windows.Forms.Button();
this.folderBrowserDialog = new System.Windows.Forms.FolderBrowserDialog();
this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
+ this.btnAdd = new System.Windows.Forms.ToolStripDropDownButton();
+ this.browseFilesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.browseFolderToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStrip1.SuspendLayout();
this.SuspendLayout();
//
@@ -55,33 +55,6 @@
this.toolStrip1.TabIndex = 0;
this.toolStrip1.Text = "toolStrip1";
//
- // btnAdd
- //
- this.btnAdd.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
- this.browseFilesToolStripMenuItem,
- this.browseFolderToolStripMenuItem});
- this.btnAdd.Image = global::Maestro.Editors.Properties.Resources.plus_circle;
- this.btnAdd.ImageTransparentColor = System.Drawing.Color.Magenta;
- this.btnAdd.Name = "btnAdd";
- this.btnAdd.Size = new System.Drawing.Size(61, 22);
- this.btnAdd.Text = "Add";
- //
- // browseFilesToolStripMenuItem
- //
- this.browseFilesToolStripMenuItem.Image = global::Maestro.Editors.Properties.Resources.document;
- this.browseFilesToolStripMenuItem.Name = "browseFilesToolStripMenuItem";
- this.browseFilesToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
- this.browseFilesToolStripMenuItem.Text = "Browse Files";
- this.browseFilesToolStripMenuItem.Click += new System.EventHandler(this.browseFilesToolStripMenuItem_Click);
- //
- // browseFolderToolStripMenuItem
- //
- this.browseFolderToolStripMenuItem.Image = global::Maestro.Editors.Properties.Resources.folder_horizontal;
- this.browseFolderToolStripMenuItem.Name = "browseFolderToolStripMenuItem";
- this.browseFolderToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
- this.browseFolderToolStripMenuItem.Text = "Browse Folder";
- this.browseFolderToolStripMenuItem.Click += new System.EventHandler(this.browseFolderToolStripMenuItem_Click);
- //
// btnDelete
//
this.btnDelete.Enabled = false;
@@ -140,6 +113,33 @@
//
this.openFileDialog.Multiselect = true;
//
+ // btnAdd
+ //
+ this.btnAdd.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.browseFilesToolStripMenuItem,
+ this.browseFolderToolStripMenuItem});
+ this.btnAdd.Image = global::Maestro.Editors.Properties.Resources.plus_circle;
+ this.btnAdd.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.btnAdd.Name = "btnAdd";
+ this.btnAdd.Size = new System.Drawing.Size(58, 22);
+ this.btnAdd.Text = "Add";
+ //
+ // browseFilesToolStripMenuItem
+ //
+ this.browseFilesToolStripMenuItem.Image = global::Maestro.Editors.Properties.Resources.document;
+ this.browseFilesToolStripMenuItem.Name = "browseFilesToolStripMenuItem";
+ this.browseFilesToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+ this.browseFilesToolStripMenuItem.Text = "Browse Files";
+ this.browseFilesToolStripMenuItem.Click += new System.EventHandler(this.browseFilesToolStripMenuItem_Click);
+ //
+ // browseFolderToolStripMenuItem
+ //
+ this.browseFolderToolStripMenuItem.Image = global::Maestro.Editors.Properties.Resources.folder_horizontal;
+ this.browseFolderToolStripMenuItem.Name = "browseFolderToolStripMenuItem";
+ this.browseFolderToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
+ this.browseFolderToolStripMenuItem.Text = "Browse Folder";
+ this.browseFolderToolStripMenuItem.Click += new System.EventHandler(this.browseFolderToolStripMenuItem_Click);
+ //
// CompositeFileCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -163,12 +163,12 @@
private System.Windows.Forms.ListView lstView;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button btnRebuild;
- private System.Windows.Forms.ToolStripSplitButton btnAdd;
private System.Windows.Forms.ToolStripButton btnDelete;
private System.Windows.Forms.ImageList imgList;
+ private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog;
+ private System.Windows.Forms.OpenFileDialog openFileDialog;
+ private System.Windows.Forms.ToolStripDropDownButton btnAdd;
private System.Windows.Forms.ToolStripMenuItem browseFilesToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem browseFolderToolStripMenuItem;
- private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog;
- private System.Windows.Forms.OpenFileDialog openFileDialog;
}
}
Modified: trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Gdal/CompositeFileCtrl.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Gdal/CompositeFileCtrl.resx 2011-03-17 10:07:18 UTC (rev 5634)
+++ trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Gdal/CompositeFileCtrl.resx 2011-03-17 11:05:38 UTC (rev 5635)
@@ -128,7 +128,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADQ
- BwAAAk1TRnQBSQFMAwEBAAFAAQABQAEAARABAAEQAQAE/wEJAQAI/wFCAU0BNgEEBgABNgEEAgABKAMA
+ BwAAAk1TRnQBSQFMAwEBAAFIAQABSAEAARABAAEQAQAE/wEJAQAI/wFCAU0BNgEEBgABNgEEAgABKAMA
AUADAAEQAwABAQEAAQgGAAEEGAABgAIAAYADAAKAAQABgAMAAYABAAGAAQACgAIAA8ABAAHAAdwBwAEA
AfABygGmAQABMwUAATMBAAEzAQABMwEAAjMCAAMWAQADHAEAAyIBAAMpAQADVQEAA00BAANCAQADOQEA
AYABfAH/AQACUAH/AQABkwEAAdYBAAH/AewBzAEAAcYB1gHvAQAB1gLnAQABkAGpAa0CAAH/ATMDAAFm
Modified: trunk/Tools/Maestro/Maestro.Editors/Properties/Resources.Designer.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Properties/Resources.Designer.cs 2011-03-17 10:07:18 UTC (rev 5634)
+++ trunk/Tools/Maestro/Maestro.Editors/Properties/Resources.Designer.cs 2011-03-17 11:05:38 UTC (rev 5635)
@@ -2583,6 +2583,15 @@
}
/// <summary>
+ /// Looks up a localized string similar to Multiple selection is not allowed when SelectFoldersOnly is set to true.
+ /// </summary>
+ internal static string UnmanagedBrowserMultiSelectionNotAllowed {
+ get {
+ return ResourceManager.GetString("UnmanagedBrowserMultiSelectionNotAllowed", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to Updating Configuration Document.
/// </summary>
internal static string UpdatingConfiguration {
Modified: trunk/Tools/Maestro/Maestro.Editors/Properties/Resources.resx
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Properties/Resources.resx 2011-03-17 10:07:18 UTC (rev 5634)
+++ trunk/Tools/Maestro/Maestro.Editors/Properties/Resources.resx 2011-03-17 11:05:38 UTC (rev 5635)
@@ -1139,4 +1139,7 @@
<data name="WidgetNameExists" xml:space="preserve">
<value>A widget named {0} already exists</value>
</data>
+ <data name="UnmanagedBrowserMultiSelectionNotAllowed" xml:space="preserve">
+ <value>Multiple selection is not allowed when SelectFoldersOnly is set to true</value>
+ </data>
</root>
\ No newline at end of file
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Properties/Resources.Designer.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Properties/Resources.Designer.cs 2011-03-17 10:07:18 UTC (rev 5634)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Properties/Resources.Designer.cs 2011-03-17 11:05:38 UTC (rev 5635)
@@ -413,7 +413,7 @@
}
/// <summary>
- /// Looks up a localized string similar to Spatial context extent appears to be invalid (or default).
+ /// Looks up a localized string similar to Spatial context extent appears to be invalid (or is the default extent returned by FDO provider. Meaning it very likely does not truly represent the extent of your data).
/// </summary>
internal static string FS_DefaultSpatialContextWarning {
get {
Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Properties/Resources.resx
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Properties/Resources.resx 2011-03-17 10:07:18 UTC (rev 5634)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/Properties/Resources.resx 2011-03-17 11:05:38 UTC (rev 5635)
@@ -190,7 +190,7 @@
<comment>An error message that is displayed if a connection test on the feature source failed</comment>
</data>
<data name="FS_DefaultSpatialContextWarning" xml:space="preserve">
- <value>Spatial context extent appears to be invalid (or default)</value>
+ <value>Spatial context extent appears to be invalid (or is the default extent returned by FDO provider. Meaning it very likely does not truly represent the extent of your data)</value>
<comment>A warning message that is displayed if the spatial context has the default extent</comment>
</data>
<data name="FS_EmptySpatialContextWarning" xml:space="preserve">
More information about the mapguide-commits
mailing list