Browse Source

Fix code-styling

Diego Prado Gesto 6 years ago
parent
commit
f91b6faecc
3 changed files with 7 additions and 3 deletions
  1. 3 1
      cura/CuraApplication.py
  2. 1 1
      cura/Settings/CuraContainerStack.py
  3. 3 1
      cura/SingleInstance.py

+ 3 - 1
cura/CuraApplication.py

@@ -1518,7 +1518,9 @@ class CuraApplication(QtApplication):
 
     @pyqtSlot("QSize")
     def setMinimumWindowSize(self, size):
-        self.getMainWindow().setMinimumSize(size)
+        main_window = self.getMainWindow()
+        if main_window:
+            main_window.setMinimumSize(size)
 
     def getBuildVolume(self):
         return self._volume

+ 1 - 1
cura/Settings/CuraContainerStack.py

@@ -48,7 +48,7 @@ class CuraContainerStack(ContainerStack):
         self._empty_material = self._container_registry.findInstanceContainers(id = "empty_material")[0] #type: InstanceContainer
         self._empty_variant = self._container_registry.findInstanceContainers(id = "empty_variant")[0] #type: InstanceContainer
 
-        self._containers = [self._empty_instance_container for i in range(len(_ContainerIndexes.IndexTypeMap))] #type: List[Union[InstanceContainer, DefinitionContainer]]
+        self._containers = [self._empty_instance_container for i in range(len(_ContainerIndexes.IndexTypeMap))] #type: List[ContainerInterface]
         self._containers[_ContainerIndexes.QualityChanges] = self._empty_quality_changes
         self._containers[_ContainerIndexes.Quality] = self._empty_quality
         self._containers[_ContainerIndexes.Material] = self._empty_material

+ 3 - 1
cura/SingleInstance.py

@@ -95,7 +95,9 @@ class SingleInstance:
                 elif command == "focus":
                     # Operating systems these days prevent windows from moving around by themselves.
                     # 'alert' or flashing the icon in the taskbar is the best thing we do now.
-                    self._application.callLater(lambda: self._application.getMainWindow().alert(0))
+                    main_window = self._application.getMainWindow()
+                    if main_window is not None:
+                        self._application.callLater(lambda: main_window.alert(0)) # type: ignore # I don't know why MyPy complains here
 
                 # Command: Close the socket connection. We're done.
                 elif command == "close-connection":