typo
[deb_libcec.git] / src / cec-config-gui / actions / ShowDeviceInfo.cs
index 61dd35f6461cde35b51914342ec65411c1b7ccb2..8e6a48de71cbb42b8e07648ce80c7d1181746e5b 100644 (file)
@@ -1,18 +1,24 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using CecSharp;
+using CecSharp;
 
 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 +66,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;
   }