From: <kro...@us...> - 2010-11-14 15:11:43
|
Revision: 3934 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=3934&view=rev Author: kroko_koenig Date: 2010-11-14 15:11:31 +0000 (Sun, 14 Nov 2010) Log Message: ----------- import bookmarks for IE and FF Modified Paths: -------------- trunk/plugins/BrowseTheWeb/Release/BrowseTheWeb.mpe1 trunk/plugins/BrowseTheWeb/Release/BrowseTheWeb.xml trunk/plugins/BrowseTheWeb/Release/BrowseTheWeb.xmp2 trunk/plugins/BrowseTheWeb/Release/Plugins/Windows/BrowseTheWeb.dll trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/Bookmark.cs 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/GetThumb.Designer.cs trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GetThumb.cs trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/ImportIE.Designer.cs trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/ImportIE.cs trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/Mouse.cs trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/Properties/AssemblyInfo.cs trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/Setup.cs trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/todo.txt trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb.suo Added Paths: ----------- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/ImportFF.Designer.cs trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/ImportFF.cs trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/ImportFF.resx Removed Paths: ------------- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/SqlLite.cs Modified: trunk/plugins/BrowseTheWeb/Release/BrowseTheWeb.mpe1 =================================================================== (Binary files differ) Modified: trunk/plugins/BrowseTheWeb/Release/BrowseTheWeb.xml =================================================================== --- trunk/plugins/BrowseTheWeb/Release/BrowseTheWeb.xml 2010-11-14 14:20:19 UTC (rev 3933) +++ trunk/plugins/BrowseTheWeb/Release/BrowseTheWeb.xml 2010-11-14 15:11:31 UTC (rev 3934) @@ -488,5 +488,102 @@ <FolderGroups /> </ProjectSettings> </PackageClass> + <PackageClass> + <Version>2.0</Version> + <Groups> + <Items> + <GroupItem Name="Default"> + <DisplayName>Default</DisplayName> + <DefaulChecked>true</DefaulChecked> + <Description>Default</Description> + <Files> + <Items /> + </Files> + </GroupItem> + <GroupItem Name="Blue3"> + <DisplayName>Blue3</DisplayName> + <DefaulChecked>true</DefaulChecked> + <Description>Blue3</Description> + <Files> + <Items /> + </Files> + </GroupItem> + <GroupItem Name="Blue3wide"> + <DisplayName>Blue3wide</DisplayName> + <DefaulChecked>true</DefaulChecked> + <Description>Blue3wide</Description> + <Files> + <Items /> + </Files> + </GroupItem> + </Items> + </Groups> + <Sections> + <Items /> + </Sections> + <Dependencies> + <Items /> + </Dependencies> + <GeneralInfo> + <Name>Browse The Web</Name> + <Id>2869e8cd-579e-4fdb-ad6d-19ff5bd4e46f</Id> + <Author>Mark Koenig (kroko) 2010</Author> + <HomePage>http://www.team-mediaportal.com</HomePage> + <ForumPage>http://forum.team-mediaportal.com/mediaportal-plugins-47/plugin-browse-web-webbrowser-89101/</ForumPage> + <UpdateUrl>https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/BrowseTheWeb/Release/BrowseTheWeb.xml</UpdateUrl> + <Version> + <Major>0</Major> + <Minor>2</Minor> + <Build>4</Build> + <Revision>0</Revision> + </Version> + <ExtensionDescription>Webrowser based on xulrunner and the "Gecko Browser" / " Webbrowser. + +</ExtensionDescription> + <VersionDescription>add import for IE and FF</VersionDescription> + <DevelopmentStatus>Stable</DevelopmentStatus> + <OnlineLocation>https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/BrowseTheWeb/Release/BrowseTheWeb.mpe1</OnlineLocation> + <ReleaseDate>2010-11-06T15:09:04.5514802+01:00</ReleaseDate> + <Tags>webbrowser, internet, web</Tags> + <Location>C:\AAA\BrowseTheWeb\Release\BrowseTheWeb.mpe1</Location> + <Params> + <Items> + <SectionParam Name="Icon"> + <Value>C:\AAA\BrowseTheWeb\Source\BrowseTheWeb\xulrunner.png</Value> + <ValueType>File</ValueType> + <Description>The icon file of the package (jpg,png,bmp)</Description> + </SectionParam> + <SectionParam Name="Online Icon"> + <Value /> + <ValueType>String</ValueType> + <Description>The icon file of the package stored online (jpg,png,bmp)</Description> + </SectionParam> + <SectionParam Name="Configuration file"> + <Value /> + <ValueType>Template</ValueType> + <Description>The file used to configure the extension. + If have .exe extension the will be executed + If have .dll extension used like MP plugin configuration</Description> + </SectionParam> + <SectionParam Name="Online Screenshots"> + <Value>https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/BrowseTheWeb/Release/browser1.jpg;https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/BrowseTheWeb/Release/setup3.jpg</Value> + <ValueType>String</ValueType> + <Description>Online stored screenshot urls separated by ; </Description> + </SectionParam> + <SectionParam Name="Force to uninstall on update"> + <Value>yes</Value> + <ValueType>Bool</ValueType> + <Description>Show dialog and force to uninstall previous version when updating an extension. Should only be disabled if you are using an NSIS/MSI installer.</Description> + </SectionParam> + </Items> + </Params> + </GeneralInfo> + <UniqueFileList> + <Items /> + </UniqueFileList> + <ProjectSettings> + <FolderGroups /> + </ProjectSettings> + </PackageClass> </Items> </ExtensionCollection> \ No newline at end of file Modified: trunk/plugins/BrowseTheWeb/Release/BrowseTheWeb.xmp2 =================================================================== --- trunk/plugins/BrowseTheWeb/Release/BrowseTheWeb.xmp2 2010-11-14 14:20:19 UTC (rev 3933) +++ trunk/plugins/BrowseTheWeb/Release/BrowseTheWeb.xmp2 2010-11-14 15:11:31 UTC (rev 3934) @@ -268,13 +268,13 @@ <Version> <Major>0</Major> <Minor>2</Minor> - <Build>3</Build> + <Build>4</Build> <Revision>0</Revision> </Version> <ExtensionDescription>Webrowser based on xulrunner and the "Gecko Browser" / " Webbrowser. </ExtensionDescription> - <VersionDescription>add force windowed mode</VersionDescription> + <VersionDescription>add import for IE and FF</VersionDescription> <DevelopmentStatus>Stable</DevelopmentStatus> <OnlineLocation>https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/BrowseTheWeb/Release/BrowseTheWeb.mpe1</OnlineLocation> <ReleaseDate>2010-11-06T15:09:04.5514802+01:00</ReleaseDate> @@ -395,7 +395,7 @@ <Param1 /> <UpdateOption>OverwriteIfOlder</UpdateOption> <LocalFileName>..\Source\BrowseTheWeb\xulrunner.png</LocalFileName> - <ZipFileName>Installer{CopyFile}\{03576131-4705-4966-917b-ed60d4c7c6ec}-xulrunner.png</ZipFileName> + <ZipFileName>Installer{CopyFile}\{eb11fd4f-fcca-4943-a16d-c1f6f8f00ad5}-xulrunner.png</ZipFileName> <DestinationFilename /> </FileItem> </Items> Modified: trunk/plugins/BrowseTheWeb/Release/Plugins/Windows/BrowseTheWeb.dll =================================================================== (Binary files differ) Modified: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/Bookmark.cs =================================================================== --- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/Bookmark.cs 2010-11-14 14:20:19 UTC (rev 3933) +++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/Bookmark.cs 2010-11-14 15:11:31 UTC (rev 3934) @@ -346,6 +346,7 @@ filename = filename.Substring(x + 2); filename = filename.Replace("/", "_"); filename = filename.Replace(".", "_"); + filename = filename.Replace("?", "_"); filename = filename + ".png"; filename = Config.GetFolder(MediaPortal.Configuration.Config.Dir.Cache) + "\\BrowseTheWeb\\" + filename; @@ -370,6 +371,7 @@ filename = filename.Substring(x + 2); filename = filename.Replace("/", "_"); filename = filename.Replace(".", "_"); + filename = filename.Replace("?", "_"); filename = filename + ".png"; filename = Config.GetFolder(MediaPortal.Configuration.Config.Dir.Cache) + "\\BrowseTheWeb\\" + filename; Modified: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/BrowseTheWeb.csproj =================================================================== --- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/BrowseTheWeb.csproj 2010-11-14 14:20:19 UTC (rev 3933) +++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/BrowseTheWeb.csproj 2010-11-14 15:11:31 UTC (rev 3934) @@ -16,7 +16,7 @@ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> - <Optimize>true</Optimize> + <Optimize>false</Optimize> <OutputPath>..\..\..\..\Program Files\Team MediaPortal\MediaPortal\plugins\Windows\</OutputPath> <DefineConstants>DEBUG;TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> @@ -38,6 +38,11 @@ <HintPath>..\..\..\..\Program Files\Team MediaPortal\MediaPortal\Core.dll</HintPath> <Private>False</Private> </Reference> + <Reference Include="Databases, Version=1.1.1.11856, Culture=neutral, processorArchitecture=x86"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\..\..\Program Files\Team MediaPortal\MediaPortal\Databases.dll</HintPath> + <Private>False</Private> + </Reference> <Reference Include="Dialogs, Version=1.1.1.11860, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> <HintPath>..\..\..\..\Program Files\Team MediaPortal\MediaPortal\plugins\Windows\Dialogs.dll</HintPath> @@ -95,6 +100,12 @@ <Compile Include="ImportIE.Designer.cs"> <DependentUpon>ImportIE.cs</DependentUpon> </Compile> + <Compile Include="ImportFF.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="ImportFF.Designer.cs"> + <DependentUpon>ImportFF.cs</DependentUpon> + </Compile> <Compile Include="Mouse.cs"> <SubType>UserControl</SubType> </Compile> @@ -120,7 +131,6 @@ <Compile Include="Setup.Designer.cs"> <DependentUpon>Setup.cs</DependentUpon> </Compile> - <Compile Include="SqlLite.cs" /> </ItemGroup> <ItemGroup> <EmbeddedResource Include="GetFolder.resx"> @@ -162,6 +172,10 @@ <EmbeddedResource Include="ImportIE.resx"> <DependentUpon>ImportIE.cs</DependentUpon> </EmbeddedResource> + <EmbeddedResource Include="ImportFF.resx"> + <DependentUpon>ImportFF.cs</DependentUpon> + <SubType>Designer</SubType> + </EmbeddedResource> <EmbeddedResource Include="Mouse.resx"> <DependentUpon>Mouse.cs</DependentUpon> <SubType>Designer</SubType> Modified: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/BrowseTheWeb.csproj.user =================================================================== --- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/BrowseTheWeb.csproj.user 2010-11-14 14:20:19 UTC (rev 3933) +++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/BrowseTheWeb.csproj.user 2010-11-14 15:11:31 UTC (rev 3934) @@ -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\COnfiguration.exe</StartProgram> </PropertyGroup> <PropertyGroup> <ProjectView>ProjectFiles</ProjectView> Modified: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs =================================================================== --- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2010-11-14 14:20:19 UTC (rev 3933) +++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GUIPlugin.cs 2010-11-14 15:11:31 UTC (rev 3934) @@ -209,6 +209,11 @@ webBrowser.Dock = System.Windows.Forms.DockStyle.None; webBrowser.Location = new System.Drawing.Point(0, 0); + MyLog.debug("Create eventhandler"); + + webBrowser.DocumentCompleted += new EventHandler(webBrowser_DocumentCompleted); + webBrowser.StatusTextChanged += new EventHandler(webBrowser_StatusTextChanged); + if (statusBar) webBrowser.Size = new System.Drawing.Size(GUIGraphicsContext.form.Width, GUIGraphicsContext.form.Height - 100); else @@ -217,11 +222,6 @@ webBrowser.Window.TextZoom = font; webBrowser.Zoom = zoom; - MyLog.debug("Create eventhandler"); - - webBrowser.DocumentCompleted += new EventHandler(webBrowser_DocumentCompleted); - webBrowser.StatusTextChanged += new EventHandler(webBrowser_StatusTextChanged); - if (windowed) { MyLog.debug("switch to windowed fullscreen mode"); Modified: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GetThumb.Designer.cs =================================================================== --- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GetThumb.Designer.cs 2010-11-14 14:20:19 UTC (rev 3933) +++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GetThumb.Designer.cs 2010-11-14 15:11:31 UTC (rev 3934) @@ -31,7 +31,6 @@ this.components = new System.ComponentModel.Container(); this.chkUrl = new System.Windows.Forms.CheckBox(); this.chkGetThumb = new System.Windows.Forms.CheckBox(); - this.progressBar1 = new System.Windows.Forms.ProgressBar(); this.button1 = new System.Windows.Forms.Button(); this.txtUrl = new System.Windows.Forms.Label(); this.timer1 = new System.Windows.Forms.Timer(this.components); @@ -60,19 +59,11 @@ this.chkGetThumb.Text = "Cache thumb"; this.chkGetThumb.UseVisualStyleBackColor = true; // - // progressBar1 - // - this.progressBar1.Location = new System.Drawing.Point(12, 116); - this.progressBar1.Name = "progressBar1"; - this.progressBar1.Size = new System.Drawing.Size(295, 23); - this.progressBar1.Style = System.Windows.Forms.ProgressBarStyle.Marquee; - this.progressBar1.TabIndex = 2; - // // button1 // - this.button1.Location = new System.Drawing.Point(12, 145); + this.button1.Location = new System.Drawing.Point(12, 103); this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(295, 23); + this.button1.Size = new System.Drawing.Size(295, 30); this.button1.TabIndex = 3; this.button1.Text = "Cancel"; this.button1.UseVisualStyleBackColor = true; @@ -109,11 +100,10 @@ // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(319, 183); + this.ClientSize = new System.Drawing.Size(319, 149); this.Controls.Add(this.chkWait); this.Controls.Add(this.txtUrl); this.Controls.Add(this.button1); - this.Controls.Add(this.progressBar1); this.Controls.Add(this.chkGetThumb); this.Controls.Add(this.chkUrl); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; @@ -130,7 +120,6 @@ private System.Windows.Forms.CheckBox chkUrl; private System.Windows.Forms.CheckBox chkGetThumb; - private System.Windows.Forms.ProgressBar progressBar1; private System.Windows.Forms.Button button1; private System.Windows.Forms.Label txtUrl; private System.Windows.Forms.Timer timer1; Modified: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GetThumb.cs =================================================================== --- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GetThumb.cs 2010-11-14 14:20:19 UTC (rev 3933) +++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/GetThumb.cs 2010-11-14 15:11:31 UTC (rev 3934) @@ -15,10 +15,10 @@ public string SelectedUrl = string.Empty; private GeckoWebBrowser browser; private Bitmap snap; - private int value; private bool received = false; private int time = 0; + private int cancel = 0; public GetThumb() { @@ -54,7 +54,6 @@ Bookmark.SaveSnap(snap, SelectedUrl); received = true; chkGetThumb.Checked = true; - } } @@ -65,9 +64,8 @@ private void timer1_Tick(object sender, EventArgs e) { - value++; - if (value > 100) value = 1; - progressBar1.Value = value; + cancel++; + if (cancel > 30) this.Close(); if (received) { Added: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/ImportFF.Designer.cs =================================================================== --- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/ImportFF.Designer.cs (rev 0) +++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/ImportFF.Designer.cs 2010-11-14 15:11:31 UTC (rev 3934) @@ -0,0 +1,143 @@ +namespace BrowseTheWeb +{ + partial class ImportFF + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.listBox1 = new System.Windows.Forms.ListBox(); + this.btnImport = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); + this.btnSelect = new System.Windows.Forms.Button(); + this.btnCancel = new System.Windows.Forms.Button(); + this.prgState = new System.Windows.Forms.ProgressBar(); + this.chkThumbs = new System.Windows.Forms.CheckBox(); + this.SuspendLayout(); + // + // listBox1 + // + this.listBox1.FormattingEnabled = true; + this.listBox1.Location = new System.Drawing.Point(12, 35); + this.listBox1.Name = "listBox1"; + this.listBox1.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended; + this.listBox1.Size = new System.Drawing.Size(502, 225); + this.listBox1.TabIndex = 0; + // + // btnImport + // + this.btnImport.Location = new System.Drawing.Point(12, 341); + this.btnImport.Name = "btnImport"; + this.btnImport.Size = new System.Drawing.Size(139, 31); + this.btnImport.TabIndex = 1; + this.btnImport.Text = "Import"; + this.btnImport.UseVisualStyleBackColor = true; + this.btnImport.Click += new System.EventHandler(this.btnImport_Click); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 9); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(135, 13); + this.label1.TabIndex = 2; + this.label1.Text = "Select bookmarks to import"; + // + // btnSelect + // + this.btnSelect.Location = new System.Drawing.Point(12, 266); + this.btnSelect.Name = "btnSelect"; + this.btnSelect.Size = new System.Drawing.Size(139, 23); + this.btnSelect.TabIndex = 3; + this.btnSelect.Text = "select / deselect all"; + this.btnSelect.UseVisualStyleBackColor = true; + this.btnSelect.Click += new System.EventHandler(this.btnSelect_Click); + // + // btnCancel + // + this.btnCancel.Location = new System.Drawing.Point(375, 341); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(139, 31); + this.btnCancel.TabIndex = 4; + this.btnCancel.Text = "Cancel"; + this.btnCancel.UseVisualStyleBackColor = true; + this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); + // + // prgState + // + this.prgState.Location = new System.Drawing.Point(12, 302); + this.prgState.Name = "prgState"; + this.prgState.Size = new System.Drawing.Size(502, 23); + this.prgState.Style = System.Windows.Forms.ProgressBarStyle.Continuous; + this.prgState.TabIndex = 5; + this.prgState.Visible = false; + // + // chkThumbs + // + this.chkThumbs.AutoSize = true; + this.chkThumbs.Location = new System.Drawing.Point(187, 270); + this.chkThumbs.Name = "chkThumbs"; + this.chkThumbs.Size = new System.Drawing.Size(164, 17); + this.chkThumbs.TabIndex = 6; + this.chkThumbs.Text = "make thumbs (take long time)"; + this.chkThumbs.UseVisualStyleBackColor = true; + // + // ImportIE + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(526, 384); + this.Controls.Add(this.chkThumbs); + this.Controls.Add(this.prgState); + this.Controls.Add(this.btnCancel); + this.Controls.Add(this.btnSelect); + this.Controls.Add(this.label1); + this.Controls.Add(this.btnImport); + this.Controls.Add(this.listBox1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "ImportIE"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "Import Internet Explorer"; + this.Load += new System.EventHandler(this.ImportFF_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.ListBox listBox1; + private System.Windows.Forms.Button btnImport; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Button btnSelect; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.ProgressBar prgState; + private System.Windows.Forms.CheckBox chkThumbs; + } +} \ No newline at end of file Added: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/ImportFF.cs =================================================================== --- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/ImportFF.cs (rev 0) +++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/ImportFF.cs 2010-11-14 15:11:31 UTC (rev 3934) @@ -0,0 +1,189 @@ +#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; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using System.IO; +using MediaPortal.Configuration; + +using SQLite.NET; + +namespace BrowseTheWeb +{ + public partial class ImportFF : Form + { + private List<Bookmark> EntryList = new List<Bookmark>(); + private TreeView tree; + private bool select = true; + + public ImportFF(TreeView SetupTreeview) + { + InitializeComponent(); + tree = SetupTreeview; + } + + private void btnImport_Click(object sender, EventArgs e) + { + btnImport.Visible = false; + btnSelect.Visible = false; + prgState.Visible = true; + chkThumbs.Enabled = false; + + int max = listBox1.SelectedItems.Count; + int imported = 0; + int counter = 1; + + #region get parent + TreeNode node = null; + foreach (TreeNode n in tree.Nodes[0].Nodes) + { + if (n.Text == "Import FF") + { + node = n; + break; + } + } + #endregion + + if (node != null) + { + foreach (Object item in listBox1.SelectedItems) + { + Application.DoEvents(); + prgState.Value = (counter * 100 / max); + + string name = (string)item; + Bookmark bkm = GetBookmark(name); + + if (bkm != null) + { + if (!Bookmark.Exists(tree, bkm.Name)) + { + imported++; + + TreeNode add = node.Nodes.Add(bkm.Url, bkm.Name); + + Bookmark addBkm = new Bookmark(); + addBkm.Name = bkm.Name; + addBkm.Url = bkm.Url; + addBkm.isSubFolder = true; + add.Tag = addBkm; + + if (chkThumbs.Checked) + { + GetThumb thumb = new GetThumb(); + thumb.SelectedUrl = bkm.Url; + thumb.ShowDialog(); + } + + node.ExpandAll(); + } + } + counter++; + } + } + + MessageBox.Show("Import is done. Imported " + imported.ToString() + " links."); + this.Close(); + } + private void btnCancel_Click(object sender, EventArgs e) + { + this.Close(); + } + + private void ImportFF_Load(object sender, EventArgs e) + { + try + { + string path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); + path += "\\Mozilla\\Firefox\\Profiles"; + + MyLog.debug("Morzilla folder is " + path); + + if (Directory.Exists(path)) + { + string[] dir = Directory.GetDirectories(path); + if (dir.Length == 1) + { + MyLog.debug("Morzilla profile under " + dir[0]); + path = dir[0] + "\\places.sqlite"; + + MyLog.debug("open database"); + SQLiteClient client = new SQLiteClient(path); + + + SQLiteResultSet result = client.Execute("SELECT moz_bookmarks.title,moz_places.url,moz_bookmarks.type FROM moz_bookmarks LEFT JOIN moz_places " + + "WHERE moz_bookmarks.fk = moz_places.id AND moz_bookmarks.title != 'null' AND moz_places.url LIKE '%http%';"); + + MyLog.debug("Morzilla bookmarks found : " + result.Rows.Count); + + foreach (SQLite.NET.SQLiteResultSet.Row row in result.Rows) + { + string title = row.fields[0].ToString(); + string url = row.fields[1].ToString(); + + Bookmark bkm = new Bookmark(); + bkm.Url = url; + bkm.Name = title; + + EntryList.Add(bkm); + listBox1.Items.Add(bkm.Name); + } + + MyLog.debug("close database"); + client.Close(); + } + } + } + catch (Exception ex) + { + MyLog.debug("Exception import ff : " + ex.Message); + MyLog.debug("Exception import ff : " + ex.StackTrace); + } + } + + private Bookmark GetBookmark(string Name) + { + foreach (Bookmark bkm in EntryList) + { + if (bkm.Name == Name) return bkm; + } + return null; + } + + private void btnSelect_Click(object sender, EventArgs e) + { + for (int i = 0; i < listBox1.Items.Count; i++) + { + listBox1.SetSelected(i, select); + } + select = !select; + } + } +} Added: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/ImportFF.resx =================================================================== --- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/ImportFF.resx (rev 0) +++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/ImportFF.resx 2010-11-14 15:11:31 UTC (rev 3934) @@ -0,0 +1,120 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root> \ No newline at end of file Modified: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/ImportIE.Designer.cs =================================================================== --- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/ImportIE.Designer.cs 2010-11-14 14:20:19 UTC (rev 3933) +++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/ImportIE.Designer.cs 2010-11-14 15:11:31 UTC (rev 3934) @@ -29,33 +29,92 @@ private void InitializeComponent() { this.listBox1 = new System.Windows.Forms.ListBox(); - this.btnClose = new System.Windows.Forms.Button(); + this.btnImport = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); + this.btnSelect = new System.Windows.Forms.Button(); + this.btnCancel = new System.Windows.Forms.Button(); + this.prgState = new System.Windows.Forms.ProgressBar(); + this.chkThumbs = new System.Windows.Forms.CheckBox(); this.SuspendLayout(); // // listBox1 // this.listBox1.FormattingEnabled = true; - this.listBox1.Location = new System.Drawing.Point(12, 22); + this.listBox1.Location = new System.Drawing.Point(12, 35); this.listBox1.Name = "listBox1"; - this.listBox1.Size = new System.Drawing.Size(502, 251); + this.listBox1.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended; + this.listBox1.Size = new System.Drawing.Size(502, 225); this.listBox1.TabIndex = 0; // - // btnClose + // btnImport // - this.btnClose.Location = new System.Drawing.Point(12, 279); - this.btnClose.Name = "btnClose"; - this.btnClose.Size = new System.Drawing.Size(502, 31); - this.btnClose.TabIndex = 1; - this.btnClose.Text = "Close"; - this.btnClose.UseVisualStyleBackColor = true; - this.btnClose.Click += new System.EventHandler(this.btnClose_Click); + this.btnImport.Location = new System.Drawing.Point(12, 341); + this.btnImport.Name = "btnImport"; + this.btnImport.Size = new System.Drawing.Size(139, 31); + this.btnImport.TabIndex = 1; + this.btnImport.Text = "Import"; + this.btnImport.UseVisualStyleBackColor = true; + this.btnImport.Click += new System.EventHandler(this.btnImport_Click); // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 9); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(135, 13); + this.label1.TabIndex = 2; + this.label1.Text = "Select bookmarks to import"; + // + // btnSelect + // + this.btnSelect.Location = new System.Drawing.Point(12, 266); + this.btnSelect.Name = "btnSelect"; + this.btnSelect.Size = new System.Drawing.Size(139, 23); + this.btnSelect.TabIndex = 3; + this.btnSelect.Text = "select / deselect all"; + this.btnSelect.UseVisualStyleBackColor = true; + this.btnSelect.Click += new System.EventHandler(this.btnSelect_Click); + // + // btnCancel + // + this.btnCancel.Location = new System.Drawing.Point(375, 341); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(139, 31); + this.btnCancel.TabIndex = 4; + this.btnCancel.Text = "Cancel"; + this.btnCancel.UseVisualStyleBackColor = true; + this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); + // + // prgState + // + this.prgState.Location = new System.Drawing.Point(12, 302); + this.prgState.Name = "prgState"; + this.prgState.Size = new System.Drawing.Size(502, 23); + this.prgState.Style = System.Windows.Forms.ProgressBarStyle.Continuous; + this.prgState.TabIndex = 5; + this.prgState.Visible = false; + // + // chkThumbs + // + this.chkThumbs.AutoSize = true; + this.chkThumbs.Location = new System.Drawing.Point(187, 270); + this.chkThumbs.Name = "chkThumbs"; + this.chkThumbs.Size = new System.Drawing.Size(164, 17); + this.chkThumbs.TabIndex = 6; + this.chkThumbs.Text = "make thumbs (take long time)"; + this.chkThumbs.UseVisualStyleBackColor = true; + // // ImportIE // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(526, 323); - this.Controls.Add(this.btnClose); + this.ClientSize = new System.Drawing.Size(526, 384); + this.Controls.Add(this.chkThumbs); + this.Controls.Add(this.prgState); + this.Controls.Add(this.btnCancel); + this.Controls.Add(this.btnSelect); + this.Controls.Add(this.label1); + this.Controls.Add(this.btnImport); this.Controls.Add(this.listBox1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D; this.MaximizeBox = false; @@ -67,12 +126,18 @@ this.Text = "Import Internet Explorer"; this.Load += new System.EventHandler(this.ImportIE_Load); this.ResumeLayout(false); + this.PerformLayout(); } #endregion private System.Windows.Forms.ListBox listBox1; - private System.Windows.Forms.Button btnClose; + private System.Windows.Forms.Button btnImport; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Button btnSelect; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.ProgressBar prgState; + private System.Windows.Forms.CheckBox chkThumbs; } } \ No newline at end of file Modified: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/ImportIE.cs =================================================================== --- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/ImportIE.cs 2010-11-14 14:20:19 UTC (rev 3933) +++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/ImportIE.cs 2010-11-14 15:11:31 UTC (rev 3934) @@ -1,4 +1,28 @@ -using System; +#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; using System.Collections.Generic; using System.ComponentModel; using System.Data; @@ -12,43 +36,109 @@ { public partial class ImportIE : Form { - public List<Bookmark> EntryList = new List<Bookmark>(); + private List<Bookmark> EntryList = new List<Bookmark>(); + private TreeView tree; + private bool select = true; - public ImportIE() + public ImportIE(TreeView SetupTreeview) { InitializeComponent(); + tree = SetupTreeview; } - private void btnClose_Click(object sender, EventArgs e) + private void btnImport_Click(object sender, EventArgs e) { + btnImport.Visible = false; + btnSelect.Visible = false; + prgState.Visible = true; + chkThumbs.Enabled = false; + + int max = listBox1.SelectedItems.Count; + int imported = 0; + int counter = 1; + + #region get parent + TreeNode node = null; + foreach (TreeNode n in tree.Nodes[0].Nodes) + { + if (n.Text == "Import IE") + { + node = n; + break; + } + } + #endregion + + if (node != null) + { + foreach (Object item in listBox1.SelectedItems) + { + Application.DoEvents(); + prgState.Value = (counter * 100 / max); + + string name = (string)item; + Bookmark bkm = GetBookmark(name); + + if (bkm != null) + { + if (!Bookmark.Exists(tree, bkm.Name)) + { + imported++; + + TreeNode add = node.Nodes.Add(bkm.Url, bkm.Name); + + Bookmark addBkm = new Bookmark(); + addBkm.Name = bkm.Name; + addBkm.Url = bkm.Url; + addBkm.isSubFolder = true; + add.Tag = addBkm; + + if (chkThumbs.Checked) + { + GetThumb thumb = new GetThumb(); + thumb.SelectedUrl = bkm.Url; + thumb.ShowDialog(); + } + + node.ExpandAll(); + } + } + counter++; + } + } + + MessageBox.Show("Import is done. Imported " + imported.ToString() + " links."); this.Close(); } + private void btnCancel_Click(object sender, EventArgs e) + { + this.Close(); + } + private void ImportIE_Load(object sender, EventArgs e) { string favPath = Environment.GetFolderPath(Environment.SpecialFolder.Favorites); string[] favFiles; - listBox1.Items.Add("Import folder is " + favPath); - listBox1.Items.Add("Reading folder"); + MyLog.debug("Import folder is " + favPath); if (Directory.Exists(favPath)) { string[] favDirs = Directory.GetDirectories(favPath); - listBox1.Items.Add("Found " + favDirs.Length.ToString() + " folder"); + MyLog.debug("Found " + favDirs.Length.ToString() + " folder"); foreach (string folder in favDirs) { - listBox1.Items.Add("Work on folder '" + Path.GetFileName(folder) + "'"); + MyLog.debug("Work on folder '" + Path.GetFileName(folder) + "'"); favFiles = Directory.GetFiles(folder, "*.url", SearchOption.TopDirectoryOnly); - listBox1.Items.Add(favFiles.Length.ToString() + " files to import"); + MyLog.debug(favFiles.Length.ToString() + " files to import"); foreach (string s in favFiles) { FileInfo f = new FileInfo(s); string name = Path.GetFileNameWithoutExtension(f.Name); - listBox1.Items.Add("Found '" + name + "'"); string url = GetUrlFile(s); if (url != null) @@ -58,21 +148,21 @@ bkm.Name = name; EntryList.Add(bkm); + listBox1.Items.Add(bkm.Name); } } } - listBox1.Items.Add("Reading root folder"); + MyLog.debug("Reading root folder"); favFiles = Directory.GetFiles(Environment.GetFolderPath(Environment.SpecialFolder.Favorites), "*.url", SearchOption.TopDirectoryOnly); - listBox1.Items.Add(favFiles.Length.ToString() + " files to import"); + MyLog.debug(favFiles.Length.ToString() + " files to import"); foreach (string s in favFiles) { FileInfo f = new FileInfo(s); string name = Path.GetFileNameWithoutExtension(f.Name); - listBox1.Items.Add("Found '" + name + "'"); string url = GetUrlFile(s); if (url != null) @@ -82,16 +172,16 @@ bkm.Name = name; EntryList.Add(bkm); + listBox1.Items.Add(bkm.Name); } } - listBox1.Items.Add("Reading finished. Found " + EntryList.Count + " bookmarks"); + MyLog.debug("Reading finished. Found " + EntryList.Count + " bookmarks"); } else { - listBox1.Items.Add("Directory does not exist."); + MyLog.debug("Directory does not exist."); } } - private string GetUrlFile(string File) { using (StreamReader sr = new StreamReader(File)) @@ -105,5 +195,22 @@ } return null; } + private Bookmark GetBookmark(string Name) + { + foreach (Bookmark bkm in EntryList) + { + if (bkm.Name == Name) return bkm; + } + return null; + } + + private void btnSelect_Click(object sender, EventArgs e) + { + for (int i = 0; i < listBox1.Items.Count; i++) + { + listBox1.SetSelected(i, select); + } + select = !select; + } } } Modified: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/Mouse.cs =================================================================== --- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/Mouse.cs 2010-11-14 14:20:19 UTC (rev 3933) +++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/Mouse.cs 2010-11-14 15:11:31 UTC (rev 3934) @@ -1,4 +1,28 @@ -using System; +#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; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; Modified: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/Properties/AssemblyInfo.cs 2010-11-14 14:20:19 UTC (rev 3933) +++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/Properties/AssemblyInfo.cs 2010-11-14 15:11:31 UTC (rev 3934) @@ -8,9 +8,9 @@ [assembly: AssemblyTitle("BrowseTheWeb")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("HP")] +[assembly: AssemblyCompany("MP")] [assembly: AssemblyProduct("BrowseTheWeb")] -[assembly: AssemblyCopyright("Copyright © HP 2010")] +[assembly: AssemblyCopyright("Copyright © 2010")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -32,5 +32,5 @@ // Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern // übernehmen, indem Sie "*" eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.2.3.0")] -[assembly: AssemblyFileVersion("0.2.3.0")] +[assembly: AssemblyVersion("0.2.4.0")] +[assembly: AssemblyFileVersion("0.2.4.0")] Modified: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/Setup.cs =================================================================== --- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/Setup.cs 2010-11-14 14:20:19 UTC (rev 3933) +++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/Setup.cs 2010-11-14 15:11:31 UTC (rev 3934) @@ -726,6 +726,7 @@ private void btnImportIE_Click(object sender, EventArgs e) { + #region generate folder if (!Bookmark.Exists(treeView1, "Import IE")) { TreeNode newNode = treeView1.Nodes[0].Nodes.Add("Import IE"); @@ -739,81 +740,35 @@ treeView1.Nodes[0].ExpandAll(); } + #endregion - ImportIE import = new ImportIE(); + ImportIE import = new ImportIE(treeView1); import.ShowDialog(); - int max = import.EntryList.Count; - int imported = 0; - - TreeNode node = null; - foreach (TreeNode n in treeView1.Nodes[0].Nodes) - { - if (n.Text == "Import IE") - { - node = n; - break; - } - } - - if (node != null) - { - foreach (Bookmark bkm in import.EntryList) - { - if (!Bookmark.Exists(treeView1, bkm.Name)) - { - if (!Bookmark.isValidUrl(bkm.Url)) - { - DialogResult res = MessageBox.Show("The url seems not to be valid !\nContinue anyway ?", "Error home page address", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); - //if (res != DialogResult.Yes) break; - } - - if (chkUseThumbs.Checked) - { - GetThumb thumb = new GetThumb(); - thumb.SelectedUrl = bkm.Url; - thumb.ShowDialog(); - } - - TreeNode add = node.Nodes.Add(bkm.Url, bkm.Name); - - Bookmark addBkm = new Bookmark(); - addBkm.Name = bkm.Name; - addBkm.Url = bkm.Url; - addBkm.isSubFolder = true; - add.Tag = addBkm; - - node.ExpandAll(); - - } - } - } + treeView1.Invalidate(); } private void btnImportFF_Click(object sender, EventArgs e) { - SQLite db = new SQLite(); - - string path = @"C:\Users\mka\AppData\Roaming\Mozilla\Firefox\Profiles\wyhhe7f5.default\places.sqlite"; - - db.OpenDatabase(path); - //db.OpenDatabase(path);"Data Source=" + path + ";Version=3;New=True;Compress=True;" - - //DataTable table = db.ExecuteQuery("select * from moz_places"); - DataTable table = db.ExecuteQuery("SELECT moz_bookmarks.title,moz_places.url,moz_bookmarks.type FROM moz_bookmarks LEFT JOIN moz_places " + - "WHERE moz_bookmarks.fk = moz_places.id AND moz_bookmarks.title != 'null' AND moz_places.url LIKE '%http%';"); - - - foreach (DataRow row in table.Rows) + #region generate folder + if (!Bookmark.Exists(treeView1, "Import FF")) { - string t = Convert.ToString(row["title"]); - string u = Convert.ToString(row["url"]); + TreeNode newNode = treeView1.Nodes[0].Nodes.Add("Import FF"); + newNode.ImageIndex = 1; + newNode.SelectedImageIndex = 1; - System.Diagnostics.Debug.WriteLine("--------"); - System.Diagnostics.Debug.WriteLine(t); - System.Diagnostics.Debug.WriteLine(u); + Bookmark bkm = new Bookmark(); + bkm.Name = "Import FF"; + bkm.isFolder = true; + newNode.Tag = bkm; + + treeView1.Nodes[0].ExpandAll(); } + #endregion - db.CloseDatabase(); + ImportFF import = new ImportFF(treeView1); + import.ShowDialog(); + + treeView1.Invalidate(); } } } Deleted: trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/SqlLite.cs =================================================================== --- trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/SqlLite.cs 2010-11-14 14:20:19 UTC (rev 3933) +++ trunk/plugins/BrowseTheWeb/Source/BrowseTheWeb/SqlLite.cs 2010-11-14 15:11:31 UTC (rev 3934) @@ -1,191 +0,0 @@ -using System; -using System.Data; -using System.Runtime.InteropServices; - -namespace BrowseTheWeb -{ - public class SQLiteException : Exception - { - public SQLiteException(string message) : - base(message) - { - - } - } - - public class SQLite - { - const int SQLITE_OK = 0; - const int SQLITE_ROW = 100; - const int SQLITE_DONE = 101; - const int SQLITE_INTEGER = 1; - const int SQLITE_FLOAT = 2; - const int SQLITE_TEXT = 3; - const int SQLITE_BLOB = 4; - const int SQLITE_NULL = 5; - - //const string path = @"C:\Program Files\Team MediaPortal\MediaPortal\Plugins\Windows\"; - const string path = ""; - - [DllImport(path + "sqlite3.dll", EntryPoint = "sqlite3_open")] - static extern int sqlite3_open(string filename, out IntPtr db); - - [DllImport(path + "sqlite3.dll", EntryPoint = "sqlite3_close")] - static extern int sqlite3_close(IntPtr db); - - [DllImport(path + "sqlite3.dll", EntryPoint = "sqlite3_prepare_v2")] - static extern int sqlite3_prepare_v2(IntPtr db, string zSql, - int nByte, out IntPtr ppStmpt, IntPtr pzTail); - - [DllImport(path + "sqlite3.dll", EntryPoint = "sqlite3_step")] - static extern int sqlite3_step(IntPtr stmHandle); - - [DllImport(path + "sqlite3.dll", EntryPoint = "sqlite3_finalize")] - static extern int sqlite3_finalize(IntPtr stmHandle); - - [DllImport(path + "sqlite3.dll", EntryPoint = "sqlite3_errmsg")] - static extern string sqlite3_errmsg(IntPtr db); - - [DllImport(path + "sqlite3.dll", EntryPoint = "sqlite3_column_count")] - static extern int sqlite3_column_count(IntPtr stmHandle); - - [DllImport(path + "sqlite3.dll", EntryPoint = "sqlite3_column_origin_name")] - static extern string sqlite3_column_origin_name( - IntPtr stmHandle, int iCol); - - [DllImport(path + "sqlite3.dll", EntryPoint = "sqlite3_column_type")] - static extern int sqlite3_column_type(IntPtr stmHandle, int iCol); - - [DllImport(path + "sqlite3.dll", EntryPoint = "sqlite3_column_int")] - static extern int sqlite3_column_int(IntPtr stmHandle, int iCol); - - [DllImport(path + "sqlite3.dll", EntryPoint = "sqlite3_column_text")] - static extern string sqlite3_column_text(IntPtr stmHandle, int iCol); - - [DllImport(path + "sqlite3.dll", EntryPoint = "sqlite3_column_double")] - static extern double sqlite3_column_double(IntPtr stmHandle, int iCol); - - private IntPtr _db; //pointer to SQLite database - private bool _open; //whether or not the database is open - - /// <summary> - /// Opens or creates SQLite database with the specified path - /// </summary> - /// <param name="path">Path to SQLite database</param> - public void OpenDatabase(string path) - { - if (sqlite3_open(path, out _db) != SQLITE_OK) - throw new SQLiteException("Could not open database file: " + path); - - _open = true; - } - - /// <summary> - /// Closes the SQLite database - /// </summary> - public void CloseDatabase() - { - if (_open) - sqlite3_close(_db); - - _open = false; - } - - /// <summary> - /// Executes a query that returns no results - /// </summary> - /// <param name="query">SQL query to execute</param> - public void ExecuteNonQuery(string query) - { - if (!_open) - throw new SQLiteException("SQLite database is not open."); - - //prepare the statement - IntPtr stmHandle = Prepare(query); - - if (sqlite3_step(stmHandle) != SQLITE_DONE) - throw new SQLiteException("Could not execute SQL statement."); - - Finalize(stmHandle); - } - - /// <summary> - /// Executes a query and stores the results in - /// a DataTable - /// </summary> - /// <param name="query">SQL query to execute</param> - /// <returns>DataTable of results</returns> - public DataTable ExecuteQuery(string query) - { - if (!_open) - throw new SQLiteException("SQLite database is not open."); - - //prepare the statement - IntPtr stmHandle = Prepare(query); - - //get the number of returned columns - int columnCount = sqlite3_column_count(stmHandle); - - //create datatable and columns - DataTable dTable = new DataTable(); - for (int i = 0; i < columnCount; i++) - dTable.Columns.Add(sqlite3_column_origin_name(stmHandle, i)); - - //populate datatable - while (sqlite3_step(stmHandle) == SQLITE_ROW) - { - object[] row = new object[columnCount]; - for (int i = 0; i < columnCount; i++) - { - switch (sqlite3_column_type(stmHandle, i)) - { - case SQLITE_INTEGER: - row[i] = sqlite3_column_int(stmHandle, i); - break; - case SQLITE_TEXT: - row[i] = sqlite3_column_text(stmHandle, i); - break; - case SQLITE_FLOAT: - row[i] = sqlite3_column_double(stmHandle, i); - break; - } - } - - dTable.Rows.Add(row); - } - - Finalize(stmHandle); - - return dTable; - } - - /// <summary> - /// Prepares a SQL statement for execution - /// </summary> - /// <param name="query">SQL query</param> - /// <returns>Pointer to SQLite prepared statement</returns> - private IntPtr Prepare(string query) - { - IntPtr stmHandle; - - if (sqlite3_prepare_v2(_db, query, query.Length, - out stmHandle, IntPtr.Zero) != SQLITE_OK) - throw new SQLiteException(sqlite3_errmsg(_db)); - - return stmHandle; - } - - /// <summary> - /// Finalizes a SQLite statement - /// </summary> - /// <param name="stmHandle"> - /// Pointer to SQLite prepared statement - /// </param> - private void Finalize(IntPtr stmHandle) - { - if (sqlite3_finalize(stmHandle) != SQLITE_OK) - throw new SQLiteException("Could not finalize SQL statement."); - } - } -} - Modified: trunk/plugins/BrowseTheWeb/Source/Bro... [truncated message content] |