From: <mis...@us...> - 2007-02-21 20:39:21
|
Revision: 130 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=130&view=rev Author: misterd_sf Date: 2007-02-21 12:39:12 -0800 (Wed, 21 Feb 2007) Log Message: ----------- MPlayer: Updated documentation Added possibility to change the displayed name of the gui plugin Changed behaviour of gui plugin to prevent that the plugin doesn't go back to root folder. Modified Paths: -------------- trunk/plugins/My MPlayer/Liesmich.pdf trunk/plugins/My MPlayer/MPlayer_GUIPlugin/ConfigurationForm.Designer.cs trunk/plugins/My MPlayer/MPlayer_GUIPlugin/ConfigurationForm.cs trunk/plugins/My MPlayer/MPlayer_GUIPlugin/MPlayer_GUIPlugin.cs trunk/plugins/My MPlayer/Readme.pdf Modified: trunk/plugins/My MPlayer/Liesmich.pdf =================================================================== (Binary files differ) Modified: trunk/plugins/My MPlayer/MPlayer_GUIPlugin/ConfigurationForm.Designer.cs =================================================================== --- trunk/plugins/My MPlayer/MPlayer_GUIPlugin/ConfigurationForm.Designer.cs 2007-02-21 20:13:55 UTC (rev 129) +++ trunk/plugins/My MPlayer/MPlayer_GUIPlugin/ConfigurationForm.Designer.cs 2007-02-21 20:39:12 UTC (rev 130) @@ -58,11 +58,13 @@ this.shareList = new System.Windows.Forms.ListBox(); this.browseButton = new System.Windows.Forms.Button(); this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.pluginName = new System.Windows.Forms.TextBox(); this.SuspendLayout(); // // okButton // - this.okButton.Location = new System.Drawing.Point(12, 211); + this.okButton.Location = new System.Drawing.Point(12, 237); this.okButton.Name = "okButton"; this.okButton.Size = new System.Drawing.Size(75, 23); this.okButton.TabIndex = 3; @@ -73,7 +75,7 @@ // cancelButton // this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.cancelButton.Location = new System.Drawing.Point(322, 211); + this.cancelButton.Location = new System.Drawing.Point(322, 237); this.cancelButton.Name = "cancelButton"; this.cancelButton.Size = new System.Drawing.Size(75, 23); this.cancelButton.TabIndex = 20; @@ -87,7 +89,7 @@ // // shareLocation // - this.shareLocation.Location = new System.Drawing.Point(90, 181); + this.shareLocation.Location = new System.Drawing.Point(90, 210); this.shareLocation.Name = "shareLocation"; this.shareLocation.Size = new System.Drawing.Size(207, 20); this.shareLocation.TabIndex = 33; @@ -96,7 +98,7 @@ // label24 // this.label24.AutoSize = true; - this.label24.Location = new System.Drawing.Point(12, 184); + this.label24.Location = new System.Drawing.Point(12, 213); this.label24.Name = "label24"; this.label24.Size = new System.Drawing.Size(48, 13); this.label24.TabIndex = 32; @@ -105,7 +107,7 @@ // label23 // this.label23.AutoSize = true; - this.label23.Location = new System.Drawing.Point(12, 158); + this.label23.Location = new System.Drawing.Point(12, 187); this.label23.Name = "label23"; this.label23.Size = new System.Drawing.Size(38, 13); this.label23.TabIndex = 31; @@ -113,7 +115,7 @@ // // shareName // - this.shareName.Location = new System.Drawing.Point(90, 155); + this.shareName.Location = new System.Drawing.Point(90, 184); this.shareName.Name = "shareName"; this.shareName.Size = new System.Drawing.Size(207, 20); this.shareName.TabIndex = 30; @@ -121,7 +123,7 @@ // // shareDelete // - this.shareDelete.Location = new System.Drawing.Point(90, 126); + this.shareDelete.Location = new System.Drawing.Point(90, 155); this.shareDelete.Name = "shareDelete"; this.shareDelete.Size = new System.Drawing.Size(75, 23); this.shareDelete.TabIndex = 29; @@ -131,7 +133,7 @@ // // shareAdd // - this.shareAdd.Location = new System.Drawing.Point(12, 126); + this.shareAdd.Location = new System.Drawing.Point(12, 155); this.shareAdd.Name = "shareAdd"; this.shareAdd.Size = new System.Drawing.Size(75, 23); this.shareAdd.TabIndex = 28; @@ -142,7 +144,7 @@ // shareList // this.shareList.FormattingEnabled = true; - this.shareList.Location = new System.Drawing.Point(12, 25); + this.shareList.Location = new System.Drawing.Point(12, 54); this.shareList.Name = "shareList"; this.shareList.Size = new System.Drawing.Size(385, 95); this.shareList.TabIndex = 27; @@ -150,7 +152,7 @@ // // browseButton // - this.browseButton.Location = new System.Drawing.Point(322, 179); + this.browseButton.Location = new System.Drawing.Point(322, 208); this.browseButton.Name = "browseButton"; this.browseButton.Size = new System.Drawing.Size(75, 23); this.browseButton.TabIndex = 34; @@ -161,17 +163,35 @@ // label1 // this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(9, 9); + this.label1.Location = new System.Drawing.Point(9, 32); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(74, 13); this.label1.TabIndex = 35; this.label1.Text = "List of Shares:"; // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(9, 12); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(170, 13); + this.label2.TabIndex = 36; + this.label2.Text = "Name of plugin displayed in Home:"; + // + // pluginName + // + this.pluginName.Location = new System.Drawing.Point(185, 9); + this.pluginName.Name = "pluginName"; + this.pluginName.Size = new System.Drawing.Size(212, 20); + this.pluginName.TabIndex = 37; + // // ConfigurationForm // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.CancelButton = this.cancelButton; - this.ClientSize = new System.Drawing.Size(409, 245); + this.ClientSize = new System.Drawing.Size(409, 274); + this.Controls.Add(this.pluginName); + this.Controls.Add(this.label2); this.Controls.Add(this.label1); this.Controls.Add(this.browseButton); this.Controls.Add(this.shareLocation); @@ -215,6 +235,8 @@ private System.Windows.Forms.ListBox shareList; private System.Windows.Forms.Button browseButton; private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox pluginName; } } \ No newline at end of file Modified: trunk/plugins/My MPlayer/MPlayer_GUIPlugin/ConfigurationForm.cs =================================================================== --- trunk/plugins/My MPlayer/MPlayer_GUIPlugin/ConfigurationForm.cs 2007-02-21 20:13:55 UTC (rev 129) +++ trunk/plugins/My MPlayer/MPlayer_GUIPlugin/ConfigurationForm.cs 2007-02-21 20:39:12 UTC (rev 130) @@ -193,6 +193,9 @@ share.Path = nodeShare.Attributes["path"].Value; shareList.Items.Add(share); } + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { + pluginName.Text = xmlreader.GetValueAsString("mplayer", "displayNameOfGUI", "My MPlayer GUI"); + } } catch (Exception e) { Log.Info("MPlayer GUI Error: Configuration could not be loaded: " + e.Message); } @@ -222,6 +225,13 @@ writer.WriteEndElement(); //</mplayer> writer.WriteEndDocument(); writer.Close(); + using (MediaPortal.Profile.Settings xmlWriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { + if (pluginName.Text.Equals(String.Empty)) { + xmlWriter.SetValue("mplayer", "displayNameOfGUI", "My MPlayer"); + } else { + xmlWriter.SetValue("mplayer", "displayNameOfGUI", pluginName.Text); + } + } } #endregion Modified: trunk/plugins/My MPlayer/MPlayer_GUIPlugin/MPlayer_GUIPlugin.cs =================================================================== --- trunk/plugins/My MPlayer/MPlayer_GUIPlugin/MPlayer_GUIPlugin.cs 2007-02-21 20:13:55 UTC (rev 129) +++ trunk/plugins/My MPlayer/MPlayer_GUIPlugin/MPlayer_GUIPlugin.cs 2007-02-21 20:39:12 UTC (rev 130) @@ -127,6 +127,15 @@ /// </summary> private static PlayListPlayer playlistPlayer; + /// <summary> + /// Current virtual Path + /// </summary> + private string virtualPath; + + /// <summary> + /// Display name of the plugin + /// </summary> + private string displayName; #endregion #region ctor @@ -134,7 +143,6 @@ /// Static Constructor for the Playlistplayer instance /// </summary> static MPlayer_GUIPlugin() { - playlistPlayer = PlayListPlayer.SingletonPlayer; } @@ -143,6 +151,10 @@ /// </summary> public MPlayer_GUIPlugin() { GetID = 9533; + virtualPath = String.Empty; + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { + displayName = xmlreader.GetValueAsString("mplayer", "displayNameOfGUI", "My MPlayer"); + } } #endregion @@ -177,6 +189,30 @@ /// <returns>true, if init was successful</returns> public override bool Init() { bool bResult = Load(GUIGraphicsContext.Skin + @"\myMPlayer.xml"); + m_directory.SetExtensions(getExtenstions()); + m_directory.Clear(); + Share share = null; + string[] drives = Environment.GetLogicalDrives(); + foreach (string driveElement in drives) { + if (Utils.getDriveType(driveElement) == 5) { + string driveLetter = driveElement.Substring(0, 1); + share = new Share(); + share.Name = driveLetter + ":\\"; + share.Path = driveLetter + ":\\"; + m_directory.Add(share); + } + } + XmlDocument doc = new XmlDocument(); + string path = Config.GetFile(Config.Dir.Config, "MPlayer_GUIPlugin.xml"); + doc.Load(path); + XmlNodeList listShare = doc.DocumentElement.SelectNodes("/mplayergui/Share"); + foreach (XmlNode nodeShare in listShare) { + share = new Share(); + share.Name = nodeShare.Attributes["name"].Value; + share.Path = nodeShare.Attributes["path"].Value; + m_directory.Add(share); + } + return bResult; } @@ -400,6 +436,7 @@ if ((item.IsFolder) && (!isFolderAMovie)) { //currentSelectedItem = -1; + virtualPath = path; LoadDirectory(path); } else { string movieFileName = path + ".mplayer"; @@ -491,31 +528,7 @@ GUIVideoOverlay videoOverlay = (GUIVideoOverlay)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_VIDEO_OVERLAY); if ((videoOverlay != null) && (videoOverlay.Focused)) videoOverlay.Focused = false; - m_directory.SetExtensions(getExtenstions()); - m_directory.Clear(); - Share share = null; - string[] drives = Environment.GetLogicalDrives(); - foreach (string driveElement in drives) { - if (Utils.getDriveType(driveElement) == 5) { - string driveLetter = driveElement.Substring(0, 1); - share = new Share(); - share.Name = driveLetter + ":\\"; - share.Path = driveLetter + ":\\"; - m_directory.Add(share); - } - } - XmlDocument doc = new XmlDocument(); - string path = Config.GetFile(Config.Dir.Config,"MPlayer_GUIPlugin.xml"); - doc.Load(path); - XmlNodeList listShare = doc.DocumentElement.SelectNodes("/mplayergui/Share"); - foreach (XmlNode nodeShare in listShare) { - share = new Share(); - share.Name = nodeShare.Attributes["name"].Value; - share.Path = nodeShare.Attributes["path"].Value; - m_directory.Add(share); - } - - LoadDirectory(""); + LoadDirectory(virtualPath); if (btnSortBy != null) { btnSortBy.SortChanged += new SortEventHandler(SortChanged); } @@ -682,7 +695,7 @@ /// <param name="strPictureImage">Hover image of the plugin</param> /// <returns>true, if it should be display in menu</returns> public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) { - strButtonText = PluginName(); + strButtonText = displayName; strButtonImage = String.Empty; strButtonImageFocus = String.Empty; strPictureImage = "hover_my videos.png"; Modified: trunk/plugins/My MPlayer/Readme.pdf =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |