eric6/MicroPython/MicroPythonReplWidget.py

branch
micropython
changeset 7123
94948e2aa0a5
parent 7120
89ee83fadec9
child 7126
376deb7fefe7
--- a/eric6/MicroPython/MicroPythonReplWidget.py	Tue Aug 06 16:42:39 2019 +0200
+++ b/eric6/MicroPython/MicroPythonReplWidget.py	Tue Aug 06 17:45:38 2019 +0200
@@ -1050,6 +1050,10 @@
         Private slot to populate the Super Menu before showing it.
         """
         self.__superMenu.clear()
+        if self.__device:
+            hasTime = self.__device.hasTimeCommands()
+        else:
+            hasTime = False
         
         act = self.__superMenu.addAction(
             self.tr("Show Version"), self.__showDeviceVersion)
@@ -1058,13 +1062,14 @@
             self.tr("Show Implementation"), self.__showImplementation)
         act.setEnabled(self.__connected)
         self.__superMenu.addSeparator()
-        act = self.__superMenu.addAction(
-            self.tr("Synchronize Time"), self.__synchronizeTime)
-        act.setEnabled(self.__connected)
-        act = self.__superMenu.addAction(
-            self.tr("Show Time"), self.__showDeviceTime)
-        act.setEnabled(self.__connected)
-        self.__superMenu.addSeparator()
+        if hasTime:
+            act = self.__superMenu.addAction(
+                self.tr("Synchronize Time"), self.__synchronizeTime)
+            act.setEnabled(self.__connected)
+            act = self.__superMenu.addAction(
+                self.tr("Show Time"), self.__showDeviceTime)
+            act.setEnabled(self.__connected)
+            self.__superMenu.addSeparator()
         if self.__device:
             self.__device.addDeviceMenuEntries(self.__superMenu)
     

eric ide

mercurial