|
From: <kro...@us...> - 2011-01-27 15:34:06
|
Revision: 4082
http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4082&view=rev
Author: kroko_koenig
Date: 2011-01-27 15:34:00 +0000 (Thu, 27 Jan 2011)
Log Message:
-----------
change zip packer
Modified Paths:
--------------
trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/BrowseTheWeb.csproj
trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/BrowseTheWeb.csproj.user
trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs
trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/Setup.cs
trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb.suo
trunk/plugins/BrowseTheWeb/Source/Skybound.Gecko/Skybound.Gecko.suo
Modified: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/BrowseTheWeb.csproj
===================================================================
--- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/BrowseTheWeb.csproj 2011-01-27 08:09:30 UTC (rev 4081)
+++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/BrowseTheWeb.csproj 2011-01-27 15:34:00 UTC (rev 4082)
@@ -53,6 +53,11 @@
<HintPath>..\..\..\..\Program Files\Team MediaPortal\MediaPortal\plugins\Windows\HtmlAgilityPack.dll</HintPath>
<Private>False</Private>
</Reference>
+ <Reference Include="Ionic.Zip, Version=1.7.2.18, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\..\..\Program Files\Team MediaPortal\MediaPortal\Ionic.Zip.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
<Reference Include="Skybound.Gecko, Version=1.9.1.1, Culture=neutral, PublicKeyToken=3209ac31600d1857, processorArchitecture=x86">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\Program Files\Team MediaPortal\MediaPortal\plugins\Windows\Skybound.Gecko.dll</HintPath>
Modified: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/BrowseTheWeb.csproj.user
===================================================================
--- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/BrowseTheWeb.csproj.user 2011-01-27 08:09:30 UTC (rev 4081)
+++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/BrowseTheWeb.csproj.user 2011-01-27 15:34:00 UTC (rev 4082)
@@ -1,7 +1,7 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<StartAction>Program</StartAction>
- <StartProgram>C:\Program Files\Team MediaPortal\MediaPortal\Mediaportal.exe</StartProgram>
+ <StartProgram>C:\Program Files\Team MediaPortal\MediaPortal\MediaPortal.exe</StartProgram>
</PropertyGroup>
<PropertyGroup>
<ProjectView>ProjectFiles</ProjectView>
Modified: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs
===================================================================
--- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2011-01-27 08:09:30 UTC (rev 4081)
+++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2011-01-27 15:34:00 UTC (rev 4082)
@@ -1,7 +1,7 @@
-#region Copyright (C) 2005-2010 Team MediaPortal
+#region Copyright (C) 2005-2011 Team MediaPortal
/*
- * Copyright (C) 2005-2010 Team MediaPortal
+ * Copyright (C) 2005-2011 Team MediaPortal
* http://www.team-mediaportal.com
*
* This Program is free software; you can redistribute it and/or modify
@@ -175,7 +175,15 @@
public override bool Init()
{
- Xpcom.Initialize(Config.GetFolder(MediaPortal.Configuration.Config.Dir.Config) + "\\xulrunner");
+ try
+ {
+ Xpcom.Initialize(Config.GetFolder(MediaPortal.Configuration.Config.Dir.Config) + "\\xulrunner");
+ }
+ catch (Exception ex)
+ {
+ MyLog.debug("Could not find xulrunner under : " + Config.GetFolder(MediaPortal.Configuration.Config.Dir.Config) + "\\xulrunner");
+ MyLog.debug("Reason : " + ex.Message);
+ }
#region add forms
webBrowser = new GeckoWebBrowser();
@@ -412,9 +420,18 @@
}
}
+ public override bool OnMessage(GUIMessage message)
+ {
+ Console.WriteLine("message :" + message.Label);
+ return base.OnMessage(message);
+ }
+
public override void OnAction(Action action)
{
- base.OnAction(action);
+ if (linkId != string.Empty)
+ GUIPropertyManager.SetProperty("#btWeb.linkid", "Link ID = " + linkId);
+ else
+ GUIPropertyManager.SetProperty("#btWeb.linkid", linkId);
#region remote diagnostic
if (remote)
@@ -540,45 +557,44 @@
case Action.ActionType.ACTION_PLAY:
case Action.ActionType.ACTION_MUSIC_PLAY:
OnEnterNewLink();
- break;
+ return;
case Action.ActionType.ACTION_PAUSE:
webBrowser.Navigate(homepage);
MyLog.debug("load home page " + homepage);
if (!remote) GUIPropertyManager.SetProperty("#btWeb.status", "go to homepage");
- break;
+ return;
case Action.ActionType.ACTION_STOP:
webBrowser.Navigate("about:blank");
if (!remote) GUIPropertyManager.SetProperty("#btWeb.status", "Stop");
- break;
+ return;
case Action.ActionType.ACTION_PREV_ITEM:
case Action.ActionType.ACTION_REWIND:
webBrowser.GoBack();
if (!remote) GUIPropertyManager.SetProperty("#btWeb.status", "go backward");
MyLog.debug("navigate go back");
- break;
+ return;
case Action.ActionType.ACTION_NEXT_ITEM:
case Action.ActionType.ACTION_FORWARD:
webBrowser.GoForward();
if (!remote) GUIPropertyManager.SetProperty("#btWeb.status", "go forward");
MyLog.debug("navigate go forward");
- break;
+ return;
case Action.ActionType.ACTION_RECORD:
OnAddBookmark();
- break;
+ return;
#region move
case Action.ActionType.ACTION_MOVE_RIGHT:
OnMoveRight();
- break;
+ return;
case Action.ActionType.ACTION_MOVE_LEFT:
OnMoveLeft();
- break;
+ return;
case Action.ActionType.ACTION_MOVE_UP:
OnMoveUp();
- break;
+ return;
case Action.ActionType.ACTION_MOVE_DOWN:
- OnMoveDown();
- break;
+ return;
case Action.ActionType.ACTION_SELECT_ITEM:
if (mouse.Visible)
{
@@ -587,16 +603,11 @@
int y = GUIGraphicsContext.form.Location.Y + mouse.Location.Y + 50;
System.Windows.Forms.Cursor.Position = new Point(x, y);
}
- break;
+ return;
#endregion
}
- if (linkId != string.Empty)
- GUIPropertyManager.SetProperty("#btWeb.linkid", "Link ID = " + linkId);
- else
- GUIPropertyManager.SetProperty("#btWeb.linkid", linkId);
+ }
-
- }
private void webBrowser_DomKeyDown(object sender, GeckoDomKeyEventArgs e)
{
if (useMouse)
@@ -945,6 +956,7 @@
}
#endregion
}
+
#region reset zoom
if (zoomPage)
{
Modified: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/Setup.cs
===================================================================
--- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/Setup.cs 2011-01-27 08:09:30 UTC (rev 4081)
+++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/Setup.cs 2011-01-27 15:34:00 UTC (rev 4082)
@@ -1,7 +1,7 @@
-#region Copyright (C) 2005-2010 Team MediaPortal
+#region Copyright (C) 2005-2011 Team MediaPortal
/*
- * Copyright (C) 2005-2010 Team MediaPortal
+ * Copyright (C) 2005-2011 Team MediaPortal
* http://www.team-mediaportal.com
*
* This Program is free software; you can redistribute it and/or modify
@@ -34,7 +34,10 @@
using System.IO;
using Skybound.Gecko;
+using Ionic.Zip;
+
using MediaPortal.Configuration;
+using MediaPortal.GUI.Library;
namespace BrowseTheWeb
{
@@ -56,33 +59,48 @@
InitializeComponent();
#region create xulrunner if needed
- string dir = Config.GetFolder(MediaPortal.Configuration.Config.Dir.Config) + "\\xulrunner";
- string dirCache = Config.GetFolder(MediaPortal.Configuration.Config.Dir.Cache);
- try
+ string zipToUnpack = Config.GetFolder(MediaPortal.Configuration.Config.Dir.Cache) + "\\xulrunner.zip";
+ string unpackDirectory = Config.GetFolder(MediaPortal.Configuration.Config.Dir.Config);
+
+ if (File.Exists(zipToUnpack))
{
- if (!Directory.Exists(dir))
+ Log.Debug("BrowseTheWeb | zip found : " + zipToUnpack, new object[0]);
+ try
{
- System.Diagnostics.ProcessStartInfo procStartInfo =
- new System.Diagnostics.ProcessStartInfo("cmd", "/c unzip.exe -o xulrunner -d ../");
- procStartInfo.WorkingDirectory = dirCache;
+ using (ZipFile zip1 = ZipFile.Read(zipToUnpack))
+ {
+ foreach (ZipEntry e in zip1)
+ {
+ e.Extract(unpackDirectory, true);
+ }
+ }
+ Log.Debug("BrowseTheWeb | unpack finished to " + unpackDirectory, new object[0]);
+ }
+ catch (Exception ex)
+ {
+ Log.Debug("BrowseTheWeb | Exception : " + ex.Message, new object[0]);
+ }
+ }
- procStartInfo.RedirectStandardOutput = true;
- procStartInfo.UseShellExecute = false;
+ #endregion
- procStartInfo.CreateNoWindow = true;
+ string plugins = Config.GetFolder(MediaPortal.Configuration.Config.Dir.Plugins);
- System.Diagnostics.Process proc = new System.Diagnostics.Process();
- proc.StartInfo = procStartInfo;
- proc.Start();
+ FileInfo info = new FileInfo(plugins + "\\Windows\\HtmlAgilityPack.dll");
+ Log.Debug("BrowseTheWeb | HtmlAgilityPack: " + info.CreationTime);
- string result = proc.StandardOutput.ReadToEnd();
- }
+ info = new FileInfo(plugins + "\\Windows\\Skybound.Gecko.dll.dll");
+ Log.Debug("BrowseTheWeb | Skybound.Gecko.dll: " + info.CreationTime);
+
+ try
+ {
+ Xpcom.Initialize(Config.GetFolder(MediaPortal.Configuration.Config.Dir.Config) + "\\xulrunner");
}
- catch { }
- #endregion
-
- Xpcom.Initialize(Config.GetFolder(MediaPortal.Configuration.Config.Dir.Config) + "\\xulrunner");
+ catch (Exception ex)
+ {
+ Log.Debug("BrowseTheWeb | Exception on init Xpcom : " + ex.Message, new object[0]);
+ }
}
private void Setup_Load(object sender, EventArgs e)
Modified: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb.suo
===================================================================
(Binary files differ)
Modified: trunk/plugins/BrowseTheWeb/Source/Skybound.Gecko/Skybound.Gecko.suo
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|