From: <Sil...@us...> - 2011-08-11 21:35:01
|
Revision: 4264 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4264&view=rev Author: SilentException Date: 2011-08-11 21:34:55 +0000 (Thu, 11 Aug 2011) Log Message: ----------- File Explorer - v1.6 - updated solution and project file - updated dialogs so they actually work (commented code can be removed later) - few more updates Modified Paths: -------------- trunk/plugins/File Explorer/Compression/Compression.sln trunk/plugins/File Explorer/Compression/Compression.vcproj trunk/plugins/File Explorer/Dialogs/GUIDialogOperation.cs trunk/plugins/File Explorer/DrivesView.cs trunk/plugins/File Explorer/File Explorer.cs trunk/plugins/File Explorer/File Explorer.csproj trunk/plugins/File Explorer/File Explorer.sln trunk/plugins/File Explorer/Preview/TextPreview.cs trunk/plugins/File Explorer/Properties/AssemblyInfo.cs Modified: trunk/plugins/File Explorer/Compression/Compression.sln =================================================================== --- trunk/plugins/File Explorer/Compression/Compression.sln 2011-07-24 11:37:56 UTC (rev 4263) +++ trunk/plugins/File Explorer/Compression/Compression.sln 2011-08-11 21:34:55 UTC (rev 4264) @@ -1,6 +1,6 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Compression", "Compression.vcproj", "{8BCD3BC9-1084-481C-82A5-23058672A3EF}" EndProject Global Modified: trunk/plugins/File Explorer/Compression/Compression.vcproj =================================================================== --- trunk/plugins/File Explorer/Compression/Compression.vcproj 2011-07-24 11:37:56 UTC (rev 4263) +++ trunk/plugins/File Explorer/Compression/Compression.vcproj 2011-08-11 21:34:55 UTC (rev 4264) @@ -1,10 +1,11 @@ <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" - Version="8,00" + Version="9,00" Name="Compression" ProjectGUID="{8BCD3BC9-1084-481C-82A5-23058672A3EF}" RootNamespace="Compression" + TargetFrameworkVersion="131072" > <Platforms> <Platform @@ -77,6 +78,8 @@ LinkIncremental="1" SuppressStartupBanner="true" ProgramDatabaseFile=".\Release/Compression.pdb" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" ImportLibrary=".\Release/Compression.lib" TargetMachine="1" /> @@ -101,9 +104,6 @@ Name="VCAppVerifierTool" /> <Tool - Name="VCWebDeploymentTool" - /> - <Tool Name="VCPostBuildEventTool" /> </Configuration> @@ -171,6 +171,8 @@ SuppressStartupBanner="true" GenerateDebugInformation="true" ProgramDatabaseFile=".\Debug/Compression.pdb" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" ImportLibrary=".\Debug/Compression.lib" TargetMachine="1" /> @@ -195,9 +197,6 @@ Name="VCAppVerifierTool" /> <Tool - Name="VCWebDeploymentTool" - /> - <Tool Name="VCPostBuildEventTool" /> </Configuration> Modified: trunk/plugins/File Explorer/Dialogs/GUIDialogOperation.cs =================================================================== --- trunk/plugins/File Explorer/Dialogs/GUIDialogOperation.cs 2011-07-24 11:37:56 UTC (rev 4263) +++ trunk/plugins/File Explorer/Dialogs/GUIDialogOperation.cs 2011-08-11 21:34:55 UTC (rev 4264) @@ -25,15 +25,19 @@ using System; using MediaPortal.GUI.Library; +using MediaPortal.Dialogs; using System.Threading; +using Action = MediaPortal.GUI.Library.Action; + namespace FileExplorer.Dialogs { /// <summary> /// This class shows a dialog which shows information about /// operations done by DrivesView class. /// </summary> - public class GUIDialogOperation : GUIWindow, IRenderLayer + //public class GUIDialogOperation : GUIWindow, IRenderLayer + public class GUIDialogOperation : GUIDialogWindow { #region enum DialogType /// <summary> @@ -60,13 +64,13 @@ #endregion #region vars - private int parentID; - private bool running = false; + //private int parentID; + //private bool running = false; private DialogType type = 0; - private string file = string.Empty; - private string to = string.Empty; + //private string file = string.Empty; + //private string to = string.Empty; private Thread processThread = null; @@ -97,6 +101,7 @@ } } + /* /// <summary> /// Shows the dialog and waits until the user has closed it. - Obsolete, not used /// </summary> @@ -134,13 +139,22 @@ Close(); } + */ + /// <summary> /// Shows the dialog. /// </summary> /// <param name="parentID">Parentwindow id.</param> - public void Show(int parentID) + public void Show(int ParentID) { + if (!_running) + { + PageLoad(ParentID); + } + + //DoModal(parentID); + /* this.parentID = parentID; if (GUIWindowManager.GetWindow(parentID) == null) @@ -166,6 +180,7 @@ running = true; GUIWindowManager.Process(); + */ processThread = new Thread(new ThreadStart(this.ProcessThread)); processThread.Start(); @@ -177,6 +192,8 @@ public void Close() { this.OnAction(new Action(Action.ActionType.ACTION_CLOSE_DIALOG, 0, 0)); + processThread.Abort(); + processThread = null; } /// <summary> @@ -321,8 +338,10 @@ public void SetCurrentFile(string file) { + CheckRunning(); + SuspendThread(); - this.file = file; + //this.file = file; // lblText1.Label = "File: " + file; lblText1.Label = Constants.Dialog.FILE + file; GUIWindowManager.Process(); @@ -331,6 +350,8 @@ public void SetToPath(string path) { + CheckRunning(); + SuspendThread(); /* if (path.Length > 30) @@ -338,7 +359,7 @@ path = path.Substring(0, 3) + "..\\" + GetFilename(path); } */ - this.to = path; + //this.to = path; // lblText2.Label = "To: " + path; lblText2.Label = Constants.Dialog.TO + path; GUIWindowManager.Process(); @@ -347,6 +368,8 @@ public void SetPath(string path) { + CheckRunning(); + SuspendThread(); /* if (path.Length > 30) @@ -365,6 +388,8 @@ /// <param name="text">Text</param> public void SetText(string text) { + CheckRunning(); + SuspendThread(); lblText1.Label = text; lblText2.Label = string.Empty; @@ -378,6 +403,8 @@ /// <param name="text2">Text for label 2.</param> public void SetText(string text1, string text2) { + CheckRunning(); + SuspendThread(); lblText1.Label = text1; lblText2.Label = text2; @@ -388,7 +415,7 @@ #region private members private void ProcessThread() { - while (running && GUIGraphicsContext.CurrentState == GUIGraphicsContext.State.RUNNING) + while (_running && GUIGraphicsContext.CurrentState == GUIGraphicsContext.State.RUNNING) { if (!Paused) { @@ -424,6 +451,16 @@ return filePath.Substring(index + 1); } + + private void CheckRunning() + { + if (processThread == null) + { + Reset(); + Type = this.type; + Show(GUIWindowManager.ActiveWindow); + } + } #endregion #region Overrides @@ -438,6 +475,12 @@ return Load(GUIGraphicsContext.Skin + "\\File Explorer_dialog.xml"); } + public override void Reset() + { + base.Reset(); + } + + /* public override void OnAction(Action action) { if (action.wID == Action.ActionType.ACTION_CLOSE_DIALOG || action.wID == Action.ActionType.ACTION_PREVIOUS_MENU) @@ -450,7 +493,9 @@ base.OnAction(action); } + */ + /* public override bool OnMessage(GUIMessage message) { if (message.TargetWindowId == GetID && message.Message == GUIMessage.MessageType.GUI_MSG_WINDOW_DEINIT) @@ -487,13 +532,17 @@ } return base.OnMessage(message); } + */ + /* protected override void OnPageLoad() { } + */ #endregion + /* #region IRenderLayer public bool ShouldRenderLayer() { @@ -508,5 +557,6 @@ } } #endregion + */ } } Modified: trunk/plugins/File Explorer/DrivesView.cs =================================================================== --- trunk/plugins/File Explorer/DrivesView.cs 2011-07-24 11:37:56 UTC (rev 4263) +++ trunk/plugins/File Explorer/DrivesView.cs 2011-08-11 21:34:55 UTC (rev 4264) @@ -418,7 +418,7 @@ { LoadPath(); FillListControl(); - if (updateSecondView && SecondView.currentDrive == currentDrive && SecondView.currentPath == currentPath) + if (updateSecondView) // && SecondView.currentDrive == currentDrive && SecondView.currentPath == currentPath) SecondView.Update(false); } @@ -780,7 +780,7 @@ ShowDialogOperation(GUIDialogOperation.DialogType.COPY); dlgOp.SetCurrentFile(GetFilename(src)); dlgOp.SetToPath(GetPath(dest)); - dlgOp.Show(winId); + //dlgOp.Show(winId); } System.IO.File.Copy(src, dest); if (showDlg) dlgOp.Close(); @@ -2237,7 +2237,7 @@ { lstFiles = new ArrayList(); ShowDialogOperation(GUIDialogOperation.DialogType.AUDIO_PLAYLIST_ADD); - dlgOp.Show(winId); + //dlgOp.Show(winId); ReadDirectories(item.Path, true, Utils.AudioExtensions); dlgOp.Close(); @@ -2397,7 +2397,7 @@ { lstFiles = new ArrayList(); ShowDialogOperation(GUIDialogOperation.DialogType.AUDIO_PLAYLIST_ADD); - dlgOp.Show(winId); + //dlgOp.Show(winId); ReadDirectories(item.Path, true, Utils.AudioExtensions); dlgOp.Close(); @@ -3194,6 +3194,7 @@ private void ShowDialogOperation(GUIDialogOperation.DialogType type) { dlgOp = (GUIDialogOperation)GUIWindowManager.GetWindow(Constants.WindowIDs.DIALOGOPERATION); + dlgOp.Reset(); dlgOp.Type = type; dlgOp.Show(winId); } Modified: trunk/plugins/File Explorer/File Explorer.cs =================================================================== --- trunk/plugins/File Explorer/File Explorer.cs 2011-07-24 11:37:56 UTC (rev 4263) +++ trunk/plugins/File Explorer/File Explorer.cs 2011-08-11 21:34:55 UTC (rev 4264) @@ -29,6 +29,8 @@ using System.IO; using MediaPortal.Configuration; +using Action = MediaPortal.GUI.Library.Action; + namespace FileExplorer { /// <summary> Modified: trunk/plugins/File Explorer/File Explorer.csproj =================================================================== --- trunk/plugins/File Explorer/File Explorer.csproj 2011-07-24 11:37:56 UTC (rev 4263) +++ trunk/plugins/File Explorer/File Explorer.csproj 2011-08-11 21:34:55 UTC (rev 4264) @@ -1,4 +1,5 @@ -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> <PropertyGroup> <OutputType>Library</OutputType> <RootNamespace>FileExplorer</RootNamespace> @@ -19,9 +20,11 @@ <StartProgram>C:\Programme\Team MediaPortal\MediaPortal\MediaPortal.exe</StartProgram> <FileUpgradeFlags> </FileUpgradeFlags> - <OldToolsVersion>2.0</OldToolsVersion> + <OldToolsVersion>3.5</OldToolsVersion> <UpgradeBackupLocation> </UpgradeBackupLocation> + <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> + <TargetFrameworkProfile /> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> <OutputPath>bin\Debug\</OutputPath> @@ -30,6 +33,7 @@ <DebugSymbols>true</DebugSymbols> <DebugType>Full</DebugType> <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow> + <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)' == 'Release' "> <OutputPath>bin\Release\</OutputPath> @@ -38,22 +42,17 @@ <DebugSymbols>false</DebugSymbols> <DebugType>None</DebugType> <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> + <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> </PropertyGroup> <ItemGroup> - <Reference Include="Common.Utils, Version=1.1.7.0, Culture=neutral, processorArchitecture=x86"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\mediaportal\xbmc\bin\Release\Common.Utils.dll</HintPath> - <Private>False</Private> + <Reference Include="Common.Utils"> + <HintPath>C:\Program Files\Team MediaPortal\MediaPortal\Common.Utils.dll</HintPath> </Reference> - <Reference Include="Core, Version=1.0.4.34667, Culture=neutral, processorArchitecture=x86"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\mediaportal\xbmc\bin\Release\Core.dll</HintPath> - <Private>False</Private> + <Reference Include="Core"> + <HintPath>C:\Program Files\Team MediaPortal\MediaPortal\Core.dll</HintPath> </Reference> - <Reference Include="Dialogs, Version=1.0.4.34668, Culture=neutral, processorArchitecture=x86"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\mediaportal\xbmc\bin\Release\plugins\Windows\Dialogs.dll</HintPath> - <Private>False</Private> + <Reference Include="Dialogs"> + <HintPath>C:\Program Files\Team MediaPortal\MediaPortal\plugins\Windows\Dialogs.dll</HintPath> </Reference> <Reference Include="System" /> <Reference Include="System.Xml" /> @@ -64,15 +63,11 @@ <Private>False</Private> </Reference> <Reference Include="Microsoft.VisualBasic" /> - <Reference Include="Utils, Version=2.2.7.34666, Culture=neutral, processorArchitecture=x86"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\mediaportal\xbmc\bin\Release\Utils.dll</HintPath> - <Private>False</Private> + <Reference Include="Utils"> + <HintPath>C:\Program Files\Team MediaPortal\MediaPortal\Utils.dll</HintPath> </Reference> - <Reference Include="WindowPlugins, Version=1.1.0.16062, Culture=neutral, processorArchitecture=x86"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\mediaportal\xbmc\bin\Release\plugins\Windows\WindowPlugins.dll</HintPath> - <Private>False</Private> + <Reference Include="WindowPlugins"> + <HintPath>C:\Program Files\Team MediaPortal\MediaPortal\plugins\Windows\WindowPlugins.dll</HintPath> </Reference> </ItemGroup> <ItemGroup> Modified: trunk/plugins/File Explorer/File Explorer.sln =================================================================== --- trunk/plugins/File Explorer/File Explorer.sln 2011-07-24 11:37:56 UTC (rev 4263) +++ trunk/plugins/File Explorer/File Explorer.sln 2011-08-11 21:34:55 UTC (rev 4264) @@ -1,6 +1,6 @@ -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "File Explorer", "File Explorer.csproj", "{39A9A612-493E-45CF-AE39-E99BAE474679}" EndProject Global Modified: trunk/plugins/File Explorer/Preview/TextPreview.cs =================================================================== --- trunk/plugins/File Explorer/Preview/TextPreview.cs 2011-07-24 11:37:56 UTC (rev 4263) +++ trunk/plugins/File Explorer/Preview/TextPreview.cs 2011-08-11 21:34:55 UTC (rev 4264) @@ -29,13 +29,17 @@ using System; using System.IO; using MediaPortal.GUI.Library; +using MediaPortal.Dialogs; +using Action = MediaPortal.GUI.Library.Action; + namespace FileExplorer.Preview { /// <summary> /// Description of TextPreview. /// </summary> - public class TextPreview : GUIWindow, ISetupForm, IRenderLayer + //public class TextPreview : GUIWindow, ISetupForm, IRenderLayer + public class TextPreview : GUIDialogWindow { #region vars private int parentID; @@ -48,6 +52,7 @@ #endregion #region public members + /* public void DoModal(int parentID) { this.parentID = parentID; @@ -69,9 +74,12 @@ GUIWindowManager.Process(); } } + */ public bool LoadTextFile(string strFile) { + Reset(); + textArea.OnMessage(new GUIMessage(GUIMessage.MessageType.GUI_MSG_LABEL_RESET, GetID, 0, textArea.GetID, 0, 0, null)); if (labelHeading != null) labelHeading.OnMessage(new GUIMessage(GUIMessage.MessageType.GUI_MSG_LABEL_RESET, GetID, 0, labelHeading.GetID, 0, 0, null)); @@ -113,6 +121,8 @@ #endregion #region ISetupForm members + /* + /// <summary> /// Returns the name of the plugin which is shown in the plugin menu /// </summary> @@ -204,6 +214,8 @@ return false; } + */ + #endregion #region Overrides @@ -218,6 +230,7 @@ return Load(GUIGraphicsContext.Skin + "\\File Explorer_textpreview.xml"); } + /* public override void OnAction(Action action) { if (action.wID == Action.ActionType.ACTION_CLOSE_DIALOG || action.wID == Action.ActionType.ACTION_PREVIOUS_MENU) @@ -230,7 +243,9 @@ base.OnAction(action); } - + */ + + /* public override bool OnMessage(GUIMessage message) { if (message.Message == GUIMessage.MessageType.GUI_MSG_WINDOW_DEINIT) @@ -257,13 +272,17 @@ } return base.OnMessage(message); } + */ + /* protected override void OnPageLoad() { } + */ #endregion + /* #region IRenderLayer public bool ShouldRenderLayer() { @@ -275,5 +294,6 @@ Render(timePassed); } #endregion + */ } } Modified: trunk/plugins/File Explorer/Properties/AssemblyInfo.cs =================================================================== --- trunk/plugins/File Explorer/Properties/AssemblyInfo.cs 2011-07-24 11:37:56 UTC (rev 4263) +++ trunk/plugins/File Explorer/Properties/AssemblyInfo.cs 2011-08-11 21:34:55 UTC (rev 4264) @@ -29,7 +29,7 @@ // You can specify all values by your own or you can build default build and revision // numbers with the '*' character (the default): -[assembly: AssemblyVersion("1.5.0.0")] +[assembly: AssemblyVersion("1.6.0.0")] // MediaPortal plugin version compatibility [assembly: CompatibleVersion("1.1.7.0")] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |