cec-config-gui: set cbPortNumber enabled when the physical address override isn't...
[deb_libcec.git] / src / cec-config-gui / actions / ShowDeviceInfo.cs
index 61dd35f6461cde35b51914342ec65411c1b7ccb2..628d4a9829a44d24faa3b4dcff8804b83976650e 100644 (file)
@@ -7,12 +7,21 @@ namespace CecConfigGui.actions
 {
   class ShowDeviceInfo : UpdateProcess
   {
-    public ShowDeviceInfo(ref LibCecSharp lib, CecLogicalAddress address)
+    public ShowDeviceInfo(CecConfigGUI gui, ref LibCecSharp lib, CecLogicalAddress address)
     {
+      Gui = gui;
       Lib = lib;
       Address = address;
     }
 
+    public virtual void ShowDialog(CecConfigGUI gui, CecLogicalAddress address, ref LibCecSharp lib,
+      bool devicePresent, CecVendorId vendor, bool isActiveSource, ushort physicalAddress,
+      CecVersion version, CecPowerStatus power, string osdName, string menuLanguage)
+    {
+      DeviceInformation di = new DeviceInformation(Gui, Address, ref Lib, devicePresent, vendor, isActiveSource, physicalAddress, version, power, osdName, menuLanguage);
+      Gui.DisplayDialog(di, false);
+    }
+
     public override void Process()
     {
       CecVendorId vendor = CecVendorId.Unknown;
@@ -60,14 +69,15 @@ namespace CecConfigGui.actions
 
       SendEvent(UpdateEventType.StatusText, "Showing device information");
       SendEvent(UpdateEventType.ProgressBar, 90);
+      SendEvent(UpdateEventType.ProcessCompleted, true);
 
-      DeviceInformation di = new DeviceInformation(Address, ref Lib, devicePresent, vendor, isActiveSource, physicalAddress, version, power, osdName, menuLanguage);
-      di.ShowDialog();
+      ShowDialog(Gui, Address, ref Lib, devicePresent, vendor, isActiveSource, physicalAddress, version, power, osdName, menuLanguage);
 
       SendEvent(UpdateEventType.StatusText, "Ready.");
       SendEvent(UpdateEventType.ProgressBar, 100);
     }
 
+    private CecConfigGUI Gui;
     private LibCecSharp Lib;
     private CecLogicalAddress Address;
   }