From: <nic...@us...> - 2013-10-20 18:54:28
|
Revision: 4662 http://sourceforge.net/p/mp-plugins/code/4662 Author: nicsergio Date: 2013-10-20 18:54:25 +0000 (Sun, 20 Oct 2013) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ShortCuter&SkinEditor/Source/MediaPortalPlugins.sln trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterForm.Designer.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterForm.cs trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterForm.resx trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs trunk/plugins/ShortCuter&SkinEditor/Source/XtremeMenuEditor/BHEditorForm.cs Added Paths: ----------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/SkinWithSounds.cs Removed Paths: ------------- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/SkinLinks.cs Modified: trunk/plugins/ShortCuter&SkinEditor/Source/MediaPortalPlugins.sln =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/MediaPortalPlugins.sln 2013-10-20 17:51:55 UTC (rev 4661) +++ trunk/plugins/ShortCuter&SkinEditor/Source/MediaPortalPlugins.sln 2013-10-20 18:54:25 UTC (rev 4662) @@ -29,7 +29,6 @@ {350D17A6-0F6B-43C4-898F-33CC68EBCD75}.Debug|x86.Build.0 = Debug|x86 {350D17A6-0F6B-43C4-898F-33CC68EBCD75}.Release|Any CPU.ActiveCfg = Release|x86 {350D17A6-0F6B-43C4-898F-33CC68EBCD75}.Release|Mixed Platforms.ActiveCfg = Debug|x86 - {350D17A6-0F6B-43C4-898F-33CC68EBCD75}.Release|Mixed Platforms.Build.0 = Debug|x86 {350D17A6-0F6B-43C4-898F-33CC68EBCD75}.Release|x86.ActiveCfg = Release|x86 {350D17A6-0F6B-43C4-898F-33CC68EBCD75}.Release|x86.Build.0 = Release|x86 {4D76B200-01C9-48C6-BA04-DAF0845D56B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU @@ -48,6 +47,7 @@ {20CEBE32-A39E-4A61-B2BD-90BF16E2AEE8}.Release|Any CPU.ActiveCfg = Release|Any CPU {20CEBE32-A39E-4A61-B2BD-90BF16E2AEE8}.Release|Any CPU.Build.0 = Release|Any CPU {20CEBE32-A39E-4A61-B2BD-90BF16E2AEE8}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {20CEBE32-A39E-4A61-B2BD-90BF16E2AEE8}.Release|Mixed Platforms.Build.0 = Release|Any CPU {20CEBE32-A39E-4A61-B2BD-90BF16E2AEE8}.Release|x86.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs 2013-10-20 17:51:55 UTC (rev 4661) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.cs 2013-10-20 18:54:25 UTC (rev 4662) @@ -65,11 +65,11 @@ if (sc.SoundEffect.Length > 0) Utils.PlaySound(sc.SoundEffect, false, true); //--> eventuale effetto sonoro - if (sc.HyperlinkParameter.Length > 0) //Richiamo schermata con parametri di caricamento - GUIWindowManager.ActivateWindow(sc.Hyperlink, sc.HyperlinkParameter, true); + if (sc.LoadParameter.Length > 0) //Richiamo schermata con parametri di caricamento + GUIWindowManager.ActivateWindow(sc.WindowID, sc.LoadParameter, true); else //Richiamo schermata senza parametri di caricamento { - GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_GOTO_WINDOW, 0, 0, 0, sc.Hyperlink, 0, null); + GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_GOTO_WINDOW, 0, 0, 0, sc.WindowID, 0, null); GUIWindowManager.SendMessage(msg); //GUIGraphicsContext.SendMessage(msg); //Metodo usato dal vecchio plugin } Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj 2013-10-20 17:51:55 UTC (rev 4661) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuter.csproj 2013-10-20 18:54:25 UTC (rev 4662) @@ -6,7 +6,7 @@ <ProductVersion>8.0.30703</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{20CEBE32-A39E-4A61-B2BD-90BF16E2AEE8}</ProjectGuid> - <OutputType>Library</OutputType> + <OutputType>WinExe</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>ProcessPlugins.ShortCuter</RootNamespace> <AssemblyName>ShortCuter</AssemblyName> @@ -106,7 +106,7 @@ <DependentUpon>ShortCuterForm.cs</DependentUpon> </Compile> <Compile Include="ShortCuts.cs" /> - <Compile Include="SkinLinks.cs" /> + <Compile Include="SkinWithSounds.cs" /> </ItemGroup> <ItemGroup> <EmbeddedResource Include="Properties\Resources.resx"> @@ -163,6 +163,114 @@ <EmbeddedResource Include="..\Common\Resources\XmlFiles\PopularSkinLinks.xml"> <Link>Resources\XmlFiles\PopularSkinLinks.xml</Link> </EmbeddedResource> + <EmbeddedResource Include="..\Common\Resources\Images\TreeViewIcons\BasicHome.png"> + <Link>Resources\Images\TreeViewIcons\BasicHome.png</Link> + </EmbeddedResource> + <EmbeddedResource Include="..\Common\Resources\Images\TreeViewIcons\BD.png"> + <Link>Resources\Images\TreeViewIcons\BD.png</Link> + </EmbeddedResource> + <EmbeddedResource Include="..\Common\Resources\Images\TreeViewIcons\DVD.png"> + <Link>Resources\Images\TreeViewIcons\DVD.png</Link> + </EmbeddedResource> + <EmbeddedResource Include="..\Common\Resources\Images\TreeViewIcons\FileExplorer.png"> + <Link>Resources\Images\TreeViewIcons\FileExplorer.png</Link> + </EmbeddedResource> + <EmbeddedResource Include="..\Common\Resources\Images\TreeViewIcons\Fullscreen.png"> + <Link>Resources\Images\TreeViewIcons\Fullscreen.png</Link> + </EmbeddedResource> + <EmbeddedResource Include="..\Common\Resources\Images\TreeViewIcons\Games.png"> + <Link>Resources\Images\TreeViewIcons\Games.png</Link> + </EmbeddedResource> + <EmbeddedResource Include="..\Common\Resources\Images\TreeViewIcons\Home.png"> + <Link>Resources\Images\TreeViewIcons\Home.png</Link> + </EmbeddedResource> + <EmbeddedResource Include="..\Common\Resources\Images\TreeViewIcons\Htpcinfo.png"> + <Link>Resources\Images\TreeViewIcons\Htpcinfo.png</Link> + </EmbeddedResource> + <EmbeddedResource Include="..\Common\Resources\Images\TreeViewIcons\Internet.png"> + <Link>Resources\Images\TreeViewIcons\Internet.png</Link> + </EmbeddedResource> + <EmbeddedResource Include="..\Common\Resources\Images\TreeViewIcons\LastFM.png"> + <Link>Resources\Images\TreeViewIcons\LastFM.png</Link> + </EmbeddedResource> + <EmbeddedResource Include="..\Common\Resources\Images\TreeViewIcons\Movies.png"> + <Link>Resources\Images\TreeViewIcons\Movies.png</Link> + </EmbeddedResource> + <EmbeddedResource Include="..\Common\Resources\Images\TreeViewIcons\MovingPictures.png"> + <Link>Resources\Images\TreeViewIcons\MovingPictures.png</Link> + </EmbeddedResource> + <EmbeddedResource Include="..\Common\Resources\Images\TreeViewIcons\Music.png"> + <Link>Resources\Images\TreeViewIcons\Music.png</Link> + </EmbeddedResource> + <EmbeddedResource Include="..\Common\Resources\Images\TreeViewIcons\MusicPlaying.png"> + <Link>Resources\Images\TreeViewIcons\MusicPlaying.png</Link> + </EmbeddedResource> + <EmbeddedResource Include="..\Common\Resources\Images\TreeViewIcons\MusicPlaylists.png"> + <Link>Resources\Images\TreeViewIcons\MusicPlaylists.png</Link> + </EmbeddedResource> + <EmbeddedResource Include="..\Common\Resources\Images\TreeViewIcons\mvCentral.png"> + <Link>Resources\Images\TreeViewIcons\mvCentral.png</Link> + </EmbeddedResource> + <EmbeddedResource Include="..\Common\Resources\Images\TreeViewIcons\MyFilms.png"> + <Link>Resources\Images\TreeViewIcons\MyFilms.png</Link> + </EmbeddedResource> + <EmbeddedResource Include="..\Common\Resources\Images\TreeViewIcons\MyLyrics.png"> + <Link>Resources\Images\TreeViewIcons\MyLyrics.png</Link> + </EmbeddedResource> + <EmbeddedResource Include="..\Common\Resources\Images\TreeViewIcons\News.png"> + <Link>Resources\Images\TreeViewIcons\News.png</Link> + </EmbeddedResource> + <EmbeddedResource Include="..\Common\Resources\Images\TreeViewIcons\OnlineVideos.png"> + <Link>Resources\Images\TreeViewIcons\OnlineVideos.png</Link> + </EmbeddedResource> + <EmbeddedResource Include="..\Common\Resources\Images\TreeViewIcons\Pictures.png"> + <Link>Resources\Images\TreeViewIcons\Pictures.png</Link> + </EmbeddedResource> + <EmbeddedResource Include="..\Common\Resources\Images\TreeViewIcons\Plugins.png"> + <Link>Resources\Images\TreeViewIcons\Plugins.png</Link> + </EmbeddedResource> + <EmbeddedResource Include="..\Common\Resources\Images\TreeViewIcons\Radio.png"> + <Link>Resources\Images\TreeViewIcons\Radio.png</Link> + </EmbeddedResource> + <EmbeddedResource Include="..\Common\Resources\Images\TreeViewIcons\Settings.png"> + <Link>Resources\Images\TreeViewIcons\Settings.png</Link> + </EmbeddedResource> + <EmbeddedResource Include="..\Common\Resources\Images\TreeViewIcons\ShowTimes.png"> + <Link>Resources\Images\TreeViewIcons\ShowTimes.png</Link> + </EmbeddedResource> + <EmbeddedResource Include="..\Common\Resources\Images\TreeViewIcons\Teletext.png"> + <Link>Resources\Images\TreeViewIcons\Teletext.png</Link> + </EmbeddedResource> + <EmbeddedResource Include="..\Common\Resources\Images\TreeViewIcons\Trailers.png"> + <Link>Resources\Images\TreeViewIcons\Trailers.png</Link> + </EmbeddedResource> + <EmbeddedResource Include="..\Common\Resources\Images\TreeViewIcons\Trakt.png"> + <Link>Resources\Images\TreeViewIcons\Trakt.png</Link> + </EmbeddedResource> + <EmbeddedResource Include="..\Common\Resources\Images\TreeViewIcons\TV.png"> + <Link>Resources\Images\TreeViewIcons\TV.png</Link> + </EmbeddedResource> + <EmbeddedResource Include="..\Common\Resources\Images\TreeViewIcons\TvGuide.png"> + <Link>Resources\Images\TreeViewIcons\TvGuide.png</Link> + </EmbeddedResource> + <EmbeddedResource Include="..\Common\Resources\Images\TreeViewIcons\TvRecs.png"> + <Link>Resources\Images\TreeViewIcons\TvRecs.png</Link> + </EmbeddedResource> + <EmbeddedResource Include="..\Common\Resources\Images\TreeViewIcons\TvSeries.png"> + <Link>Resources\Images\TreeViewIcons\TvSeries.png</Link> + </EmbeddedResource> + <EmbeddedResource Include="..\Common\Resources\Images\TreeViewIcons\Twitter.png"> + <Link>Resources\Images\TreeViewIcons\Twitter.png</Link> + </EmbeddedResource> + <EmbeddedResource Include="..\Common\Resources\Images\TreeViewIcons\Weather.png"> + <Link>Resources\Images\TreeViewIcons\Weather.png</Link> + </EmbeddedResource> + <EmbeddedResource Include="..\Common\Resources\Images\TreeViewIcons\Wikipedia.png"> + <Link>Resources\Images\TreeViewIcons\Wikipedia.png</Link> + </EmbeddedResource> + <EmbeddedResource Include="..\Common\Resources\Images\TreeViewIcons\YouTube.png"> + <Link>Resources\Images\TreeViewIcons\YouTube.png</Link> + </EmbeddedResource> <Content Include="Resources\Images\ShortCuter.ico" /> <EmbeddedResource Include="Resources\Images\ShortCuterDisable.png" /> <EmbeddedResource Include="Resources\Images\ShortCuterEnable.png" /> Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterForm.Designer.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterForm.Designer.cs 2013-10-20 17:51:55 UTC (rev 4661) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterForm.Designer.cs 2013-10-20 18:54:25 UTC (rev 4662) @@ -34,7 +34,6 @@ this.shortCutsDataGridView = new System.Windows.Forms.DataGridView(); this.itemsTabControl = new System.Windows.Forms.TabControl(); this.linksTabPage = new System.Windows.Forms.TabPage(); - this.skinLinksListBox = new System.Windows.Forms.ListBox(); this.skinTabPage = new System.Windows.Forms.TabPage(); this.skinFilesListBox = new System.Windows.Forms.ListBox(); this.linkPropertiesGroupBox = new System.Windows.Forms.GroupBox(); @@ -53,6 +52,7 @@ this.rowRemoveButton = new System.Windows.Forms.Button(); this.rowAddButton = new System.Windows.Forms.Button(); this.propLeftPictureBox = new System.Windows.Forms.PictureBox(); + this.skinLinksTreeView = new System.Windows.Forms.TreeView(); ((System.ComponentModel.ISupportInitialize)(this.shortCutsDataGridView)).BeginInit(); this.itemsTabControl.SuspendLayout(); this.linksTabPage.SuspendLayout(); @@ -107,7 +107,7 @@ // // linksTabPage // - this.linksTabPage.Controls.Add(this.skinLinksListBox); + this.linksTabPage.Controls.Add(this.skinLinksTreeView); this.linksTabPage.Location = new System.Drawing.Point(4, 22); this.linksTabPage.Name = "linksTabPage"; this.linksTabPage.Padding = new System.Windows.Forms.Padding(3); @@ -116,18 +116,6 @@ this.linksTabPage.Text = "Default Links"; this.linksTabPage.UseVisualStyleBackColor = true; // - // skinLinksListBox - // - this.skinLinksListBox.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(213)))), ((int)(((byte)(220)))), ((int)(((byte)(227))))); - this.skinLinksListBox.FormattingEnabled = true; - this.skinLinksListBox.Location = new System.Drawing.Point(1, 5); - this.skinLinksListBox.Name = "skinLinksListBox"; - this.skinLinksListBox.Size = new System.Drawing.Size(235, 173); - this.skinLinksListBox.TabIndex = 0; - this.skinLinksListBox.SelectedIndexChanged += new System.EventHandler(this.skinLinksListBox_SelectedIndexChanged); - this.skinLinksListBox.DoubleClick += new System.EventHandler(this.skinLinksListBox_DoubleClick); - this.skinLinksListBox.Enter += new System.EventHandler(this.skinLinksListBox_Enter); - // // skinTabPage // this.skinTabPage.Controls.Add(this.skinFilesListBox); @@ -325,6 +313,19 @@ this.propLeftPictureBox.TabStop = false; this.propLeftPictureBox.Visible = false; // + // skinLinksTreeView + // + this.skinLinksTreeView.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(213)))), ((int)(((byte)(220)))), ((int)(((byte)(227))))); + this.skinLinksTreeView.FullRowSelect = true; + this.skinLinksTreeView.HideSelection = false; + this.skinLinksTreeView.Location = new System.Drawing.Point(1, 5); + this.skinLinksTreeView.Name = "skinLinksTreeView"; + this.skinLinksTreeView.Size = new System.Drawing.Size(235, 173); + this.skinLinksTreeView.TabIndex = 2; + this.skinLinksTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.skinLinksTreeView_AfterSelect); + this.skinLinksTreeView.DoubleClick += new System.EventHandler(this.skinLinksTreeView_DoubleClick); + this.skinLinksTreeView.Enter += new System.EventHandler(this.skinLinksTreeView_Enter); + // // ShortCuterForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -370,7 +371,6 @@ private System.Windows.Forms.DataGridView shortCutsDataGridView; private System.Windows.Forms.TabControl itemsTabControl; private System.Windows.Forms.TabPage linksTabPage; - private System.Windows.Forms.ListBox skinLinksListBox; private System.Windows.Forms.TabPage skinTabPage; private System.Windows.Forms.ListBox skinFilesListBox; private System.Windows.Forms.PictureBox propLeftPictureBox; @@ -389,6 +389,7 @@ private System.Windows.Forms.Label skinFileLabel; private System.Windows.Forms.GroupBox loadParameterGroupBox; private System.Windows.Forms.Label loadParameterLabel; + private System.Windows.Forms.TreeView skinLinksTreeView; } } \ No newline at end of file Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterForm.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterForm.cs 2013-10-20 17:51:55 UTC (rev 4661) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterForm.cs 2013-10-20 18:54:25 UTC (rev 4662) @@ -10,7 +10,7 @@ namespace ProcessPlugins.ShortCuter { - [PluginIcons("ProcessPlugins.ShortCuter.Resources.ShortCuterEnable.png", "ProcessPlugins.ShortCuter.Resources.ShortCuterDisable.png")] + [PluginIcons("ProcessPlugins.ShortCuter.Resources.Images.ShortCuterEnable.png", "ProcessPlugins.ShortCuter.Resources.Images.ShortCuterDisable.png")] public partial class ShortCuterForm : Form, ISetupForm //Form per la configurazione del plugin, con implementazione interfaccia ISetupForm (per lancio da configurazione MediaPortal) { #region Dati @@ -33,9 +33,9 @@ skinFilesListBox.DataSource = mySkin.SkinFiles; skinFilesListBox.SelectedIndex = -1; toolTip.SetToolTip(skinFilesListBox, "Double Click to Set the Link's Parameter to ShortCut"); - skinLinksListBox.DataSource = mySkin.SkinLinks; - skinLinksListBox.SelectedIndex = -1; - toolTip.SetToolTip(skinLinksListBox, "Double Click to Set the Link's Parameter to ShortCut"); + mySkin.FillTreeViewSkinLinks(skinLinksTreeView); + skinLinksTreeView.CollapseAll(); + toolTip.SetToolTip(skinLinksTreeView, "Double Click to Set the Link's Parameter to ShortCut"); FormatShortCutsGrid(); } private void FormatShortCutsGrid() //Formattazione (e popolazione) tabella shortcuts @@ -80,20 +80,20 @@ shiftColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; shiftColumn.DefaultCellStyle.BackColor = Color.LightCyan; - DataGridViewTextBoxColumn hyperlinkColumn = new DataGridViewTextBoxColumn(); - hyperlinkColumn.DataPropertyName = "Hyperlink"; - hyperlinkColumn.HeaderText = "Window ID"; - hyperlinkColumn.Width = 70; - hyperlinkColumn.MaxInputLength = 10; - hyperlinkColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; + DataGridViewTextBoxColumn windowIDColumn = new DataGridViewTextBoxColumn(); + windowIDColumn.DataPropertyName = "WindowID"; + windowIDColumn.HeaderText = "Window ID"; + windowIDColumn.Width = 70; + windowIDColumn.MaxInputLength = 10; + windowIDColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; - DataGridViewTextBoxColumn hyperlinkParameterColumn = new DataGridViewTextBoxColumn(); - hyperlinkParameterColumn.DataPropertyName = "HyperlinkParameter"; - hyperlinkParameterColumn.HeaderText = "Load Parameter"; - hyperlinkParameterColumn.Width = 200; - hyperlinkParameterColumn.MaxInputLength = 100; - hyperlinkParameterColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; - hyperlinkParameterColumn.DefaultCellStyle.Font = new Font("Microsoft Sans Serif", 7, FontStyle.Regular); + DataGridViewTextBoxColumn loadParameterColumn = new DataGridViewTextBoxColumn(); + loadParameterColumn.DataPropertyName = "LoadParameter"; + loadParameterColumn.HeaderText = "Load Parameter"; + loadParameterColumn.Width = 200; + loadParameterColumn.MaxInputLength = 100; + loadParameterColumn.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter; + loadParameterColumn.DefaultCellStyle.Font = new Font("Microsoft Sans Serif", 7, FontStyle.Regular); DataGridViewComboBoxColumn soundEffectColumn = new DataGridViewComboBoxColumn(); soundEffectColumn.DataPropertyName = "SoundEffect"; @@ -107,8 +107,8 @@ shortCutsDataGridView.Columns.Add(ctrlColumn); shortCutsDataGridView.Columns.Add(altColumn); shortCutsDataGridView.Columns.Add(shiftColumn); - shortCutsDataGridView.Columns.Add(hyperlinkColumn); - shortCutsDataGridView.Columns.Add(hyperlinkParameterColumn); + shortCutsDataGridView.Columns.Add(windowIDColumn); + shortCutsDataGridView.Columns.Add(loadParameterColumn); shortCutsDataGridView.Columns.Add(soundEffectColumn); shortCutsDataGridView.DataSource = myShortCuts.Items; @@ -134,8 +134,8 @@ case "skinLinksListBox": //Lista links predefiniti della skin skinFileLabel.Text = mySkin.SkinLinks[itemsList.SelectedIndex].XmlFile; - windowIdLabel.Text = mySkin.SkinLinks[itemsList.SelectedIndex].Hyperlink.ToString(); - loadParameterLabel.Text = mySkin.SkinLinks[itemsList.SelectedIndex].HyperlinkParameter; + windowIdLabel.Text = mySkin.SkinLinks[itemsList.SelectedIndex].WindowID.ToString(); + loadParameterLabel.Text = mySkin.SkinLinks[itemsList.SelectedIndex].LoadParameter; break; } } @@ -148,18 +148,19 @@ propLeftPictureBox.Visible = true; //--> visualizzazione freccia grafica if (!forceCell) //Non nel caso di forzatura valore cella WindowID (doppio click da lista links) { - int showIndex; int hyperlink; + int showIndex; + int windowID = Convert.ToInt32(shortCutsDataGridView.Rows[shortCutsDataGridView.CurrentRow.Index].Cells[5].Value); if (itemsTabControl.SelectedIndex == 0) { - hyperlink = Convert.ToInt32(shortCutsDataGridView.Rows[shortCutsDataGridView.CurrentRow.Index].Cells[5].Value); - string hyperlinkParameter = Convert.ToString(shortCutsDataGridView.Rows[shortCutsDataGridView.CurrentRow.Index].Cells[6].Value); - showIndex = mySkin.SkinLinks.FindIndex(x => x.Hyperlink == hyperlink && x.HyperlinkParameter == hyperlinkParameter); - skinLinksListBox.SelectedIndex = showIndex; //--> selezione eventuale link corrispondente a WindowID & HyperlinkParameter + string loadParameter = Convert.ToString(shortCutsDataGridView.Rows[shortCutsDataGridView.CurrentRow.Index].Cells[6].Value); + showIndex = mySkin.SkinLinks.FindIndex(x => x.WindowID == windowID && x.LoadParameter == loadParameter); + + //--> selezione eventuale link corrispondente a WindowID & HyperlinkParameter + skinLinksTreeView.SelectedNode = skinLinksTreeView.Nodes.Find(showIndex.ToString(), true)[0]; } else { - hyperlink = Convert.ToInt32(shortCutsDataGridView.Rows[shortCutsDataGridView.CurrentRow.Index].Cells[5].Value); - showIndex = mySkin.SkinFiles.FindLastIndex(x => x.Id == hyperlink); + showIndex = mySkin.SkinFiles.FindLastIndex(x => x.Id == windowID); skinFilesListBox.SelectedIndex = showIndex; //--> selezione eventuale file corrispondente a WindowID } } @@ -342,11 +343,17 @@ #region Eventi Liste Files & Links Skin private void itemsTabControl_SelectedIndexChanged(object sender, EventArgs e) { - ((itemsTabControl.SelectedIndex == 0) ? skinLinksListBox : skinFilesListBox).Focus(); + if(itemsTabControl.SelectedIndex == 0) + skinLinksTreeView.Focus(); + else + skinFilesListBox.Focus(); } private void itemsTabControl_Click(object sender, EventArgs e) { - ((itemsTabControl.SelectedIndex == 0) ? skinLinksListBox : skinFilesListBox).Focus(); + if (itemsTabControl.SelectedIndex == 0) + skinLinksTreeView.Focus(); + else + skinFilesListBox.Focus(); } private void skinFilesListBox_SelectedIndexChanged(object sender, EventArgs e) { @@ -368,21 +375,22 @@ forceCell = false; } } - private void skinLinksListBox_SelectedIndexChanged(object sender, EventArgs e) + private void skinLinksTreeView_AfterSelect(object sender, TreeViewEventArgs e) { ShowLinkProperties(sender); } - private void skinLinksListBox_Enter(object sender, EventArgs e) + private void skinLinksTreeView_Enter(object sender, EventArgs e) { ShowLinkItem(); ShowLinkProperties(sender); } - private void skinLinksListBox_DoubleClick(object sender, EventArgs e) + private void skinLinksTreeView_DoubleClick(object sender, EventArgs e) { - if (shortCutsDataGridView.CurrentRow != null && shortCutsDataGridView.RowCount > 0) + int skinLinkIndex = mySkin.GetSkinLinkIndex(skinLinksTreeView); + if (shortCutsDataGridView.CurrentRow != null && shortCutsDataGridView.RowCount > 0 && skinLinkIndex >= 0) { - shortCutsDataGridView.Rows[shortCutsDataGridView.CurrentRow.Index].Cells[5].Value = mySkin.SkinLinks[skinLinksListBox.SelectedIndex].Hyperlink.ToString(); - shortCutsDataGridView.Rows[shortCutsDataGridView.CurrentRow.Index].Cells[6].Value = mySkin.SkinLinks[skinLinksListBox.SelectedIndex].HyperlinkParameter; + shortCutsDataGridView.Rows[shortCutsDataGridView.CurrentRow.Index].Cells[5].Value = mySkin.SkinLinks[skinLinkIndex].WindowID.ToString(); + shortCutsDataGridView.Rows[shortCutsDataGridView.CurrentRow.Index].Cells[6].Value = mySkin.SkinLinks[skinLinkIndex].LoadParameter; forceCell = true; shortCutsDataGridView.CurrentCell = shortCutsDataGridView[5, shortCutsDataGridView.CurrentRow.Index]; forceCell = false; Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterForm.resx =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterForm.resx 2013-10-20 17:51:55 UTC (rev 4661) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuterForm.resx 2013-10-20 18:54:25 UTC (rev 4662) @@ -117,75 +117,9 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> - <metadata name="shortCutsDataGridView.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="itemsTabControl.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="linksTabPage.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="skinLinksListBox.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="skinTabPage.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="skinFilesListBox.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="linkPropertiesGroupBox.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="loadParameterGroupBox.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="loadParameterLabel.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="windowIdGroupBox.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="windowIdLabel.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="skinFileGroupBox.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="skinFileLabel.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <value>4, 2</value> </metadata> - <metadata name="updateButton.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="resetButton.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="rowDownButton.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="rowUpButton.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="infoPictureBox.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="rowRemoveButton.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="rowAddButton.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="propLeftPictureBox.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> - <metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> - <value>True</value> - </metadata> <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <value>25</value> </metadata> Modified: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2013-10-20 17:51:55 UTC (rev 4661) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/ShortCuts.cs 2013-10-20 18:54:25 UTC (rev 4662) @@ -19,8 +19,8 @@ private bool _ctrl; //Utilizzo del modificatore "Ctrl" - combinazione di tasti private bool _alt; //Utilizzo del modificatore "Alt" - combinazione di tasti private bool _shift; //Utilizzo del modificatore "Shift" - combinazione di tasti - private int _hyperlink; //Id finestra per visualizzazione in MediaPortal - private string _hyperlinkParameter; //Eventuali parametri aggiuntivi per visualizzazione (sotto-categorie, ecc.) + private int _windowID; //Id finestra per visualizzazione in MediaPortal + private string _loadParameter; //Eventuali parametri di caricamento per visualizzazione (sotto-categorie, ecc.) private string _soundEffect; //File relativo all'eventuale effetto sonoro public static readonly List<Keys> ModifierKeys = new List<Keys>(); //Lista dei tasti modificatori @@ -41,14 +41,14 @@ } public ShortCut() //Costruttore classe ShortCut { - _caption = "ShortCutXX"; //--> inizializzazione titolo - _key = "A"; //--> inizializzazione tasto - _ctrl = true; //--> inizializzazione utilizzo del modificatore "Ctrl" - _alt = false; //--> inizializzazione utilizzo del modificatore "Alt" - _shift = true; //--> inizializzazione utilizzo del modificatore "Shift" - _hyperlink = 0; //--> inizializzazione hyperlink - _hyperlinkParameter = ""; //--> inizializzazione parametri aggiuntivi per visualizzazione - _soundEffect = "click.wav"; //--> inizializzazione effetto sonoro + _caption = "ShortCut"; //--> inizializzazione titolo + _key = "A"; //--> inizializzazione tasto + _ctrl = true; //--> inizializzazione utilizzo del modificatore "Ctrl" + _alt = false; //--> inizializzazione utilizzo del modificatore "Alt" + _shift = true; //--> inizializzazione utilizzo del modificatore "Shift" + _windowID = 0; //--> inizializzazione window ID + _loadParameter = ""; //--> inizializzazione parametri di caricamento per visualizzazione + _soundEffect = "click.wav"; //--> inizializzazione effetto sonoro } #endregion @@ -63,7 +63,7 @@ #region Metodi Pubblici & Eventi public bool IsValid() //Verifica validità dello shortcut { - if ((_ctrl || _alt || _shift) && _hyperlink >= 0) //Per validare lo shortcut deve esserci almeno un modificatore nella combinazione di tasti e l'ID della finestra di MediaPortal deve essere valido + if ((_ctrl || _alt || _shift) && _windowID >= 0) //Per validare lo shortcut deve esserci almeno un modificatore nella combinazione di tasti e l'ID della finestra di MediaPortal deve essere valido { KeysConverter kc = new KeysConverter(); Keys key = new Keys(); @@ -84,9 +84,9 @@ ret += "<ALT>"; if (_shift) ret += "<SHIFT>"; - ret += "<" + _key + ">" + " --> Hyperlink=" + _hyperlink.ToString(); - if (_hyperlinkParameter.Length > 0) - ret += " HyperlinkParameter=[" + _hyperlinkParameter + "]"; + ret += "<" + _key + ">" + " --> WindowID=" + _windowID.ToString(); + if (_loadParameter.Length > 0) + ret += " LoadParameter=[" + _loadParameter + "]"; if (_soundEffect.Length > 0) ret += " SoundEffect=" + _soundEffect; return ret; @@ -95,14 +95,14 @@ #endregion #region Proprietà - public string Caption { get { return this._caption; } set { this._caption = value; this.NotifyPropertyChanged("Caption"); } } - public string Key { get { return this._key; } set { this._key = value; this.NotifyPropertyChanged("Key"); } } - public bool Ctrl { get { return this._ctrl; } set { this._ctrl = value; this.NotifyPropertyChanged("Ctrl"); } } - public bool Alt { get { return this._alt; } set { this._alt = value; this.NotifyPropertyChanged("Alt"); } } - public bool Shift { get { return this._shift; } set { this._shift = value; this.NotifyPropertyChanged("Shift"); } } - public int Hyperlink { get { return this._hyperlink; } set { this._hyperlink = value; this.NotifyPropertyChanged("Hyperlink"); } } - public string HyperlinkParameter { get { return this._hyperlinkParameter; } set { this._hyperlinkParameter = value; this.NotifyPropertyChanged("HyperlinkParameter"); } } - public string SoundEffect { get { return this._soundEffect; } set { this._soundEffect = value; this.NotifyPropertyChanged("SoundEffect"); } } + public string Caption { get { return this._caption; } set { this._caption = value; this.NotifyPropertyChanged("Caption"); } } + public string Key { get { return this._key; } set { this._key = value; this.NotifyPropertyChanged("Key"); } } + public bool Ctrl { get { return this._ctrl; } set { this._ctrl = value; this.NotifyPropertyChanged("Ctrl"); } } + public bool Alt { get { return this._alt; } set { this._alt = value; this.NotifyPropertyChanged("Alt"); } } + public bool Shift { get { return this._shift; } set { this._shift = value; this.NotifyPropertyChanged("Shift"); } } + public int WindowID { get { return this._windowID; } set { this._windowID = value; this.NotifyPropertyChanged("WindowID"); } } + public string LoadParameter { get { return this._loadParameter; } set { this._loadParameter = value; this.NotifyPropertyChanged("LoadParameter"); } } + public string SoundEffect { get { return this._soundEffect; } set { this._soundEffect = value; this.NotifyPropertyChanged("SoundEffect"); } } #endregion } internal class ShortCuts //Classe di gestione degli shortcuts configurati @@ -153,12 +153,12 @@ for (int i = 1; i <= 20; i++) //Iterazione di lettura shortcut { ShortCut sc = new ShortCut(); - sc.Caption = confReader.GetValueAsString(sectionName, capPrefix + string.Format("{0:00}", i), ""); - sc.Key = confReader.GetValueAsString(sectionName, keyPrefix + string.Format("{0:00}", i), "").ToUpper(); - sc.Hyperlink = confReader.GetValueAsInt(sectionName, widPrefix + string.Format("{0:00}", i), -1); - sc.Ctrl = ctrl; - sc.Alt = false; - sc.Shift = shift; + sc.Caption = confReader.GetValueAsString(sectionName, capPrefix + string.Format("{0:00}", i), ""); + sc.Key = confReader.GetValueAsString(sectionName, keyPrefix + string.Format("{0:00}", i), "").ToUpper(); + sc.WindowID = confReader.GetValueAsInt(sectionName, widPrefix + string.Format("{0:00}", i), -1); + sc.Ctrl = ctrl; + sc.Alt = false; + sc.Shift = shift; if (sc.IsValid()) //Se shortcut valido _items.Add(sc); //--> aggiunta dello shortcut nella lista } @@ -219,12 +219,24 @@ innerNode = node.SelectSingleNode("Shift"); if (innerNode != null) sc.Shift = Convert.ToBoolean(Convert.ToInt16(innerNode.InnerText)); - innerNode = node.SelectSingleNode("Hyperlink"); + innerNode = node.SelectSingleNode("WindowID"); if (innerNode != null) - sc.Hyperlink = Convert.ToInt32(innerNode.InnerText); - innerNode = node.SelectSingleNode("HyperlinkParameter"); + sc.WindowID = Convert.ToInt32(innerNode.InnerText); + else + { + innerNode = node.SelectSingleNode("Hyperlink"); //Necessario per compatibilità con file di configurazione V2.0.0.0 + if (innerNode != null) + sc.WindowID = Convert.ToInt32(innerNode.InnerText); + } + innerNode = node.SelectSingleNode("LoadParameter"); if (innerNode != null) - sc.HyperlinkParameter = innerNode.InnerText; + sc.LoadParameter = innerNode.InnerText; + else + { + innerNode = node.SelectSingleNode("HyperlinkParameter"); //Necessario per compatibilità con file di configurazione V2.0.0.0 + if (innerNode != null) + sc.LoadParameter = innerNode.InnerText; + } innerNode = node.SelectSingleNode("SoundEffect"); if (innerNode != null) sc.SoundEffect = innerNode.InnerText; @@ -272,14 +284,14 @@ foreach (ShortCut sc in _items) //Iterazione per salvataggio sortcuts { xmlSettings.WriteStartElement("Item"); - xmlSettings.WriteElementString("Caption", sc.Caption); - xmlSettings.WriteElementString("Key", sc.Key); - xmlSettings.WriteElementString("Ctrl", Convert.ToInt16(sc.Ctrl).ToString()); - xmlSettings.WriteElementString("Alt", Convert.ToInt16(sc.Alt).ToString()); - xmlSettings.WriteElementString("Shift", Convert.ToInt16(sc.Shift).ToString()); - xmlSettings.WriteElementString("Hyperlink", sc.Hyperlink.ToString()); - xmlSettings.WriteElementString("HyperlinkParameter", sc.HyperlinkParameter); - xmlSettings.WriteElementString("SoundEffect", sc.SoundEffect); + xmlSettings.WriteElementString("Caption", sc.Caption); + xmlSettings.WriteElementString("Key", sc.Key); + xmlSettings.WriteElementString("Ctrl", Convert.ToInt16(sc.Ctrl).ToString()); + xmlSettings.WriteElementString("Alt", Convert.ToInt16(sc.Alt).ToString()); + xmlSettings.WriteElementString("Shift", Convert.ToInt16(sc.Shift).ToString()); + xmlSettings.WriteElementString("WindowID", sc.WindowID.ToString()); + xmlSettings.WriteElementString("LoadParameter", sc.LoadParameter); + xmlSettings.WriteElementString("SoundEffect", sc.SoundEffect); xmlSettings.WriteEndElement(); } xmlSettings.WriteEndElement(); Deleted: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/SkinLinks.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/SkinLinks.cs 2013-10-20 17:51:55 UTC (rev 4661) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/SkinLinks.cs 2013-10-20 18:54:25 UTC (rev 4662) @@ -1,112 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Reflection; -using System.Xml; -using My.Common; - -namespace ProcessPlugins.ShortCuter -{ - internal class Skin : MediaPortalSkin //Classe per gestione skin di MediaPortal - { - #region Dati - public struct SkinLink //Struttura dati link della skin - { - public string Caption; //Titolo - public string XmlFile; //Nome del file xml della skin - public int Hyperlink; //Id finestra per visualizzazione in MediaPortal - public string HyperlinkParameter; //Eventuali parametri aggiuntivi per visualizzazione (sotto-categorie, ecc.) - public override string ToString() { return Caption; } //Override metodo ToString per riempire classi ListControl - } - private List<SkinLink> _skinLinks = new List<SkinLink>(); //Lista link più popolari disponibili per la skin - private List<string> _skinSounds = new List<string>(); //Lista effetti sonori della skin - #endregion - - #region Costruttore - public Skin(string skinName, string skinsPath, string cachesPath) : base(skinName, skinsPath, cachesPath, false) - { //Costruttore classe Skin - _initialized = _initialized && GetSkinLinks() && GetSkinSounds(); //--> raccolta link ed effetti sonori della skin - } - #endregion - - #region MetodiPrivati - private bool GetSkinLinks() //Raccolta dei link più popolari disponibili per la skin - { - XmlDocument xmlFile = new XmlDocument(); - try - { - using (Stream streamFile = Assembly.GetExecutingAssembly().GetManifestResourceStream("ProcessPlugins.ShortCuter.XmlFiles.PopularSkinLinks.xml")) - { - xmlFile.Load(streamFile); //Links skin disponibili --> lettura file xml incapsulato - } - } - catch (Exception e) - { - Tools.ErrorMessage("Error loading PopularSkinLinks.xml.", e.Message); - return false; - } - XmlNodeList nodeList = xmlFile.DocumentElement.SelectNodes("/Items/Item"); - foreach (XmlNode node in nodeList) //Iterazione per memorizzazione dati - { - SkinLink skL = new SkinLink(); - XmlNode innerNode = node.SelectSingleNode("Caption"); - if (innerNode != null) - skL.Caption = innerNode.InnerText; - innerNode = node.SelectSingleNode("XmlFile"); - if (innerNode != null) - skL.XmlFile = innerNode.InnerText; - innerNode = node.SelectSingleNode("Hyperlink"); - if (innerNode != null) - skL.Hyperlink = Convert.ToInt32(innerNode.InnerText); - innerNode = node.SelectSingleNode("HyperlinkParameter"); - if (innerNode != null) - skL.HyperlinkParameter = innerNode.InnerText; - - try - { - SkinFile skF = _skinFiles.Find(x => x.Id == skL.Hyperlink); - if (skF.ToString() != null || skL.XmlFile == "-") //Verifica se Hyperlink disponibile negli Ids della skin (o se non specificato file xml - link di sistema) - _skinLinks.Add(skL); //--> aggiunta link nella lista - } - catch { } - } - if (_skinLinks.Count > 0) - return true; //--> raccolta links effettuata - else - { - Tools.ErrorMessage("No skin links found loading PopularSkinLinks.xml."); - return false; - } - } - private bool GetSkinSounds() //Raccolta effetti sonori della skin - { - DirectoryInfo dInfo = new DirectoryInfo(_paths.Sounds); - if (!dInfo.Exists) - { - Tools.ErrorMessage("Skin sounds folder not found!", _paths.Sounds); - return false; - } - foreach (FileInfo fInfo in dInfo.GetFiles()) //Iterazione per applicazione filtro e memorizzazione dati - { - if (fInfo.Extension.ToLower() == ".wav") - _skinSounds.Add(fInfo.Name); //--> aggiunta effetto sonoro nella lista - } - if (_skinSounds.Count > 0) - { - _skinSounds.Insert(0, ""); //--> aggiunta della selezione per nessun effetto sonoro - return true; //--> raccolta effetti sonori effettuata - } - else - { - Tools.ErrorMessage("No sounds found.", _paths.Sounds); - return false; - } - } - #endregion - - #region Proprietà - public List<SkinLink> SkinLinks { get { return this._skinLinks; } } - public List<string> SkinSounds { get { return this._skinSounds; } } - #endregion - } -} Added: trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/SkinWithSounds.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/SkinWithSounds.cs (rev 0) +++ trunk/plugins/ShortCuter&SkinEditor/Source/ShortCuter/SkinWithSounds.cs 2013-10-20 18:54:25 UTC (rev 4662) @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Reflection; +using System.Xml; +using My.Common; + +namespace ProcessPlugins.ShortCuter +{ + internal class Skin : MediaPortalSkin //Classe per gestione skin di MediaPortal + { + #region Dati + private List<string> _skinSounds = new List<string>(); //Lista effetti sonori della skin + #endregion + + #region Costruttore + public Skin(string skinName, string skinsPath, string cachesPath) : base(skinName, skinsPath, cachesPath, false, false) + { //Costruttore classe Skin + _initialized = _initialized && GetSkinSounds(); //--> raccolta effetti sonori della skin + } + #endregion + + #region MetodiPrivati + private bool GetSkinSounds() //Raccolta effetti sonori della skin + { + DirectoryInfo dInfo = new DirectoryInfo(_paths.Sounds); + if (!dInfo.Exists) + { + Tools.ErrorMessage("Skin sounds folder not found!", _paths.Sounds); + return false; + } + foreach (FileInfo fInfo in dInfo.GetFiles()) //Iterazione per applicazione filtro e memorizzazione dati + { + if (fInfo.Extension.ToLower() == ".wav") + _skinSounds.Add(fInfo.Name); //--> aggiunta effetto sonoro nella lista + } + if (_skinSounds.Count > 0) + { + _skinSounds.Insert(0, ""); //--> aggiunta della selezione per nessun effetto sonoro + return true; //--> raccolta effetti sonori effettuata + } + else + { + Tools.ErrorMessage("No sounds found.", _paths.Sounds); + return false; + } + } + #endregion + + #region Proprietà + public List<string> SkinSounds { get { return this._skinSounds; } } + #endregion + } +} Modified: trunk/plugins/ShortCuter&SkinEditor/Source/XtremeMenuEditor/BHEditorForm.cs =================================================================== --- trunk/plugins/ShortCuter&SkinEditor/Source/XtremeMenuEditor/BHEditorForm.cs 2013-10-20 17:51:55 UTC (rev 4661) +++ trunk/plugins/ShortCuter&SkinEditor/Source/XtremeMenuEditor/BHEditorForm.cs 2013-10-20 18:54:25 UTC (rev 4662) @@ -110,7 +110,6 @@ case "skinLinksTreeView": //Lista links predefiniti della skin propertiesGroupBox.Text = propBoxText + " (Default Links)"; labelTextBox.Enabled= true; - labelTextBox.Text = myMediaPortal.SelectedSkin.SkinLinks[selectedIndex].Context; captionTextBox.Text = myMediaPortal.SelectedSkin.SkinLinks[selectedIndex].Caption; skinFileShowLabel.Text = myMediaPortal.SelectedSkin.SkinLinks[selectedIndex].XmlFile; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |