Merge pull request #11535 from Ultimaker/CURA-8688_qt6_cleanup

[CURA-8688] QT6 cleanup
This commit is contained in:
Remco Burema 2022-03-02 16:49:53 +01:00 committed by GitHub
commit 901dc55733
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
63 changed files with 1109 additions and 855 deletions

View file

@ -14,7 +14,7 @@ UM.PreferencesPage
title: catalog.i18nc("@title:tab", "General")
id: generalPreferencesPage
width: parent.width
width: parent ? parent.width: 0
function setDefaultLanguage(languageCode)
{
@ -554,8 +554,8 @@ UM.PreferencesPage
model: comboBoxList
textRole: "text"
width: UM.Theme.getSize("setting_control").width
height: UM.Theme.getSize("setting_control").height
width: UM.Theme.getSize("combobox_wide").width
height: UM.Theme.getSize("combobox_wide").height
currentIndex:
{
@ -711,8 +711,8 @@ UM.PreferencesPage
Cura.ComboBox
{
id: choiceOnOpenProjectDropDownButton
width: UM.Theme.getSize("setting_control").width
height: UM.Theme.getSize("setting_control").height
width: UM.Theme.getSize("combobox_wide").width
height: UM.Theme.getSize("combobox_wide").height
model: ListModel
{
@ -779,8 +779,8 @@ UM.PreferencesPage
Cura.ComboBox
{
id: choiceOnProfileOverrideDropDownButton
width: UM.Theme.getSize("setting_control").width
height: UM.Theme.getSize("setting_control").height
width: UM.Theme.getSize("combobox_wide").width
height: UM.Theme.getSize("combobox_wide").height
model: ListModel
{
id: discardOrKeepProfileListModel
@ -849,6 +849,7 @@ UM.PreferencesPage
hoverBackgroundColor: UM.Theme.getColor("secondary_button_hover")
backgroundRadius: width / 2
height: UM.Theme.getSize("small_button_icon").height
color: UM.Theme.getColor("small_button_text")
width: height
}
}
@ -894,7 +895,7 @@ UM.PreferencesPage
text: catalog.i18nc("@info:tooltip", "When checking for updates, only check for stable releases.")
anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("default_margin").width
RadioButton
Cura.RadioButton
{
id: checkUpdatesOptionStable
text: catalog.i18nc("@option:radio", "Stable releases only")
@ -910,7 +911,7 @@ UM.PreferencesPage
text: catalog.i18nc("@info:tooltip", "When checking for updates, check for both stable and for beta releases.")
anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("default_margin").width
RadioButton
Cura.RadioButton
{
id: checkUpdatesOptionBeta
text: catalog.i18nc("@option:radio", "Stable and Beta releases")

View file

@ -125,7 +125,7 @@ UM.ManagementPage
}
}
UM.RenameDialog
Cura.RenameDialog
{
id: renameDialog
object: base.currentItem && base.currentItem.name ? base.currentItem.name : ""

View file

@ -310,7 +310,7 @@ Item
}
// Dialogs
UM.MessageDialog
Cura.MessageDialog
{
id: confirmRemoveMaterialDialog
title: catalog.i18nc("@title:window", "Confirm Remove")
@ -337,7 +337,7 @@ Item
{
const result = Cura.ContainerManager.importMaterialContainer(fileUrl);
const messageDialog = Qt.createQmlObject("import UM 1.5 as UM; UM.MessageDialog { onClosed: destroy() }", base);
const messageDialog = Qt.createQmlObject("import Cura 1.5 as Cura; Cura.MessageDialog { onClosed: destroy() }", base);
messageDialog.standardButtons = Dialog.Ok;
messageDialog.title = catalog.i18nc("@title:window", "Import Material");
switch (result.status)
@ -365,7 +365,7 @@ Item
{
const result = Cura.ContainerManager.exportContainer(base.currentItem.root_material_id, selectedNameFilter, fileUrl);
const messageDialog = Qt.createQmlObject("import UM 1.5 as UM; UM.MessageDialog { onClosed: destroy() }", base);
const messageDialog = Qt.createQmlObject("import Cura 1.5 as Cura; Cura.MessageDialog { onClosed: destroy() }", base);
messageDialog.title = catalog.i18nc("@title:window", "Export Material");
messageDialog.standardButtons = Dialog.Ok;
switch (result.status)

View file

@ -266,7 +266,7 @@ Window
border.color: UM.Theme.getColor("lining")
border.width: UM.Theme.getSize("default_lining").width
width: printerList.width - printerListScrollBar.width
height: UM.Theme.getSize("card").height
height: UM.Theme.getSize("machine_selector_icon").height + 2 * UM.Theme.getSize("default_margin").height
property string syncStatus:
{

View file

@ -119,7 +119,7 @@ Item
width: base.width
property real rowHeight: brandTextField.height + UM.Theme.getSize("default_lining").height
UM.MessageDialog
Cura.MessageDialog
{
id: confirmDiameterChangeDialog

View file

@ -137,14 +137,14 @@ UM.ManagementPage
base.toActivateNewQuality = false;
}
}
UM.MessageDialog
Cura.MessageDialog
{
id: messageDialog
standardButtons: Dialog.Ok
}
// Dialog to request a name when creating a new profile
UM.RenameDialog
Cura.RenameDialog
{
id: createQualityDialog
title: catalog.i18nc("@title:window", "Create Profile")
@ -233,7 +233,7 @@ UM.ManagementPage
}
// Dialog to request a name when duplicating a new profile
UM.RenameDialog
Cura.RenameDialog
{
id: duplicateQualityDialog
title: catalog.i18nc("@title:window", "Duplicate Profile")
@ -245,7 +245,7 @@ UM.ManagementPage
}
// Confirmation dialog for removing a profile
UM.MessageDialog
Cura.MessageDialog
{
id: confirmRemoveQualityDialog
@ -263,7 +263,7 @@ UM.ManagementPage
}
// Dialog to rename a quality profile
UM.RenameDialog
Cura.RenameDialog
{
id: renameQualityDialog
title: catalog.i18nc("@title:window", "Rename Profile")
@ -293,11 +293,6 @@ UM.ManagementPage
}
}
SystemPalette
{
id: palette
}
Column
{
id: detailsPanelHeaderColumn

View file

@ -0,0 +1,86 @@
// Copyright (c) 2022 Ultimaker B.V.
// Uranium is released under the terms of the LGPLv3 or higher.
import QtQuick 2.1
import QtQuick.Controls 2.0
import QtQuick.Window 2.1
import UM 1.5 as UM
import Cura 1.0 as Cura
UM.Dialog
{
id: base
buttonSpacing: UM.Theme.getSize("default_margin").width
property string object: ""
property alias newName: nameField.text
property bool validName: true
property string validationError
property string dialogTitle: catalog.i18nc("@title:window", "Rename")
property string explanation: catalog.i18nc("@info", "Please provide a new name.")
title: dialogTitle
minimumWidth: UM.Theme.getSize("small_popup_dialog").width
minimumHeight: UM.Theme.getSize("small_popup_dialog").height
width: minimumWidth
height: minimumHeight
property variant catalog: UM.I18nCatalog { name: "cura" }
signal textChanged(string text)
signal selectText()
onSelectText:
{
nameField.selectAll();
nameField.focus = true;
}
Column
{
anchors.fill: parent
UM.Label
{
text: base.explanation + "\n" //Newline to make some space using system theming.
width: parent.width
wrapMode: Text.WordWrap
}
Cura.TextField
{
id: nameField
width: parent.width
text: base.object
maximumLength: 40
selectByMouse: true
onTextChanged: base.textChanged(text)
}
UM.Label
{
visible: !base.validName
text: base.validationError
}
}
rightButtons: [
Cura.SecondaryButton
{
id: cancelButton
text: catalog.i18nc("@action:button","Cancel")
onClicked: base.reject()
},
Cura.PrimaryButton
{
id: okButton
text: catalog.i18nc("@action:button", "OK")
onClicked: base.accept()
enabled: base.validName
}
]
}

View file

@ -84,7 +84,7 @@ UM.PreferencesPage
}
}
TextField
Cura.TextField
{
id: filter
@ -105,7 +105,7 @@ UM.PreferencesPage
Cura.ComboBox
{
id: visibilityPreset
width: 150 * screenScaleFactor
width: UM.Theme.getSize("action_button").width
anchors
{
top: parent.top
@ -189,7 +189,6 @@ UM.PreferencesPage
}
UM.I18nCatalog { name: "cura" }
SystemPalette { id: palette }
Component
{