mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-26 12:21:26 -07:00
Merge branch 'CURA-5744-move-oauth-login' of github.com:Ultimaker/Cura
This commit is contained in:
commit
dabe747ec0
23 changed files with 1005 additions and 127 deletions
|
|
@ -1,7 +1,7 @@
|
|||
# Copyright (c) 2018 Ultimaker B.V.
|
||||
# Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
from typing import Optional
|
||||
from typing import Optional, List, Dict, Union
|
||||
import os
|
||||
import urllib.parse
|
||||
from configparser import ConfigParser
|
||||
|
|
@ -60,7 +60,7 @@ class SettingVisibilityPresetsModel(ListModel):
|
|||
|
||||
def _populate(self) -> None:
|
||||
from cura.CuraApplication import CuraApplication
|
||||
items = []
|
||||
items = [] # type: List[Dict[str, Union[str, int, List[str]]]]
|
||||
for file_path in Resources.getAllResourcesOfType(CuraApplication.ResourceTypes.SettingVisibilityPreset):
|
||||
try:
|
||||
mime_type = MimeTypeDatabase.getMimeTypeForFile(file_path)
|
||||
|
|
@ -79,7 +79,7 @@ class SettingVisibilityPresetsModel(ListModel):
|
|||
if not parser.has_option("general", "name") or not parser.has_option("general", "weight"):
|
||||
continue
|
||||
|
||||
settings = []
|
||||
settings = [] # type: List[str]
|
||||
for section in parser.sections():
|
||||
if section == 'general':
|
||||
continue
|
||||
|
|
@ -98,7 +98,7 @@ class SettingVisibilityPresetsModel(ListModel):
|
|||
except Exception:
|
||||
Logger.logException("e", "Failed to load setting preset %s", file_path)
|
||||
|
||||
items.sort(key = lambda k: (int(k["weight"]), k["id"]))
|
||||
items.sort(key = lambda k: (int(k["weight"]), k["id"])) # type: ignore
|
||||
# Put "custom" at the top
|
||||
items.insert(0, {"id": "custom",
|
||||
"name": "Custom selection",
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ from typing import TYPE_CHECKING, Optional, cast, Dict, List
|
|||
|
||||
from PyQt5.QtCore import QObject, QTimer, pyqtSignal, pyqtSlot
|
||||
|
||||
from UM.Application import Application
|
||||
from UM.ConfigurationErrorMessage import ConfigurationErrorMessage
|
||||
from UM.Logger import Logger
|
||||
from UM.Util import parseBool
|
||||
|
|
@ -21,7 +20,6 @@ if TYPE_CHECKING:
|
|||
from cura.Settings.GlobalStack import GlobalStack
|
||||
from .QualityChangesGroup import QualityChangesGroup
|
||||
from cura.CuraApplication import CuraApplication
|
||||
from UM.Settings.ContainerRegistry import ContainerRegistry
|
||||
|
||||
|
||||
#
|
||||
|
|
@ -38,11 +36,11 @@ class QualityManager(QObject):
|
|||
|
||||
qualitiesUpdated = pyqtSignal()
|
||||
|
||||
def __init__(self, container_registry: "ContainerRegistry", parent = None) -> None:
|
||||
def __init__(self, application: "CuraApplication", parent = None) -> None:
|
||||
super().__init__(parent)
|
||||
self._application = Application.getInstance() # type: CuraApplication
|
||||
self._application = application
|
||||
self._material_manager = self._application.getMaterialManager()
|
||||
self._container_registry = container_registry
|
||||
self._container_registry = self._application.getContainerRegistry()
|
||||
|
||||
self._empty_quality_container = self._application.empty_quality_container
|
||||
self._empty_quality_changes_container = self._application.empty_quality_changes_container
|
||||
|
|
@ -458,7 +456,7 @@ class QualityManager(QObject):
|
|||
# stack and clear the user settings.
|
||||
@pyqtSlot(str)
|
||||
def createQualityChanges(self, base_name: str) -> None:
|
||||
machine_manager = Application.getInstance().getMachineManager()
|
||||
machine_manager = self._application.getMachineManager()
|
||||
|
||||
global_stack = machine_manager.activeMachine
|
||||
if not global_stack:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue