From: <an...@us...> - 2007-04-25 05:00:39
|
Revision: 343 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=343&view=rev Author: and-81 Date: 2007-04-24 22:00:30 -0700 (Tue, 24 Apr 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/MCEReplacement/Forms/GoToScreen.Designer.cs trunk/plugins/MCEReplacement/MCEReplacement.cs Modified: trunk/plugins/MCEReplacement/Forms/GoToScreen.Designer.cs =================================================================== --- trunk/plugins/MCEReplacement/Forms/GoToScreen.Designer.cs 2007-04-19 14:45:34 UTC (rev 342) +++ trunk/plugins/MCEReplacement/Forms/GoToScreen.Designer.cs 2007-04-25 05:00:30 UTC (rev 343) @@ -38,17 +38,18 @@ // this.comboBoxScreen.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.comboBoxScreen.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBoxScreen.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend; + this.comboBoxScreen.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems; this.comboBoxScreen.FormattingEnabled = true; this.comboBoxScreen.Location = new System.Drawing.Point(8, 24); this.comboBoxScreen.Name = "comboBoxScreen"; - this.comboBoxScreen.Size = new System.Drawing.Size(280, 21); + this.comboBoxScreen.Size = new System.Drawing.Size(248, 21); this.comboBoxScreen.TabIndex = 0; // // buttonOK // this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.buttonOK.Location = new System.Drawing.Point(152, 56); + this.buttonOK.Location = new System.Drawing.Point(120, 56); this.buttonOK.Name = "buttonOK"; this.buttonOK.Size = new System.Drawing.Size(64, 24); this.buttonOK.TabIndex = 1; @@ -60,7 +61,7 @@ // this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.buttonCancel.Location = new System.Drawing.Point(224, 56); + this.buttonCancel.Location = new System.Drawing.Point(192, 56); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(64, 24); this.buttonCancel.TabIndex = 2; @@ -74,7 +75,7 @@ | System.Windows.Forms.AnchorStyles.Right))); this.labelScreen.Location = new System.Drawing.Point(8, 8); this.labelScreen.Name = "labelScreen"; - this.labelScreen.Size = new System.Drawing.Size(280, 16); + this.labelScreen.Size = new System.Drawing.Size(248, 16); this.labelScreen.TabIndex = 3; this.labelScreen.Text = "Screen:"; // @@ -84,14 +85,14 @@ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.CancelButton = this.buttonCancel; - this.ClientSize = new System.Drawing.Size(296, 89); + this.ClientSize = new System.Drawing.Size(264, 89); this.Controls.Add(this.labelScreen); this.Controls.Add(this.buttonCancel); this.Controls.Add(this.buttonOK); this.Controls.Add(this.comboBoxScreen); this.MaximizeBox = false; this.MinimizeBox = false; - this.MinimumSize = new System.Drawing.Size(270, 116); + this.MinimumSize = new System.Drawing.Size(272, 123); this.Name = "GoToScreen"; this.ShowIcon = false; this.ShowInTaskbar = false; Modified: trunk/plugins/MCEReplacement/MCEReplacement.cs =================================================================== --- trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-04-19 14:45:34 UTC (rev 342) +++ trunk/plugins/MCEReplacement/MCEReplacement.cs 2007-04-25 05:00:30 UTC (rev 343) @@ -38,7 +38,7 @@ public const string IRExtension = ".IR"; public const string MacroExtension = ".MACRO"; - // Plugin Commands + // Macro Commands public const string RunCommandPrefix = "Run: "; public const string BlastCommandPrefix = "Blast: "; public const string PauseCommandPrefix = "Pause: "; @@ -412,7 +412,6 @@ if (LogVerbose) Log.Info("MCEReplacement: Started"); } - public void Stop() { if (LogVerbose) @@ -2160,27 +2159,6 @@ return ProcessGoTo(command.Substring(GoToCommandPrefix.Length)); } - - - - - /* - public const string SetMapCommandPrefix = "Multi-Mapping: "; - public const string SetMouseCommandPrefix = "Mouse Mode: "; - public const string InputLayerCommand = "Toggle Input Layer"; - public const string WindowStateCommand = "Toggle Window State"; - public const string GetFocusCommand = "Get Focus"; - - public const string ExitCommand = "Exit MediaPortal"; -public const string StandByCommand = "Standby"; -public const string HibernateCommand = "Hibernate"; -public const string RebootCommand = "Reboot"; -public const string ShutdownCommand = "Shutdown"; - */ - - - - Log.Error("MCEReplacement: Unprocessed command \"{0}\"", command); return false; } @@ -2323,16 +2301,41 @@ try { - GUIWindow.Window window = (GUIWindow.Window)Enum.Parse(typeof(GUIWindow.Window), "WINDOW_" + screen); + int window = (int)GUIWindow.Window.WINDOW_INVALID; - if (window == GUIWindow.Window.WINDOW_HOME && MP_BasicHome) - window = GUIWindow.Window.WINDOW_SECOND_HOME; + try + { + window = (int)Enum.Parse(typeof(GUIWindow.Window), "WINDOW_" + screen); + } + catch + { + // Parsing the window id as a GUIWindow.Window failed, so parse it as an int + } + try + { + if (window == (int)GUIWindow.Window.WINDOW_INVALID) + window = Convert.ToInt32(screen); + } + catch + { + // Parsing the window id as an int failed, give up. + } + + if (window == (int)GUIWindow.Window.WINDOW_INVALID) + { + Log.Error("MCEReplacement: Failed to parse Goto command window id \"{0}\"", screen); + return false; + } + + if (window == (int)GUIWindow.Window.WINDOW_HOME && MP_BasicHome) + window = (int)GUIWindow.Window.WINDOW_SECOND_HOME; + if (LogVerbose) - Log.Info("MCEReplacement: Go To Window \"{0}\"", Enum.GetName(typeof(GUIWindow.Window), window)); + Log.Info("MCEReplacement: Go To Window \"{0}\"", window); GUIGraphicsContext.ResetLastActivity(); - GUIWindowManager.SendThreadMessage(new GUIMessage(GUIMessage.MessageType.GUI_MSG_GOTO_WINDOW, 0, 0, 0, (int)window, 0, null)); + GUIWindowManager.SendThreadMessage(new GUIMessage(GUIMessage.MessageType.GUI_MSG_GOTO_WINDOW, 0, 0, 0, window, 0, null)); } catch (Exception ex) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |