From: <lk...@us...> - 2007-08-08 10:14:02
|
Revision: 812 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=812&view=rev Author: lkuech Date: 2007-08-08 03:14:00 -0700 (Wed, 08 Aug 2007) Log Message: ----------- Added Paths: ----------- trunk/plugins/WorldMap/GUIWorldMap.csproj trunk/plugins/WorldMap/MAPS/ trunk/plugins/WorldMap/MAPS/ImageFunctions.cs trunk/plugins/WorldMap/MAPS/MapFunctions.cs trunk/plugins/WorldMap/MAPS/MapTile.cs trunk/plugins/WorldMap/MAPS/MapTiles.cs trunk/plugins/WorldMap/MAPS/SearchGeoCodes.cs trunk/plugins/WorldMap/MAPS/ThreadedDownload.cs trunk/plugins/WorldMap/MAPS/TileCacheDatabase.cs trunk/plugins/WorldMap/NewVirtualKeyboard.cs trunk/plugins/WorldMap/PlugInBase.cs trunk/plugins/WorldMap/Properties/ trunk/plugins/WorldMap/Properties/AssemblyInfo.cs trunk/plugins/WorldMap/Properties/Resources.Designer.cs trunk/plugins/WorldMap/Properties/Resources.resx trunk/plugins/WorldMap/Resources/ trunk/plugins/WorldMap/Settings.cs trunk/plugins/WorldMap/WorldMap.cs trunk/plugins/WorldMap/WorldMapSearchResults.cs trunk/plugins/WorldMap/WorldmapConfig.Designer.cs trunk/plugins/WorldMap/WorldmapConfig.cs trunk/plugins/WorldMap/WorldmapConfig.resx trunk/plugins/WorldMap/WorldmapMenu.cs trunk/plugins/WorldMap/WorldmapSearch.cs trunk/plugins/WorldMap/mediaTemplates/ trunk/plugins/WorldMap/mediaTemplates/Thumbs.db trunk/plugins/WorldMap/mediaTemplates/WMprogressBarActive.png trunk/plugins/WorldMap/mediaTemplates/WMprogressBarActive.pspimage trunk/plugins/WorldMap/skinFiles/ trunk/plugins/WorldMap/skinFiles/BlueTwo/ trunk/plugins/WorldMap/skinFiles/BlueTwo/Media/ trunk/plugins/WorldMap/skinFiles/BlueTwo/Media/WMIPBlocked.jpeg trunk/plugins/WorldMap/skinFiles/BlueTwo/Media/WMTileNotAvailable.jpeg trunk/plugins/WorldMap/skinFiles/BlueTwo/Media/WMTilePlaceholder.jpeg trunk/plugins/WorldMap/skinFiles/BlueTwo/Media/WMprogressBarActive.png trunk/plugins/WorldMap/skinFiles/BlueTwo/Media/WMprogressBarQueued.png trunk/plugins/WorldMap/skinFiles/BlueTwo/Media/WMprogressDummy.png trunk/plugins/WorldMap/skinFiles/BlueTwo/Media/hover_worldmap.png trunk/plugins/WorldMap/skinFiles/BlueTwo/MyWorldMap.xml trunk/plugins/WorldMap/skinFiles/BlueTwo/MyWorldmapMenu.xml trunk/plugins/WorldMap/skinFiles/BlueTwo/MyWorldmapSearch.xml trunk/plugins/WorldMap/skinFiles/BlueTwo/MyWorldmapSearchResults.xml trunk/plugins/WorldMap/skinFiles/BlueTwo wide/ trunk/plugins/WorldMap/skinFiles/BlueTwo wide/Media/ trunk/plugins/WorldMap/skinFiles/BlueTwo wide/Media/WMIPBlocked.jpeg trunk/plugins/WorldMap/skinFiles/BlueTwo wide/Media/WMTileNotAvailable.jpeg trunk/plugins/WorldMap/skinFiles/BlueTwo wide/Media/WMTilePlaceholder.jpeg trunk/plugins/WorldMap/skinFiles/BlueTwo wide/Media/WMprogressBarActive.png trunk/plugins/WorldMap/skinFiles/BlueTwo wide/Media/WMprogressBarQueued.png trunk/plugins/WorldMap/skinFiles/BlueTwo wide/Media/WMprogressDummy.png trunk/plugins/WorldMap/skinFiles/BlueTwo wide/Media/hover_worldmap.png trunk/plugins/WorldMap/skinFiles/BlueTwo wide/MyWorldMap.xml trunk/plugins/WorldMap/skinFiles/BlueTwo wide/MyWorldmapMenu.xml trunk/plugins/WorldMap/skinFiles/BlueTwo wide/MyWorldmapSearch.xml trunk/plugins/WorldMap/skinFiles/BlueTwo wide/MyWorldmapSearchResults.xml Added: trunk/plugins/WorldMap/GUIWorldMap.csproj =================================================================== --- trunk/plugins/WorldMap/GUIWorldMap.csproj (rev 0) +++ trunk/plugins/WorldMap/GUIWorldMap.csproj 2007-08-08 10:14:00 UTC (rev 812) @@ -0,0 +1,109 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{857D8A0C-FB95-4A26-8ED6-8E51586D2116}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>GUIWorldmap</RootNamespace> + <AssemblyName>GUIWorldmap</AssemblyName> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="Core, Version=0.2.2.0, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\Core\bin\Debug\Core.dll</HintPath> + </Reference> + <Reference Include="Dialogs, Version=0.0.0.0, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\Dialogs\bin\Debug\Dialogs.dll</HintPath> + </Reference> + <Reference Include="Microsoft.DirectX, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> + <Reference Include="Microsoft.DirectX.Direct3D, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> + <Reference Include="Microsoft.DirectX.Direct3DX, Version=1.0.2911.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> + <Reference Include="Microsoft.DirectX.DirectDraw, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Data.SQLite, Version=1.0.41.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>bin\Debug\System.Data.SQLite.DLL</HintPath> + </Reference> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + <Reference Include="Utils, Version=2.1.2.0, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\Utils\bin\Debug\Utils.dll</HintPath> + </Reference> + </ItemGroup> + <ItemGroup> + <Compile Include="Properties\Resources.Designer.cs"> + <AutoGen>True</AutoGen> + <DesignTime>True</DesignTime> + <DependentUpon>Resources.resx</DependentUpon> + </Compile> + <Compile Include="WorldmapConfig.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="WorldmapConfig.Designer.cs"> + <DependentUpon>WorldmapConfig.cs</DependentUpon> + </Compile> + <Compile Include="MAPS\ImageFunctions.cs" /> + <Compile Include="MAPS\MapFunctions.cs" /> + <Compile Include="MAPS\MapTile.cs" /> + <Compile Include="MAPS\MapTiles.cs" /> + <Compile Include="MAPS\SearchGeoCodes.cs" /> + <Compile Include="MAPS\ThreadedDownload.cs" /> + <Compile Include="MAPS\TileCacheDatabase.cs" /> + <Compile Include="NewVirtualKeyboard.cs" /> + <Compile Include="Settings.cs" /> + <Compile Include="WorldMap.cs" /> + <Compile Include="PlugInBase.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="WorldmapMenu.cs" /> + <Compile Include="WorldmapSearch.cs" /> + <Compile Include="WorldMapSearchResults.cs" /> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="WorldmapConfig.resx"> + <SubType>Designer</SubType> + <DependentUpon>WorldmapConfig.cs</DependentUpon> + </EmbeddedResource> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="Properties\Resources.resx"> + <SubType>Designer</SubType> + <Generator>ResXFileCodeGenerator</Generator> + <LastGenOutput>Resources.Designer.cs</LastGenOutput> + </EmbeddedResource> + </ItemGroup> + <ItemGroup> + <Folder Include="Resources\" /> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file Added: trunk/plugins/WorldMap/MAPS/ImageFunctions.cs =================================================================== --- trunk/plugins/WorldMap/MAPS/ImageFunctions.cs (rev 0) +++ trunk/plugins/WorldMap/MAPS/ImageFunctions.cs 2007-08-08 10:14:00 UTC (rev 812) @@ -0,0 +1,77 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using System.Drawing.Drawing2D; + +namespace MAPS +{ + class ImageFunctions + { + public static Bitmap MergeBitmaps(Bitmap Background, Bitmap Overlay) + { + Graphics graphics = Graphics.FromImage(Background); + graphics.DrawImage(Overlay, 0, 0, Background.Width, Background.Height); + + return new Bitmap(Background); + } + + public static Bitmap GetUpperLeftPart(Bitmap Tile) + { + Bitmap tmpBitmap = new Bitmap(256,256); + Graphics graphic = Graphics.FromImage(tmpBitmap); + + Rectangle tmpDestRect = new Rectangle(0,0,Tile.Width,Tile.Height);; + Rectangle tmpSourceRect = new Rectangle(0, 0, 128, 128); + + graphic.DrawImage(tmpBitmap,tmpDestRect,0,0,128,128,GraphicsUnit.Pixel); + //(Tile, 0, 0, tmpSourceRect, GraphicsUnit.Pixel) + + return tmpBitmap; + } + + public static Bitmap GetUpperRightPart(Bitmap Tile) + { + Bitmap tmpBitmap = new Bitmap(256, 256); + Graphics graphic = Graphics.FromImage(tmpBitmap); + + Rectangle tmpDestRect = new Rectangle(0, 0, Tile.Width, Tile.Height); ; + Rectangle tmpSourceRect = new Rectangle(129, 0, 256, 128); + + graphic.DrawImage(tmpBitmap, tmpDestRect, 129, 0, 256, 128, GraphicsUnit.Pixel); + + return tmpBitmap; + + } + + public static Bitmap GetLowerLeftPart(Bitmap Tile) + { + Bitmap tmpBitmap = new Bitmap(256, 256); + Graphics graphic = Graphics.FromImage(tmpBitmap); + + Rectangle tmpDestRect = new Rectangle(0, 0, Tile.Width, Tile.Height); ; + Rectangle tmpSourceRect = new Rectangle(0, 129, 128, 256); + + graphic.DrawImage(tmpBitmap, tmpDestRect, 0, 129, 128, 256, GraphicsUnit.Pixel); + + return tmpBitmap; + } + + public static Bitmap GetLowerRightPart(Bitmap Tile) + { + Bitmap tmpBitmap = new Bitmap(256, 256); + Graphics graphic = Graphics.FromImage(tmpBitmap); + + Rectangle tmpDestRect = new Rectangle(0, 0, Tile.Width, Tile.Height); ; + Rectangle tmpSourceRect = new Rectangle(129, 129, 256, 256); + + graphic.DrawImage(tmpBitmap, tmpDestRect, 129, 129, 256, 256, GraphicsUnit.Pixel); + + return tmpBitmap; + } + + + } +} + + Added: trunk/plugins/WorldMap/MAPS/MapFunctions.cs =================================================================== --- trunk/plugins/WorldMap/MAPS/MapFunctions.cs (rev 0) +++ trunk/plugins/WorldMap/MAPS/MapFunctions.cs 2007-08-08 10:14:00 UTC (rev 812) @@ -0,0 +1,434 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace MAPS +{ + public class MapFunctions + { + public enum MapType + { + GMRoad, + GMAerial, + GMHybrid, + VERoad, + VEAerial, + VEHybrid + } + + public static MapType GetNextMapType(MapType currentMapType) + { + Array tmpMapTypes = Enum.GetValues(typeof(MapFunctions.MapType)); + int IntMapType = Convert.ToInt32(currentMapType); + IntMapType++; + if (IntMapType > tmpMapTypes.Length - 1) IntMapType = 0; + return (MapFunctions.MapType)(Enum.ToObject(typeof(MapFunctions.MapType), IntMapType)); + } + + public static MapType GetNextRoadMap(MapType currentMapType) + { + if (currentMapType == MapType.GMAerial || currentMapType == MapType.GMHybrid) return MapType.GMRoad; + if (currentMapType == MapType.VEAerial || currentMapType == MapType.VEHybrid) return MapType.VERoad; + if (currentMapType == MapType.GMRoad) return MapType.VERoad; + + return MapType.GMRoad; + } + + public static MapType GetNextSateliteMap(MapType currentMapType) + { + if (currentMapType == MapType.GMRoad || currentMapType == MapType.GMHybrid) return MapType.GMAerial; + if (currentMapType == MapType.VERoad || currentMapType == MapType.VEHybrid) return MapType.VEAerial; + if (currentMapType == MapType.GMAerial) return MapType.VEAerial; + + return MapType.GMAerial; + } + + public static MapType GetNextHybridMap(MapType currentMapType) + { + if (currentMapType == MapType.GMAerial || currentMapType == MapType.GMRoad) return MapType.GMHybrid; + if (currentMapType == MapType.VEAerial || currentMapType == MapType.VERoad) return MapType.VEHybrid; + if (currentMapType == MapType.GMHybrid) return MapType.VEHybrid; + + return MapType.GMHybrid; + } + + /// <summary> + /// Get the vertical tile number from a latitude using mercator ptrojection formula + /// </summary> + public static int ConvertLatitudeToTileY(double latitude, int zoomLevel) + { + double maxlat = Math.PI; + + double lat = latitude; + + if (lat > 90) lat = lat - 180; + if (lat < -90) lat = lat + 180; + + // conversion degre=>radians + double phi = Math.PI * lat / 180; + + double res; + //double temp = Math.Tan(Math.PI / 4 - phi / 2); + //res = Math.Log(temp); + res = 0.5 * Math.Log((1 + Math.Sin(phi)) / (1 - Math.Sin(phi))); + double maxTileY = Math.Pow(2, zoomLevel); + int result = (int)(((1 - res / maxlat) / 2) * (maxTileY)); + + return (result); + } + + /// <summary> + /// Get the horizontal tile number from a longitude using mercator ptrojection formula + /// </summary> + public static int ConvertLongitudeToTileX(double longitude, int zoomLevel) + { + if (longitude > 180) + { + longitude = longitude - 360; + } + if (longitude < -180) + { + longitude = longitude + 360; + } + + double res = (longitude + 180) / 360; + return (int)(res * Math.Pow(2, zoomLevel)); + } + + /// <summary> + /// get latitude/longitude mini of a tile + /// </summary> + //private PointF getMinBounds(int numlat, int numlong, int zoom) + //{ + // PointF res = new PointF(); + + // double maxlat = Math.PI; + // double maxTile = Math.Pow(2, zoom); + // double numlatrel = maxlat * (1 - 2 * ((numlat + 1) / maxTile)); + + // res.Y = (float)((2 * Math.Atan(Math.Exp(numlatrel)) - Math.PI / 2) * 180 / Math.PI); + // res.X = (float)(360 * (numlong / maxTile) - 180); + // return res; + //} + + /** get latitude/longitude maxi of a tile*/ + //private PointF getMaxBounds(int numlat, int numlong, int zoom) + //{ + // PointF res = new PointF(); + // double maxlat = Math.PI; + // double maxTile = Math.Pow(2, zoom); + // double numlatrel = maxlat * (1 - 2 * (numlat / maxTile)); + + // res.Y = (float)((2 * Math.Atan(Math.Exp(numlatrel)) - Math.PI / 2) * 180 / Math.PI); + // res.X = (float)(360 * (numlong + 1) / maxTile - 180); + // return res; + //} + + + public static double ConvertTileXToLongitude(int TileX, int ZoomLevel) + { + double maxTile = Math.Pow(2, ZoomLevel); + return (float)(360 * (TileX ) / maxTile - 180); + } + + public static double ConvertTileYToLatitude(int TileY, int ZoomLevel) + { + double maxlat = Math.PI; + double maxTile = Math.Pow(2, ZoomLevel); + double numlatrel = maxlat * (1 - 2 * (TileY / maxTile)); + + return (float)((2 * Math.Atan(Math.Exp(numlatrel)) - Math.PI / 2) * 180 / Math.PI); + } + + public static double ConvertZoomLevelToTileSizeDegree(int zoomLevel) + { + double LevelTileSizeDegrees = 360; + + for (int i = 1; i <= zoomLevel; i++) + { + LevelTileSizeDegrees /= 2; + } + return LevelTileSizeDegrees; + } + + public static int ConvertTileSizeDegreeToZoomLevel(double TileSizeDegree) + { + int zoomLevel = 0; + while (TileSizeDegree < 360) + { + TileSizeDegree *= 2; + zoomLevel++; + } + return zoomLevel; + } + + public static string GetGMapSatUrl(double Longitude, double Latitude, int zoomLevel, ref MapConfig curConfig) + { + return GetGMapSatUrl(ConvertLongitudeToTileX(Longitude, zoomLevel), ConvertLatitudeToTileY(Latitude, zoomLevel), zoomLevel, ref curConfig); + } + + public static string GetGMapSatUrl(int TileX, int TileY, int zoomLevel, ref MapConfig curConfig) + { + string tileCode = GetGMapSatUrlTileCode(TileX, TileY, zoomLevel); + if(tileCode=="") return ""; + + int servNum = -1; + + try + { + switch (tileCode[tileCode.Length - 1]) + { + case 'q': servNum = 0; + break; + case 'r': servNum = 1; + break; + case 's': servNum = 2; + break; + case 't': servNum = 3; + break; + } + } + catch (Exception err) + { } + + string StringServNum; + if (servNum == -1) StringServNum = ""; + else StringServNum = servNum.ToString(); + + string fullurl = string.Format(curConfig.GMAUrl,StringServNum, tileCode); + if (tileCode == "transparent") + { + //fullurl = "http://www.google.com/intl/en_ALL/mapfiles/transparent.png"; + fullurl = "***"; + } + return fullurl; + } + + public static string GetGMapSatUrlTileCode(int TileX, int TileY, int zoomLevel) + { + string tileid = "t"; + double halflat = TileY; /**/ + double locxmin, locxmax, locymin, locymax, locxmoy, locymoy; + + locxmin = 0; locxmax = Math.Pow(2, zoomLevel); + locymin = 0; locymax = Math.Pow(2, zoomLevel); + + for (int i = 0; i < zoomLevel; i++) + { + locxmoy = (locxmax + locxmin) / 2; + locymoy = (locymax + locymin) / 2; + if ((halflat < locymin) || + (halflat > locymax) || + (TileX < locxmin) || + (TileX > locxmax)) + { + return ("transparent"); + } + if (halflat < locymoy) + { + locymax = locymoy; + if (TileX < locxmoy) + { /*q quadrant (top left)*/ + tileid += "q"; + locxmax = locxmoy; + } + else + {/*r quadrant (top right)*/ + tileid += "r"; + locxmin = locxmoy; + } + } + else + { + locymin = locymoy; + if (TileX < locxmoy) + { /*t quadrant (bottom right)*/ + tileid += "t"; + locxmax = locxmoy; + } + else + {/*s quadrant (bottom left)*/ + tileid += "s"; + locxmin = locxmoy; + } + } + } + return tileid; + + + } + + public static string GetGMapUrl(int TileX, int TileY, int zoomLevel, ref MapConfig curConfig) + { + string tileCode = GetGMapSatUrlTileCode(TileX, TileY, zoomLevel); + if (tileCode == "") return ""; + + int servNum = -1; + + try + { + switch (tileCode[tileCode.Length - 1]) + { + case 'q': servNum = 0; + break; + case 'r': servNum = 1; + break; + case 's': servNum = 2; + break; + case 't': servNum = 3; + break; + } + } + catch (Exception err) + { } + + string StringServNum; + if (servNum == -1) StringServNum = ""; + else StringServNum = servNum.ToString(); + + string TileCode = GetGMapTileCode(TileX, TileY, zoomLevel); + string[] urltab = TileCode.Split('_'); + string fullurl = string.Format(curConfig.GMRUrl, StringServNum, urltab[0],urltab[1],urltab[2]); + return fullurl; + + } + + public static string GetGHybridOverlayUrl(int TileX, int TileY, int zoomLevel, ref MapConfig curConfig) + { + string tileCode = GetGMapSatUrlTileCode(TileX, TileY, zoomLevel); + if (tileCode == "") return ""; + + int servNum = -1; + + try + { + switch (tileCode[tileCode.Length - 1]) + { + case 'q': servNum = 0; + break; + case 'r': servNum = 1; + break; + case 's': servNum = 2; + break; + case 't': servNum = 3; + break; + } + } + catch (Exception err) + { } + + string StringServNum; + if (servNum == -1) StringServNum = ""; + else StringServNum = servNum.ToString(); + + string TileCode = GetGMapTileCode(TileX, TileY, zoomLevel); + string[] urltab = TileCode.Split('_'); + string fullurl = string.Format(curConfig.GMHUrl, StringServNum, urltab[0], urltab[1], urltab[2]); // a small "t" make the big differens + return fullurl; + } + + public static string GetGMapTileCode(int TileX, int TileY, int zoomLevel) + { + int localzoom = (17 - zoomLevel); + string tileid = ""; + double numLong = (int)TileX; + double numLat = (int)TileY; + tileid = numLong.ToString() + "_" + ((int)numLat).ToString() + "_" + localzoom.ToString(); + return tileid; + } + + public static string GetGMTileUrl(MapType mapType, int TileX, int TileY, int zoomLevel, ref MapConfig curConfig) + { + string url = null; + switch (mapType) + { + case MapType.GMRoad: url = GetGMapUrl(TileX, TileY, zoomLevel, ref curConfig); + break; + case MapType.GMAerial: url = GetGMapSatUrl(TileX, TileY, zoomLevel, ref curConfig); + break; + case MapType.GMHybrid: url = GetGMapSatUrl(TileX, TileY, zoomLevel, ref curConfig); + break; + } + return url; + } + + public static string GetVETileUrl(MapType mapType, int TileX, int TileY, int zoomLevel, ref MapConfig curConfig) + { + string url = null; + string mapTypePreFix = null; + string mapExtension = null; + switch (mapType) + { + case MapType.VERoad: + { + mapTypePreFix = "r"; + mapExtension = ".png"; + } + break; + case MapType.VEAerial: + { + mapTypePreFix = "a"; + mapExtension = ".jpeg"; + } + break; + case MapType.VEHybrid: + { + mapTypePreFix = "h"; + mapExtension = ".jpeg"; + } + break; + } + + string quadKey = VETileToQuadKey(TileX, TileY, zoomLevel); + try + { + url = string.Format(curConfig.VEUrl, mapTypePreFix, quadKey[quadKey.Length - 1], quadKey, mapExtension); + } + catch(Exception err) + { } + return url; + } + + public static string VETileToQuadKey(int TileX, int TileY, int zoomLevel) + { + string quad = ""; + + for (int i = zoomLevel; i > 0; i--) + { + int mask = 1 << (i - 1); + int cell = 0; + + if ((TileX & mask) != 0) + { + cell++; + } + + if ((TileY & mask) != 0) + { + cell += 2; + } + quad += cell; + } + return quad; + } + + public static string GetTileUrl(MapType mapType, int TileX, int TileY, int zoomLevel, ref MapConfig curConfig) + { + string url = null; + + switch (mapType) + { + case MapType.GMAerial: + case MapType.GMHybrid: + case MapType.GMRoad: url = GetGMTileUrl(mapType,TileX,TileY,zoomLevel, ref curConfig); + break; + case MapType.VERoad: + case MapType.VEAerial: + case MapType.VEHybrid: url = GetVETileUrl(mapType, TileX, TileY, zoomLevel, ref curConfig); + break; + } + + return url; + } + } +} Added: trunk/plugins/WorldMap/MAPS/MapTile.cs =================================================================== --- trunk/plugins/WorldMap/MAPS/MapTile.cs (rev 0) +++ trunk/plugins/WorldMap/MAPS/MapTile.cs 2007-08-08 10:14:00 UTC (rev 812) @@ -0,0 +1,120 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; + +namespace MAPS +{ + public delegate void ImageChangedEventHandler(object sender, ImageChangedEventArgs e); + + public class ImageChangedEventArgs : EventArgs + { + private int TileX, TileY, ZoomMode; + public ImageChangedEventArgs(int tileX, int tileY, int zoomMode) + { + this.TileX = tileX; + this.TileY = tileY; + this.ZoomMode = zoomMode; + } + } + + public class MapTile + { + public event ImageChangedEventHandler ImageChangedEvent; + + protected virtual void OnImageChangedEvent(ImageChangedEventArgs e) + { + ImageChangedEvent(this, e); + } + + MapFunctions.MapType _mapType; + private int _PosX; + private int _PosY; + private int _ZoomLevel; + private double _LeftLongitude; + private double _RightLongitude; + private double _TopLatitude; + private double _BottomLatitude; + private double _TileWidthDegree; + private double _TileHeightDegree; + + private Bitmap _Image; + + public MapFunctions.MapType MapType + { + get { return _mapType; } + } + public int PosX + { + get { return _PosX; } + } + public int PosY + { + get { return _PosY; } + } + public int ZoomLevel + { + get { return _ZoomLevel; } + } + public double LeftLongitude + { + get { return _LeftLongitude; } + } + public double RigthLongitude + { + get { return _RightLongitude; } + } + public double TopLatitude + { + get { return _TopLatitude; } + } + public double BottomLatitude + { + get { return _BottomLatitude; } + } + public double TileWidthDegree + { + get { return _TileWidthDegree; } + } + public double TileHeightDegree + { + get { return _TileHeightDegree; } + } + public Bitmap Image + { + get { return _Image;} + set + { + _Image = value; + OnImageChangedEvent(new ImageChangedEventArgs(_PosX, _PosY, _ZoomLevel)); + } + } + + public MapTile(MapFunctions.MapType mapType, int TileX, int TileY, int ZoomLevel) + { + _mapType = mapType; + + _PosX = TileX; + _PosY = TileY; + + _ZoomLevel = ZoomLevel; + _TileWidthDegree = MapFunctions.ConvertZoomLevelToTileSizeDegree(_ZoomLevel); + + _LeftLongitude = MapFunctions.ConvertTileXToLongitude(_PosX, _ZoomLevel); + _RightLongitude = MapFunctions.ConvertTileXToLongitude(_PosX+1, _ZoomLevel); + + _TopLatitude = MapFunctions.ConvertTileYToLatitude(_PosY, _ZoomLevel); + _BottomLatitude = MapFunctions.ConvertTileYToLatitude(_PosY+1, _ZoomLevel); + + _TileWidthDegree = RigthLongitude - LeftLongitude; + if (_TileWidthDegree < 0) _TileWidthDegree *= -1; + + _TileHeightDegree = BottomLatitude - TopLatitude; + if (_TileHeightDegree < 0) _TileHeightDegree *= -1; + + _Image = new Bitmap(256, 256); + + } + + } +} Added: trunk/plugins/WorldMap/MAPS/MapTiles.cs =================================================================== --- trunk/plugins/WorldMap/MAPS/MapTiles.cs (rev 0) +++ trunk/plugins/WorldMap/MAPS/MapTiles.cs 2007-08-08 10:14:00 UTC (rev 812) @@ -0,0 +1,198 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Drawing; +using System.Threading; + +namespace MAPS +{ + public class MapConfig + { + public string CacheFolder; + public int ThreadCountGMR; + public int ThreadCountGMA; + public int ThreadCountGMH; + public int ThreadCountVER; + public int ThreadCountVEA; + public int ThreadCountVEH; + public int DaysToKeepCachedDetailedTiles; + public int DaysToKeepCachedOverviewTiles; + public string GMAUrl; + public string GMRUrl; + public string GMHUrl; + public string VEUrl; + public Bitmap TileNotAvailable; + public Bitmap IPBlocked; + public Bitmap DownloadPlaceholder; + + public MapConfig() + { + CacheFolder = "C:\\"; + ThreadCountGMR = 4; + ThreadCountGMA = 1; + ThreadCountGMH = 1; + ThreadCountVER = 5; + ThreadCountVEA = 5; + ThreadCountVEH = 5; + DaysToKeepCachedDetailedTiles = 30; + DaysToKeepCachedDetailedTiles = 200; + } + } + + public delegate void CombinedImageChangedEventHandler(object sender, ImageChangedEventArgs e); + + public class MapTiles + { + public event CombinedImageChangedEventHandler CombinedImageChangedEvent; + + public MapConfig mapConfig; + + public ThreadedDownload ImageGrabber; + public MapTile[][] Tiles; + + public int ImageResolutionX; + public int ImageResolutionY; + + public int TileCountX; + public int TileCountY; + + public int StartTileX; + public int StartTileY; + + public double Longitude; + public double Latitude; + + public int OffsetX; + public int OffsetY; + + public int ZoomLevel; + public MapFunctions.MapType mapType; + + public Bitmap combinedTiles; + public Bitmap croppedCombinedTiles; + + public MapTiles(int ImageResulotionX, int ImageResulotionY, MapConfig mapConfig) + { + this.ImageResolutionX = ImageResulotionX; + this.ImageResolutionY = ImageResulotionY; + + this.mapConfig = mapConfig; + + ImageGrabber = new ThreadedDownload(mapConfig); + + TileCountX = CalcTileCount(ImageResulotionX + 256); + TileCountY = CalcTileCount(ImageResulotionY + 256); + + combinedTiles = new Bitmap(TileCountX * 256, TileCountY * 256); + } + + protected virtual void OnCombinedImageChangedEvent(ImageChangedEventArgs e) + { + try + { + CombinedImageChangedEvent(this, e); + } + catch (NullReferenceException err) + { + + } + } + + public void Refresh() + { + int CenterTileX = MapFunctions.ConvertLongitudeToTileX(Longitude,ZoomLevel); + int CenterTileY = MapFunctions.ConvertLatitudeToTileY(Latitude,ZoomLevel); + + StartTileX = CenterTileX - ((int)(TileCountX / 2)); + StartTileY = CenterTileY - ((int)(TileCountY / 2)); + + MapTile tmpTile = new MapTile(mapType, CenterTileX, CenterTileY, ZoomLevel); + + double tmpLongitudeDelta; + tmpLongitudeDelta = Longitude - tmpTile.LeftLongitude; + if (tmpLongitudeDelta < 0) tmpLongitudeDelta *= -1; + + OffsetX = (int)(256 * (((100 / tmpTile.TileWidthDegree) * tmpLongitudeDelta) / 100)); + + double tmpLatitudeDelta; + tmpLatitudeDelta = Latitude - tmpTile.TopLatitude; + if (tmpLatitudeDelta < 0) tmpLatitudeDelta *= -1; + + OffsetY = (int)(256 * (((100 / tmpTile.TileHeightDegree) * tmpLatitudeDelta) / 100)); + + Tiles = new MapTile[TileCountX][]; + + //MapTile tmpTile; + tmpTile = null; + + for (int X = 0; X < TileCountX; X++) + { + Tiles[X] = new MapTile[TileCountY]; + for (int Y = 0; Y < TileCountY; Y++) + { + tmpTile = new MapTile(mapType, StartTileX + X, StartTileY + Y, ZoomLevel); + Tiles[X][Y] = tmpTile; + tmpTile.ImageChangedEvent += new ImageChangedEventHandler(tmpTile_ImageChangedEvent); + ImageGrabber.DownloadImage(Tiles[X][Y]); + } + } + } + + void tmpTile_ImageChangedEvent(object sender, ImageChangedEventArgs e) + { + lock (combinedTiles) + { + bool newTiles = false; + MapTile tmpTile = (MapTile)sender; + try + { + if (tmpTile == null) + { + return; + } + int insertX = (tmpTile.PosX - StartTileX) * 256; + int insertY = (tmpTile.PosY - StartTileY) * 256; + + Graphics graphics = Graphics.FromImage(combinedTiles); + graphics.DrawImage(tmpTile.Image, insertX, insertY, tmpTile.Image.Width, tmpTile.Image.Height); + newTiles = true; + } + catch (NullReferenceException err) + { } + catch (InvalidOperationException err) + { } + catch (ArgumentOutOfRangeException err) + { } + + if (newTiles) + { + croppedCombinedTiles = new Bitmap(ImageResolutionX, ImageResolutionY); + Graphics cropGraphics = Graphics.FromImage(croppedCombinedTiles); + + int cropPosX = (((combinedTiles.Width / 2) - 128) + OffsetX) - (ImageResolutionX / 2); //(((combinedTiles.Width / 2) - (ImageResolutionX / 2)) + 128) - OffsetX; + int cropPosY = (((combinedTiles.Height / 2) - 128) + OffsetY) - (ImageResolutionY / 2); // (((combinedTiles.Height / 2) - (ImageResolutionY / 2)) + 128) - OffsetY; + + //System.Diagnostics.Debug.WriteLine(OffsetX + " : " + OffsetY + " :: " + cropPosX + " : " + cropPosY); + Rectangle tmpSource = new Rectangle(cropPosX, cropPosY, ImageResolutionX, ImageResolutionY); + Rectangle tmpDest = new Rectangle(0, 0, ImageResolutionX, ImageResolutionY); + cropGraphics.DrawImage(combinedTiles, tmpDest, tmpSource, GraphicsUnit.Pixel); + + OnCombinedImageChangedEvent(null); + } + } + } + + public int CalcTileCount(int Pixel) + { + int ret = (int)(Pixel / 256); + if ((Pixel % 256) != 0) ret++; // if the division does not fit + if ((ret % 2) == 0) ret++; // if the the tile count is unpair + return ret; + } + + public void ClearTileDownloadQueue() + { + ImageGrabber.ClearDownloadQueue(); + } + } +} Added: trunk/plugins/WorldMap/MAPS/SearchGeoCodes.cs =================================================================== --- trunk/plugins/WorldMap/MAPS/SearchGeoCodes.cs (rev 0) +++ trunk/plugins/WorldMap/MAPS/SearchGeoCodes.cs 2007-08-08 10:14:00 UTC (rev 812) @@ -0,0 +1,204 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Net; +using System.Web; +using System.IO; +using System.Xml; +using System.Diagnostics; + +namespace MAPS +{ + enum GeoCodeService + { + OpenGeoCoding, + YahooGeoCoding, + GeoNames + } + + class GeoCode + { + public string Name; + public string Street; + public string City; + public string State; + public string Country; + public double Longitude; + public double Latitude; + } + + class SearchGeoCodes + { + public string Street = ""; + public string City = ""; + public string Country = ""; + public string Placename = ""; + public GeoCodeService ServiceName = GeoCodeService.YahooGeoCoding; + public List<GeoCode> SearchResult = null; + + public void SearchNow() + { + if (ServiceName == GeoCodeService.YahooGeoCoding) + { + Uri url = GetYahooAdress(); + string XMLString = GetXMLResult(url); + PushYahooResultToSearchResult(XMLString); + } + if (ServiceName == GeoCodeService.GeoNames) + { + Uri url = GetGeoNamesAdress(); + string XMLString = GetXMLResult(url); + PushGeoNamesResultToSearchResult(XMLString); + } + } + + public string GetXMLResult(Uri url) + { + string ret = null; + + HttpWebRequest httpRequest = (HttpWebRequest)WebRequest.Create(url); + httpRequest.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"; + httpRequest.Timeout = 15000; + httpRequest.ReadWriteTimeout = 15000; + httpRequest.Method = "GET"; + + HttpWebResponse httpResponse = null; + + try + { + httpResponse = (HttpWebResponse)httpRequest.GetResponse(); + Stream tmpStream = httpResponse.GetResponseStream(); + + using (StreamReader reader = new StreamReader(tmpStream)) + { + ret = reader.ReadToEnd(); + } + } + catch (WebException err) + { + Debug.WriteLine(err.ToString()); + } + + return ret; + } + + public void PushYahooResultToSearchResult(string XMLString) + { + if (XMLString == null) return; + SearchResult = new List<GeoCode>(); + SearchResult.Clear(); + + XmlDocument doc = new XmlDocument(); + doc.LoadXml(XMLString); + + //XmlNode root = doc.DocumentElement; + //XmlNodeList nodes = doc.SelectNodes("//ResultSet/Result"); + //nodes = doc.DocumentElement.SelectNodes("Result"); + + XmlNodeList nodes = doc.DocumentElement.ChildNodes; + + System.Globalization.CultureInfo ci = System.Globalization.CultureInfo.InstalledUICulture; + System.Globalization.NumberFormatInfo ni = (System.Globalization.NumberFormatInfo)ci.NumberFormat.Clone(); + ni.NumberDecimalSeparator = "."; + ni.NumberGroupSeparator = ","; + + foreach (XmlNode node in nodes) + { + GeoCode tmpGeoCode = new GeoCode(); + tmpGeoCode.Name = ""; + tmpGeoCode.Street = node["Address"].InnerText; + tmpGeoCode.City = node["City"].InnerText; + tmpGeoCode.State = node["State"].InnerText; + tmpGeoCode.Country = node["Country"].InnerText; + tmpGeoCode.Latitude = double.Parse(node["Latitude"].InnerText, ni); + tmpGeoCode.Longitude = double.Parse(node["Longitude"].InnerText, ni); + SearchResult.Add(tmpGeoCode); + } + } + + public void PushGeoNamesResultToSearchResult(string XMLString) + { + SearchResult = new List<GeoCode>(); + SearchResult.Clear(); + + XmlDocument doc = new XmlDocument(); + doc.LoadXml(XMLString); + + XmlNode root = doc.DocumentElement; + //XmlNodeList nodes = doc.SelectNodes("//ResultSet/Result"); + //nodes = doc.DocumentElement.SelectNodes("Result"); + + XmlNodeList nodes = doc.DocumentElement.ChildNodes; + + System.Globalization.CultureInfo ci = System.Globalization.CultureInfo.InstalledUICulture; + System.Globalization.NumberFormatInfo ni = (System.Globalization.NumberFormatInfo)ci.NumberFormat.Clone(); + ni.NumberDecimalSeparator = "."; + ni.NumberGroupSeparator = ","; + + foreach (XmlNode node in nodes) + { + if (node.Name == "geoname") + { + GeoCode tmpGeoCode = new GeoCode(); + tmpGeoCode.Name = node["name"].InnerText; + try + { + tmpGeoCode.Name += " (" + node["adminName1"].InnerText + ")"; + } + catch (Exception err) + { } + tmpGeoCode.Country = node["countryName"].InnerText; + tmpGeoCode.Latitude = double.Parse(node["lat"].InnerText, ni); + tmpGeoCode.Longitude = double.Parse(node["lng"].InnerText, ni); + SearchResult.Add(tmpGeoCode); + } + } + } + + public Uri GetYahooAdress() + { + string url = "http://local.yahooapis.com/MapsService/V1/geocode?appid=MediaPortalWorldmap&output=xml"; + + if (Street != "") url += "&street=" + Street; + if (City != "") url += "&city=" + City; + if (Country != "") url += "&state=" + Country; + + url = ConvertStringToSafeUrl(url); + + return new Uri(url); + } + + public Uri GetGeoNamesAdress() + { + string url = "http://ws.geonames.org/search?maxRows=20&style=full"; + + if (Placename != "") url += "&q=" + Placename; + + url = ConvertStringToSafeUrl(url); + + return new Uri(url); + } + + + /// <summary> + /// Converts special characters to safe ones (e.g. \xFC becomes %FC) + /// </summary> + public string ConvertStringToSafeUrl(string url) + { + string ret = string.Empty; + string safeChars = "0123456789" + // Numeric + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + // Alphabetic + "abcdefghijklmnopqrstuvwxyz" + + ":-_.!~*'()?\\/=&"; // special + foreach (char Char in url) + { + if (safeChars.Contains(Char.ToString())) ret += Char; + else { ret += String.Format("%{0:X2}", (int)Char); } // convert to % plus the "hex value" + } + + return ret; + } + + } + +} Added: trunk/plugins/WorldMap/MAPS/ThreadedDownload.cs =================================================================== --- trunk/plugins/WorldMap/MAPS/ThreadedDownload.cs (rev 0) +++ trunk/plugins/WorldMap/MAPS/ThreadedDownload.cs 2007-08-08 10:14:00 UTC (rev 812) @@ -0,0 +1,372 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Windows.Forms; +using System.IO; +using System.Net; +using System.Diagnostics; +using System.Drawing; +using System.Threading; + +namespace MAPS +{ + delegate void ProcessDownloadQueue(); + delegate void ImageThread(Object stateInfo); + public class ThreadedDownload + { + public List<MapTile> QueuedImageDownloads = new List<MapTile>(); + public List<Thread> ImageDownloadThreads = new List<Thread>(); + + public MapConfig mapConfig; + public TileCacheDatabase cacheDatabase; + + public ThreadedDownload(MapConfig mapConfig) + { + this.mapConfig = mapConfig; + + DatabaseOptions databaseOptions = new DatabaseOptions(); + databaseOptions.cacheFolder = mapConfig.CacheFolder; + databaseOptions.DaysToKeepCachedDetailedTiles = mapConfig.DaysToKeepCachedDetailedTiles; + databaseOptions.DaysToKeepCachedOverviewTiles = mapConfig.DaysToKeepCachedOverviewTiles; + + cacheDatabase = new TileCacheDatabase(databaseOptions); + } + + public void DownloadImage(MapTile mapTile) + { + string FilePreFix = null; + + switch (mapTile.MapType) + { + case MapFunctions.MapType.GMRoad: FilePreFix = "gmr"; + break; + case MapFunctions.MapType.GMAerial: FilePreFix = "gma"; + break; + case MapFunctions.MapType.GMHybrid: FilePreFix = "gmh"; + break; + case MapFunctions.MapType.VERoad: FilePreFix = "ver"; + break; + case MapFunctions.MapType.VEAerial: FilePreFix = "vea"; + break; + case MapFunctions.MapType.VEHybrid: FilePreFix = "veh"; + break; + } + + Bitmap tmpTileImage = null; + + try + { + tmpTileImage = cacheDatabase.GetImage(FilePreFix, mapTile.PosX, mapTile.PosY, mapTile.ZoomLevel); + if (tmpTileImage != null) + { + mapTile.Image = tmpTileImage; + return; + } + } + catch (NullReferenceException err) + { } + catch (Exception err) + { + Debug.WriteLine(err.ToString()); + }; + + //tmpTileImage = GetParentTilePart(FilePreFix,mapTile.PosX, mapTile.PosY, mapTile.ZoomLevel); + + if (tmpTileImage == null) + { + tmpTileImage = mapConfig.DownloadPlaceholder; + } + + mapTile.Image = tmpTileImage; + + //System.Threading.ThreadPool.QueueUserWorkItem(new WaitCallback(ImageThread), tmpImage); + + QueuedImageDownloads.Add(mapTile); + ProcessDownloadQueue(); + } + + Bitmap GetParentTilePart(string mapPreFix, int TileX, int TileY, int zoomLevel) + { + Bitmap ret = null; + + double curLongitude = MapFunctions.ConvertTileXToLongitude(TileX,zoomLevel); + double curLatitude = MapFunctions.ConvertTileYToLatitude(TileY,zoomLevel); + + int parentX = MapFunctions.ConvertLongitudeToTileX(curLongitude, zoomLevel - 1); + int parentY = MapFunctions.ConvertLatitudeToTileY(curLatitude, zoomLevel - 1); + + try + { + Bitmap parentTile = cacheDatabase.GetImage(mapPreFix, parentX, parentY, (zoomLevel - 1)); + if (parentTile != null) + { + string tmpTileCode = MapFunctions.GetGMapSatUrlTileCode(TileX, TileY, zoomLevel); + switch (tmpTileCode[tmpTileCode.Length - 1]) + { + case 'q': ret = ImageFunctions.GetUpperLeftPart(parentTile); + break; + case 'r': ret = ImageFunctions.GetUpperRightPart(parentTile); + break; + case 's': ret = ImageFunctions.GetLowerLeftPart(parentTile); + break; + case 't': ret = ImageFunctions.GetLowerRightPart(parentTile); + break; + } + } + } + catch (Exception err) + { + // Debug.WriteLine(err.ToString()); + }; + + return ret; + } + + public void ProcessDownloadQueue() + { + int maxThreadCount = 1; + try + { + switch (QueuedImageDownloads[0].MapType) + { + case MapFunctions.MapType.GMRoad: maxThreadCount = mapConfig.ThreadCountGMR; + break; + case MapFunctions.MapType.GMAerial: maxThreadCount = mapConfig.ThreadCountGMA; + break; + case MapFunctions.MapType.GMHybrid: maxThreadCount = mapConfig.ThreadCountGMH; + break; + case MapFunctions.MapType.VERoad: maxThreadCount = mapConfig.ThreadCountVER; + break; + case MapFunctions.MapType.VEAerial: maxThreadCount = mapConfig.ThreadCountVEA; + break; + case MapFunctions.MapType.VEHybrid: maxThreadCount = mapConfig.ThreadCountVEH; + break; + } + } + catch(Exception err) + { } + + if (ImageDownloadThreads.Count < maxThreadCount) + { + if (QueuedImageDownloads.Count > 0) + { + MapTile tmpTile = QueuedImageDownloads[0]; + QueuedImageDownloads.RemoveAt(0); + + Thread t = new Thread(new ParameterizedThreadStart(ImageThread)); + t.Priority = ThreadPriority.BelowNormal; + t.Name = "MapTileDownloader"; + t.IsBackground = true; + ImageDownloadThreads.Add(t); + try + { + t.Start(tmpTile); + } + catch (ThreadStartException err) + { } + + //if(QueuedImageDownloads.Count>0) QueuedImageDownloads.RemoveAt(0); + } + } + Debug.WriteLine(QueuedImageDownloads.Count + " : " + ImageDownloadThreads.Count); + } + + public void ClearDownloadQueue() + { + QueuedImageDownloads.Clear(); + + while (ImageThreadIsRunning()) + { + for (int i = 0; i < ImageDownloadThreads.Count; i++) + { + try + { + ImageDownloadThreads[i].Abort(); + //while (ImageDownloadThreads[0].IsAlive) { Thread.Sleep(100); } + + //ImageDownloadThreads.RemoveAt(0); + } + catch(Exception err) + { } + } + Thread.Sleep(250); + } + + + ImageDownloadThreads.Clear(); + + System.GC.ReRegisterForFinalize(QueuedImageDownloads); + System.GC.ReRegisterForFinalize(ImageDownloadThreads); + System.GC.Collect(); + //currentlyRunningThreads = 0; + } + + bool ImageThreadIsRunning() + { + bool ret = false; + for (int i = 0; i < ImageDownloadThreads.Count; i++) + { + try + { + ret |= ImageDownloadThreads[i].IsAlive; + } + catch (Exception err) + { } + } + return ret; + } + + void RemoveCurrentThreadFromList() + { + for (int i = 0; i < ImageDownloadThreads.Count; i++) + { + try + { + if (ImageDownloadThreads[i].Equals(Thread.CurrentThread)) + { + try + { + ImageDownloadThreads.RemoveAt(i); + } + catch (Exception err) + { } + } + } + catch (Exception err) + { } + } + } + + void ImageThread(Object stateInfo) + { + MapTile tmpImage = (MapTile)stateInfo; + Bitmap tmpTileImage = null; + + string url; + string FilePreFix = null; + + url = MapFunctions.GetTileUrl(tmpImage.MapType, tmpImage.PosX, tmpImage.PosY, tmpImage.ZoomLevel, ref mapConfig); + if (url == "***" || url == null) + { + tmpImage.Image = mapConfig.TileNotAvailable; + + RemoveCurrentThreadFromList(); + ProcessDownloadQueue(); + return; + } + + switch (tmpImage.MapType) + { + case MapFunctions.MapType.GMRoad: FilePreFix = "gmr"; + break; + case MapFunctions.MapType.GMAerial: FilePreFix = "gma"; + break; + case MapFunctions.MapType.GMHybrid: FilePreFix = "gmh"; + break; + case MapFunctions.MapType.VERoad: FilePreFix = "ver"; + break; + case MapFunctions.MapType.VEAerial: FilePreFix = "vea"; + break; + case MapFunctions.MapType.VEHybrid: FilePreFix = "veh"; + break; + } + + string UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4"; + if (tmpImage.MapType == MapFunctions.MapType.VEAerial || tmpImage.MapType == MapFunctions.MapType.VEHybrid || tmpImage.MapType == MapFunctions.MapType.VERoad) + { + UserAgent = "Virtual Earth 3D"; + } + + HttpWebRequest httpRequest = (HttpWebRequest) WebRequest.Create(url); + httpRequest.UserAgent = UserAgent; + httpRequest.Timeout = 7000; + httpRequest.ReadWriteTimeout = 7000; + httpRequest.Method = "GET"; + HttpWebResponse httpResponse = null; + + try + { + Stream tmpImageStream; + Debug.WriteLine(url); + //Thread.Sleep(6500); + + if (tmpImage.MapType == MapFunctions.MapType.GMHybrid) + { + try + { + tmpTileImage = cacheDatabase.GetImage("gma", tmpImage.PosX, tmpImage.PosY, tmpImage.ZoomLevel); + } + catch (Exception err) + { } + } + + if (tmpTileImage == null) + { + httpResponse = (HttpWebResponse)httpRequest.GetResponse(); + tmpImageStream = httpResponse.GetResponseStream(); + + tmpTileImage = new Bitmap(tmpImageStream); + if (tmpImage.MapType == MapFunctions.MapType.GMHybrid) + { + cacheDatabase.InsertImage("gma", tmpImage.PosX, tmpImage.PosY, tmpImage.ZoomLevel, tmpTileImage); + } + } + + if (tmpTileImage != null && tmpImage.MapType == MapFunctions.MapType.GMHybrid) + { + url = MapFunctions.GetGHybridOverlayUrl(tmpImage.PosX, tmpImage.PosY, tmpImage.ZoomLevel, ref mapConfig); + Debug.WriteLine(url); + httpRequest = (HttpWebRequest)WebRequest.Create(url); + httpRequest.UserAgent = UserAgent; + httpRequest.Timeout = 7000; + httpRequest.ReadWriteTimeout = 7000; + httpRequest.Method = "GET"; + httpResponse = (HttpWebResponse)httpRequest.GetResponse(); + tmpImageStream = httpResponse.GetResponseStream(); + + Bitmap tmpHybridOverlay = new Bitmap(tmpImageStream); + tmpTileImage = ImageFunctions.MergeBitmaps(tmpTileImage, tmpHybridOverlay); + } + + cacheDatabase.InsertImage(FilePreFix, tmpImage.PosX, tmpImage.PosY, tmpImage.ZoomLevel, tmpTileImage); + tmpImage.Image = tmpTileImage; + } + catch (WebException err) + { + Debug.WriteLine(err.ToString()); + if (err.Status == WebExceptionStatus.ProtocolError) + { + httpResponse = (HttpWebResponse)err.Response; + if (httpResponse.StatusCode == HttpStatusCode.Forbidden) + { + tmpImage.Image = mapConfig.IPBlocked; + } + if (httpResponse.StatusCode == HttpStatusCode.BadRequest || httpResponse.StatusCode == HttpStatusCode.NotFound) + { + tmpImage.Image = mapConfig.TileNotAvailable; + } + } + } + catch (ThreadAbortException err) + { + Debug.WriteLine(err.ToString()); + try + { + httpRequest.Abort(); + } + catch (Exception err2) + { } + } + catch (Exception err) + { + Debug.WriteLine(err.ToString()); + } + + //httpResponse.Close(); + //tmpTileImage.Dispose(); + + RemoveCurrentThreadFromList(); + ProcessDownloadQueue(); + } + } +} Added: trunk/plugins/WorldMap/MAPS/TileCacheDatabase.cs =================================================================== --- trunk/plugins/WorldMap/MAPS/TileCacheDatabase.cs (rev 0) +++ trunk/plugins/WorldMap/MAPS/TileCacheDatabase.cs 2007-08-08 10:14:00 UTC (rev 812) @@ -0,0 +1,267 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Diagnostics; +using System.Data.SQLite; +using System.Data; +using System.IO; +using System.Drawing; + +namespace MAPS +{ + public class DatabaseOptions + { + public string cacheFolder; + public int DaysToKeepCachedDetailedTiles; + public int DaysToKeepCachedOverviewTiles; + } + + public class TileCacheDatabase + { + private DatabaseOptions options; + private SQLiteConnection CurrentConnection = null; + + public TileCacheDatabase(DatabaseOptions DatabaseOptions) + { + options = DatabaseOptions; + //options.DaysToKeepCachedDetailedTiles = 30; + //options.DaysToKeepCachedOverviewTiles = 200; + + CreateDatebase(); + } + + public void CreateDatebase() + { + string dbpath = options.cacheFolder + @"\MapTileCache.db"; + string connString = @"Data Source=" + dbpath + ";New=True;UTF8Encoding=True;Version=3"; + // if the db file doesn't exist, create a new db (New=True to create a db)--- + if (!File.Exists(dbpath)) + { + SQLiteConnection con = new SQLiteConnection(connString); + SQLiteCommand cmd = con.CreateCommand(); + cmd.CommandText = "CREATE TABLE MapTiles (TimeStamp timestamp DEFAULT CURRENT_TIMESTAMP NULL, MapType varchar(3), zoomLevel integer, TileX integer, TileY integer,image BLOB)"; + con.Open(); + cmd.ExecuteNonQuery(); + + cmd = con.CreateCommand(); + cmd.CommandText = "CREATE INDEX TimeStampIndex ON MapTiles (TimeStamp)"; + cmd.ExecuteNonQuery(); + + cmd = con.CreateCommand(); + cmd.CommandText = "CREATE INDEX MapTypeIndex ON MapTiles (MapType)"; + cmd.ExecuteNonQuery(); + + cmd = con.CreateCommand(); + cmd.CommandText = "CREATE INDEX zoomLevelIndex ON MapTiles (zoomLevel)"; + cmd.ExecuteNonQuery(); + + cmd = con.CreateCommand(); + cmd.CommandText = "CREATE INDEX TileXIndex ON MapTiles (TileX)"; + cmd.ExecuteNonQuery(); + + cmd = con.CreateCommand(); + cmd.CommandText = "CREATE INDEX TileYIndex ON MapTiles (TileY)"; + cmd.ExecuteNonQuery(); + + con.Close(); + cmd.Dispose(); + } + + } + + public void InsertImage(string MapType, int TileX, int TileY, int zoomLevel, Bitmap image) + { + if (CurrentConnection == null) + { + + string dbpath = options.cacheFolder + @"\MapTileCache.db"; + string connString = @"Data Source=" + dbpath + ";UTF8Encoding=True;Version=3"; + CurrentConnection = new SQLiteConnection(connString); + } + // stream to save the bitmap to + MemoryStream ms = new MemoryStream(); + // Save to memory using the Jpeg format + image.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg); + + // read to end + byte[] imageBytes = ms.GetBuffer(); + ms.Close(); + + IDbCommand cmd = CurrentConnection.CreateCommand(); + cmd.CommandText = "INSERT INTO MapTiles (MapType,zoomLevel,TileX,TileY,image) VALUES (@MapType,@zoomLevel,@TileX,@TileY,@image)"; + + SQLiteParameter paramMapType = new SQLiteParameter("@MapType", DbType.String); + paramMapType.Value = MapType; + cmd.Parameters.Add(paramMapType); + + SQLiteParameter paramZoomLevel = new SQLiteParameter("@zoomLevel", DbType.Int16); + paramZoomLevel.Value = zoomLevel; + cmd.Parameters.Add(paramZoomLevel); + + SQLiteParameter paramTileX = new SQLiteParameter("@TileX", DbType.Int32); + paramTileX.Value = TileX; + cmd.Parameters.Add(paramTileX); + + SQLiteParameter paramTileY = new SQLiteParameter("@TileY", DbType.Int32); + paramTileY.Value = TileY; + cmd.Parameters.Add(paramTileY); + + SQLiteParameter paramImage = new SQLiteParameter("@image", DbType.Binary); + paramImage.Value = imageBytes; + cmd.Parameters.Add(paramImage); + try + { + if(CurrentConnection.State == ConnectionState.Closed) CurrentConnection.Open(); + cmd.ExecuteNonQuery(); + + } + catch (Exception err) + { } + finally + { + cmd.Dispose(); + //CurrentConnection.Close(); + } + } + + public Bitmap GetImage(string MapType, int TileX, int TileY, int zoomLevel) + { + Bitmap tmpImage = null; + + if (CurrentConnection == null) + { + string dbpath = options.cacheFolder + @"\MapTileCache.db"; + string connString = @"Data Source=" + dbpath + ";UTF8Encoding=True;Version=3"; + CurrentConnection = new SQLiteConnection(connString); + } + + //IDbCommand cmd = CurrentConnection.CreateCommand(); + SQLiteCommand cmd = new SQLiteCommand(CurrentConnection); + cmd.CommandText = "Select * From MapTiles Where MapType=@MapType AND zoomLevel=@zoomLevel AND TileX=@TileX AND TileY=@TileY"; + + SQLiteParameter paramMapType = new SQLiteParameter("@MapType", DbType.String); + paramMapType.Value = MapType; + cmd.Parameters.Add(paramMapType); + + SQLiteParameter paramZoomLevel = new SQLiteParameter("@zoomLevel", DbType.Int16); + paramZoomLevel.Value = zoomLevel; + cmd.Parameters.Add(paramZoomLevel); + + SQLiteParameter paramTileX = new SQLiteParameter("@TileX", DbType.Int32); + paramTileX.Value = TileX; + cmd.Parameters.Add(paramTileX); + + SQLiteParameter paramTileY = new SQLiteParameter("@TileY", DbType.Int32); + paramTileY.Value = TileY; + cmd.Parameters.Add(paramTileY); + + MemoryStream ms = null; + try + { + SQLiteDataAdapter da = new SQLiteDataAdapter(cmd); + SQLiteCommandBuilder MyCB = new SQLiteCommandBuilder(da); + DataSet ds = new DataSet("MapTileImage"); + da.Fill(ds, "MapTileImage"); + DataRow myRow; + // get the latest row + myRow = ds.Tables["MapTileImage"].Rows[ds.Tables["MapTileImage"].Rows.Count - 1]; + + byte[] imageBytes = (byte[])myRow["image"]; + ms = new MemoryStream(imageBytes); + tmpImage = new Bitmap(ms); + ms.Close(); + } + catch (IndexOutOfRangeException err) + { Debug.WriteLine("The map tile was not in the database!"); } + catch (Exception err) + { } + finally + { + //CurrentConnection.Close(); + cmd.Dispose(); + ms.Dispose(); + } + + return tmpImage; + } + + public void DeleteOldCacheEntries() + { + if (CurrentConnection == null) + { + + string dbpath = options.cacheFolder + @"\MapTileCache.db"; + string connString = @"Data Source=" + dbpath + ";UTF8Encoding=True;Version=3"; + CurrentConnection = new SQLiteConnection(connString); + } + IDbCommand cmd = CurrentConnection.CreateCommand(); + cmd.CommandText = String.Format("DELETE FROM MapTiles WHERE zoomLevel < 15 AND TimeStamp < datetime('now','-{0} day')", options.DaysToKeepCachedOverviewTiles); + + try + { + CurrentConnection.Open(); + } + catch (InvalidOperationException err) + { } + + try + { + Debug.WriteLine(cmd.ExecuteNonQuery().ToString() + " overview tiles affected"); + } + catch (Exception err) + { + Debug.WriteLine(err); + } + finally + { + cmd.Dispose(); + } + + cmd = CurrentConnection.CreateCommand(); + cmd.CommandText = String.Format("DELETE FROM MapTiles WHERE zoomLevel >= 15 AND TimeStamp < datetime('now','-{0} day')", options.DaysToKeepCachedDetailedTiles); + + try + { + Debug.WriteLine(cmd.ExecuteNonQuery().ToString() + " detailed tiles affected"); + } + catch (Exception err) + { + Debug.WriteLine(err); + } + + finally + ... [truncated message content] |
From: <lk...@us...> - 2007-12-08 18:56:21
|
Revision: 1135 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1135&view=rev Author: lkuech Date: 2007-12-08 10:56:18 -0800 (Sat, 08 Dec 2007) Log Message: ----------- Updated URLs for GM First implementation of the new GM terrain maps (needs some final work) Modified Paths: -------------- trunk/plugins/WorldMap/MAPS/MapFunctions.cs trunk/plugins/WorldMap/MAPS/MapTiles.cs trunk/plugins/WorldMap/MAPS/ThreadedDownload.cs trunk/plugins/WorldMap/Settings.cs trunk/plugins/WorldMap/WorldMap.cs trunk/plugins/WorldMap/WorldmapConfig.Designer.cs trunk/plugins/WorldMap/WorldmapConfig.cs Modified: trunk/plugins/WorldMap/MAPS/MapFunctions.cs =================================================================== --- trunk/plugins/WorldMap/MAPS/MapFunctions.cs 2007-12-08 13:42:04 UTC (rev 1134) +++ trunk/plugins/WorldMap/MAPS/MapFunctions.cs 2007-12-08 18:56:18 UTC (rev 1135) @@ -9,6 +9,7 @@ public enum MapType { GMRoad, + GMTerrain, GMAerial, GMHybrid, VERoad, @@ -257,7 +258,41 @@ } + public static string GetGTerrainUrl(int TileX, int TileY, int zoomLevel, ref MapConfig curConfig) + { + string tileCode = GetGMapSatUrlTileCode(TileX, TileY, zoomLevel); + if (tileCode == "") return ""; + int servNum = -1; + + try + { + switch (tileCode[tileCode.Length - 1]) + { + case 'q': servNum = 0; + break; + case 'r': servNum = 1; + break; + case 's': servNum = 2; + break; + case 't': servNum = 3; + break; + } + } + catch (Exception err) + { } + + string StringServNum; + if (servNum == -1) StringServNum = ""; + else StringServNum = servNum.ToString(); + + string TileCode = GetGMapTileCode(TileX, TileY, zoomLevel); + string[] urltab = TileCode.Split('_'); + string fullurl = string.Format(curConfig.GMTUrl, StringServNum, urltab[0], urltab[1], urltab[2]); + return fullurl; + + } + public static string GetGMapUrl(int TileX, int TileY, int zoomLevel, ref MapConfig curConfig) { string tileCode = GetGMapSatUrlTileCode(TileX, TileY, zoomLevel); @@ -342,6 +377,8 @@ string url = null; switch (mapType) { + case MapType.GMTerrain: url = GetGTerrainUrl(TileX, TileY, zoomLevel, ref curConfig); + break; case MapType.GMRoad: url = GetGMapUrl(TileX, TileY, zoomLevel, ref curConfig); break; case MapType.GMAerial: url = GetGMapSatUrl(TileX, TileY, zoomLevel, ref curConfig); @@ -420,7 +457,8 @@ { case MapType.GMAerial: case MapType.GMHybrid: - case MapType.GMRoad: url = GetGMTileUrl(mapType,TileX,TileY,zoomLevel, ref curConfig); + case MapType.GMTerrain: + case MapType.GMRoad: url = GetGMTileUrl(mapType, TileX, TileY, zoomLevel, ref curConfig); break; case MapType.VERoad: case MapType.VEAerial: Modified: trunk/plugins/WorldMap/MAPS/MapTiles.cs =================================================================== --- trunk/plugins/WorldMap/MAPS/MapTiles.cs 2007-12-08 13:42:04 UTC (rev 1134) +++ trunk/plugins/WorldMap/MAPS/MapTiles.cs 2007-12-08 18:56:18 UTC (rev 1135) @@ -12,6 +12,7 @@ public int ThreadCountGMR; public int ThreadCountGMA; public int ThreadCountGMH; + public int ThreadCountGMT; public int ThreadCountVER; public int ThreadCountVEA; public int ThreadCountVEH; @@ -20,6 +21,7 @@ public string GMAUrl; public string GMRUrl; public string GMHUrl; + public string GMTUrl; public string VEUrl; public Bitmap TileNotAvailable; public Bitmap IPBlocked; @@ -28,9 +30,10 @@ public MapConfig() { CacheFolder = "C:\\"; - ThreadCountGMR = 4; - ThreadCountGMA = 1; - ThreadCountGMH = 1; + ThreadCountGMR = 5; + ThreadCountGMA = 5; + ThreadCountGMH = 5; + ThreadCountGMT = 5; ThreadCountVER = 5; ThreadCountVEA = 5; ThreadCountVEH = 5; Modified: trunk/plugins/WorldMap/MAPS/ThreadedDownload.cs =================================================================== --- trunk/plugins/WorldMap/MAPS/ThreadedDownload.cs 2007-12-08 13:42:04 UTC (rev 1134) +++ trunk/plugins/WorldMap/MAPS/ThreadedDownload.cs 2007-12-08 18:56:18 UTC (rev 1135) @@ -44,6 +44,8 @@ break; case MapFunctions.MapType.GMHybrid: FilePreFix = "gmh"; break; + case MapFunctions.MapType.GMTerrain: FilePreFix = "gmt"; + break; case MapFunctions.MapType.VERoad: FilePreFix = "ver"; break; case MapFunctions.MapType.VEAerial: FilePreFix = "vea"; @@ -263,6 +265,8 @@ break; case MapFunctions.MapType.GMHybrid: FilePreFix = "gmh"; break; + case MapFunctions.MapType.GMTerrain: FilePreFix = "gmt"; + break; case MapFunctions.MapType.VERoad: FilePreFix = "ver"; break; case MapFunctions.MapType.VEAerial: FilePreFix = "vea"; Modified: trunk/plugins/WorldMap/Settings.cs =================================================================== --- trunk/plugins/WorldMap/Settings.cs 2007-12-08 13:42:04 UTC (rev 1134) +++ trunk/plugins/WorldMap/Settings.cs 2007-12-08 18:56:18 UTC (rev 1135) @@ -18,6 +18,7 @@ public int ThreadCountGMR; public int ThreadCountGMA; public int ThreadCountGMH; + public int ThreadCountGMT; public int ThreadCountVER; public int ThreadCountVEA; public int ThreadCountVEH; @@ -28,6 +29,7 @@ public string GMAUrl; public string GMRUrl; public string GMHUrl; + public string GMTUrl; public string VEUrl; public Action.ActionType ActionMoveUp; @@ -54,6 +56,7 @@ public static string ParmThreadCountGMR = "parmthreadcountgmr"; public static string ParmThreadCountGMA = "parmthreadcountgma"; public static string ParmThreadCountGMH = "parmthreadcountgmh"; + public static string ParmThreadCountGMT = "parmthreadcountgmt"; public static string ParmThreadCountVER = "parmthreadcountver"; public static string ParmThreadCountVEA = "parmthreadcountvea"; public static string ParmThreadCountVEH = "parmthreadcountveh"; @@ -62,6 +65,7 @@ public static string ParmGMAUrl = "parmgmaurl"; public static string ParmGMRUrl = "parmgmrurl"; public static string ParmGMHUrl = "parmgmhurl"; + public static string ParmGMTUrl = "parmgmturl"; public static string ParmVEUrl = "parmveurl"; public static string ParmActionMoveUp = "parmactionmoveup"; @@ -98,6 +102,7 @@ ThreadCountGMR = reader.GetValueAsInt(SectionName, ParmThreadCountGMR, 5); ThreadCountGMA = reader.GetValueAsInt(SectionName, ParmThreadCountGMA, 5); ThreadCountGMH = reader.GetValueAsInt(SectionName, ParmThreadCountGMH, 5); + ThreadCountGMT = reader.GetValueAsInt(SectionName, ParmThreadCountGMT, 5); ThreadCountVER = reader.GetValueAsInt(SectionName, ParmThreadCountVER, 5); ThreadCountVEA = reader.GetValueAsInt(SectionName, ParmThreadCountVEA, 5); ThreadCountVEH = reader.GetValueAsInt(SectionName, ParmThreadCountVEH, 5); @@ -125,6 +130,7 @@ GMAUrl = reader.GetValueAsString(SectionName, ParmGMAUrl, "http://kh{0}.google.com/kh?n=404&v=18&t={1}"); GMRUrl = reader.GetValueAsString(SectionName, ParmGMRUrl, "http://mt{0}.google.com/mt?n=404&v=w2.99&x={1}&y={2}&zoom={3}"); GMHUrl = reader.GetValueAsString(SectionName, ParmGMHUrl, "http://mt{0}.google.com/mt?n=404&v=w2t.99&x={1}&y={2}&zoom={3}"); + GMTUrl = reader.GetValueAsString(SectionName, ParmGMTUrl, "http://mt{0}.google.com/mt?n=404&v=w2p.99&x={1}&y={2}&zoom={3}"); VEUrl = reader.GetValueAsString(SectionName, ParmVEUrl, "http://{0}{1}.ortho.tiles.virtualearth.net/tiles/{0}{2}{3}?g=1"); } } @@ -142,6 +148,7 @@ xmlwriter.SetValue(SectionName, ParmThreadCountGMR, ThreadCountGMR.ToString()); xmlwriter.SetValue(SectionName, ParmThreadCountGMA, ThreadCountGMA.ToString()); xmlwriter.SetValue(SectionName, ParmThreadCountGMH, ThreadCountGMH.ToString()); + xmlwriter.SetValue(SectionName, ParmThreadCountGMT, ThreadCountGMT.ToString()); xmlwriter.SetValue(SectionName, ParmThreadCountVER, ThreadCountVER.ToString()); xmlwriter.SetValue(SectionName, ParmThreadCountVEA, ThreadCountVEA.ToString()); xmlwriter.SetValue(SectionName, ParmThreadCountVEH, ThreadCountVEH.ToString()); @@ -172,6 +179,7 @@ xmlwriter.SetValue(SectionName, ParmGMAUrl, GMAUrl); xmlwriter.SetValue(SectionName, ParmGMRUrl, GMRUrl); xmlwriter.SetValue(SectionName, ParmGMHUrl, GMHUrl); + xmlwriter.SetValue(SectionName, ParmGMTUrl, GMTUrl); xmlwriter.SetValue(SectionName, ParmVEUrl, VEUrl); } } Modified: trunk/plugins/WorldMap/WorldMap.cs =================================================================== --- trunk/plugins/WorldMap/WorldMap.cs 2007-12-08 13:42:04 UTC (rev 1134) +++ trunk/plugins/WorldMap/WorldMap.cs 2007-12-08 18:56:18 UTC (rev 1135) @@ -233,6 +233,7 @@ mapConfig.ThreadCountGMR = settings.ThreadCountGMR; mapConfig.ThreadCountGMA = settings.ThreadCountGMA; mapConfig.ThreadCountGMH = settings.ThreadCountGMH; + mapConfig.ThreadCountGMT = settings.ThreadCountGMT; mapConfig.ThreadCountVER = settings.ThreadCountVER; mapConfig.ThreadCountVEA = settings.ThreadCountVEA; mapConfig.ThreadCountVEH = settings.ThreadCountVEH; @@ -240,6 +241,7 @@ mapConfig.GMAUrl = settings.GMAUrl; mapConfig.GMRUrl = settings.GMRUrl; mapConfig.GMHUrl = settings.GMHUrl; + mapConfig.GMTUrl = settings.GMTUrl; mapConfig.VEUrl = settings.VEUrl; string tmpSkinFolder = Config.GetSubFolder(Config.Dir.Skin, GUIGraphicsContext.Skin); @@ -307,6 +309,7 @@ settings.ThreadCountGMR = mapConfig.ThreadCountGMR; settings.ThreadCountGMA = mapConfig.ThreadCountGMA; settings.ThreadCountGMH = mapConfig.ThreadCountGMH; + settings.ThreadCountGMT = mapConfig.ThreadCountGMT; settings.ThreadCountVER = mapConfig.ThreadCountVER; settings.ThreadCountVEA = mapConfig.ThreadCountVEA; settings.ThreadCountVEH = mapConfig.ThreadCountVEH; Modified: trunk/plugins/WorldMap/WorldmapConfig.Designer.cs =================================================================== --- trunk/plugins/WorldMap/WorldmapConfig.Designer.cs 2007-12-08 13:42:04 UTC (rev 1134) +++ trunk/plugins/WorldMap/WorldmapConfig.Designer.cs 2007-12-08 18:56:18 UTC (rev 1135) @@ -91,6 +91,10 @@ this.label25 = new System.Windows.Forms.Label(); this.btnOk = new System.Windows.Forms.Button(); this.btnCancel = new System.Windows.Forms.Button(); + this.uadGMT = new System.Windows.Forms.NumericUpDown(); + this.label29 = new System.Windows.Forms.Label(); + this.txbGMTUrl = new System.Windows.Forms.TextBox(); + this.label30 = new System.Windows.Forms.Label(); this.tbConfig.SuspendLayout(); this.tpMain.SuspendLayout(); this.panel1.SuspendLayout(); @@ -104,6 +108,7 @@ this.panel3.SuspendLayout(); this.tpRemote.SuspendLayout(); this.tpUrls.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.uadGMT)).BeginInit(); this.SuspendLayout(); // // tbConfig @@ -118,7 +123,7 @@ this.tbConfig.Location = new System.Drawing.Point(1, 1); this.tbConfig.Name = "tbConfig"; this.tbConfig.SelectedIndex = 0; - this.tbConfig.Size = new System.Drawing.Size(682, 231); + this.tbConfig.Size = new System.Drawing.Size(682, 252); this.tbConfig.TabIndex = 0; // // tpMain @@ -130,7 +135,7 @@ this.tpMain.Location = new System.Drawing.Point(4, 22); this.tpMain.Name = "tpMain"; this.tpMain.Padding = new System.Windows.Forms.Padding(3); - this.tpMain.Size = new System.Drawing.Size(674, 205); + this.tpMain.Size = new System.Drawing.Size(674, 226); this.tpMain.TabIndex = 0; this.tpMain.Text = "Main"; this.tpMain.UseVisualStyleBackColor = true; @@ -138,6 +143,8 @@ // panel1 // this.panel1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(192))))); + this.panel1.Controls.Add(this.uadGMT); + this.panel1.Controls.Add(this.label29); this.panel1.Controls.Add(this.uadGMH); this.panel1.Controls.Add(this.label2); this.panel1.Controls.Add(this.uadVEH); @@ -153,12 +160,12 @@ this.panel1.Controls.Add(this.label6); this.panel1.Location = new System.Drawing.Point(10, 11); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(162, 185); + this.panel1.Size = new System.Drawing.Size(162, 209); this.panel1.TabIndex = 17; // // uadGMH // - this.uadGMH.Location = new System.Drawing.Point(109, 75); + this.uadGMH.Location = new System.Drawing.Point(111, 75); this.uadGMH.Maximum = new decimal(new int[] { 10, 0, @@ -190,7 +197,7 @@ // // uadVEH // - this.uadVEH.Location = new System.Drawing.Point(109, 153); + this.uadVEH.Location = new System.Drawing.Point(111, 180); this.uadVEH.Maximum = new decimal(new int[] { 10, 0, @@ -212,7 +219,7 @@ // // uadVEA // - this.uadVEA.Location = new System.Drawing.Point(109, 127); + this.uadVEA.Location = new System.Drawing.Point(111, 154); this.uadVEA.Maximum = new decimal(new int[] { 10, 0, @@ -243,7 +250,7 @@ // // uadVER // - this.uadVER.Location = new System.Drawing.Point(109, 101); + this.uadVER.Location = new System.Drawing.Point(111, 128); this.uadVER.Maximum = new decimal(new int[] { 10, 0, @@ -274,7 +281,7 @@ // // uadGMA // - this.uadGMA.Location = new System.Drawing.Point(109, 49); + this.uadGMA.Location = new System.Drawing.Point(111, 49); this.uadGMA.Maximum = new decimal(new int[] { 10, 0, @@ -305,7 +312,7 @@ // // uadGMR // - this.uadGMR.Location = new System.Drawing.Point(109, 23); + this.uadGMR.Location = new System.Drawing.Point(111, 23); this.uadGMR.Maximum = new decimal(new int[] { 10, 0, @@ -328,7 +335,7 @@ // label5 // this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(6, 103); + this.label5.Location = new System.Drawing.Point(6, 130); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(93, 13); this.label5.TabIndex = 8; @@ -337,7 +344,7 @@ // label7 // this.label7.AutoSize = true; - this.label7.Location = new System.Drawing.Point(6, 155); + this.label7.Location = new System.Drawing.Point(6, 182); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(97, 13); this.label7.TabIndex = 12; @@ -346,7 +353,7 @@ // label6 // this.label6.AutoSize = true; - this.label6.Location = new System.Drawing.Point(6, 129); + this.label6.Location = new System.Drawing.Point(6, 156); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(93, 13); this.label6.TabIndex = 10; @@ -426,7 +433,7 @@ this.panel3.Controls.Add(this.label23); this.panel3.Location = new System.Drawing.Point(171, 114); this.panel3.Name = "panel3"; - this.panel3.Size = new System.Drawing.Size(493, 82); + this.panel3.Size = new System.Drawing.Size(493, 106); this.panel3.TabIndex = 24; // // txbCacheDaysDetailed @@ -703,6 +710,8 @@ // // tpUrls // + this.tpUrls.Controls.Add(this.txbGMTUrl); + this.tpUrls.Controls.Add(this.label30); this.tpUrls.Controls.Add(this.txbGMRUrl); this.tpUrls.Controls.Add(this.label28); this.tpUrls.Controls.Add(this.txbGMHUrl); @@ -714,7 +723,7 @@ this.tpUrls.Location = new System.Drawing.Point(4, 22); this.tpUrls.Name = "tpUrls"; this.tpUrls.Padding = new System.Windows.Forms.Padding(3); - this.tpUrls.Size = new System.Drawing.Size(674, 205); + this.tpUrls.Size = new System.Drawing.Size(674, 226); this.tpUrls.TabIndex = 2; this.tpUrls.Text = "Tile URL\'s"; this.tpUrls.UseVisualStyleBackColor = true; @@ -755,7 +764,7 @@ // // txbVEUrl // - this.txbVEUrl.Location = new System.Drawing.Point(108, 92); + this.txbVEUrl.Location = new System.Drawing.Point(108, 122); this.txbVEUrl.Name = "txbVEUrl"; this.txbVEUrl.Size = new System.Drawing.Size(309, 20); this.txbVEUrl.TabIndex = 3; @@ -764,7 +773,7 @@ // label26 // this.label26.AutoSize = true; - this.label26.Location = new System.Drawing.Point(7, 95); + this.label26.Location = new System.Drawing.Point(7, 125); this.label26.Name = "label26"; this.label26.Size = new System.Drawing.Size(80, 13); this.label26.TabIndex = 2; @@ -790,7 +799,7 @@ // // btnOk // - this.btnOk.Location = new System.Drawing.Point(627, 238); + this.btnOk.Location = new System.Drawing.Point(627, 259); this.btnOk.Name = "btnOk"; this.btnOk.Size = new System.Drawing.Size(42, 23); this.btnOk.TabIndex = 1; @@ -800,7 +809,7 @@ // // btnCancel // - this.btnCancel.Location = new System.Drawing.Point(569, 238); + this.btnCancel.Location = new System.Drawing.Point(569, 259); this.btnCancel.Name = "btnCancel"; this.btnCancel.Size = new System.Drawing.Size(52, 23); this.btnCancel.TabIndex = 2; @@ -808,11 +817,59 @@ this.btnCancel.UseVisualStyleBackColor = true; this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); // + // uadGMT + // + this.uadGMT.Location = new System.Drawing.Point(111, 101); + this.uadGMT.Maximum = new decimal(new int[] { + 10, + 0, + 0, + 0}); + this.uadGMT.Minimum = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.uadGMT.Name = "uadGMT"; + this.uadGMT.Size = new System.Drawing.Size(33, 20); + this.uadGMT.TabIndex = 13; + this.uadGMT.Value = new decimal(new int[] { + 1, + 0, + 0, + 0}); + // + // label29 + // + this.label29.AutoSize = true; + this.label29.Location = new System.Drawing.Point(6, 103); + this.label29.Name = "label29"; + this.label29.Size = new System.Drawing.Size(106, 13); + this.label29.TabIndex = 14; + this.label29.Text = "Google Maps Terrain"; + // + // txbGMTUrl + // + this.txbGMTUrl.Location = new System.Drawing.Point(108, 96); + this.txbGMTUrl.Name = "txbGMTUrl"; + this.txbGMTUrl.Size = new System.Drawing.Size(309, 20); + this.txbGMTUrl.TabIndex = 9; + this.txbGMTUrl.TextChanged += new System.EventHandler(this.txbGMTUrl_TextChanged); + // + // label30 + // + this.label30.AutoSize = true; + this.label30.Location = new System.Drawing.Point(7, 99); + this.label30.Name = "label30"; + this.label30.Size = new System.Drawing.Size(93, 13); + this.label30.TabIndex = 8; + this.label30.Text = "Google Terrain Url"; + // // WorldmapConfig // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(681, 273); + this.ClientSize = new System.Drawing.Size(681, 294); this.Controls.Add(this.btnCancel); this.Controls.Add(this.btnOk); this.Controls.Add(this.tbConfig); @@ -839,6 +896,7 @@ this.tpRemote.PerformLayout(); this.tpUrls.ResumeLayout(false); this.tpUrls.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.uadGMT)).EndInit(); this.ResumeLayout(false); } @@ -908,5 +966,9 @@ private System.Windows.Forms.Label label27; private System.Windows.Forms.TextBox txbVEUrl; private System.Windows.Forms.Label label26; + private System.Windows.Forms.NumericUpDown uadGMT; + private System.Windows.Forms.Label label29; + private System.Windows.Forms.TextBox txbGMTUrl; + private System.Windows.Forms.Label label30; } } \ No newline at end of file Modified: trunk/plugins/WorldMap/WorldmapConfig.cs =================================================================== --- trunk/plugins/WorldMap/WorldmapConfig.cs 2007-12-08 13:42:04 UTC (rev 1134) +++ trunk/plugins/WorldMap/WorldmapConfig.cs 2007-12-08 18:56:18 UTC (rev 1135) @@ -120,6 +120,7 @@ uadGMR.Value = (int)settings.ThreadCountGMR; uadGMA.Value = (int)settings.ThreadCountGMA; uadGMH.Value = (int)settings.ThreadCountGMH; + uadGMT.Value = (int)settings.ThreadCountGMT; uadVER.Value = (int)settings.ThreadCountVER; uadVEA.Value = (int)settings.ThreadCountVEA; uadVEH.Value = (int)settings.ThreadCountVEH; @@ -144,6 +145,7 @@ txbGMAUrl.Text = settings.GMAUrl; txbGMRUrl.Text = settings.GMRUrl; txbGMHUrl.Text = settings.GMHUrl; + txbGMTUrl.Text = settings.GMTUrl; txbVEUrl.Text = settings.VEUrl; } @@ -158,6 +160,7 @@ settings.ThreadCountGMR = (int)uadGMR.Value; settings.ThreadCountGMA = (int)uadGMA.Value; settings.ThreadCountGMH = (int)uadGMH.Value; + settings.ThreadCountGMT = (int)uadGMT.Value; settings.ThreadCountVER = (int)uadVER.Value; settings.ThreadCountVEA = (int)uadVEA.Value; settings.ThreadCountVEH = (int)uadVEH.Value; @@ -179,6 +182,7 @@ settings.GMAUrl = txbGMAUrl.Text; settings.GMRUrl = txbGMRUrl.Text; settings.GMHUrl = txbGMHUrl.Text; + settings.GMTUrl = txbGMTUrl.Text; settings.VEUrl = txbVEUrl.Text; try @@ -239,5 +243,15 @@ } else txbVEUrl.BackColor = System.Drawing.SystemColors.Window; } + + private void txbGMTUrl_TextChanged(object sender, EventArgs e) + { + if (txbGMTUrl.Text != settings.GMTUrl) + { + txbGMTUrl.BackColor = Color.LightCoral; + MapUrlsChanged = true; + } + else txbGMTUrl.BackColor = System.Drawing.SystemColors.Window; + } } } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lk...@us...> - 2007-12-10 07:26:27
|
Revision: 1137 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1137&view=rev Author: lkuech Date: 2007-12-09 23:26:11 -0800 (Sun, 09 Dec 2007) Log Message: ----------- GM Terrain Maps now working default skinfiles do now come with a "topbar disable"-tag Enter (or OK on the remote) in the main screen now brings up the maptype selection FIX: GM Terrain maps did ignore the relevant threadCount. Modified Paths: -------------- trunk/plugins/WorldMap/GUIWorldMap.csproj trunk/plugins/WorldMap/MAPS/ThreadedDownload.cs trunk/plugins/WorldMap/Settings.cs trunk/plugins/WorldMap/WorldMap.cs trunk/plugins/WorldMap/WorldmapMenu.cs trunk/plugins/WorldMap/skinFiles/BlueTwo/MyWorldmapMenu.xml trunk/plugins/WorldMap/skinFiles/BlueTwo/MyWorldmapSearch.xml trunk/plugins/WorldMap/skinFiles/BlueTwo/MyWorldmapSearchResults.xml trunk/plugins/WorldMap/skinFiles/BlueTwo wide/MyWorldmapMenu.xml trunk/plugins/WorldMap/skinFiles/BlueTwo wide/MyWorldmapSearch.xml trunk/plugins/WorldMap/skinFiles/BlueTwo wide/MyWorldmapSearchResults.xml Added Paths: ----------- trunk/plugins/WorldMap/System.Data.SQLite.DLL Modified: trunk/plugins/WorldMap/GUIWorldMap.csproj =================================================================== --- trunk/plugins/WorldMap/GUIWorldMap.csproj 2007-12-09 06:00:45 UTC (rev 1136) +++ trunk/plugins/WorldMap/GUIWorldMap.csproj 2007-12-10 07:26:11 UTC (rev 1137) @@ -36,15 +36,21 @@ <SpecificVersion>False</SpecificVersion> <HintPath>..\Dialogs\bin\Debug\Dialogs.dll</HintPath> </Reference> - <Reference Include="Microsoft.DirectX, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> - <Reference Include="Microsoft.DirectX.Direct3D, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> - <Reference Include="Microsoft.DirectX.Direct3DX, Version=1.0.2911.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> - <Reference Include="Microsoft.DirectX.DirectDraw, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /> + <Reference Include="Microsoft.DirectX.Direct3D, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> + <HintPath>..\MediaPortal.Base\Microsoft.DirectX.Direct3D.dll</HintPath> + </Reference> + <Reference Include="Microsoft.DirectX.Direct3DX, Version=1.0.2911.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\MediaPortal.Base\Microsoft.DirectX.Direct3DX.dll</HintPath> + </Reference> + <Reference Include="Microsoft.DirectX.DirectDraw, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> + <HintPath>..\MediaPortal.Base\Microsoft.DirectX.DirectDraw.dll</HintPath> + </Reference> <Reference Include="System" /> <Reference Include="System.Data" /> <Reference Include="System.Data.SQLite, Version=1.0.41.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <HintPath>bin\Debug\System.Data.SQLite.DLL</HintPath> + <HintPath>.\System.Data.SQLite.DLL</HintPath> </Reference> <Reference Include="System.Drawing" /> <Reference Include="System.Windows.Forms" /> Modified: trunk/plugins/WorldMap/MAPS/ThreadedDownload.cs =================================================================== --- trunk/plugins/WorldMap/MAPS/ThreadedDownload.cs 2007-12-09 06:00:45 UTC (rev 1136) +++ trunk/plugins/WorldMap/MAPS/ThreadedDownload.cs 2007-12-10 07:26:11 UTC (rev 1137) @@ -137,6 +137,8 @@ break; case MapFunctions.MapType.GMHybrid: maxThreadCount = mapConfig.ThreadCountGMH; break; + case MapFunctions.MapType.GMTerrain: maxThreadCount = mapConfig.ThreadCountGMT; + break; case MapFunctions.MapType.VERoad: maxThreadCount = mapConfig.ThreadCountVER; break; case MapFunctions.MapType.VEAerial: maxThreadCount = mapConfig.ThreadCountVEA; Modified: trunk/plugins/WorldMap/Settings.cs =================================================================== --- trunk/plugins/WorldMap/Settings.cs 2007-12-09 06:00:45 UTC (rev 1136) +++ trunk/plugins/WorldMap/Settings.cs 2007-12-10 07:26:11 UTC (rev 1137) @@ -127,7 +127,7 @@ using (MediaPortal.Profile.Settings reader = new MediaPortal.Profile.Settings(Config.GetSubFolder(Config.Dir.Plugins,"Windows") + "\\GUIWorldmap.xml")) { - GMAUrl = reader.GetValueAsString(SectionName, ParmGMAUrl, "http://kh{0}.google.com/kh?n=404&v=18&t={1}"); + GMAUrl = reader.GetValueAsString(SectionName, ParmGMAUrl, "http://kh{0}.google.com/kh?n=404&v=99&t={1}"); GMRUrl = reader.GetValueAsString(SectionName, ParmGMRUrl, "http://mt{0}.google.com/mt?n=404&v=w2.99&x={1}&y={2}&zoom={3}"); GMHUrl = reader.GetValueAsString(SectionName, ParmGMHUrl, "http://mt{0}.google.com/mt?n=404&v=w2t.99&x={1}&y={2}&zoom={3}"); GMTUrl = reader.GetValueAsString(SectionName, ParmGMTUrl, "http://mt{0}.google.com/mt?n=404&v=w2p.99&x={1}&y={2}&zoom={3}"); Added: trunk/plugins/WorldMap/System.Data.SQLite.DLL =================================================================== (Binary files differ) Property changes on: trunk/plugins/WorldMap/System.Data.SQLite.DLL ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/plugins/WorldMap/WorldMap.cs =================================================================== --- trunk/plugins/WorldMap/WorldMap.cs 2007-12-09 06:00:45 UTC (rev 1136) +++ trunk/plugins/WorldMap/WorldMap.cs 2007-12-10 07:26:11 UTC (rev 1137) @@ -95,6 +95,7 @@ Settings settings; bool VisibleImageChanged = false; + bool MapTypeMenuShown = false; WorldmapMenu Menu = null; WorldmapSearch Search = null; @@ -463,6 +464,11 @@ GUIWindowManager.ActivateWindow(Menu.GetID); } break; + case Action.ActionType.ACTION_SELECT_ITEM: + { + ChooseMapType(); + } + break; case Action.ActionType.ACTION_KEY_PRESSED: { if (action.m_key.KeyChar == 'r') @@ -531,6 +537,64 @@ Log.Debug("[Worldmap] Calcalation result: ScreenWidth:MinZoomLevel:mapTiles {0}:{1}:{2}", GUIGraphicsContext.Width, MinZoomLevel, tmpMapTiles); } + public void ChooseMapType() + { + if (MapTypeMenuShown) return; + MapTypeMenuShown = true; + + GUIDialogMenu Menu = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); + + Menu.Reset(); + Menu.SetHeading("Choose a maptype"); + + Array tmpMapTypes = Enum.GetValues(typeof(MapFunctions.MapType)); + + for (int i = 0; i < tmpMapTypes.Length; i++) + { + MapFunctions.MapType tmpMapType = (MapFunctions.MapType)(Enum.ToObject(typeof(MapFunctions.MapType), i)); + switch (tmpMapType) + { + case MapFunctions.MapType.GMRoad: + Menu.Add("Google Road"); + break; + case MapFunctions.MapType.GMTerrain: + Menu.Add("Google Terrain"); + break; + case MapFunctions.MapType.GMAerial: + Menu.Add("Google Satellite"); + break; + case MapFunctions.MapType.GMHybrid: + Menu.Add("Google Hybrid"); + break; + case MapFunctions.MapType.VERoad: + Menu.Add("Microsoft Road"); + break; + case MapFunctions.MapType.VEAerial: + Menu.Add("Microsoft Satellite"); + break; + case MapFunctions.MapType.VEHybrid: + Menu.Add("Microsoft Hybrid"); + break; + } + } + + Menu.SelectedLabel = Convert.ToInt32(this.currentMapType); + + Menu.DoModal(GUIWindowManager.ActiveWindow); + MapTypeMenuShown = false; + + if (Menu.SelectedLabel == -1) + return; + + //WorldMap tmpMainWindow = (WorldMap)GUIWindowManager.GetWindow((int)WorldmapWindowIDs.MainWindow); + + //tmpMainWindow.currentMapType = (MapFunctions.MapType)(Enum.ToObject(typeof(MapFunctions.MapType), Menu.SelectedLabel)); + //tmpMainWindow.RefreshImageTiles(); + this.currentMapType = (MapFunctions.MapType)(Enum.ToObject(typeof(MapFunctions.MapType), Menu.SelectedLabel)); + this.RefreshImageTiles(); + } + + public override void Render(float timePassed) { int ThreadsRunning = 0; Modified: trunk/plugins/WorldMap/WorldmapMenu.cs =================================================================== --- trunk/plugins/WorldMap/WorldmapMenu.cs 2007-12-09 06:00:45 UTC (rev 1136) +++ trunk/plugins/WorldMap/WorldmapMenu.cs 2007-12-10 07:26:11 UTC (rev 1137) @@ -127,31 +127,8 @@ private void ChooseMapType() { - if (MenuShown) return; - MenuShown = true; - - GUIDialogMenu Menu = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); - - Menu.Reset(); - Menu.SetHeading("Choose a maptype"); - - Array tmpMapTypes = Enum.GetValues(typeof(MapFunctions.MapType)); - - for (int i = 0; i < tmpMapTypes.Length; i++) - { - Menu.Add(((MapFunctions.MapType)(Enum.ToObject(typeof(MapFunctions.MapType), i))).ToString()); - } - - Menu.DoModal(GUIWindowManager.ActiveWindow); - MenuShown = false; - - if (Menu.SelectedLabel == -1) - return; - WorldMap tmpMainWindow = (WorldMap)GUIWindowManager.GetWindow((int)WorldmapWindowIDs.MainWindow); - - tmpMainWindow.currentMapType = (MapFunctions.MapType)(Enum.ToObject(typeof(MapFunctions.MapType), Menu.SelectedLabel)); - tmpMainWindow.RefreshImageTiles(); + tmpMainWindow.ChooseMapType(); } private void ShowLastResults() Modified: trunk/plugins/WorldMap/skinFiles/BlueTwo/MyWorldmapMenu.xml =================================================================== --- trunk/plugins/WorldMap/skinFiles/BlueTwo/MyWorldmapMenu.xml 2007-12-09 06:00:45 UTC (rev 1136) +++ trunk/plugins/WorldMap/skinFiles/BlueTwo/MyWorldmapMenu.xml 2007-12-10 07:26:11 UTC (rev 1137) @@ -3,6 +3,7 @@ <id>10235</id> <defaultcontrol>2</defaultcontrol> <allowoverlay>no</allowoverlay> + <disabletopbar>yes</disabletopbar> <controls> <control> <description>background</description> Modified: trunk/plugins/WorldMap/skinFiles/BlueTwo/MyWorldmapSearch.xml =================================================================== --- trunk/plugins/WorldMap/skinFiles/BlueTwo/MyWorldmapSearch.xml 2007-12-09 06:00:45 UTC (rev 1136) +++ trunk/plugins/WorldMap/skinFiles/BlueTwo/MyWorldmapSearch.xml 2007-12-10 07:26:11 UTC (rev 1137) @@ -2,6 +2,7 @@ <id>10236</id> <defaultcontrol>2</defaultcontrol> <allowoverlay>no</allowoverlay> + <disabletopbar>yes</disabletopbar> <controls> <control> <type>image</type> Modified: trunk/plugins/WorldMap/skinFiles/BlueTwo/MyWorldmapSearchResults.xml =================================================================== --- trunk/plugins/WorldMap/skinFiles/BlueTwo/MyWorldmapSearchResults.xml 2007-12-09 06:00:45 UTC (rev 1136) +++ trunk/plugins/WorldMap/skinFiles/BlueTwo/MyWorldmapSearchResults.xml 2007-12-10 07:26:11 UTC (rev 1137) @@ -2,6 +2,7 @@ <id>10237</id> <defaultcontrol>5</defaultcontrol> <allowoverlay>no</allowoverlay> + <disabletopbar>yes</disabletopbar> <controls> <control> <type>image</type> Modified: trunk/plugins/WorldMap/skinFiles/BlueTwo wide/MyWorldmapMenu.xml =================================================================== --- trunk/plugins/WorldMap/skinFiles/BlueTwo wide/MyWorldmapMenu.xml 2007-12-09 06:00:45 UTC (rev 1136) +++ trunk/plugins/WorldMap/skinFiles/BlueTwo wide/MyWorldmapMenu.xml 2007-12-10 07:26:11 UTC (rev 1137) @@ -3,6 +3,7 @@ <id>10235</id> <defaultcontrol>2</defaultcontrol> <allowoverlay>no</allowoverlay> + <disabletopbar>yes</disabletopbar> <controls> <control> <description>background</description> Modified: trunk/plugins/WorldMap/skinFiles/BlueTwo wide/MyWorldmapSearch.xml =================================================================== --- trunk/plugins/WorldMap/skinFiles/BlueTwo wide/MyWorldmapSearch.xml 2007-12-09 06:00:45 UTC (rev 1136) +++ trunk/plugins/WorldMap/skinFiles/BlueTwo wide/MyWorldmapSearch.xml 2007-12-10 07:26:11 UTC (rev 1137) @@ -2,6 +2,7 @@ <id>10236</id> <defaultcontrol>2</defaultcontrol> <allowoverlay>no</allowoverlay> + <disabletopbar>yes</disabletopbar> <controls> <control> <type>image</type> Modified: trunk/plugins/WorldMap/skinFiles/BlueTwo wide/MyWorldmapSearchResults.xml =================================================================== --- trunk/plugins/WorldMap/skinFiles/BlueTwo wide/MyWorldmapSearchResults.xml 2007-12-09 06:00:45 UTC (rev 1136) +++ trunk/plugins/WorldMap/skinFiles/BlueTwo wide/MyWorldmapSearchResults.xml 2007-12-10 07:26:11 UTC (rev 1137) @@ -2,6 +2,7 @@ <id>10237</id> <defaultcontrol>5</defaultcontrol> <allowoverlay>no</allowoverlay> + <disabletopbar>yes</disabletopbar> <controls> <control> <type>image</type> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lk...@us...> - 2007-12-10 12:51:56
|
Revision: 1138 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1138&view=rev Author: lkuech Date: 2007-12-10 04:51:05 -0800 (Mon, 10 Dec 2007) Log Message: ----------- FIX: Exception appeared when closing MP with WorldMap in foreground FIX: Better handling of empty SearchResults (GeoCodes) FIX: "IP Blocked" bitmap was not always shown Modified Paths: -------------- trunk/plugins/WorldMap/MAPS/SearchGeoCodes.cs trunk/plugins/WorldMap/MAPS/ThreadedDownload.cs trunk/plugins/WorldMap/WorldMap.cs trunk/plugins/WorldMap/WorldMapSearchResults.cs trunk/plugins/WorldMap/WorldmapMenu.cs trunk/plugins/WorldMap/WorldmapSearch.cs Modified: trunk/plugins/WorldMap/MAPS/SearchGeoCodes.cs =================================================================== --- trunk/plugins/WorldMap/MAPS/SearchGeoCodes.cs 2007-12-10 07:26:11 UTC (rev 1137) +++ trunk/plugins/WorldMap/MAPS/SearchGeoCodes.cs 2007-12-10 12:51:05 UTC (rev 1138) @@ -84,9 +84,9 @@ public void PushYahooResultToSearchResult(string XMLString) { - if (XMLString == null) return; SearchResult = new List<GeoCode>(); SearchResult.Clear(); + if (XMLString == null) return; XmlDocument doc = new XmlDocument(); doc.LoadXml(XMLString); @@ -121,6 +121,8 @@ SearchResult = new List<GeoCode>(); SearchResult.Clear(); + if (XMLString == null) return; + XmlDocument doc = new XmlDocument(); doc.LoadXml(XMLString); Modified: trunk/plugins/WorldMap/MAPS/ThreadedDownload.cs =================================================================== --- trunk/plugins/WorldMap/MAPS/ThreadedDownload.cs 2007-12-10 07:26:11 UTC (rev 1137) +++ trunk/plugins/WorldMap/MAPS/ThreadedDownload.cs 2007-12-10 12:51:05 UTC (rev 1138) @@ -311,7 +311,15 @@ httpResponse = (HttpWebResponse)httpRequest.GetResponse(); tmpImageStream = httpResponse.GetResponseStream(); - tmpTileImage = new Bitmap(tmpImageStream); + try + { + tmpTileImage = new Bitmap(tmpImageStream); + } + catch (Exception) + { + tmpImage.Image = mapConfig.IPBlocked; + } + if (tmpImage.MapType == MapFunctions.MapType.GMHybrid) { cacheDatabase.InsertImage("gma", tmpImage.PosX, tmpImage.PosY, tmpImage.ZoomLevel, tmpTileImage); Modified: trunk/plugins/WorldMap/WorldMap.cs =================================================================== --- trunk/plugins/WorldMap/WorldMap.cs 2007-12-10 07:26:11 UTC (rev 1137) +++ trunk/plugins/WorldMap/WorldMap.cs 2007-12-10 12:51:05 UTC (rev 1138) @@ -289,7 +289,8 @@ { if(IsNotWorldmapWindow(new_windowId)) { - SaveSettingsAndFreeRessources(); + bool MPisClosing = (new_windowId == 0); + SaveSettingsAndFreeRessources(MPisClosing); } } @@ -302,7 +303,7 @@ else return false; } - public void SaveSettingsAndFreeRessources() + public void SaveSettingsAndFreeRessources(bool MPisClosing) { settings.DaysToKeepCachedDetailedTiles = mapConfig.DaysToKeepCachedDetailedTiles; settings.DaysToKeepCachedOverviewTiles = mapConfig.DaysToKeepCachedOverviewTiles; @@ -328,8 +329,14 @@ mapTiles.ClearTileDownloadQueue(); - using (WaitCursor cursor = new WaitCursor()) mapTiles.ImageGrabber.cacheDatabase.DeleteOldCacheEntries(); - + if (MPisClosing) + { + mapTiles.ImageGrabber.cacheDatabase.DeleteOldCacheEntries(); + } + else + { + using (WaitCursor cursor = new WaitCursor()) mapTiles.ImageGrabber.cacheDatabase.DeleteOldCacheEntries(); + } mapTiles = null; ProgressBarActiveTexture.Dispose(); Modified: trunk/plugins/WorldMap/WorldMapSearchResults.cs =================================================================== --- trunk/plugins/WorldMap/WorldMapSearchResults.cs 2007-12-10 07:26:11 UTC (rev 1137) +++ trunk/plugins/WorldMap/WorldMapSearchResults.cs 2007-12-10 12:51:05 UTC (rev 1138) @@ -99,7 +99,8 @@ if (tmpMainWindow.IsNotWorldmapWindow(new_windowId)) { - tmpMainWindow.SaveSettingsAndFreeRessources(); + bool MPisClosing = (new_windowId == 0); + tmpMainWindow.SaveSettingsAndFreeRessources(MPisClosing); } } Modified: trunk/plugins/WorldMap/WorldmapMenu.cs =================================================================== --- trunk/plugins/WorldMap/WorldmapMenu.cs 2007-12-10 07:26:11 UTC (rev 1137) +++ trunk/plugins/WorldMap/WorldmapMenu.cs 2007-12-10 12:51:05 UTC (rev 1138) @@ -64,7 +64,8 @@ if (tmpMainWindow.IsNotWorldmapWindow(new_windowId)) { - tmpMainWindow.SaveSettingsAndFreeRessources(); + bool MPisClosing = (new_windowId == 0); + tmpMainWindow.SaveSettingsAndFreeRessources(MPisClosing); } } Modified: trunk/plugins/WorldMap/WorldmapSearch.cs =================================================================== --- trunk/plugins/WorldMap/WorldmapSearch.cs 2007-12-10 07:26:11 UTC (rev 1137) +++ trunk/plugins/WorldMap/WorldmapSearch.cs 2007-12-10 12:51:05 UTC (rev 1138) @@ -113,7 +113,8 @@ if (tmpMainWindow.IsNotWorldmapWindow(new_windowId)) { - tmpMainWindow.SaveSettingsAndFreeRessources(); + bool MPisClosing = (new_windowId == 0); + tmpMainWindow.SaveSettingsAndFreeRessources(MPisClosing); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lk...@us...> - 2007-12-10 13:23:29
|
Revision: 1139 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1139&view=rev Author: lkuech Date: 2007-12-10 05:23:27 -0800 (Mon, 10 Dec 2007) Log Message: ----------- Prepare MPInstaller file Added Paths: ----------- trunk/plugins/WorldMap/Installer/ trunk/plugins/WorldMap/Installer/Worldmap.xmp trunk/plugins/WorldMap/Installer/globe-compass.ico Added: trunk/plugins/WorldMap/Installer/Worldmap.xmp =================================================================== --- trunk/plugins/WorldMap/Installer/Worldmap.xmp (rev 0) +++ trunk/plugins/WorldMap/Installer/Worldmap.xmp 2007-12-10 13:23:27 UTC (rev 1139) @@ -0,0 +1,48 @@ +<MPinstaler> + <ver>1.00.000</ver> + <FileList> + <File> + <FileName>GUIWorldmap.dll</FileName> + <Type>Plugin</Type> + <SubType>Window</SubType> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\bin\Release\GUIWorldmap.dll</Source> + <Id>01010</Id> + <Option /> + <Guid>d2ee1aed-4d96-47f4-a4a7-89a5734c83d9</Guid> + </File> + <File> + <FileName>System.Data.SQLite.DLL</FileName> + <Type>Plugin</Type> + <SubType>Window</SubType> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\System.Data.SQLite.DLL</Source> + <Id>01010</Id> + <Option /> + <Guid>2e1ade2a-0b65-4b61-8d81-3a73caf88a39</Guid> + </File> + </FileList> + <StringList /> + <Actions /> + <SetupGroups /> + <SetupGroupMappings /> + <Option> + <BuildFileName /> + <ProiectFileName>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\Installer\Worldmap.xmp</ProiectFileName> + <ProiectName>Worldmap</ProiectName> + <Author>LKuech</Author> + <UpdateURL>http://www.team-mediaportal.com</UpdateURL> + <Version>0.5</Version> + <Description>Browse the whole world via your remote and watch Road maps, Satellite images or a hybrid image from Google maps or Microsoft Virtual Earth.</Description> + <Group>Web</Group> + <Release>Beta</Release> + </Option> + <Properties> + <MPMaxVersion /> + <MPMinVersion /> + <MinExtensionVersion /> + <MaxExtensionVersion /> + <ForumURL /> + <WebURL /> + <CreationDate>Monday, December 10, 2007 12:00:00 AM</CreationDate> + <SingleGroupSelect>False</SingleGroupSelect> + </Properties> +</MPinstaler> \ No newline at end of file Added: trunk/plugins/WorldMap/Installer/globe-compass.ico =================================================================== (Binary files differ) Property changes on: trunk/plugins/WorldMap/Installer/globe-compass.ico ___________________________________________________________________ Name: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lk...@us...> - 2007-12-13 09:49:39
|
Revision: 1151 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1151&view=rev Author: lkuech Date: 2007-12-13 01:49:30 -0800 (Thu, 13 Dec 2007) Log Message: ----------- Enabled multi language support. fixed the "my"-prefix bug. fixed a navigation bug with the menu of the BlueTwo skin. refactored the the namespace. Modified Paths: -------------- trunk/plugins/WorldMap/GUIWorldMap.csproj trunk/plugins/WorldMap/Installer/Worldmap.xmp trunk/plugins/WorldMap/PlugInBase.cs trunk/plugins/WorldMap/Settings.cs trunk/plugins/WorldMap/WorldMap.cs trunk/plugins/WorldMap/WorldMapSearchResults.cs trunk/plugins/WorldMap/WorldmapConfig.Designer.cs trunk/plugins/WorldMap/WorldmapConfig.cs trunk/plugins/WorldMap/WorldmapMenu.cs trunk/plugins/WorldMap/WorldmapSearch.cs trunk/plugins/WorldMap/skinFiles/BlueTwo/MyWorldmapMenu.xml Added Paths: ----------- trunk/plugins/WorldMap/LocalizeStrings.cs trunk/plugins/WorldMap/language/ trunk/plugins/WorldMap/language/MyWorldmap/ trunk/plugins/WorldMap/language/MyWorldmap/strings_de.xml trunk/plugins/WorldMap/language/MyWorldmap/strings_en.xml Modified: trunk/plugins/WorldMap/GUIWorldMap.csproj =================================================================== --- trunk/plugins/WorldMap/GUIWorldMap.csproj 2007-12-13 05:23:17 UTC (rev 1150) +++ trunk/plugins/WorldMap/GUIWorldMap.csproj 2007-12-13 09:49:30 UTC (rev 1151) @@ -61,6 +61,7 @@ </Reference> </ItemGroup> <ItemGroup> + <Compile Include="LocalizeStrings.cs" /> <Compile Include="Properties\Resources.Designer.cs"> <AutoGen>True</AutoGen> <DesignTime>True</DesignTime> Modified: trunk/plugins/WorldMap/Installer/Worldmap.xmp =================================================================== --- trunk/plugins/WorldMap/Installer/Worldmap.xmp 2007-12-13 05:23:17 UTC (rev 1150) +++ trunk/plugins/WorldMap/Installer/Worldmap.xmp 2007-12-13 09:49:30 UTC (rev 1151) @@ -8,7 +8,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\bin\Release\GUIWorldmap.dll</Source> <Id>01010</Id> <Option /> - <Guid>0390f2ca-304a-4184-9ef7-daa21547649f</Guid> + <Guid>150d9039-90cb-41c4-9e22-9e0382676428</Guid> </File> <File> <FileName>GUIWorldmap.xml</FileName> @@ -17,7 +17,7 @@ <Source>GUIWorldmap.xml</Source> <Id>01010</Id> <Option /> - <Guid>9869589b-dc7f-4d63-b12a-034131b4e642</Guid> + <Guid>b0f4f614-918d-4562-a378-62a490df965b</Guid> </File> <File> <FileName>hover_worldmap.png</FileName> @@ -26,206 +26,224 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\hover_worldmap.png</Source> <Id>04010</Id> <Option /> - <Guid>54a37bf8-1c6b-4de9-81ce-50f90695872f</Guid> + <Guid>0e59df06-8cdd-4e4d-b061-92fcbfdce298</Guid> </File> <File> - <FileName>WMIPBlocked.jpeg</FileName> + <FileName>hover_worldmap.png</FileName> <Type>Other</Type> - <SubType>%Skin%\BlueTwo wide\Media</SubType> - <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\WMIPBlocked.jpeg</Source> + <SubType>%Skin%\BlueTwo\Media</SubType> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\hover_worldmap.png</Source> <Id>04010</Id> <Option /> - <Guid>be36be7a-3245-4fb0-a495-b5ca75a00dfe</Guid> + <Guid>6987f549-1f62-4670-8dc7-c62d60d6351a</Guid> </File> <File> - <FileName>WMprogressBarActive.png</FileName> + <FileName>MyWorldMap.xml</FileName> <Type>Other</Type> - <SubType>%Skin%\BlueTwo wide\Media</SubType> - <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\WMprogressBarActive.png</Source> + <SubType>%Skin%\BlueTwo wide</SubType> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\MyWorldMap.xml</Source> <Id>04010</Id> <Option /> - <Guid>0d13ea2d-8fe9-46d1-a687-3e51821a773c</Guid> + <Guid>e3b4a7d2-45b3-44c3-92cf-d205d01bba3c</Guid> </File> <File> - <FileName>WMprogressBarQueued.png</FileName> + <FileName>MyWorldMap.xml</FileName> <Type>Other</Type> - <SubType>%Skin%\BlueTwo wide\Media</SubType> - <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\WMprogressBarQueued.png</Source> + <SubType>%Skin%\BlueTwo</SubType> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\MyWorldMap.xml</Source> <Id>04010</Id> <Option /> - <Guid>248e6bb8-e410-4180-b25a-2037d466467d</Guid> + <Guid>05f01705-359d-4536-8023-7a33419e1f50</Guid> </File> <File> - <FileName>WMprogressDummy.png</FileName> + <FileName>MyWorldmapMenu.xml</FileName> <Type>Other</Type> - <SubType>%Skin%\BlueTwo wide\Media</SubType> - <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\WMprogressDummy.png</Source> + <SubType>%Skin%\BlueTwo wide</SubType> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\MyWorldmapMenu.xml</Source> <Id>04010</Id> <Option /> - <Guid>374f1c3f-039f-424b-ab30-e3ce799fccc8</Guid> + <Guid>d595127f-9f85-4963-aa31-67ab316b3318</Guid> </File> <File> - <FileName>WMTileNotAvailable.jpeg</FileName> + <FileName>MyWorldmapMenu.xml</FileName> <Type>Other</Type> - <SubType>%Skin%\BlueTwo wide\Media</SubType> - <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\WMTileNotAvailable.jpeg</Source> + <SubType>%Skin%\BlueTwo</SubType> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\MyWorldmapMenu.xml</Source> <Id>04010</Id> <Option /> - <Guid>70132c77-e7d2-4b7c-8297-41429bfde3b6</Guid> + <Guid>5b7b849a-065a-47a1-a62a-b5103594a570</Guid> </File> <File> - <FileName>WMTilePlaceholder.jpeg</FileName> + <FileName>MyWorldmapSearch.xml</FileName> <Type>Other</Type> - <SubType>%Skin%\BlueTwo wide\Media</SubType> - <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\WMTilePlaceholder.jpeg</Source> + <SubType>%Skin%\BlueTwo wide</SubType> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\MyWorldmapSearch.xml</Source> <Id>04010</Id> <Option /> - <Guid>9ec4cbd1-e94b-4cf0-9032-982fe1a21bf2</Guid> + <Guid>f0764712-a889-41b7-aa21-71e7f787d448</Guid> </File> <File> - <FileName>MyWorldMap.xml</FileName> + <FileName>MyWorldmapSearch.xml</FileName> <Type>Other</Type> - <SubType>%Skin%\BlueTwo wide</SubType> - <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\MyWorldMap.xml</Source> + <SubType>%Skin%\BlueTwo</SubType> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\MyWorldmapSearch.xml</Source> <Id>04010</Id> <Option /> - <Guid>60ce0a34-e30e-40bf-bef0-e9fd75ea9a0a</Guid> + <Guid>01659dc8-3403-474a-8e2b-0af9e4718f02</Guid> </File> <File> - <FileName>MyWorldmapMenu.xml</FileName> + <FileName>MyWorldmapSearchResults.xml</FileName> <Type>Other</Type> <SubType>%Skin%\BlueTwo wide</SubType> - <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\MyWorldmapMenu.xml</Source> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\MyWorldmapSearchResults.xml</Source> <Id>04010</Id> <Option /> - <Guid>a5b6eb86-7ada-47f5-ae6b-3ad2175a6646</Guid> + <Guid>7fb93ce4-df48-41d7-95c5-4667fd9e597f</Guid> </File> <File> - <FileName>MyWorldmapSearch.xml</FileName> + <FileName>MyWorldmapSearchResults.xml</FileName> <Type>Other</Type> - <SubType>%Skin%\BlueTwo wide</SubType> - <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\MyWorldmapSearch.xml</Source> + <SubType>%Skin%\BlueTwo</SubType> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\MyWorldmapSearchResults.xml</Source> <Id>04010</Id> <Option /> - <Guid>7e67dab3-07dd-4fff-a585-db8c99683875</Guid> + <Guid>944e69b0-f988-4651-8a0f-74fbfb5b7e23</Guid> </File> <File> - <FileName>MyWorldmapSearchResults.xml</FileName> + <FileName>strings_de.xml</FileName> <Type>Other</Type> - <SubType>%Skin%\BlueTwo wide</SubType> - <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\MyWorldmapSearchResults.xml</Source> + <SubType>%Language%\MyWorldmap</SubType> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\language\MyWorldmap\strings_de.xml</Source> <Id>04010</Id> <Option /> - <Guid>df094da5-a0aa-476c-b57c-5e18d8c2c606</Guid> + <Guid>2a2845f6-3074-4960-90e1-38de1a9d969a</Guid> </File> <File> - <FileName>hover_worldmap.png</FileName> + <FileName>strings_en.xml</FileName> <Type>Other</Type> - <SubType>%Skin%\BlueTwo\Media</SubType> - <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\hover_worldmap.png</Source> + <SubType>%Language%\MyWorldmap</SubType> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\language\MyWorldmap\strings_en.xml</Source> <Id>04010</Id> <Option /> - <Guid>e7c4af1b-6b07-413f-ade5-07b5a313335f</Guid> + <Guid>86b5bd30-e28e-4cf5-9eca-82d32847660c</Guid> </File> <File> + <FileName>System.Data.SQLite.DLL</FileName> + <Type>Plugin</Type> + <SubType>Window</SubType> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\System.Data.SQLite.DLL</Source> + <Id>01010</Id> + <Option /> + <Guid>c14130a2-c7de-44ef-97ef-fcb5245a9989</Guid> + </File> + <File> <FileName>WMIPBlocked.jpeg</FileName> <Type>Other</Type> + <SubType>%Skin%\BlueTwo wide\Media</SubType> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\WMIPBlocked.jpeg</Source> + <Id>04010</Id> + <Option /> + <Guid>d89c6076-9e44-41ab-b2a4-b829f4383d78</Guid> + </File> + <File> + <FileName>WMIPBlocked.jpeg</FileName> + <Type>Other</Type> <SubType>%Skin%\BlueTwo\Media</SubType> <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\WMIPBlocked.jpeg</Source> <Id>04010</Id> <Option /> - <Guid>016a7236-aac2-4a08-a040-66127a30b586</Guid> + <Guid>5bad2483-c09a-460f-95dc-694da29643fc</Guid> </File> <File> <FileName>WMprogressBarActive.png</FileName> <Type>Other</Type> + <SubType>%Skin%\BlueTwo wide\Media</SubType> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\WMprogressBarActive.png</Source> + <Id>04010</Id> + <Option /> + <Guid>8d90b983-2ffa-48f6-a2fb-4f34046658bd</Guid> + </File> + <File> + <FileName>WMprogressBarActive.png</FileName> + <Type>Other</Type> <SubType>%Skin%\BlueTwo\Media</SubType> <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\WMprogressBarActive.png</Source> <Id>04010</Id> <Option /> - <Guid>a644fa25-8291-4bf9-9dca-ebac34ac2d0e</Guid> + <Guid>802d738f-9bbc-494c-b4e3-8cd735214893</Guid> </File> <File> <FileName>WMprogressBarQueued.png</FileName> <Type>Other</Type> - <SubType>%Skin%\BlueTwo\Media</SubType> - <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\WMprogressBarQueued.png</Source> + <SubType>%Skin%\BlueTwo wide\Media</SubType> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\WMprogressBarQueued.png</Source> <Id>04010</Id> <Option /> - <Guid>eff3f4b6-974a-4e7c-9454-746d215fba1b</Guid> + <Guid>421c2b25-8d9d-4d4a-af77-4f57d21ace90</Guid> </File> <File> - <FileName>WMprogressDummy.png</FileName> + <FileName>WMprogressBarQueued.png</FileName> <Type>Other</Type> <SubType>%Skin%\BlueTwo\Media</SubType> - <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\WMprogressDummy.png</Source> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\WMprogressBarQueued.png</Source> <Id>04010</Id> <Option /> - <Guid>aae9fba4-a1b8-4e87-b444-32c1442f3e1f</Guid> + <Guid>2995e3ad-1d7c-4136-970e-a08326a696ba</Guid> </File> <File> - <FileName>WMTileNotAvailable.jpeg</FileName> + <FileName>WMprogressDummy.png</FileName> <Type>Other</Type> - <SubType>%Skin%\BlueTwo\Media</SubType> - <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\WMTileNotAvailable.jpeg</Source> + <SubType>%Skin%\BlueTwo wide\Media</SubType> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\WMprogressDummy.png</Source> <Id>04010</Id> <Option /> - <Guid>dc10ce65-0482-46a1-a136-6cd01d3b0976</Guid> + <Guid>0ab52df2-2ccf-460d-99b2-290eea92244e</Guid> </File> <File> - <FileName>WMTilePlaceholder.jpeg</FileName> + <FileName>WMprogressDummy.png</FileName> <Type>Other</Type> <SubType>%Skin%\BlueTwo\Media</SubType> - <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\WMTilePlaceholder.jpeg</Source> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\WMprogressDummy.png</Source> <Id>04010</Id> <Option /> - <Guid>8266623f-46ce-459c-b58e-a71b0f6922f1</Guid> + <Guid>83d51e8b-089c-4858-82c2-1e504bd9b3b8</Guid> </File> <File> - <FileName>MyWorldMap.xml</FileName> + <FileName>WMTileNotAvailable.jpeg</FileName> <Type>Other</Type> - <SubType>%Skin%\BlueTwo</SubType> - <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\MyWorldMap.xml</Source> + <SubType>%Skin%\BlueTwo wide\Media</SubType> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\WMTileNotAvailable.jpeg</Source> <Id>04010</Id> <Option /> - <Guid>779e4c1f-46b1-4472-9485-956ae2f7cee3</Guid> + <Guid>447d23fb-0661-466b-8b08-22a509534275</Guid> </File> <File> - <FileName>MyWorldmapMenu.xml</FileName> + <FileName>WMTileNotAvailable.jpeg</FileName> <Type>Other</Type> - <SubType>%Skin%\BlueTwo</SubType> - <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\MyWorldmapMenu.xml</Source> + <SubType>%Skin%\BlueTwo\Media</SubType> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\WMTileNotAvailable.jpeg</Source> <Id>04010</Id> <Option /> - <Guid>a3fc33c1-d828-4ebb-b08a-cb02a72ad920</Guid> + <Guid>3b44e93c-6d4c-4d21-abcc-3dd2b6329f2e</Guid> </File> <File> - <FileName>MyWorldmapSearch.xml</FileName> + <FileName>WMTilePlaceholder.jpeg</FileName> <Type>Other</Type> - <SubType>%Skin%\BlueTwo</SubType> - <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\MyWorldmapSearch.xml</Source> + <SubType>%Skin%\BlueTwo wide\Media</SubType> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\WMTilePlaceholder.jpeg</Source> <Id>04010</Id> <Option /> - <Guid>581a0b87-504c-4189-b0c5-518c883ba397</Guid> + <Guid>9cdedc6a-6d29-4d8b-84ef-1c3bbbe61f2e</Guid> </File> <File> - <FileName>MyWorldmapSearchResults.xml</FileName> + <FileName>WMTilePlaceholder.jpeg</FileName> <Type>Other</Type> - <SubType>%Skin%\BlueTwo</SubType> - <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\MyWorldmapSearchResults.xml</Source> + <SubType>%Skin%\BlueTwo\Media</SubType> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\WMTilePlaceholder.jpeg</Source> <Id>04010</Id> <Option /> - <Guid>f116e37a-3d07-4aef-8f50-139de30e9d24</Guid> + <Guid>5659a223-6bec-4a9c-bfac-86611cfb4142</Guid> </File> - <File> - <FileName>System.Data.SQLite.DLL</FileName> - <Type>Plugin</Type> - <SubType>Window</SubType> - <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\System.Data.SQLite.DLL</Source> - <Id>01010</Id> - <Option /> - <Guid>c4727184-da74-47b4-87b3-23809319926a</Guid> - </File> </FileList> <StringList /> <Actions /> Added: trunk/plugins/WorldMap/LocalizeStrings.cs =================================================================== --- trunk/plugins/WorldMap/LocalizeStrings.cs (rev 0) +++ trunk/plugins/WorldMap/LocalizeStrings.cs 2007-12-13 09:49:30 UTC (rev 1151) @@ -0,0 +1,262 @@ +#region Copyright (C) 2005-2007 Team MediaPortal + +/* + * Copyright (C) 2005-2007 Team MediaPortal + * http://www.team-mediaportal.com + * + * This Program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This Program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GNU Make; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * http://www.gnu.org/copyleft/gpl.html + * + */ + +#endregion + +using System; +using System.IO; +using System.Globalization; +using System.Collections; +using System.Collections.Generic; +using System.Text; +using System.Xml; +using MediaPortal.Util; +using MediaPortal.GUI.Library; +using MediaPortal.Configuration; +using MediaPortal.Localisation; + +namespace MediaPortal.GUI.MyWorldmap +{ + /// <summary> + /// This class will hold all text used in the application + /// The text is loaded for the current language from + /// the file language/[language]/strings.xml + /// </summary> + public class GUILocalizeStrings + { + #region Variables + static LocalisationProvider _stringProvider; + static Dictionary<string, string> _cultures; + static string[] _languages; + #endregion + + #region Constructors/Destructors + // singleton. Dont allow any instance of this class + private GUILocalizeStrings() + { + } + + static public void Dispose() + { + if (_stringProvider != null) + _stringProvider.Dispose(); + } + #endregion + + #region Public Methods + /// <summary> + /// Public method to load the text from a strings/xml file into memory + /// </summary> + /// <param name="strFileName">Contains the filename+path for the string.xml file</param> + /// <returns> + /// true when text is loaded + /// false when it was unable to load the text + /// </returns> + //[Obsolete("This method has changed", true)] + static public bool Load(string language) + { + bool isPrefixEnabled = true; + + using (MediaPortal.Profile.Settings reader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + isPrefixEnabled = reader.GetValueAsBool("general", "myprefix", true); + if (language == null) language = reader.GetValueAsString("skin", "language", "English"); + } + + string directory = Config.GetSubFolder(Config.Dir.Language, "MyWorldmap"); + string cultureName = null; + if (language != null) cultureName = GetCultureName(language); + + Log.Info(" Loading localised Strings - Path: {0} Culture: {1} Language: {2} Prefix: {3}", directory, cultureName, language, isPrefixEnabled); + + _stringProvider = new LocalisationProvider(directory, cultureName, isPrefixEnabled); + + GUIGraphicsContext.CharsInCharacterSet = _stringProvider.Characters; + + return true; + } + + static public string CurrentLanguage() + { + if (_stringProvider == null) + Load(null); + + return _stringProvider.CurrentLanguage.EnglishName; + } + + static public void ChangeLanguage(string language) + { + if (_stringProvider == null) + Load(language); + else + _stringProvider.ChangeLanguage(GetCultureName(language)); + } + + /// <summary> + /// Get the translation for a given id and format the sting with + /// the given parameters + /// </summary> + /// <param name="dwCode">id of text</param> + /// <param name="parameters">parameters used in the formating</param> + /// <returns> + /// string containing the translated text + /// </returns> + static public string Get(int dwCode, object[] parameters) + { + if (_stringProvider == null) + Load(null); + + string translation = _stringProvider.GetString("unmapped", dwCode); + // if parameters or the translation is null, return the translation. + if ((translation == null) || (parameters == null)) + { + return translation; + } + // return the formatted string. If formatting fails, log the error + // and return the unformatted string. + try + { + return String.Format(translation, parameters); + } + catch (System.FormatException e) + { + Log.Error("Error formatting translation with id {0}", dwCode); + Log.Error("Unformatted translation: {0}", translation); + Log.Error(e); + return translation; + } + } + + /// <summary> + /// Get the translation for a given id + /// </summary> + /// <param name="dwCode">id of text</param> + /// <returns> + /// string containing the translated text + /// </returns> + static public string Get(int dwCode) + { + if (_stringProvider == null) + Load(null); + + string translation = _stringProvider.GetString("unmapped", dwCode); + + if (translation == null) + { + Log.Error("No translation found for id {0}", dwCode); + return String.Empty; + } + + return translation; + } + + static public void LocalizeLabel(ref string strLabel) + { + if (_stringProvider == null) + Load(null); + + if (strLabel == null) strLabel = String.Empty; + if (strLabel == "-") strLabel = ""; + if (strLabel == "") return; + // This can't be a valid string code if the first character isn't a number. + // This check will save us from catching unnecessary exceptions. + if (!char.IsNumber(strLabel, 0)) + return; + + int dwLabelID; + + try + { + dwLabelID = System.Int32.Parse(strLabel); + } + catch (FormatException e) + { + Log.Error(e); + strLabel = String.Empty; + return; + } + + strLabel = _stringProvider.GetString("unmapped", dwLabelID); + if (strLabel == null) + { + Log.Error("No translation found for id {0}", dwLabelID); + strLabel = String.Empty; + } + } + + public static string LocalSupported() + { + if (_stringProvider == null) + Load(null); + + CultureInfo culture = _stringProvider.GetBestLanguage(); + + return culture.EnglishName; + } + + public static string[] SupportedLanguages() + { + if (_languages == null) + { + if (_stringProvider == null) + Load(null); + + CultureInfo[] cultures = _stringProvider.AvailableLanguages(); + + SortedList sortedLanguages = new SortedList(); + foreach (CultureInfo culture in cultures) + sortedLanguages.Add(culture.EnglishName, culture.EnglishName); + + _languages = new string[sortedLanguages.Count]; + + for (int i = 0; i < sortedLanguages.Count; i++) + { + _languages[i] = (string)sortedLanguages.GetByIndex(i); + } + } + + return _languages; + } + + static public string GetCultureName(string language) + { + if (_cultures == null) + { + _cultures = new Dictionary<string, string>(); + + CultureInfo[] cultureList = CultureInfo.GetCultures(CultureTypes.AllCultures); + + for (int i = 0; i < cultureList.Length; i++) + { + _cultures.Add(cultureList[i].EnglishName, cultureList[i].Name); + } + } + + if (_cultures.ContainsKey(language)) + return _cultures[language]; + + return null; + } + #endregion + } +} \ No newline at end of file Modified: trunk/plugins/WorldMap/PlugInBase.cs =================================================================== --- trunk/plugins/WorldMap/PlugInBase.cs 2007-12-13 05:23:17 UTC (rev 1150) +++ trunk/plugins/WorldMap/PlugInBase.cs 2007-12-13 09:49:30 UTC (rev 1151) @@ -5,7 +5,7 @@ using MediaPortal.GUI.Library; using MediaPortal.Configuration; -namespace WindowPlugins.Worldmap +namespace MediaPortal.GUI.MyWorldmap { public enum WorldmapWindowIDs { @@ -87,7 +87,7 @@ public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) { - strButtonText = "Worldmap"; + strButtonText = MyWorldmap.GUILocalizeStrings.Get(0); strButtonImage = String.Empty; strButtonImageFocus = String.Empty; strPictureImage = @"hover_worldmap.png"; Modified: trunk/plugins/WorldMap/Settings.cs =================================================================== --- trunk/plugins/WorldMap/Settings.cs 2007-12-13 05:23:17 UTC (rev 1150) +++ trunk/plugins/WorldMap/Settings.cs 2007-12-13 09:49:30 UTC (rev 1151) @@ -5,7 +5,7 @@ using MediaPortal.GUI.Library; using MAPS; -namespace WindowPlugins.Worldmap +namespace MediaPortal.GUI.MyWorldmap { class Settings { Modified: trunk/plugins/WorldMap/WorldMap.cs =================================================================== --- trunk/plugins/WorldMap/WorldMap.cs 2007-12-13 05:23:17 UTC (rev 1150) +++ trunk/plugins/WorldMap/WorldMap.cs 2007-12-13 09:49:30 UTC (rev 1151) @@ -14,7 +14,7 @@ using System.IO; using MediaPortal.Configuration; -namespace WindowPlugins.Worldmap +namespace MediaPortal.GUI.MyWorldmap { //[PluginIcons("GUIWorldMap.worldmapicon.png", "worldmapicon_disabled.png")] public class WorldMap : PlugInBase @@ -118,10 +118,10 @@ mapTiles.mapType = currentMapType; - lblLongitude.Label = "Longitude: " + currentLongitude.ToString(); - lblLatitude.Label = "Latitude: " + currentLatitude.ToString(); + lblLongitude.Label = MyWorldmap.GUILocalizeStrings.Get(1) + currentLongitude.ToString(); + lblLatitude.Label = MyWorldmap.GUILocalizeStrings.Get(2) + currentLatitude.ToString(); lblMapType.Label = currentMapType.ToString(); - string tmpZoomModeString = "ZoomMode: " + currentZoomMode.ToString() + " : "; + string tmpZoomModeString = MyWorldmap.GUILocalizeStrings.Get(3) + currentZoomMode.ToString() + " : "; if (currentZoomMode == ZoomMode.Level) tmpZoomModeString += currentZoomLevel.ToString(); else tmpZoomModeString += currentZoomFactor.ToString(); lblZoomMode.Label = tmpZoomModeString; @@ -552,7 +552,7 @@ GUIDialogMenu Menu = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); Menu.Reset(); - Menu.SetHeading("Choose a maptype"); + Menu.SetHeading(MyWorldmap.GUILocalizeStrings.Get(36)); Array tmpMapTypes = Enum.GetValues(typeof(MapFunctions.MapType)); Modified: trunk/plugins/WorldMap/WorldMapSearchResults.cs =================================================================== --- trunk/plugins/WorldMap/WorldMapSearchResults.cs 2007-12-13 05:23:17 UTC (rev 1150) +++ trunk/plugins/WorldMap/WorldMapSearchResults.cs 2007-12-13 09:49:30 UTC (rev 1151) @@ -6,12 +6,14 @@ using MediaPortal.GUI.Library; using MediaPortal.Dialogs; -namespace WindowPlugins.Worldmap +namespace MediaPortal.GUI.MyWorldmap { class WorldMapSearchResults : GUIWindow { [SkinControlAttribute(5)] protected GUIListControl listview = null; + [SkinControlAttribute(24)] + protected GUILabelControl lblHeader = null; public List<MAPS.GeoCode> SearchResults = new List<MAPS.GeoCode>(); public int LastWindowID = -1; @@ -38,6 +40,8 @@ tmpMainWindow.FillMapTileRessources(); } + GUIControl.SetControlLabel(GetID, lblHeader.GetID, MyWorldmap.GUILocalizeStrings.Get(70)); // Search result + RefreshListView(); } Modified: trunk/plugins/WorldMap/WorldmapConfig.Designer.cs =================================================================== --- trunk/plugins/WorldMap/WorldmapConfig.Designer.cs 2007-12-13 05:23:17 UTC (rev 1150) +++ trunk/plugins/WorldMap/WorldmapConfig.Designer.cs 2007-12-13 09:49:30 UTC (rev 1151) @@ -1,4 +1,4 @@ -namespace WindowPlugins.Worldmap +namespace MediaPortal.GUI.MyWorldmap { partial class WorldmapConfig { Modified: trunk/plugins/WorldMap/WorldmapConfig.cs =================================================================== --- trunk/plugins/WorldMap/WorldmapConfig.cs 2007-12-13 05:23:17 UTC (rev 1150) +++ trunk/plugins/WorldMap/WorldmapConfig.cs 2007-12-13 09:49:30 UTC (rev 1151) @@ -8,7 +8,7 @@ using MediaPortal.GUI.Library; using System.Collections; -namespace WindowPlugins.Worldmap +namespace MediaPortal.GUI.MyWorldmap { public partial class WorldmapConfig : Form Modified: trunk/plugins/WorldMap/WorldmapMenu.cs =================================================================== --- trunk/plugins/WorldMap/WorldmapMenu.cs 2007-12-13 05:23:17 UTC (rev 1150) +++ trunk/plugins/WorldMap/WorldmapMenu.cs 2007-12-13 09:49:30 UTC (rev 1151) @@ -8,10 +8,12 @@ using MAPS; -namespace WindowPlugins.Worldmap +namespace MediaPortal.GUI.MyWorldmap { class WorldmapMenu : GUIWindow { + [SkinControlAttribute(1)] + protected GUILabelControl lblSearchHeader = null; [SkinControlAttribute(2)] protected GUIButtonControl btnSearchAdress = null; [SkinControlAttribute(3)] @@ -55,6 +57,14 @@ tmpMainWindow.FillMapTileRessources(); } + GUIControl.SetControlLabel(GetID, lblSearchHeader.GetID, MyWorldmap.GUILocalizeStrings.Get(30)); // Search... + GUIControl.SetControlLabel(GetID, btnSearchAdress.GetID, MyWorldmap.GUILocalizeStrings.Get(31)); // Address or Location + GUIControl.SetControlLabel(GetID, btnSearchplaceName.GetID, MyWorldmap.GUILocalizeStrings.Get(32)); // Special Location + GUIControl.SetControlLabel(GetID, btnLastResult.GetID, MyWorldmap.GUILocalizeStrings.Get(33)); // Last Search Result + GUIControl.SetControlLabel(GetID, btnPlacemarks.GetID, MyWorldmap.GUILocalizeStrings.Get(34)); // stored Placemarks + GUIControl.SetControlLabel(GetID, btnMapType.GetID, MyWorldmap.GUILocalizeStrings.Get(36)); // choose Maptype + GUIControl.SetControlLabel(GetID, btnOptions.GetID, MyWorldmap.GUILocalizeStrings.Get(37)); // options + base.OnPageLoad(); } @@ -74,7 +84,7 @@ WorldMap tmpMainWindow = (WorldMap)GUIWindowManager.GetWindow((int)WorldmapWindowIDs.MainWindow); tmpMainWindow.Render(timePassed); - btnZoomMode.Label = "Zoom" + tmpMainWindow.currentZoomMode.ToString() + " is active"; + btnZoomMode.Label = "Zoom" + tmpMainWindow.currentZoomMode.ToString() + MyWorldmap.GUILocalizeStrings.Get(35); base.Render(timePassed); } Modified: trunk/plugins/WorldMap/WorldmapSearch.cs =================================================================== --- trunk/plugins/WorldMap/WorldmapSearch.cs 2007-12-13 05:23:17 UTC (rev 1150) +++ trunk/plugins/WorldMap/WorldmapSearch.cs 2007-12-13 09:49:30 UTC (rev 1151) @@ -5,7 +5,7 @@ using MediaPortal.Dialogs; using System.Threading; -namespace WindowPlugins.Worldmap +namespace MediaPortal.GUI.MyWorldmap { enum SearchType { @@ -99,6 +99,14 @@ tmpMainWindow.FillMapTileRessources(); } + GUIControl.SetControlLabel(GetID, lblHeader.GetID, MyWorldmap.GUILocalizeStrings.Get(50)); // Search for address or location + GUIControl.SetControlLabel(GetID, btnStreet.GetID, MyWorldmap.GUILocalizeStrings.Get(51)); // Street + GUIControl.SetControlLabel(GetID, btnCity.GetID, MyWorldmap.GUILocalizeStrings.Get(52)); // City + GUIControl.SetControlLabel(GetID, btnCountry.GetID, MyWorldmap.GUILocalizeStrings.Get(53)); // Country + GUIControl.SetControlLabel(GetID, btnPlacename.GetID, MyWorldmap.GUILocalizeStrings.Get(54)); // placename + GUIControl.SetControlLabel(GetID, btnSearch.GetID, MyWorldmap.GUILocalizeStrings.Get(55)); // Search + GUIControl.SetControlLabel(GetID, btnCancel.GetID, MyWorldmap.GUILocalizeStrings.Get(56)); // Cancel + if (SearchType == SearchType.none) SearchType = SearchType.Adress; lblStreet.Label = Street; @@ -247,8 +255,8 @@ else { GUIDialogOK tmpOK = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK); - tmpOK.SetHeading("Search Result"); - tmpOK.SetLine(1, "No result was empty"); + tmpOK.SetHeading(MyWorldmap.GUILocalizeStrings.Get(70)); + tmpOK.SetLine(1, MyWorldmap.GUILocalizeStrings.Get(71)); tmpOK.DoModal(this.GetID); } } Added: trunk/plugins/WorldMap/language/MyWorldmap/strings_de.xml =================================================================== --- trunk/plugins/WorldMap/language/MyWorldmap/strings_de.xml (rev 0) +++ trunk/plugins/WorldMap/language/MyWorldmap/strings_de.xml 2007-12-13 09:49:30 UTC (rev 1151) @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="utf-8"?> +<Language name="German" characters="255"> + <Section name="unmapped"> + <String id="0" prefix="Meine ">Weltkarte</String> + <String id="1">Längengrad: </String> + <String id="2">Breitengrad: </String> + <String id="3">Zoom Modus: </String> + <String id="30">Suche...</String> + <String id="31">Adresse oder Ort</String> + <String id="32">Besondere Orte</String> + <String id="33">Letzte Suchergebnisse</String> + <String id="34">gespeicherte Orte</String> + <String id="35"> ist aktiv</String> + <String id="36">Kartentype wählen</String> + <String id="37">Optionen</String> + <String id="50">Suche Adresse oder Ort</String> + <String id="51">Straße:</String> + <String id="52">Stadt:</String> + <String id="53">Land:</String> + <String id="54">bes. Ort:</String> + <String id="55">Suche</String> + <String id="56">Abbruch</String> + <String id="70">Ergebnis der Suche</String> + <String id="71">Ergebnis war leer</String> + </Section> +</Language> \ No newline at end of file Added: trunk/plugins/WorldMap/language/MyWorldmap/strings_en.xml =================================================================== --- trunk/plugins/WorldMap/language/MyWorldmap/strings_en.xml (rev 0) +++ trunk/plugins/WorldMap/language/MyWorldmap/strings_en.xml 2007-12-13 09:49:30 UTC (rev 1151) @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="utf-8"?> +<Language name="English" characters="255"> + <Section name="unmapped"> + <String id="0" prefix="My ">Worldmap</String> + <String id="1">Longitude: </String> + <String id="2">Latitude: </String> + <String id="3">Zoom Mode: </String> + <String id="30">Search...</String> + <String id="31">Address oder Location</String> + <String id="32">Special Location</String> + <String id="33">Last Search Result</String> + <String id="34">stored Placemarks</String> + <String id="35"> is active</String> + <String id="36">Choose MapType</String> + <String id="37">Options</String> + <String id="50">Search for address or location</String> + <String id="51">Street:</String> + <String id="52">City:</String> + <String id="53">Country:</String> + <String id="54">Placename:</String> + <String id="55">Search</String> + <String id="56">Cancel</String> + <String id="70">Search results</String> + <String id="71">Result was empty</String> + </Section> +</Language> \ No newline at end of file Modified: trunk/plugins/WorldMap/skinFiles/BlueTwo/MyWorldmapMenu.xml =================================================================== --- trunk/plugins/WorldMap/skinFiles/BlueTwo/MyWorldmapMenu.xml 2007-12-13 05:23:17 UTC (rev 1150) +++ trunk/plugins/WorldMap/skinFiles/BlueTwo/MyWorldmapMenu.xml 2007-12-13 09:49:30 UTC (rev 1151) @@ -91,7 +91,7 @@ <label>Switch To ...</label> <onleft>8</onleft> <onright>8</onright> - <onup>3</onup> + <onup>6</onup> <ondown>10</ondown> </control> @@ -105,8 +105,8 @@ <label>Choose maptype</label> <onleft>10</onleft> <onright>10</onright> - <onup>3</onup> - <ondown>2</ondown> + <onup>8</onup> + <ondown>12</ondown> </control> <control> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lk...@us...> - 2007-12-13 12:36:31
|
Revision: 1152 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1152&view=rev Author: lkuech Date: 2007-12-13 04:36:28 -0800 (Thu, 13 Dec 2007) Log Message: ----------- added Norwegian language file (thx ronsile). Modified Paths: -------------- trunk/plugins/WorldMap/Installer/Worldmap.xmp Added Paths: ----------- trunk/plugins/WorldMap/language/MyWorldmap/strings_no.xml Modified: trunk/plugins/WorldMap/Installer/Worldmap.xmp =================================================================== --- trunk/plugins/WorldMap/Installer/Worldmap.xmp 2007-12-13 09:49:30 UTC (rev 1151) +++ trunk/plugins/WorldMap/Installer/Worldmap.xmp 2007-12-13 12:36:28 UTC (rev 1152) @@ -8,7 +8,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\bin\Release\GUIWorldmap.dll</Source> <Id>01010</Id> <Option /> - <Guid>150d9039-90cb-41c4-9e22-9e0382676428</Guid> + <Guid>b396f951-e4bc-41ee-b375-ada7c418bfb4</Guid> </File> <File> <FileName>GUIWorldmap.xml</FileName> @@ -17,7 +17,7 @@ <Source>GUIWorldmap.xml</Source> <Id>01010</Id> <Option /> - <Guid>b0f4f614-918d-4562-a378-62a490df965b</Guid> + <Guid>65f941d2-2c3b-4dee-ad0e-7e8d6b7c1c8a</Guid> </File> <File> <FileName>hover_worldmap.png</FileName> @@ -26,7 +26,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\hover_worldmap.png</Source> <Id>04010</Id> <Option /> - <Guid>0e59df06-8cdd-4e4d-b061-92fcbfdce298</Guid> + <Guid>c8a1358c-d6e2-46ba-8339-f482f3fb2241</Guid> </File> <File> <FileName>hover_worldmap.png</FileName> @@ -35,7 +35,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\hover_worldmap.png</Source> <Id>04010</Id> <Option /> - <Guid>6987f549-1f62-4670-8dc7-c62d60d6351a</Guid> + <Guid>e990ac65-8765-4ab2-b48e-5e3ef67c8d25</Guid> </File> <File> <FileName>MyWorldMap.xml</FileName> @@ -44,7 +44,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\MyWorldMap.xml</Source> <Id>04010</Id> <Option /> - <Guid>e3b4a7d2-45b3-44c3-92cf-d205d01bba3c</Guid> + <Guid>7147f317-d3bc-4106-b823-eb46a122d59b</Guid> </File> <File> <FileName>MyWorldMap.xml</FileName> @@ -53,7 +53,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\MyWorldMap.xml</Source> <Id>04010</Id> <Option /> - <Guid>05f01705-359d-4536-8023-7a33419e1f50</Guid> + <Guid>0abe1190-123f-4c08-8708-4c57bb835a79</Guid> </File> <File> <FileName>MyWorldmapMenu.xml</FileName> @@ -62,7 +62,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\MyWorldmapMenu.xml</Source> <Id>04010</Id> <Option /> - <Guid>d595127f-9f85-4963-aa31-67ab316b3318</Guid> + <Guid>f0c73f77-a2ac-4b23-8b95-d62aa14546ca</Guid> </File> <File> <FileName>MyWorldmapMenu.xml</FileName> @@ -71,7 +71,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\MyWorldmapMenu.xml</Source> <Id>04010</Id> <Option /> - <Guid>5b7b849a-065a-47a1-a62a-b5103594a570</Guid> + <Guid>3a6a3022-051c-4354-9033-60103e5d72d6</Guid> </File> <File> <FileName>MyWorldmapSearch.xml</FileName> @@ -80,7 +80,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\MyWorldmapSearch.xml</Source> <Id>04010</Id> <Option /> - <Guid>f0764712-a889-41b7-aa21-71e7f787d448</Guid> + <Guid>635a1ffc-455e-4080-a82c-04dfb14e5b62</Guid> </File> <File> <FileName>MyWorldmapSearch.xml</FileName> @@ -89,7 +89,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\MyWorldmapSearch.xml</Source> <Id>04010</Id> <Option /> - <Guid>01659dc8-3403-474a-8e2b-0af9e4718f02</Guid> + <Guid>e9635e86-313f-4d13-bfe1-c0f3f824c25d</Guid> </File> <File> <FileName>MyWorldmapSearchResults.xml</FileName> @@ -98,7 +98,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\MyWorldmapSearchResults.xml</Source> <Id>04010</Id> <Option /> - <Guid>7fb93ce4-df48-41d7-95c5-4667fd9e597f</Guid> + <Guid>7b3f1cc2-4c84-4add-af89-1663900c1d67</Guid> </File> <File> <FileName>MyWorldmapSearchResults.xml</FileName> @@ -107,7 +107,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\MyWorldmapSearchResults.xml</Source> <Id>04010</Id> <Option /> - <Guid>944e69b0-f988-4651-8a0f-74fbfb5b7e23</Guid> + <Guid>ec0d2048-9809-4ef5-9037-e79bc5ccad1b</Guid> </File> <File> <FileName>strings_de.xml</FileName> @@ -116,7 +116,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\language\MyWorldmap\strings_de.xml</Source> <Id>04010</Id> <Option /> - <Guid>2a2845f6-3074-4960-90e1-38de1a9d969a</Guid> + <Guid>0b1b2d38-18ba-4a45-9304-e0603b76e6c4</Guid> </File> <File> <FileName>strings_en.xml</FileName> @@ -125,16 +125,25 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\language\MyWorldmap\strings_en.xml</Source> <Id>04010</Id> <Option /> - <Guid>86b5bd30-e28e-4cf5-9eca-82d32847660c</Guid> + <Guid>0f8839ed-3be5-4355-af53-4e474ab17130</Guid> </File> <File> + <FileName>strings_no.xml</FileName> + <Type>Other</Type> + <SubType>%Language%\MyWorldmap</SubType> + <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\language\MyWorldmap\strings_no.xml</Source> + <Id>04010</Id> + <Option /> + <Guid>5d56d92e-b22e-4925-a753-843b6d6d0ef1</Guid> + </File> + <File> <FileName>System.Data.SQLite.DLL</FileName> <Type>Plugin</Type> <SubType>Window</SubType> <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\System.Data.SQLite.DLL</Source> <Id>01010</Id> <Option /> - <Guid>c14130a2-c7de-44ef-97ef-fcb5245a9989</Guid> + <Guid>b1876242-ceae-40b9-97d0-1ea7452006ad</Guid> </File> <File> <FileName>WMIPBlocked.jpeg</FileName> @@ -143,7 +152,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\WMIPBlocked.jpeg</Source> <Id>04010</Id> <Option /> - <Guid>d89c6076-9e44-41ab-b2a4-b829f4383d78</Guid> + <Guid>579aa1e7-fbdc-4727-a9c9-b7e101a86ad6</Guid> </File> <File> <FileName>WMIPBlocked.jpeg</FileName> @@ -152,7 +161,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\WMIPBlocked.jpeg</Source> <Id>04010</Id> <Option /> - <Guid>5bad2483-c09a-460f-95dc-694da29643fc</Guid> + <Guid>ce545f0d-8d2e-446d-9f17-45b771238317</Guid> </File> <File> <FileName>WMprogressBarActive.png</FileName> @@ -161,7 +170,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\WMprogressBarActive.png</Source> <Id>04010</Id> <Option /> - <Guid>8d90b983-2ffa-48f6-a2fb-4f34046658bd</Guid> + <Guid>b94ad3f0-9325-451e-b632-4bb29e544254</Guid> </File> <File> <FileName>WMprogressBarActive.png</FileName> @@ -170,7 +179,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\WMprogressBarActive.png</Source> <Id>04010</Id> <Option /> - <Guid>802d738f-9bbc-494c-b4e3-8cd735214893</Guid> + <Guid>ea337f95-2234-4779-8d65-b8a071c00f6c</Guid> </File> <File> <FileName>WMprogressBarQueued.png</FileName> @@ -179,7 +188,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\WMprogressBarQueued.png</Source> <Id>04010</Id> <Option /> - <Guid>421c2b25-8d9d-4d4a-af77-4f57d21ace90</Guid> + <Guid>79a23ddd-96cd-43dc-9780-98a4f1abd747</Guid> </File> <File> <FileName>WMprogressBarQueued.png</FileName> @@ -188,7 +197,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\WMprogressBarQueued.png</Source> <Id>04010</Id> <Option /> - <Guid>2995e3ad-1d7c-4136-970e-a08326a696ba</Guid> + <Guid>f064559f-7c3f-4081-bd07-e29d712ca17b</Guid> </File> <File> <FileName>WMprogressDummy.png</FileName> @@ -197,7 +206,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\WMprogressDummy.png</Source> <Id>04010</Id> <Option /> - <Guid>0ab52df2-2ccf-460d-99b2-290eea92244e</Guid> + <Guid>603d736a-69bf-4cd3-affc-2558b78878cb</Guid> </File> <File> <FileName>WMprogressDummy.png</FileName> @@ -206,7 +215,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\WMprogressDummy.png</Source> <Id>04010</Id> <Option /> - <Guid>83d51e8b-089c-4858-82c2-1e504bd9b3b8</Guid> + <Guid>32efb54b-353f-41a3-87c3-b0323f3309c0</Guid> </File> <File> <FileName>WMTileNotAvailable.jpeg</FileName> @@ -215,7 +224,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\WMTileNotAvailable.jpeg</Source> <Id>04010</Id> <Option /> - <Guid>447d23fb-0661-466b-8b08-22a509534275</Guid> + <Guid>19b33326-8325-4f12-965e-ea81cac54b36</Guid> </File> <File> <FileName>WMTileNotAvailable.jpeg</FileName> @@ -224,7 +233,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\WMTileNotAvailable.jpeg</Source> <Id>04010</Id> <Option /> - <Guid>3b44e93c-6d4c-4d21-abcc-3dd2b6329f2e</Guid> + <Guid>fcff0e34-e85d-4832-bdbc-546bbb82d306</Guid> </File> <File> <FileName>WMTilePlaceholder.jpeg</FileName> @@ -233,7 +242,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\WMTilePlaceholder.jpeg</Source> <Id>04010</Id> <Option /> - <Guid>9cdedc6a-6d29-4d8b-84ef-1c3bbbe61f2e</Guid> + <Guid>1355fd07-5491-443b-a738-06b93a1db27e</Guid> </File> <File> <FileName>WMTilePlaceholder.jpeg</FileName> @@ -242,7 +251,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\WMTilePlaceholder.jpeg</Source> <Id>04010</Id> <Option /> - <Guid>5659a223-6bec-4a9c-bfac-86611cfb4142</Guid> + <Guid>0ed81b8e-03fe-4fad-82d2-c31f75832d08</Guid> </File> </FileList> <StringList /> Added: trunk/plugins/WorldMap/language/MyWorldmap/strings_no.xml =================================================================== --- trunk/plugins/WorldMap/language/MyWorldmap/strings_no.xml (rev 0) +++ trunk/plugins/WorldMap/language/MyWorldmap/strings_no.xml 2007-12-13 12:36:28 UTC (rev 1152) @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="utf-8"?> +<Language name="English" characters="255"> + <Section name="unmapped"> + <String id="0" prefix="Mitt ">Atlas</String> + <String id="1">Lengdegrad: </String> + <String id="2">Breddegrad: </String> + <String id="3">Zoom Modus: </String> + <String id="30">Søk...</String> + <String id="31">Adresse eller Sted</String> + <String id="32">Spesielle steder</String> + <String id="33">Siste søke resultat</String> + <String id="34">Lagrede merker</String> + <String id="35"> er aktiv</String> + <String id="36">Velg karttype</String> + <String id="37">Instillinger</String> + <String id="50">Søk etter adresse eller sted</String> + <String id="51">Gate:</String> + <String id="52">By:</String> + <String id="53">Land:</String> + <String id="54">Stedsnavn:</String> + <String id="55">Søk</String> + <String id="56">Avbryt</String> + <String id="70">Søke resultat</String> + <String id="71">Ingen resultat funnet</String> + </Section> +</Language> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lk...@us...> - 2007-12-13 14:07:22
|
Revision: 1153 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1153&view=rev Author: lkuech Date: 2007-12-13 06:07:17 -0800 (Thu, 13 Dec 2007) Log Message: ----------- Made the new Terrain maps default for new setups (that did start for the first time) Modified Paths: -------------- trunk/plugins/WorldMap/Installer/Worldmap.xmp trunk/plugins/WorldMap/Settings.cs trunk/plugins/WorldMap/WorldMap.cs Modified: trunk/plugins/WorldMap/Installer/Worldmap.xmp =================================================================== --- trunk/plugins/WorldMap/Installer/Worldmap.xmp 2007-12-13 12:36:28 UTC (rev 1152) +++ trunk/plugins/WorldMap/Installer/Worldmap.xmp 2007-12-13 14:07:17 UTC (rev 1153) @@ -8,7 +8,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\bin\Release\GUIWorldmap.dll</Source> <Id>01010</Id> <Option /> - <Guid>b396f951-e4bc-41ee-b375-ada7c418bfb4</Guid> + <Guid>060956a8-cef0-4726-a19a-c2aa727883df</Guid> </File> <File> <FileName>GUIWorldmap.xml</FileName> @@ -17,7 +17,7 @@ <Source>GUIWorldmap.xml</Source> <Id>01010</Id> <Option /> - <Guid>65f941d2-2c3b-4dee-ad0e-7e8d6b7c1c8a</Guid> + <Guid>f5fbf236-5f4b-455f-a3c5-c0ede150e845</Guid> </File> <File> <FileName>hover_worldmap.png</FileName> @@ -26,7 +26,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\hover_worldmap.png</Source> <Id>04010</Id> <Option /> - <Guid>c8a1358c-d6e2-46ba-8339-f482f3fb2241</Guid> + <Guid>5efcfc7b-ae78-426a-b026-50b6da4c97a8</Guid> </File> <File> <FileName>hover_worldmap.png</FileName> @@ -35,7 +35,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\hover_worldmap.png</Source> <Id>04010</Id> <Option /> - <Guid>e990ac65-8765-4ab2-b48e-5e3ef67c8d25</Guid> + <Guid>e7103781-cd4d-49a9-8972-7fc938df9580</Guid> </File> <File> <FileName>MyWorldMap.xml</FileName> @@ -44,7 +44,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\MyWorldMap.xml</Source> <Id>04010</Id> <Option /> - <Guid>7147f317-d3bc-4106-b823-eb46a122d59b</Guid> + <Guid>d4049b41-fb28-4d1a-80fc-c9e4a7685200</Guid> </File> <File> <FileName>MyWorldMap.xml</FileName> @@ -53,7 +53,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\MyWorldMap.xml</Source> <Id>04010</Id> <Option /> - <Guid>0abe1190-123f-4c08-8708-4c57bb835a79</Guid> + <Guid>62e37304-b2da-4495-9c91-3dff72f00ef6</Guid> </File> <File> <FileName>MyWorldmapMenu.xml</FileName> @@ -62,7 +62,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\MyWorldmapMenu.xml</Source> <Id>04010</Id> <Option /> - <Guid>f0c73f77-a2ac-4b23-8b95-d62aa14546ca</Guid> + <Guid>8e1093e2-328f-4514-8a60-d290e314023e</Guid> </File> <File> <FileName>MyWorldmapMenu.xml</FileName> @@ -71,7 +71,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\MyWorldmapMenu.xml</Source> <Id>04010</Id> <Option /> - <Guid>3a6a3022-051c-4354-9033-60103e5d72d6</Guid> + <Guid>7580710c-618d-4e6e-b2d4-8337750321c4</Guid> </File> <File> <FileName>MyWorldmapSearch.xml</FileName> @@ -80,7 +80,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\MyWorldmapSearch.xml</Source> <Id>04010</Id> <Option /> - <Guid>635a1ffc-455e-4080-a82c-04dfb14e5b62</Guid> + <Guid>759c15b5-b888-4fbe-8add-eae4b54d2929</Guid> </File> <File> <FileName>MyWorldmapSearch.xml</FileName> @@ -89,7 +89,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\MyWorldmapSearch.xml</Source> <Id>04010</Id> <Option /> - <Guid>e9635e86-313f-4d13-bfe1-c0f3f824c25d</Guid> + <Guid>15bae91a-e4b8-4dbb-8ba1-7c9198766f4b</Guid> </File> <File> <FileName>MyWorldmapSearchResults.xml</FileName> @@ -98,7 +98,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\MyWorldmapSearchResults.xml</Source> <Id>04010</Id> <Option /> - <Guid>7b3f1cc2-4c84-4add-af89-1663900c1d67</Guid> + <Guid>bf3a08f2-df5d-4595-8ea8-62d138d08e19</Guid> </File> <File> <FileName>MyWorldmapSearchResults.xml</FileName> @@ -107,7 +107,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\MyWorldmapSearchResults.xml</Source> <Id>04010</Id> <Option /> - <Guid>ec0d2048-9809-4ef5-9037-e79bc5ccad1b</Guid> + <Guid>9c43a7b1-7544-45f6-bdba-7f7dc3202cbd</Guid> </File> <File> <FileName>strings_de.xml</FileName> @@ -116,7 +116,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\language\MyWorldmap\strings_de.xml</Source> <Id>04010</Id> <Option /> - <Guid>0b1b2d38-18ba-4a45-9304-e0603b76e6c4</Guid> + <Guid>006e62f7-3f40-4bfd-9e99-16aadf75c366</Guid> </File> <File> <FileName>strings_en.xml</FileName> @@ -125,7 +125,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\language\MyWorldmap\strings_en.xml</Source> <Id>04010</Id> <Option /> - <Guid>0f8839ed-3be5-4355-af53-4e474ab17130</Guid> + <Guid>05e3828b-426b-4097-a3af-e720d645999e</Guid> </File> <File> <FileName>strings_no.xml</FileName> @@ -134,7 +134,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\language\MyWorldmap\strings_no.xml</Source> <Id>04010</Id> <Option /> - <Guid>5d56d92e-b22e-4925-a753-843b6d6d0ef1</Guid> + <Guid>1afcc8bb-aa8d-4452-848d-8f0a1f26b153</Guid> </File> <File> <FileName>System.Data.SQLite.DLL</FileName> @@ -143,7 +143,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\System.Data.SQLite.DLL</Source> <Id>01010</Id> <Option /> - <Guid>b1876242-ceae-40b9-97d0-1ea7452006ad</Guid> + <Guid>0d9db766-c802-4e2c-92e1-fe3c472d054b</Guid> </File> <File> <FileName>WMIPBlocked.jpeg</FileName> @@ -152,7 +152,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\WMIPBlocked.jpeg</Source> <Id>04010</Id> <Option /> - <Guid>579aa1e7-fbdc-4727-a9c9-b7e101a86ad6</Guid> + <Guid>afa4c48c-b10a-46c0-bb6e-dc07034185d5</Guid> </File> <File> <FileName>WMIPBlocked.jpeg</FileName> @@ -161,7 +161,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\WMIPBlocked.jpeg</Source> <Id>04010</Id> <Option /> - <Guid>ce545f0d-8d2e-446d-9f17-45b771238317</Guid> + <Guid>767b59db-2c06-49ab-a87c-5abf3e6248c7</Guid> </File> <File> <FileName>WMprogressBarActive.png</FileName> @@ -170,7 +170,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\WMprogressBarActive.png</Source> <Id>04010</Id> <Option /> - <Guid>b94ad3f0-9325-451e-b632-4bb29e544254</Guid> + <Guid>2abf5200-59ff-466f-99f9-d5ae1209e5be</Guid> </File> <File> <FileName>WMprogressBarActive.png</FileName> @@ -179,7 +179,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\WMprogressBarActive.png</Source> <Id>04010</Id> <Option /> - <Guid>ea337f95-2234-4779-8d65-b8a071c00f6c</Guid> + <Guid>c8470867-c6f5-4ae8-8edd-457c8bd5efaa</Guid> </File> <File> <FileName>WMprogressBarQueued.png</FileName> @@ -188,7 +188,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\WMprogressBarQueued.png</Source> <Id>04010</Id> <Option /> - <Guid>79a23ddd-96cd-43dc-9780-98a4f1abd747</Guid> + <Guid>0a72a995-224e-466c-b611-1ca1f9c2f2f8</Guid> </File> <File> <FileName>WMprogressBarQueued.png</FileName> @@ -197,7 +197,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\WMprogressBarQueued.png</Source> <Id>04010</Id> <Option /> - <Guid>f064559f-7c3f-4081-bd07-e29d712ca17b</Guid> + <Guid>4c0a8640-061d-4642-a481-53a196492d56</Guid> </File> <File> <FileName>WMprogressDummy.png</FileName> @@ -206,7 +206,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\WMprogressDummy.png</Source> <Id>04010</Id> <Option /> - <Guid>603d736a-69bf-4cd3-affc-2558b78878cb</Guid> + <Guid>336af7f3-0145-4e67-8b1f-cfbad75e1a84</Guid> </File> <File> <FileName>WMprogressDummy.png</FileName> @@ -215,7 +215,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\WMprogressDummy.png</Source> <Id>04010</Id> <Option /> - <Guid>32efb54b-353f-41a3-87c3-b0323f3309c0</Guid> + <Guid>d8cf6a5c-fa35-4640-8b24-417a3b73fa94</Guid> </File> <File> <FileName>WMTileNotAvailable.jpeg</FileName> @@ -224,7 +224,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\WMTileNotAvailable.jpeg</Source> <Id>04010</Id> <Option /> - <Guid>19b33326-8325-4f12-965e-ea81cac54b36</Guid> + <Guid>ba43f235-de94-4987-991a-9bc17f631424</Guid> </File> <File> <FileName>WMTileNotAvailable.jpeg</FileName> @@ -233,7 +233,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\WMTileNotAvailable.jpeg</Source> <Id>04010</Id> <Option /> - <Guid>fcff0e34-e85d-4832-bdbc-546bbb82d306</Guid> + <Guid>2301a2e2-7406-424a-bc4b-32bbaa974bc3</Guid> </File> <File> <FileName>WMTilePlaceholder.jpeg</FileName> @@ -242,7 +242,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\WMTilePlaceholder.jpeg</Source> <Id>04010</Id> <Option /> - <Guid>1355fd07-5491-443b-a738-06b93a1db27e</Guid> + <Guid>34a80876-17b1-41b9-a399-37b990e962c4</Guid> </File> <File> <FileName>WMTilePlaceholder.jpeg</FileName> @@ -251,7 +251,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\WMTilePlaceholder.jpeg</Source> <Id>04010</Id> <Option /> - <Guid>0ed81b8e-03fe-4fad-82d2-c31f75832d08</Guid> + <Guid>afa3d399-5515-48f8-a93f-43b633b71f77</Guid> </File> </FileList> <StringList /> Modified: trunk/plugins/WorldMap/Settings.cs =================================================================== --- trunk/plugins/WorldMap/Settings.cs 2007-12-13 12:36:28 UTC (rev 1152) +++ trunk/plugins/WorldMap/Settings.cs 2007-12-13 14:07:17 UTC (rev 1153) @@ -97,7 +97,7 @@ LastZoomLevel = reader.GetValueAsInt(SectionName, ParmLastZoomLevel, 0); LastZoomFactor = double.Parse(reader.GetValueAsString(SectionName, ParmLastZoomFactor, "2")); if (LastZoomFactor < 1f) LastZoomFactor = 1f; - LastMapType = IntToMapType(reader.GetValueAsInt(SectionName, ParmLastMapType, 5)); + LastMapType = IntToMapType(reader.GetValueAsInt(SectionName, ParmLastMapType, 1)); ThreadCountGMR = reader.GetValueAsInt(SectionName, ParmThreadCountGMR, 5); ThreadCountGMA = reader.GetValueAsInt(SectionName, ParmThreadCountGMA, 5); @@ -187,7 +187,7 @@ private MapFunctions.MapType IntToMapType(int intMapType) { Array tmpMapTypes = Enum.GetValues(typeof(MapFunctions.MapType)); - if ((intMapType > tmpMapTypes.Length - 1) || (intMapType <0)) intMapType = 5; + if ((intMapType > tmpMapTypes.Length - 1) || (intMapType <0)) intMapType = 1; return (MapFunctions.MapType)(Enum.ToObject(typeof(MapFunctions.MapType), intMapType)); } Modified: trunk/plugins/WorldMap/WorldMap.cs =================================================================== --- trunk/plugins/WorldMap/WorldMap.cs 2007-12-13 12:36:28 UTC (rev 1152) +++ trunk/plugins/WorldMap/WorldMap.cs 2007-12-13 14:07:17 UTC (rev 1153) @@ -86,7 +86,7 @@ public ZoomMode currentZoomMode = ZoomMode.Level; - public MapFunctions.MapType currentMapType = MapFunctions.MapType.VEHybrid; + public MapFunctions.MapType currentMapType = MapFunctions.MapType.GMTerrain; int LastImageRefresh = System.Environment.TickCount; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lk...@us...> - 2007-12-14 08:21:44
|
Revision: 1158 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1158&view=rev Author: lkuech Date: 2007-12-14 00:21:28 -0800 (Fri, 14 Dec 2007) Log Message: ----------- Added additional language strings for the option dialog. Modified Paths: -------------- trunk/plugins/WorldMap/WorldmapMenu.cs trunk/plugins/WorldMap/language/MyWorldmap/strings_de.xml trunk/plugins/WorldMap/language/MyWorldmap/strings_en.xml Modified: trunk/plugins/WorldMap/WorldmapMenu.cs =================================================================== --- trunk/plugins/WorldMap/WorldmapMenu.cs 2007-12-14 04:16:35 UTC (rev 1157) +++ trunk/plugins/WorldMap/WorldmapMenu.cs 2007-12-14 08:21:28 UTC (rev 1158) @@ -215,9 +215,9 @@ GUIDialogMenu Menu = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); Menu.Reset(); - Menu.SetHeading("Choose a option"); + Menu.SetHeading(MyWorldmap.GUILocalizeStrings.Get(37)); // options - Menu.Add("Free unused cache database space"); + Menu.Add(MyWorldmap.GUILocalizeStrings.Get(80)); Menu.DoModal(GUIWindowManager.ActiveWindow); @@ -229,9 +229,9 @@ case 0: { GUIDialogYesNo tmpYesNo = (GUIDialogYesNo)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_YES_NO); - tmpYesNo.SetHeading("Optimize database"); - tmpYesNo.SetLine(1, "This may take a while!"); - tmpYesNo.SetLine(2, "Start optimization now?"); + tmpYesNo.SetHeading(MyWorldmap.GUILocalizeStrings.Get(81)); + tmpYesNo.SetLine(1, MyWorldmap.GUILocalizeStrings.Get(82)); + tmpYesNo.SetLine(2, MyWorldmap.GUILocalizeStrings.Get(83)); tmpYesNo.SetDefaultToYes(true); tmpYesNo.DoModal(GUIWindowManager.ActiveWindow); if (tmpYesNo.IsConfirmed) Modified: trunk/plugins/WorldMap/language/MyWorldmap/strings_de.xml =================================================================== --- trunk/plugins/WorldMap/language/MyWorldmap/strings_de.xml 2007-12-14 04:16:35 UTC (rev 1157) +++ trunk/plugins/WorldMap/language/MyWorldmap/strings_de.xml 2007-12-14 08:21:28 UTC (rev 1158) @@ -22,5 +22,9 @@ <String id="56">Abbruch</String> <String id="70">Ergebnis der Suche</String> <String id="71">Ergebnis war leer</String> + <String id="80">Bereinige unbenutzten Speicherplatz der Cache-Datenbank</String> + <String id="81">Optimiere Datenbank</String> + <String id="82">Das könnte etwas dauern!</String> + <String id="83">Jetzt starten?</String> </Section> </Language> \ No newline at end of file Modified: trunk/plugins/WorldMap/language/MyWorldmap/strings_en.xml =================================================================== --- trunk/plugins/WorldMap/language/MyWorldmap/strings_en.xml 2007-12-14 04:16:35 UTC (rev 1157) +++ trunk/plugins/WorldMap/language/MyWorldmap/strings_en.xml 2007-12-14 08:21:28 UTC (rev 1158) @@ -22,5 +22,9 @@ <String id="56">Cancel</String> <String id="70">Search results</String> <String id="71">Result was empty</String> + <String id="80">Free unused cache database space</String> + <String id="81">Optimizing database</String> + <String id="82">This may take a while!</String> + <String id="83">Start optimization now?</String> </Section> </Language> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lk...@us...> - 2008-01-16 13:45:29
|
Revision: 1252 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1252&view=rev Author: lkuech Date: 2008-01-16 05:45:22 -0800 (Wed, 16 Jan 2008) Log Message: ----------- Worldmap: Prepared to switch the AdressSearch from Yahoo! to Google, because it covers much more Aerias of the World. Modified Paths: -------------- trunk/plugins/WorldMap/MAPS/SearchGeoCodes.cs trunk/plugins/WorldMap/WorldmapSearch.cs Modified: trunk/plugins/WorldMap/MAPS/SearchGeoCodes.cs =================================================================== --- trunk/plugins/WorldMap/MAPS/SearchGeoCodes.cs 2008-01-16 06:20:58 UTC (rev 1251) +++ trunk/plugins/WorldMap/MAPS/SearchGeoCodes.cs 2008-01-16 13:45:22 UTC (rev 1252) @@ -13,6 +13,7 @@ { OpenGeoCoding, YahooGeoCoding, + GoogleGeoCoding, GeoNames } @@ -38,6 +39,12 @@ public void SearchNow() { + if (ServiceName == GeoCodeService.GoogleGeoCoding) + { + Uri url = GetGoogleAdress(); + string XMLString = GetXMLResult(url); + PushGoogleResultToSearchResult(XMLString); + } if (ServiceName == GeoCodeService.YahooGeoCoding) { Uri url = GetYahooAdress(); @@ -157,6 +164,50 @@ } } + public void PushGoogleResultToSearchResult(string XMLString) + { + SearchResult = new List<GeoCode>(); + SearchResult.Clear(); + + if (XMLString == null) return; + + XmlDocument doc = new XmlDocument(); + doc.LoadXml(XMLString); + + XmlNode root = doc.DocumentElement; + root = root["Response"]; + + XmlNodeList nodes = root.ChildNodes; + + + System.Globalization.CultureInfo ci = System.Globalization.CultureInfo.InstalledUICulture; + System.Globalization.NumberFormatInfo ni = (System.Globalization.NumberFormatInfo)ci.NumberFormat.Clone(); + ni.NumberDecimalSeparator = "."; + ni.NumberGroupSeparator = ","; + + foreach (XmlNode node in nodes) + { + if(node.Name == "Status") + { + Debug.WriteLine(String.Format("WorldMap Google GeoCodeSearch. Request:{0} ReturnCode: {1}", node["request"].InnerText, node["code"].InnerText)); + } + + if (node.Name == "Placemark") + { + GeoCode tmpGeoCode = new GeoCode(); + tmpGeoCode.Name = node["address"].InnerText; + + XmlNode PointNode = node["Point"]; + string Coordinates = PointNode.FirstChild.InnerText; + string longitude = Coordinates.Split(new char[] { ',' })[0]; + string latitude = Coordinates.Split(new char[] { ',' })[1]; + tmpGeoCode.Longitude = double.Parse(longitude, ni); + tmpGeoCode.Latitude = double.Parse(latitude, ni); + SearchResult.Add(tmpGeoCode); + } + } + } + public Uri GetYahooAdress() { string url = "http://local.yahooapis.com/MapsService/V1/geocode?appid=MediaPortalWorldmap&output=xml"; @@ -182,6 +233,36 @@ } + public Uri GetGoogleAdress() + { + // right now the key is found somewhere at the internet. Why have to get our own... + string url = "http://maps.google.com/maps/geo?output=xml&key=ABQIAAAA5rWB_5p0XK5Y2Qzsyd6HpxSPVks7h_CYIzXuM6UMzYp2f8KU7RQbRo0p7vACcXJ1w39qEH6JPQL_xg&q="; + + int valuesAdded = 0; + + if (Street != "") + { + url += Street; + valuesAdded++; + } + if (City != "") + { + if (valuesAdded > 0) url += ","; + url += City; + valuesAdded++; + } + if (Country != "") + { + if (valuesAdded > 0) url += ","; + url += Country; + valuesAdded++; + } + url = ConvertStringToSafeUrl(url); + + return new Uri(url); + } + + /// <summary> /// Converts special characters to safe ones (e.g. \xFC becomes %FC) /// </summary> Modified: trunk/plugins/WorldMap/WorldmapSearch.cs =================================================================== --- trunk/plugins/WorldMap/WorldmapSearch.cs 2008-01-16 06:20:58 UTC (rev 1251) +++ trunk/plugins/WorldMap/WorldmapSearch.cs 2008-01-16 13:45:22 UTC (rev 1252) @@ -236,7 +236,11 @@ if (searchType == SearchType.Place) tmpWin.SuggestedZoomLevel = 13; else { - if (lblStreet.Label != "") tmpWin.SuggestedZoomLevel = 16; + if (lblStreet.Label != "") + { + tmpWin.SuggestedZoomLevel = 16; + if (tmpMainWindow.currentMapType == MAPS.MapFunctions.MapType.GMTerrain) tmpWin.SuggestedZoomLevel = 15; + } if (lblStreet.Label == "" && lblCity.Label != "") tmpWin.SuggestedZoomLevel = 11; if (lblStreet.Label == "" && lblCity.Label == "" && lblCountry.Label != "") tmpWin.SuggestedZoomLevel = 5; } @@ -276,7 +280,7 @@ Street = lblStreet.Label; City = lblCity.Label; Country = lblCountry.Label; - tmpSearch.ServiceName = MAPS.GeoCodeService.YahooGeoCoding; + tmpSearch.ServiceName = MAPS.GeoCodeService.GoogleGeoCoding; } if (searchType == SearchType.Place) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lk...@us...> - 2008-02-07 12:28:25
|
Revision: 1345 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1345&view=rev Author: lkuech Date: 2008-02-07 04:28:23 -0800 (Thu, 07 Feb 2008) Log Message: ----------- WorldMap: - refactored the Namespace. - added configuration icon. Modified Paths: -------------- trunk/plugins/WorldMap/Installer/Worldmap.xmp trunk/plugins/WorldMap/LocalizeStrings.cs trunk/plugins/WorldMap/PlugInBase.cs trunk/plugins/WorldMap/Properties/AssemblyInfo.cs trunk/plugins/WorldMap/Properties/Resources.Designer.cs trunk/plugins/WorldMap/Settings.cs trunk/plugins/WorldMap/WorldMap.cs trunk/plugins/WorldMap/WorldMapSearchResults.cs trunk/plugins/WorldMap/WorldmapConfig.Designer.cs trunk/plugins/WorldMap/WorldmapConfig.cs trunk/plugins/WorldMap/WorldmapMenu.cs trunk/plugins/WorldMap/WorldmapSearch.cs Added Paths: ----------- trunk/plugins/WorldMap/MyWorldMap.csproj trunk/plugins/WorldMap/worldmap_disabled.png trunk/plugins/WorldMap/worldmap_enabled.png Removed Paths: ------------- trunk/plugins/WorldMap/GUIWorldMap.csproj Deleted: trunk/plugins/WorldMap/GUIWorldMap.csproj =================================================================== --- trunk/plugins/WorldMap/GUIWorldMap.csproj 2008-02-07 12:24:33 UTC (rev 1344) +++ trunk/plugins/WorldMap/GUIWorldMap.csproj 2008-02-07 12:28:23 UTC (rev 1345) @@ -1,116 +0,0 @@ -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <PropertyGroup> - <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> - <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ProductVersion>8.0.50727</ProductVersion> - <SchemaVersion>2.0</SchemaVersion> - <ProjectGuid>{857D8A0C-FB95-4A26-8ED6-8E51586D2116}</ProjectGuid> - <OutputType>Library</OutputType> - <AppDesignerFolder>Properties</AppDesignerFolder> - <RootNamespace>GUIWorldmap</RootNamespace> - <AssemblyName>GUIWorldmap</AssemblyName> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> - <DebugSymbols>true</DebugSymbols> - <DebugType>full</DebugType> - <Optimize>false</Optimize> - <OutputPath>bin\Debug\</OutputPath> - <DefineConstants>DEBUG;TRACE</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - </PropertyGroup> - <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <DebugType>pdbonly</DebugType> - <Optimize>true</Optimize> - <OutputPath>bin\Release\</OutputPath> - <DefineConstants>TRACE</DefineConstants> - <ErrorReport>prompt</ErrorReport> - <WarningLevel>4</WarningLevel> - </PropertyGroup> - <ItemGroup> - <Reference Include="Core, Version=0.2.2.0, Culture=neutral, processorArchitecture=x86"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\Core\bin\Debug\Core.dll</HintPath> - </Reference> - <Reference Include="Dialogs, Version=0.0.0.0, Culture=neutral, processorArchitecture=x86"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\Dialogs\bin\Debug\Dialogs.dll</HintPath> - </Reference> - <Reference Include="Microsoft.DirectX.Direct3D, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> - <HintPath>..\MediaPortal.Base\Microsoft.DirectX.Direct3D.dll</HintPath> - </Reference> - <Reference Include="Microsoft.DirectX.Direct3DX, Version=1.0.2911.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\MediaPortal.Base\Microsoft.DirectX.Direct3DX.dll</HintPath> - </Reference> - <Reference Include="Microsoft.DirectX.DirectDraw, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> - <HintPath>..\MediaPortal.Base\Microsoft.DirectX.DirectDraw.dll</HintPath> - </Reference> - <Reference Include="System" /> - <Reference Include="System.Data" /> - <Reference Include="System.Data.SQLite, Version=1.0.41.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=x86"> - <SpecificVersion>False</SpecificVersion> - <HintPath>.\System.Data.SQLite.DLL</HintPath> - </Reference> - <Reference Include="System.Drawing" /> - <Reference Include="System.Windows.Forms" /> - <Reference Include="System.Xml" /> - <Reference Include="Utils, Version=2.1.2.0, Culture=neutral, processorArchitecture=x86"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\Utils\bin\Debug\Utils.dll</HintPath> - </Reference> - </ItemGroup> - <ItemGroup> - <Compile Include="LocalizeStrings.cs" /> - <Compile Include="Properties\Resources.Designer.cs"> - <AutoGen>True</AutoGen> - <DesignTime>True</DesignTime> - <DependentUpon>Resources.resx</DependentUpon> - </Compile> - <Compile Include="WorldmapConfig.cs"> - <SubType>Form</SubType> - </Compile> - <Compile Include="WorldmapConfig.Designer.cs"> - <DependentUpon>WorldmapConfig.cs</DependentUpon> - </Compile> - <Compile Include="MAPS\ImageFunctions.cs" /> - <Compile Include="MAPS\MapFunctions.cs" /> - <Compile Include="MAPS\MapTile.cs" /> - <Compile Include="MAPS\MapTiles.cs" /> - <Compile Include="MAPS\SearchGeoCodes.cs" /> - <Compile Include="MAPS\ThreadedDownload.cs" /> - <Compile Include="MAPS\TileCacheDatabase.cs" /> - <Compile Include="NewVirtualKeyboard.cs" /> - <Compile Include="Settings.cs" /> - <Compile Include="WorldMap.cs" /> - <Compile Include="PlugInBase.cs" /> - <Compile Include="Properties\AssemblyInfo.cs" /> - <Compile Include="WorldmapMenu.cs" /> - <Compile Include="WorldmapSearch.cs" /> - <Compile Include="WorldMapSearchResults.cs" /> - </ItemGroup> - <ItemGroup> - <EmbeddedResource Include="WorldmapConfig.resx"> - <SubType>Designer</SubType> - <DependentUpon>WorldmapConfig.cs</DependentUpon> - </EmbeddedResource> - </ItemGroup> - <ItemGroup> - <EmbeddedResource Include="Properties\Resources.resx"> - <SubType>Designer</SubType> - <Generator>ResXFileCodeGenerator</Generator> - <LastGenOutput>Resources.Designer.cs</LastGenOutput> - </EmbeddedResource> - </ItemGroup> - <ItemGroup> - <Folder Include="Resources\" /> - </ItemGroup> - <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> - <!-- To modify your build process, add your task inside one of the targets below and uncomment it. - Other similar extension points exist, see Microsoft.Common.targets. - <Target Name="BeforeBuild"> - </Target> - <Target Name="AfterBuild"> - </Target> - --> -</Project> \ No newline at end of file Modified: trunk/plugins/WorldMap/Installer/Worldmap.xmp =================================================================== --- trunk/plugins/WorldMap/Installer/Worldmap.xmp 2008-02-07 12:24:33 UTC (rev 1344) +++ trunk/plugins/WorldMap/Installer/Worldmap.xmp 2008-02-07 12:28:23 UTC (rev 1345) @@ -8,7 +8,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\bin\Release\GUIWorldmap.dll</Source> <Id>01010</Id> <Option /> - <Guid>060956a8-cef0-4726-a19a-c2aa727883df</Guid> + <Guid>38597bb0-0df2-4f2e-a4d4-79ae4e74c809</Guid> </File> <File> <FileName>GUIWorldmap.xml</FileName> @@ -17,7 +17,7 @@ <Source>GUIWorldmap.xml</Source> <Id>01010</Id> <Option /> - <Guid>f5fbf236-5f4b-455f-a3c5-c0ede150e845</Guid> + <Guid>e37454ad-9e1d-480d-bae5-32a5c9fab8d2</Guid> </File> <File> <FileName>hover_worldmap.png</FileName> @@ -26,7 +26,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\hover_worldmap.png</Source> <Id>04010</Id> <Option /> - <Guid>5efcfc7b-ae78-426a-b026-50b6da4c97a8</Guid> + <Guid>d344ee1f-acba-4404-9f60-43a92272caa3</Guid> </File> <File> <FileName>hover_worldmap.png</FileName> @@ -35,7 +35,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\hover_worldmap.png</Source> <Id>04010</Id> <Option /> - <Guid>e7103781-cd4d-49a9-8972-7fc938df9580</Guid> + <Guid>6ad61fbb-2cf6-46b4-9a01-bb9842dfd610</Guid> </File> <File> <FileName>MyWorldMap.xml</FileName> @@ -44,7 +44,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\MyWorldMap.xml</Source> <Id>04010</Id> <Option /> - <Guid>d4049b41-fb28-4d1a-80fc-c9e4a7685200</Guid> + <Guid>142e2e32-de00-497b-b604-0a577a5be997</Guid> </File> <File> <FileName>MyWorldMap.xml</FileName> @@ -53,7 +53,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\MyWorldMap.xml</Source> <Id>04010</Id> <Option /> - <Guid>62e37304-b2da-4495-9c91-3dff72f00ef6</Guid> + <Guid>31117dab-ec31-4841-a97b-c7e22b9657f2</Guid> </File> <File> <FileName>MyWorldmapMenu.xml</FileName> @@ -62,7 +62,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\MyWorldmapMenu.xml</Source> <Id>04010</Id> <Option /> - <Guid>8e1093e2-328f-4514-8a60-d290e314023e</Guid> + <Guid>db1b7706-caf3-4ad1-8b60-4b7c46e66ad0</Guid> </File> <File> <FileName>MyWorldmapMenu.xml</FileName> @@ -71,7 +71,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\MyWorldmapMenu.xml</Source> <Id>04010</Id> <Option /> - <Guid>7580710c-618d-4e6e-b2d4-8337750321c4</Guid> + <Guid>decc2347-47e5-4686-a267-d727db9fad39</Guid> </File> <File> <FileName>MyWorldmapSearch.xml</FileName> @@ -80,7 +80,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\MyWorldmapSearch.xml</Source> <Id>04010</Id> <Option /> - <Guid>759c15b5-b888-4fbe-8add-eae4b54d2929</Guid> + <Guid>6be93826-21ee-4e3b-b299-8399ba315fd1</Guid> </File> <File> <FileName>MyWorldmapSearch.xml</FileName> @@ -89,7 +89,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\MyWorldmapSearch.xml</Source> <Id>04010</Id> <Option /> - <Guid>15bae91a-e4b8-4dbb-8ba1-7c9198766f4b</Guid> + <Guid>4210f654-03d1-4ffb-adcb-a0341efefa76</Guid> </File> <File> <FileName>MyWorldmapSearchResults.xml</FileName> @@ -98,7 +98,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\MyWorldmapSearchResults.xml</Source> <Id>04010</Id> <Option /> - <Guid>bf3a08f2-df5d-4595-8ea8-62d138d08e19</Guid> + <Guid>87859a8c-81e3-43fb-be97-8135253bb426</Guid> </File> <File> <FileName>MyWorldmapSearchResults.xml</FileName> @@ -107,7 +107,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\MyWorldmapSearchResults.xml</Source> <Id>04010</Id> <Option /> - <Guid>9c43a7b1-7544-45f6-bdba-7f7dc3202cbd</Guid> + <Guid>a4382150-b791-46fc-bb24-abe5a0142735</Guid> </File> <File> <FileName>strings_de.xml</FileName> @@ -116,7 +116,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\language\MyWorldmap\strings_de.xml</Source> <Id>04010</Id> <Option /> - <Guid>006e62f7-3f40-4bfd-9e99-16aadf75c366</Guid> + <Guid>54c487c2-b583-4e5f-9836-5422fa461a2c</Guid> </File> <File> <FileName>strings_en.xml</FileName> @@ -125,7 +125,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\language\MyWorldmap\strings_en.xml</Source> <Id>04010</Id> <Option /> - <Guid>05e3828b-426b-4097-a3af-e720d645999e</Guid> + <Guid>69d9dce4-fbe3-4ba3-be93-cfd83443123d</Guid> </File> <File> <FileName>strings_no.xml</FileName> @@ -134,7 +134,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\language\MyWorldmap\strings_no.xml</Source> <Id>04010</Id> <Option /> - <Guid>1afcc8bb-aa8d-4452-848d-8f0a1f26b153</Guid> + <Guid>f89f9b66-c052-4278-ab42-01c3eeacf9a8</Guid> </File> <File> <FileName>System.Data.SQLite.DLL</FileName> @@ -143,7 +143,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\System.Data.SQLite.DLL</Source> <Id>01010</Id> <Option /> - <Guid>0d9db766-c802-4e2c-92e1-fe3c472d054b</Guid> + <Guid>cf84758b-6d66-44d4-93bf-0df51d301e9f</Guid> </File> <File> <FileName>WMIPBlocked.jpeg</FileName> @@ -152,7 +152,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\WMIPBlocked.jpeg</Source> <Id>04010</Id> <Option /> - <Guid>afa4c48c-b10a-46c0-bb6e-dc07034185d5</Guid> + <Guid>b505eee3-23c4-4884-871c-47b1f8c84b2e</Guid> </File> <File> <FileName>WMIPBlocked.jpeg</FileName> @@ -161,7 +161,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\WMIPBlocked.jpeg</Source> <Id>04010</Id> <Option /> - <Guid>767b59db-2c06-49ab-a87c-5abf3e6248c7</Guid> + <Guid>a21d1942-08cc-4bc2-926c-23a7f22688de</Guid> </File> <File> <FileName>WMprogressBarActive.png</FileName> @@ -170,7 +170,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\WMprogressBarActive.png</Source> <Id>04010</Id> <Option /> - <Guid>2abf5200-59ff-466f-99f9-d5ae1209e5be</Guid> + <Guid>3d832a2d-8bf5-469a-9ecf-90d009c806fe</Guid> </File> <File> <FileName>WMprogressBarActive.png</FileName> @@ -179,7 +179,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\WMprogressBarActive.png</Source> <Id>04010</Id> <Option /> - <Guid>c8470867-c6f5-4ae8-8edd-457c8bd5efaa</Guid> + <Guid>a6d65a8e-8c71-4257-9e0a-7b685c50e7eb</Guid> </File> <File> <FileName>WMprogressBarQueued.png</FileName> @@ -188,7 +188,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\WMprogressBarQueued.png</Source> <Id>04010</Id> <Option /> - <Guid>0a72a995-224e-466c-b611-1ca1f9c2f2f8</Guid> + <Guid>8d30c1fd-323c-4359-b6eb-9df287872cf4</Guid> </File> <File> <FileName>WMprogressBarQueued.png</FileName> @@ -197,7 +197,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\WMprogressBarQueued.png</Source> <Id>04010</Id> <Option /> - <Guid>4c0a8640-061d-4642-a481-53a196492d56</Guid> + <Guid>fb1fc111-e803-44a6-a6ec-accdedebcfc2</Guid> </File> <File> <FileName>WMprogressDummy.png</FileName> @@ -206,7 +206,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\WMprogressDummy.png</Source> <Id>04010</Id> <Option /> - <Guid>336af7f3-0145-4e67-8b1f-cfbad75e1a84</Guid> + <Guid>76d87e83-3fc2-4858-ac08-25ab9a9254e6</Guid> </File> <File> <FileName>WMprogressDummy.png</FileName> @@ -215,7 +215,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\WMprogressDummy.png</Source> <Id>04010</Id> <Option /> - <Guid>d8cf6a5c-fa35-4640-8b24-417a3b73fa94</Guid> + <Guid>c9eb9885-9290-4f4f-a100-0f4a675f1150</Guid> </File> <File> <FileName>WMTileNotAvailable.jpeg</FileName> @@ -224,7 +224,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\WMTileNotAvailable.jpeg</Source> <Id>04010</Id> <Option /> - <Guid>ba43f235-de94-4987-991a-9bc17f631424</Guid> + <Guid>751dbf71-cb22-4cfc-8353-860b0efcf5ce</Guid> </File> <File> <FileName>WMTileNotAvailable.jpeg</FileName> @@ -233,7 +233,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\WMTileNotAvailable.jpeg</Source> <Id>04010</Id> <Option /> - <Guid>2301a2e2-7406-424a-bc4b-32bbaa974bc3</Guid> + <Guid>59edd262-7382-4914-8464-941b56ec201a</Guid> </File> <File> <FileName>WMTilePlaceholder.jpeg</FileName> @@ -242,7 +242,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo wide\Media\WMTilePlaceholder.jpeg</Source> <Id>04010</Id> <Option /> - <Guid>34a80876-17b1-41b9-a399-37b990e962c4</Guid> + <Guid>7c527f26-1779-4a28-8429-5bd30dde8ef2</Guid> </File> <File> <FileName>WMTilePlaceholder.jpeg</FileName> @@ -251,7 +251,7 @@ <Source>C:\Users\TH10KX\Documents\Visual Studio 2005\Projects\MP Source\MediaPortal.Org\GUIWorldMap\skinFiles\BlueTwo\Media\WMTilePlaceholder.jpeg</Source> <Id>04010</Id> <Option /> - <Guid>afa3d399-5515-48f8-a93f-43b633b71f77</Guid> + <Guid>aaf0cb82-9b25-4f61-b140-ebdbd1a3c865</Guid> </File> </FileList> <StringList /> Modified: trunk/plugins/WorldMap/LocalizeStrings.cs =================================================================== --- trunk/plugins/WorldMap/LocalizeStrings.cs 2008-02-07 12:24:33 UTC (rev 1344) +++ trunk/plugins/WorldMap/LocalizeStrings.cs 2008-02-07 12:28:23 UTC (rev 1345) @@ -35,7 +35,7 @@ using MediaPortal.Configuration; using MediaPortal.Localisation; -namespace MediaPortal.GUI.MyWorldmap +namespace MyWorldmap { /// <summary> /// This class will hold all text used in the application Added: trunk/plugins/WorldMap/MyWorldMap.csproj =================================================================== --- trunk/plugins/WorldMap/MyWorldMap.csproj (rev 0) +++ trunk/plugins/WorldMap/MyWorldMap.csproj 2008-02-07 12:28:23 UTC (rev 1345) @@ -0,0 +1,124 @@ +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>8.0.50727</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{857D8A0C-FB95-4A26-8ED6-8E51586D2116}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>MyWorldmap</RootNamespace> + <AssemblyName>GUIWorldmap</AssemblyName> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="Core, Version=0.2.2.0, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\Core\bin\Debug\Core.dll</HintPath> + </Reference> + <Reference Include="Dialogs, Version=0.0.0.0, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\Dialogs\bin\Debug\Dialogs.dll</HintPath> + </Reference> + <Reference Include="Microsoft.DirectX.Direct3D, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> + <HintPath>..\MediaPortal.Base\Microsoft.DirectX.Direct3D.dll</HintPath> + </Reference> + <Reference Include="Microsoft.DirectX.Direct3DX, Version=1.0.2911.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\MediaPortal.Base\Microsoft.DirectX.Direct3DX.dll</HintPath> + </Reference> + <Reference Include="Microsoft.DirectX.DirectDraw, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> + <HintPath>..\MediaPortal.Base\Microsoft.DirectX.DirectDraw.dll</HintPath> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Data.SQLite, Version=1.0.41.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>.\System.Data.SQLite.DLL</HintPath> + </Reference> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + <Reference Include="Utils, Version=2.1.2.0, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\Utils\bin\Debug\Utils.dll</HintPath> + </Reference> + </ItemGroup> + <ItemGroup> + <Compile Include="LocalizeStrings.cs" /> + <Compile Include="Properties\Resources.Designer.cs"> + <AutoGen>True</AutoGen> + <DesignTime>True</DesignTime> + <DependentUpon>Resources.resx</DependentUpon> + </Compile> + <Compile Include="WorldmapConfig.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="WorldmapConfig.Designer.cs"> + <DependentUpon>WorldmapConfig.cs</DependentUpon> + </Compile> + <Compile Include="MAPS\ImageFunctions.cs" /> + <Compile Include="MAPS\MapFunctions.cs" /> + <Compile Include="MAPS\MapTile.cs" /> + <Compile Include="MAPS\MapTiles.cs" /> + <Compile Include="MAPS\SearchGeoCodes.cs" /> + <Compile Include="MAPS\ThreadedDownload.cs" /> + <Compile Include="MAPS\TileCacheDatabase.cs" /> + <Compile Include="NewVirtualKeyboard.cs" /> + <Compile Include="Settings.cs" /> + <Compile Include="WorldMap.cs" /> + <Compile Include="PlugInBase.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="WorldmapMenu.cs" /> + <Compile Include="WorldmapSearch.cs" /> + <Compile Include="WorldMapSearchResults.cs" /> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="WorldmapConfig.resx"> + <SubType>Designer</SubType> + <DependentUpon>WorldmapConfig.cs</DependentUpon> + </EmbeddedResource> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="Properties\Resources.resx"> + <SubType>Designer</SubType> + <Generator>ResXFileCodeGenerator</Generator> + <LastGenOutput>Resources.Designer.cs</LastGenOutput> + </EmbeddedResource> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="worldmap_disabled.png"> + <CustomToolNamespace>MyWorldmap</CustomToolNamespace> + </EmbeddedResource> + <EmbeddedResource Include="worldmap_enabled.png"> + <CustomToolNamespace>MyWorldmap</CustomToolNamespace> + </EmbeddedResource> + </ItemGroup> + <ItemGroup> + <Folder Include="Resources\" /> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file Modified: trunk/plugins/WorldMap/PlugInBase.cs =================================================================== --- trunk/plugins/WorldMap/PlugInBase.cs 2008-02-07 12:24:33 UTC (rev 1344) +++ trunk/plugins/WorldMap/PlugInBase.cs 2008-02-07 12:28:23 UTC (rev 1345) @@ -5,7 +5,7 @@ using MediaPortal.GUI.Library; using MediaPortal.Configuration; -namespace MediaPortal.GUI.MyWorldmap +namespace MyWorldmap { public enum WorldmapWindowIDs { Modified: trunk/plugins/WorldMap/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/WorldMap/Properties/AssemblyInfo.cs 2008-02-07 12:24:33 UTC (rev 1344) +++ trunk/plugins/WorldMap/Properties/AssemblyInfo.cs 2008-02-07 12:28:23 UTC (rev 1345) @@ -5,12 +5,12 @@ // Allgemeine Informationen über eine Assembly werden über die folgenden // Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, // die mit einer Assembly verknüpft sind. -[assembly: AssemblyTitle("GUIAtlas")] -[assembly: AssemblyDescription("")] +[assembly: AssemblyTitle("MyWorldMap")] +[assembly: AssemblyDescription("plugin for MediaPortal")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Airbus Deutschland GmbH")] -[assembly: AssemblyProduct("GUIAtlas")] -[assembly: AssemblyCopyright("Copyright © Airbus Deutschland GmbH 2007")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MyWorldMap")] +[assembly: AssemblyCopyright("(c) 2008")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -31,5 +31,5 @@ // // Sie können alle Werte angeben oder die standardmäßigen Revisions- und Buildnummern // übernehmen, indem Sie "*" eingeben: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("0.5.1.0")] +[assembly: AssemblyFileVersion("0.5.1.0")] Modified: trunk/plugins/WorldMap/Properties/Resources.Designer.cs =================================================================== --- trunk/plugins/WorldMap/Properties/Resources.Designer.cs 2008-02-07 12:24:33 UTC (rev 1344) +++ trunk/plugins/WorldMap/Properties/Resources.Designer.cs 2008-02-07 12:28:23 UTC (rev 1345) @@ -1,14 +1,14 @@ //------------------------------------------------------------------------------ // <auto-generated> // Dieser Code wurde von einem Tool generiert. -// Laufzeitversion:2.0.50727.42 +// Laufzeitversion:2.0.50727.312 // // Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn // der Code erneut generiert wird. // </auto-generated> //------------------------------------------------------------------------------ -namespace GUIWorldmap.Properties { +namespace MyWorldmap.Properties { using System; @@ -39,7 +39,7 @@ internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("GUIWorldmap.Properties.Resources", typeof(Resources).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MyWorldmap.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; Modified: trunk/plugins/WorldMap/Settings.cs =================================================================== --- trunk/plugins/WorldMap/Settings.cs 2008-02-07 12:24:33 UTC (rev 1344) +++ trunk/plugins/WorldMap/Settings.cs 2008-02-07 12:28:23 UTC (rev 1345) @@ -5,7 +5,7 @@ using MediaPortal.GUI.Library; using MAPS; -namespace MediaPortal.GUI.MyWorldmap +namespace MyWorldmap { class Settings { Modified: trunk/plugins/WorldMap/WorldMap.cs =================================================================== --- trunk/plugins/WorldMap/WorldMap.cs 2008-02-07 12:24:33 UTC (rev 1344) +++ trunk/plugins/WorldMap/WorldMap.cs 2008-02-07 12:28:23 UTC (rev 1345) @@ -14,9 +14,9 @@ using System.IO; using MediaPortal.Configuration; -namespace MediaPortal.GUI.MyWorldmap +namespace MyWorldmap { - //[PluginIcons("GUIWorldMap.worldmapicon.png", "worldmapicon_disabled.png")] + [PluginIcons("MyWorldmap.worldmap_enabled.png", "MyWorldmap.worldmap_disabled.png")] public class WorldMap : PlugInBase { [SkinControlAttribute(2)] Modified: trunk/plugins/WorldMap/WorldMapSearchResults.cs =================================================================== --- trunk/plugins/WorldMap/WorldMapSearchResults.cs 2008-02-07 12:24:33 UTC (rev 1344) +++ trunk/plugins/WorldMap/WorldMapSearchResults.cs 2008-02-07 12:28:23 UTC (rev 1345) @@ -6,7 +6,7 @@ using MediaPortal.GUI.Library; using MediaPortal.Dialogs; -namespace MediaPortal.GUI.MyWorldmap +namespace MyWorldmap { class WorldMapSearchResults : GUIWindow { Modified: trunk/plugins/WorldMap/WorldmapConfig.Designer.cs =================================================================== --- trunk/plugins/WorldMap/WorldmapConfig.Designer.cs 2008-02-07 12:24:33 UTC (rev 1344) +++ trunk/plugins/WorldMap/WorldmapConfig.Designer.cs 2008-02-07 12:28:23 UTC (rev 1345) @@ -1,4 +1,4 @@ -namespace MediaPortal.GUI.MyWorldmap +namespace MyWorldmap { partial class WorldmapConfig { Modified: trunk/plugins/WorldMap/WorldmapConfig.cs =================================================================== --- trunk/plugins/WorldMap/WorldmapConfig.cs 2008-02-07 12:24:33 UTC (rev 1344) +++ trunk/plugins/WorldMap/WorldmapConfig.cs 2008-02-07 12:28:23 UTC (rev 1345) @@ -8,7 +8,7 @@ using MediaPortal.GUI.Library; using System.Collections; -namespace MediaPortal.GUI.MyWorldmap +namespace MyWorldmap { public partial class WorldmapConfig : Form Modified: trunk/plugins/WorldMap/WorldmapMenu.cs =================================================================== --- trunk/plugins/WorldMap/WorldmapMenu.cs 2008-02-07 12:24:33 UTC (rev 1344) +++ trunk/plugins/WorldMap/WorldmapMenu.cs 2008-02-07 12:28:23 UTC (rev 1345) @@ -8,7 +8,7 @@ using MAPS; -namespace MediaPortal.GUI.MyWorldmap +namespace MyWorldmap { class WorldmapMenu : GUIWindow { Modified: trunk/plugins/WorldMap/WorldmapSearch.cs =================================================================== --- trunk/plugins/WorldMap/WorldmapSearch.cs 2008-02-07 12:24:33 UTC (rev 1344) +++ trunk/plugins/WorldMap/WorldmapSearch.cs 2008-02-07 12:28:23 UTC (rev 1345) @@ -5,7 +5,7 @@ using MediaPortal.Dialogs; using System.Threading; -namespace MediaPortal.GUI.MyWorldmap +namespace MyWorldmap { enum SearchType { Added: trunk/plugins/WorldMap/worldmap_disabled.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/WorldMap/worldmap_disabled.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/plugins/WorldMap/worldmap_enabled.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/WorldMap/worldmap_enabled.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lk...@us...> - 2008-04-02 11:22:53
|
Revision: 1579 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1579&view=rev Author: lkuech Date: 2008-04-02 04:22:44 -0700 (Wed, 02 Apr 2008) Log Message: ----------- Fixed: Potential exception when closing MediaPortal Fixed: some url's where not encoded correctly Modified Paths: -------------- trunk/plugins/WorldMap/MAPS/SearchGeoCodes.cs trunk/plugins/WorldMap/WorldMap.cs Modified: trunk/plugins/WorldMap/MAPS/SearchGeoCodes.cs =================================================================== --- trunk/plugins/WorldMap/MAPS/SearchGeoCodes.cs 2008-04-01 15:13:59 UTC (rev 1578) +++ trunk/plugins/WorldMap/MAPS/SearchGeoCodes.cs 2008-04-02 11:22:44 UTC (rev 1579) @@ -272,7 +272,7 @@ string safeChars = "0123456789" + // Numeric "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + // Alphabetic "abcdefghijklmnopqrstuvwxyz" + - ":-_.!~*'()?\\/=&"; // special + ":-_.!~*'()?\\/=&%"; // special foreach (char Char in url) { if (safeChars.Contains(Char.ToString())) ret += Char; Modified: trunk/plugins/WorldMap/WorldMap.cs =================================================================== --- trunk/plugins/WorldMap/WorldMap.cs 2008-04-01 15:13:59 UTC (rev 1578) +++ trunk/plugins/WorldMap/WorldMap.cs 2008-04-02 11:22:44 UTC (rev 1579) @@ -329,14 +329,8 @@ mapTiles.ClearTileDownloadQueue(); - if (MPisClosing) - { - mapTiles.ImageGrabber.cacheDatabase.DeleteOldCacheEntries(); - } - else - { - using (WaitCursor cursor = new WaitCursor()) mapTiles.ImageGrabber.cacheDatabase.DeleteOldCacheEntries(); - } + mapTiles.ImageGrabber.cacheDatabase.DeleteOldCacheEntries(); + mapTiles = null; ProgressBarActiveTexture.Dispose(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |