[wolsetup] replace the choicebox with the messagebox. and remove ethtool command.
authorkos <kos@dev3>
Thu, 18 Jul 2013 02:11:51 +0000 (11:11 +0900)
committerkos <kos@dev3>
Thu, 18 Jul 2013 02:11:51 +0000 (11:11 +0900)
lib/python/Plugins/SystemPlugins/WOLSetup/plugin.py

index 1276b1e..bf29218 100644 (file)
@@ -118,8 +118,7 @@ class WOLSetup(ConfigListScreen, Screen):
                config.plugins.wolconfig.location.value = self.backup["location"]
 
        def OnKeyGreenCB(self, answer):
                config.plugins.wolconfig.location.value = self.backup["location"]
 
        def OnKeyGreenCB(self, answer):
-               answer = answer and answer[1]
-               if answer == "n":
+               if not answer:
                        self.Restore()
                        return
                self.Save()
                        self.Restore()
                        return
                self.Save()
@@ -136,7 +135,7 @@ class WOLSetup(ConfigListScreen, Screen):
                        self.close()
                        return
                message = _("If WOL is enabled, power consumption will be around 2W.\nErP Standby Power Regulation (<0.5W at standby) cannot be met.\nProceed?")
                        self.close()
                        return
                message = _("If WOL is enabled, power consumption will be around 2W.\nErP Standby Power Regulation (<0.5W at standby) cannot be met.\nProceed?")
-               self.session.openWithCallback(self.OnKeyGreenCB, ChoiceBox, title=message, list=((_("Yes"), "y"), (_("No"), "n"),))
+               self.session.openWithCallback(self.OnKeyGreenCB, MessageBox, message, MessageBox.TYPE_YESNO, default = True)
 
        def OnKeyCancel(self):
                self.Restore()
 
        def OnKeyCancel(self):
                self.Restore()
@@ -166,7 +165,6 @@ class WOLSetup(ConfigListScreen, Screen):
                        return
                if writeDevice:
                        os.system('echo "%s" > %s' % (enable and "enable" or "disble",_deviseWOL))
                        return
                if writeDevice:
                        os.system('echo "%s" > %s' % (enable and "enable" or "disble",_deviseWOL))
-               os.system("ethtool -s %s wol %s" % (_ethDevice, enable and "g" or "d"))
 
        @staticmethod
        def DeepStandbyNotifierCB(self=None):
 
        @staticmethod
        def DeepStandbyNotifierCB(self=None):
@@ -201,4 +199,3 @@ def Plugins(**kwargs):
        l.append(PluginDescriptor(where=PluginDescriptor.WHERE_SESSIONSTART, fnc=SessionStartMain))
        l.append(PluginDescriptor(where=PluginDescriptor.WHERE_MENU, fnc=MenuSelected))
        return l
        l.append(PluginDescriptor(where=PluginDescriptor.WHERE_SESSIONSTART, fnc=SessionStartMain))
        l.append(PluginDescriptor(where=PluginDescriptor.WHERE_MENU, fnc=MenuSelected))
        return l
-