From: <an...@us...> - 2008-03-31 05:10:13
|
Revision: 1571 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1571&view=rev Author: and-81 Date: 2008-03-30 22:10:08 -0700 (Sun, 30 Mar 2008) Log Message: ----------- Modified Paths: -------------- trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs trunk/plugins/IR Server Suite/Documentation/new.html trunk/plugins/IR Server Suite/setup-languages.nsh trunk/plugins/IR Server Suite/setup.nsi trunk/plugins/TelnetInterface/TelnetInterface.cs Modified: trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs =================================================================== --- trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs 2008-03-31 02:20:01 UTC (rev 1570) +++ trunk/plugins/IR Server Suite/Common/IrssUtils/Common.cs 2008-03-31 05:10:08 UTC (rev 1571) @@ -495,7 +495,7 @@ process.StartInfo.WindowStyle = (ProcessWindowStyle)Enum.Parse(typeof(ProcessWindowStyle), commands[3], true); process.StartInfo.CreateNoWindow = bool.Parse(commands[4]); process.StartInfo.UseShellExecute = bool.Parse(commands[5]); - //process.PriorityClass = ProcessPriorityClass. + //process.PriorityClass = ProcessPriorityClass. bool waitForExit = bool.Parse(commands[6]); bool forceFocus = bool.Parse(commands[7]); @@ -505,12 +505,10 @@ // Give new process focus ... if (forceFocus && !process.StartInfo.CreateNoWindow && process.StartInfo.WindowStyle != ProcessWindowStyle.Hidden) { - process.WaitForInputIdle(15000); - Thread focusForcer = new Thread(new ParameterizedThreadStart(FocusForcer)); focusForcer.Name = String.Format("Focus Forcer: {0}", process.MainWindowTitle); focusForcer.IsBackground = true; - focusForcer.Start(process.MainWindowTitle); + focusForcer.Start(process); /* int attempt = 0; @@ -534,11 +532,15 @@ static void FocusForcer(object processObj) { - string title = processObj as string; + Process process = processObj as Process; - if (title == null) - throw new ArgumentException("Argument is not a string object", "processObj"); + if (process == null) + throw new ArgumentException("Argument is not a Process object", "processObj"); + process.WaitForInputIdle(15000); + + string title = process.MainWindowTitle; + IntPtr windowHandle; while ((windowHandle = Win32.FindWindowByTitle(title)) != IntPtr.Zero) Modified: trunk/plugins/IR Server Suite/Documentation/new.html =================================================================== --- trunk/plugins/IR Server Suite/Documentation/new.html 2008-03-31 02:20:01 UTC (rev 1570) +++ trunk/plugins/IR Server Suite/Documentation/new.html 2008-03-31 05:10:08 UTC (rev 1571) @@ -65,6 +65,7 @@ <LI>Installer: More installer improvements thanks to Chef_Koch.</LI> <LI>Installer: Added a required file for Technotrend remote.</LI> <LI>Abstract Remote Model: Corrected a bug in the Abstract Remote Map for MP Control Plugin.</LI> +<LI>Run Command: Fixed a Force Focus bug.</LI> </UL></P> <BR> Modified: trunk/plugins/IR Server Suite/setup-languages.nsh =================================================================== --- trunk/plugins/IR Server Suite/setup-languages.nsh 2008-03-31 02:20:01 UTC (rev 1570) +++ trunk/plugins/IR Server Suite/setup-languages.nsh 2008-03-31 05:10:08 UTC (rev 1571) @@ -31,19 +31,21 @@ # ENGLISH LangString DESC_SectionInputService ${LANG_ENGLISH} "A windows service that provides access to your IR devices." +LangString DESC_SectionGroupMP ${LANG_ENGLISH} "MediaPortal plugins." LangString DESC_SectionMPControlPlugin ${LANG_ENGLISH} "Connects to the Input Service to control MediaPortal." LangString DESC_SectionMPBlastZonePlugin ${LANG_ENGLISH} "Lets you control your IR devices from within the MediaPortal GUI." LangString DESC_SectionTV2BlasterPlugin ${LANG_ENGLISH} "For tuning external channels (on Set Top Boxes) with the default MediaPortal TV engine." +LangString DESC_SectionGroupTV3 ${LANG_ENGLISH} "MediaPortal TV Server plugins." LangString DESC_SectionTV3BlasterPlugin ${LANG_ENGLISH} "For tuning external channels (on Set Top Boxes) with the MediaPortal TV server." LangString DESC_SectionTranslator ${LANG_ENGLISH} "Control your whole PC." -LangString DESC_SectionTrayLauncher ${LANG_ENGLISH} "Simple tray application to launch an application of your choosing when a particular button is pressed." -LangString DESC_SectionVirtualRemote ${LANG_ENGLISH} "Simulated remote control, works as an application or as a web hosted remote control (with included Web Remote). Also includes a Skin Editor and Smart Device versions of Virtual Remote." +LangString DESC_SectionTrayLauncher ${LANG_ENGLISH} "Simple program to launch an application of your choosing when a particular button is pressed." +LangString DESC_SectionVirtualRemote ${LANG_ENGLISH} "Simulated remote control. Includes PC application, web, and Smart Devices versions." LangString DESC_SectionIRBlast ${LANG_ENGLISH} "Command line tools for blasting IR codes." LangString DESC_SectionIRFileTool ${LANG_ENGLISH} "Tool for learning, modifying, testing, correcting and converting IR command files." LangString DESC_SectionKeyboardInputRelay ${LANG_ENGLISH} "Relays keyboard input to the Input Service to act on keypresses like remote buttons." LangString DESC_SectionDboxTuner ${LANG_ENGLISH} "Command line tuner for Dreambox devices." LangString DESC_SectionHcwPvrTuner ${LANG_ENGLISH} "Command line tuner for Hauppauge PVR devices." -LangString DESC_SectionDebugClient ${LANG_ENGLISH} "Very simple testing tool for troubleshooting input and communications problems." +LangString DESC_SectionDebugClient ${LANG_ENGLISH} "Simple testing tool for troubleshooting input and communications problems." LangString ^UninstallLink ${LANG_ENGLISH} "Uninstall $(^Name)" @@ -51,7 +53,7 @@ LangString TEXT_MSGBOX_REMOVE_ALL ${LANG_ENGLISH} "Do you want to remove your User settings?$\r$\nAttention: This will remove all your customised settings including Skins and Databases." LangString TEXT_MSGBOX_ERROR_DOTNET ${LANG_ENGLISH} "Microsoft .Net Framework Runtime is a prerequisite. Please install first." -LangString TEXT_MSGBOX_ERROR_WIN ${LANG_ENGLISH} "MediaPortal requires at least Windows XP. Your Windows is not supported. Installation aborted" -LangString TEXT_MSGBOX_ERROR_IS_INSTALLED ${LANG_ENGLISH} "MediaPortal is already installed. You need to uninstall it, before you continue with the installation.$\r$\nUninstall will be lunched when pressing OK." +LangString TEXT_MSGBOX_ERROR_WIN ${LANG_ENGLISH} "$(^Name) requires at least Windows XP. Your Windows is not supported. Installation aborted" +LangString TEXT_MSGBOX_ERROR_IS_INSTALLED ${LANG_ENGLISH} "$(^Name) is already installed. You need to uninstall it, before you continue with the installation.$\r$\nUninstall will be lunched when pressing OK." LangString TEXT_MSGBOX_ERROR_ON_UNINSTALL ${LANG_ENGLISH} "An error occured while trying to uninstall old version!$\r$\nDo you still want to continue the installation?" -LangString TEXT_MSGBOX_ERROR_REBOOT_REQUIRED ${LANG_ENGLISH} "REBOOT IS REQUIRED. DO THAT!!!!" +LangString TEXT_MSGBOX_ERROR_REBOOT_REQUIRED ${LANG_ENGLISH} "You must reboot your computer to continue the installation." Modified: trunk/plugins/IR Server Suite/setup.nsi =================================================================== --- trunk/plugins/IR Server Suite/setup.nsi 2008-03-31 02:20:01 UTC (rev 1570) +++ trunk/plugins/IR Server Suite/setup.nsi 2008-03-31 05:10:08 UTC (rev 1571) @@ -97,7 +97,7 @@ #!define MUI_HEADERIMAGE_RIGHT !define MUI_COMPONENTSPAGE_SMALLDESC -!define MUI_FINISHPAGE_NOAUTOCLOSE +!define MUI_FINISHPAGE_AUTOCLOSE ;!define MUI_FINISHPAGE_RUN "$INSTDIR\Input Service Configuration\Input Service Configuration.exe" ;!define MUI_FINISHPAGE_RUN_TEXT "Input Service Configuration" @@ -1321,10 +1321,12 @@ ; Section descriptions !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_DESCRIPTION_TEXT ${SectionInputService} "$(DESC_SectionInputService)" - !insertmacro MUI_DESCRIPTION_TEXT ${SectionMPControlPlugin} "$(DESC_SectionMPControlPlugin)" - !insertmacro MUI_DESCRIPTION_TEXT ${SectionMPBlastZonePlugin} "$(DESC_SectionMPBlastZonePlugin)" - !insertmacro MUI_DESCRIPTION_TEXT ${SectionTV2BlasterPlugin} "$(DESC_SectionTV2BlasterPlugin)" - !insertmacro MUI_DESCRIPTION_TEXT ${SectionTV3BlasterPlugin} "$(DESC_SectionTV3BlasterPlugin)" + !insertmacro MUI_DESCRIPTION_TEXT ${SectionGroupMP} "$(DESC_SectionGroupMP)" + !insertmacro MUI_DESCRIPTION_TEXT ${SectionMPControlPlugin} "$(DESC_SectionMPControlPlugin)" + !insertmacro MUI_DESCRIPTION_TEXT ${SectionMPBlastZonePlugin} "$(DESC_SectionMPBlastZonePlugin)" + !insertmacro MUI_DESCRIPTION_TEXT ${SectionTV2BlasterPlugin} "$(DESC_SectionTV2BlasterPlugin)" + !insertmacro MUI_DESCRIPTION_TEXT ${SectionGroupTV3} "$(DESC_SectionGroupTV3)" + !insertmacro MUI_DESCRIPTION_TEXT ${SectionTV3BlasterPlugin} "$(DESC_SectionTV3BlasterPlugin)" !insertmacro MUI_DESCRIPTION_TEXT ${SectionTranslator} "$(DESC_SectionTranslator)" !insertmacro MUI_DESCRIPTION_TEXT ${SectionTrayLauncher} "$(DESC_SectionTrayLauncher)" !insertmacro MUI_DESCRIPTION_TEXT ${SectionVirtualRemote} "$(DESC_SectionVirtualRemote)" Modified: trunk/plugins/TelnetInterface/TelnetInterface.cs =================================================================== --- trunk/plugins/TelnetInterface/TelnetInterface.cs 2008-03-31 02:20:01 UTC (rev 1570) +++ trunk/plugins/TelnetInterface/TelnetInterface.cs 2008-03-31 05:10:08 UTC (rev 1571) @@ -35,6 +35,8 @@ bool _processConnectionThread; + List<Socket> _activeSockets; + #endregion Variables #region IPlugin Members @@ -46,9 +48,13 @@ { _serverPort = 23; _processConnectionThread = true; - + + GUIWindowManager.Receivers += new SendMessageHandler(OnMessage); + try { + _activeSockets = new List<Socket>(); + _localEndPoint = new IPEndPoint(IPAddress.Any, _serverPort); _serverSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); @@ -78,12 +84,19 @@ { _processConnectionThread = false; + lock (_activeSockets) + foreach (Socket socket in _activeSockets) + socket.Close(); + + if (_serverSocket != null) _serverSocket.Close(); - _serverSocket = null; - _localEndPoint = null; + _serverSocket = null; + _localEndPoint = null; _connectionThread = null; + + GUIWindowManager.Receivers -= new SendMessageHandler(OnMessage); } #endregion IPlugin Members @@ -95,14 +108,6 @@ public bool DefaultEnabled() { return true; } public string Description() { return "Provides a telnet interface to control and interact with MediaPortal"; } - /// <summary> - /// Gets the home screen details for the plugin. - /// </summary> - /// <param name="strButtonText">The button text.</param> - /// <param name="strButtonImage">The button image.</param> - /// <param name="strButtonImageFocus">The button image focus.</param> - /// <param name="strPictureImage">The picture image.</param> - /// <returns>true if the plugin can be seen, otherwise false.</returns> public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) { strButtonText = strButtonImage = strButtonImageFocus = strPictureImage = String.Empty; @@ -123,6 +128,21 @@ #endregion ISetupForm Members + void OnMessage(GUIMessage msg) + { + string message = String.Format("MediaPortal Message: {0} - {1}, {2}", Enum.GetName(typeof(GUIMessage.MessageType), msg.Message), msg.Label, msg.Param1); + + SocketSendAll(message); + } + + + void SocketSendAll(string text) + { + lock (_activeSockets) + foreach (Socket socket in _activeSockets) + SocketSend(socket, text); + } + void SocketSend(Socket socket, string text) { byte[] textBytes = Encoding.ASCII.GetBytes(text + "\n\r"); @@ -138,6 +158,9 @@ Socket socket = _serverSocket.Accept(); socket.Blocking = true; + lock (_activeSockets) + _activeSockets.Add(socket); + SocketSend(socket, "MediaPortal Telnet Interface"); Thread communicationThread = new Thread(new ParameterizedThreadStart(CommunicationThread)); @@ -201,10 +224,14 @@ { Log.Error(ex); } + finally + { + lock (_activeSockets) + _activeSockets.Remove(socket); + } } - void ProcessCommand(Socket socket, string text) { string[] words = text.Split(' '); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |