Merge branch '4.9' of github.com:Ultimaker/Cura

This commit is contained in:
Jaime van Kessel 2021-04-12 11:21:22 +02:00
commit f4f1dce941
No known key found for this signature in database
GPG Key ID: 3710727397403C91
3 changed files with 18 additions and 39 deletions

View File

@ -18,6 +18,9 @@ if Platform.isWindows() and hasattr(sys, "frozen"):
import win32timezone import win32timezone
from keyring.backends.Windows import WinVaultKeyring from keyring.backends.Windows import WinVaultKeyring
keyring.set_keyring(WinVaultKeyring()) keyring.set_keyring(WinVaultKeyring())
if Platform.isOSX() and hasattr(sys, "frozen"):
from keyring.backends.macOS import Keyring
keyring.set_keyring(Keyring())
# Even if errors happen, we don't want this stored locally: # Even if errors happen, we don't want this stored locally:
DONT_EVER_STORE_LOCALLY: List[str] = ["refresh_token"] DONT_EVER_STORE_LOCALLY: List[str] = ["refresh_token"]

View File

@ -287,7 +287,7 @@ class CloudOutputDevice(UltimakerNetworkedPrinterOutputDevice):
firmware_version = Version([version_number[0], version_number[1], version_number[2]]) firmware_version = Version([version_number[0], version_number[1], version_number[2]])
return firmware_version >= self.PRINT_JOB_ACTIONS_MIN_VERSION return firmware_version >= self.PRINT_JOB_ACTIONS_MIN_VERSION
@pyqtProperty(bool) @pyqtProperty(bool, constant = True)
def supportsPrintJobQueue(self) -> bool: def supportsPrintJobQueue(self) -> bool:
"""Gets whether the printer supports a queue""" """Gets whether the printer supports a queue"""

View File

@ -2,10 +2,12 @@
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.10 import QtQuick 2.10
import QtQuick.Controls 2.3 import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import QtQuick.Controls.Styles 1.1 import QtQuick.Controls.Styles 1.1
import QtQuick.Controls 2.3 as NewControls
import UM 1.1 as UM import UM 1.1 as UM
import Cura 1.1 as Cura import Cura 1.1 as Cura
@ -139,6 +141,7 @@ UM.PreferencesPage
{ {
id: interfaceGrid id: interfaceGrid
columns: 4 columns: 4
width: parent.width
Label Label
{ {
@ -178,12 +181,13 @@ UM.PreferencesPage
} }
} }
ComboBox NewControls.ComboBox
{ {
id: languageComboBox id: languageComboBox
textRole: "text" textRole: "text"
model: languageList model: languageList
Layout.fillWidth: true
currentIndex: currentIndex:
{ {
@ -197,20 +201,6 @@ UM.PreferencesPage
} }
} }
onActivated: UM.Preferences.setValue("general/language", model.get(index).code) onActivated: UM.Preferences.setValue("general/language", model.get(index).code)
Component.onCompleted:
{
// Because ListModel is stupid and does not allow using qsTr() for values.
for(var i = 0; i < languageList.count; ++i)
{
languageList.setProperty(i, "text", catalog.i18n(languageList.get(i).text));
}
// Glorious hack time. ComboBox does not update the text properly after changing the
// model. So change the indices around to force it to update.
currentIndex += 1;
currentIndex -= 1;
}
} }
Label Label
@ -245,12 +235,13 @@ UM.PreferencesPage
} }
} }
ComboBox NewControls.ComboBox
{ {
id: themeComboBox id: themeComboBox
model: themeList model: themeList
textRole: "text" textRole: "text"
Layout.fillWidth: true
currentIndex: currentIndex:
{ {
@ -265,21 +256,6 @@ UM.PreferencesPage
return 0; return 0;
} }
onActivated: UM.Preferences.setValue("general/theme", model.get(index).code) onActivated: UM.Preferences.setValue("general/theme", model.get(index).code)
Component.onCompleted:
{
// Because ListModel is stupid and does not allow using qsTr() for values.
for(var i = 0; i < themeList.count; ++i)
{
themeList.setProperty(i, "text", catalog.i18n(themeList.get(i).text));
}
// Glorious hack time. ComboBox does not update the text properly after changing the
// model. So change the indices around to force it to update.
currentIndex += 1;
currentIndex -= 1;
}
} }
} }
@ -535,7 +511,7 @@ UM.PreferencesPage
} }
} }
ComboBox NewControls.ComboBox
{ {
id: cameraComboBox id: cameraComboBox
@ -676,10 +652,10 @@ UM.PreferencesPage
text: catalog.i18nc("@window:text", "Default behavior when opening a project file: ") text: catalog.i18nc("@window:text", "Default behavior when opening a project file: ")
} }
ComboBox NewControls.ComboBox
{ {
id: choiceOnOpenProjectDropDownButton id: choiceOnOpenProjectDropDownButton
width: 200 * screenScaleFactor width: Math.round(250 * screenScaleFactor)
model: ListModel model: ListModel
{ {
@ -743,11 +719,11 @@ UM.PreferencesPage
text: catalog.i18nc("@window:text", "Default behavior for changed setting values when switching to a different profile: ") text: catalog.i18nc("@window:text", "Default behavior for changed setting values when switching to a different profile: ")
} }
ComboBox NewControls.ComboBox
{ {
id: choiceOnProfileOverrideDropDownButton id: choiceOnProfileOverrideDropDownButton
width: 200 * screenScaleFactor width: Math.round(250 * screenScaleFactor)
popup.width: Math.round(350 * screenScaleFactor)
model: ListModel model: ListModel
{ {
id: discardOrKeepProfileListModel id: discardOrKeepProfileListModel