X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2FLibCecTray%2Fcontroller%2Fapplications%2FApplicationController.cs;h=ae9a226f26cfba18f7bc84b94ee68404d08ff710;hb=bfea6e0a8ee4bc9e40c64ea68f22db69ac3cb26f;hp=f36bd6ae7efaeda194fba55558400e6073fe26ba;hpb=f4729954da8ed049a6bc5ea6bbd72e30f158ddc9;p=deb_libcec.git diff --git a/src/LibCecTray/controller/applications/ApplicationController.cs b/src/LibCecTray/controller/applications/ApplicationController.cs index f36bd6a..ae9a226 100644 --- a/src/LibCecTray/controller/applications/ApplicationController.cs +++ b/src/LibCecTray/controller/applications/ApplicationController.cs @@ -1,7 +1,7 @@ /* * This file is part of the libCEC(R) library. * - * libCEC(R) is Copyright (C) 2011-2012 Pulse-Eight Limited. All rights reserved. + * libCEC(R) is Copyright (C) 2011-2013 Pulse-Eight Limited. All rights reserved. * libCEC(R) is an original work, containing original code. * * libCEC(R) is a trademark of Pulse-Eight Limited. @@ -114,7 +114,20 @@ namespace LibCECTray.controller.applications var item = args.RowIndex < ButtonConfig.Count ? ButtonConfig[args.RowIndex] : null; if (item == null) return; - (new CecButtonConfigUI(item)).ShowDialog(); + if (args.ColumnIndex >= 0) + { + (new CecButtonConfigUI(item)).ShowDialog(); + } + else + { + var mappedButton = ButtonConfig[item.Key]; + if (mappedButton == null || mappedButton.Value.Empty()) + return; + + var controlWindow = FindInstance(); + if (controlWindow != IntPtr.Zero && item.Key.Duration == 0) + mappedButton.Value.Transmit(controlWindow); + } }; foreach (var item in _buttonConfig) @@ -208,7 +221,7 @@ namespace LibCECTray.controller.applications ApplicationRunningChanged(isRunning); _applicationRunning = isRunning; - UiControl.SetStartButtonEnabled(isRunning && !SuppressApplicationStart); + UiControl.SetStartButtonEnabled(!isRunning && !SuppressApplicationStart); } #endregion @@ -235,7 +248,7 @@ namespace LibCECTray.controller.applications return false; var controlWindow = FindInstance(); - if (controlWindow != IntPtr.Zero && key.Duration == 0) + if (controlWindow != IntPtr.Zero && (key.Duration == 0 || key.Duration > 500)) return mappedButton.Value.Transmit(controlWindow); return false;