|
From: <dos...@us...> - 2014-12-22 20:16:34
|
Revision: 4900
http://sourceforge.net/p/mp-plugins/code/4900
Author: doskabouter
Date: 2014-12-22 20:16:00 +0000 (Mon, 22 Dec 2014)
Log Message:
-----------
Refactoring
Modified Paths:
--------------
trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/Bookmarks.cs
trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/BrowseTheWeb.csproj
Added Paths:
-----------
trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/VersionSpecific.cs
Removed Paths:
-------------
trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/MyLog.cs
Modified: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/Bookmarks.cs
===================================================================
--- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/Bookmarks.cs 2014-12-21 20:41:16 UTC (rev 4899)
+++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/Bookmarks.cs 2014-12-22 20:16:00 UTC (rev 4900)
@@ -27,7 +27,6 @@
using System.IO;
using System.Windows.Forms;
using System.Net;
-using MediaPortal.Configuration;
using System.Drawing;
@@ -185,7 +184,7 @@
public class Bookmark
{
- private static string ThumbDir = Config.GetFolder(MediaPortal.Configuration.Config.Dir.Thumbs) + "\\BrowseTheWeb";
+ private static string ThumbDir = VersionSpecific.ThumbDir;
public static TreeNode FindNode(TreeView Treeview, string Name)
{
@@ -226,7 +225,7 @@
return true;
}
- private static void SaveSnap(Bitmap Snap, string Url)
+ private static void SaveSnap(Image Snap, string Url)
{
try
{
@@ -241,7 +240,6 @@
public static Bitmap GetSnap(string Url)
{
-
try
{
string filename = GetSnapPath(Url);
@@ -296,14 +294,17 @@
{
if (browser.Url.ToString() != "about:blank")
{
- Bitmap snap = browser.GetBitmap((uint)browser.Width, (uint)browser.Height);
-
- snap = MediaPortal.Util.BitmapResize.Resize(ref snap, 300, 400, false, true);
-
- Graphics g = Graphics.FromImage((Image)snap);
- g.DrawRectangle(new Pen(Color.Black, 2), new Rectangle(1, 1, snap.Width - 2, snap.Height - 2));
-
- Bookmark.SaveSnap(snap, url);
+ using (Bitmap snap = browser.GetBitmap((uint)browser.Width, (uint)browser.Height))
+ {
+ using (Image newImage = VersionSpecific.Resize(snap))
+ {
+ using (Graphics g = Graphics.FromImage(newImage))
+ {
+ g.DrawRectangle(new Pen(Color.Black, 2), new Rectangle(1, 1, newImage.Width - 2, newImage.Height - 2));
+ }
+ Bookmark.SaveSnap(newImage, url);
+ }
+ }
return true;
}
return false;
Modified: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/BrowseTheWeb.csproj
===================================================================
--- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/BrowseTheWeb.csproj 2014-12-21 20:41:16 UTC (rev 4899)
+++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/BrowseTheWeb.csproj 2014-12-22 20:16:00 UTC (rev 4900)
@@ -131,7 +131,6 @@
<DependentUpon>ImportBrowser.cs</DependentUpon>
</Compile>
<Compile Include="JSONNode.cs" />
- <Compile Include="MyLog.cs" />
<Compile Include="OSD_LinkId.cs">
<SubType>UserControl</SubType>
</Compile>
@@ -151,6 +150,7 @@
<Compile Include="Setup.Designer.cs">
<DependentUpon>Setup.cs</DependentUpon>
</Compile>
+ <Compile Include="VersionSpecific.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="GetFolder.resx">
Deleted: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/MyLog.cs
===================================================================
--- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/MyLog.cs 2014-12-21 20:41:16 UTC (rev 4899)
+++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/MyLog.cs 2014-12-22 20:16:00 UTC (rev 4900)
@@ -1,46 +0,0 @@
-#region Copyright (C) 2005-2010 Team MediaPortal
-
-/*
- * Copyright (C) 2005-2010 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 MediaPortal.GUI.Library;
-
-namespace BrowseTheWeb
-{
- /// <summary>
- /// just some log if needed
- /// </summary>
- public static class MyLog
- {
- public static void debug(string str)
- {
- Log.Debug("BrowseTheWeb | " + str, new object[0]);
- }
-
- public static void error(string str)
- {
- Log.Error("BrowseTheWeb | " + str, new object[0]);
- }
- }
-}
-
Copied: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/VersionSpecific.cs (from rev 4888, trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/MyLog.cs)
===================================================================
--- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/VersionSpecific.cs (rev 0)
+++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/VersionSpecific.cs 2014-12-22 20:16:00 UTC (rev 4900)
@@ -0,0 +1,59 @@
+#region Copyright (C) 2005-2010 Team MediaPortal
+
+/*
+ * Copyright (C) 2005-2010 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.Drawing;
+using MediaPortal.Configuration;
+using MediaPortal.GUI.Library;
+
+namespace BrowseTheWeb
+{
+ /// <summary>
+ /// just some log if needed
+ /// </summary>
+ public static class MyLog
+ {
+ public static void debug(string str)
+ {
+ Log.Debug("BrowseTheWeb | " + str, new object[0]);
+ }
+
+ public static void error(string str)
+ {
+ Log.Error("BrowseTheWeb | " + str, new object[0]);
+ }
+ }
+
+ public static class VersionSpecific
+ {
+ public static string ThumbDir = Config.GetFolder(MediaPortal.Configuration.Config.Dir.Thumbs) + "\\BrowseTheWeb";
+
+ public static Image Resize(Bitmap image)
+ {
+ return MediaPortal.Util.BitmapResize.Resize(ref image, 300, 400, false, true);
+ }
+
+ }
+}
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|