50 Commits

Author SHA1 Message Date
casper
2dd440cc0c Fix print settings tab in materials view
CURA-8979
2022-03-10 22:13:32 +01:00
casper
f9a5cb33fd Implement basic styling of material management page
CURA-8979
2022-03-09 15:26:55 +01:00
casper
e03176a1fa Replace UM.MessageDialog with newly added Cura.MessageDialog
This dialog is different from the `UM.MessageDialog` in that it

CURA-8688
2022-02-23 14:09:38 +01:00
casper
9f7581d4e8 Remove ReadOnlyTextField
and use a
```
UM.TextField
{
   enabled: false
}
```
instead

CURA-8688
2022-02-18 08:57:38 +01:00
Jaime van Kessel
a20dac4c9b Update ReadOnlyTextArea to controls 2
CURA-8685
2022-02-15 15:08:06 +01:00
casper
2edd634909 Provide a title with the color picker
CURA 8687
2022-02-11 13:27:41 +01:00
Casper Lamboo
8c0b0ddc5b
Remove superfluous semicolumn
Co-authored-by: Jaime van Kessel <nallath@gmail.com>
2022-02-11 11:32:03 +01:00
casper
91c95a0ed6 Remove duplicate function
CURA 8687
2022-02-11 10:47:37 +01:00
casper
1c711129e2 Merge branch 'replace_controls_1_for_controls_2' into CURA-8687_dialogs
# Conflicts:
#	resources/qml/Account/SyncState.qml
#	resources/qml/Preferences/ReadOnlySpinBox.qml
2022-02-11 10:44:52 +01:00
casper
1eabf251f4 Remove unused function
CURA 8687
2022-02-10 18:07:42 +01:00
casper
fca6ef29ae Move ColorDialog to Cura repo
Move component to the Cura repo as `Cura.SecondaryButton` and
`Cura.PrimaryButton` are used.

CURA 8687
2022-02-10 18:06:43 +01:00
j.delarago
9bad66b6ce Add custom ColorDialog.qml with simple hex value selector.
Cura-8681
2022-02-10 17:28:29 +01:00
casper
2e1f2a37a3 Fix centering of MessageDialog
Instead of centering in the parent the dialog is now center within the
`Overlay.overlay`. This is the window container.

CURA 8687
2022-02-09 16:45:34 +01:00
casper
9c2d370e72 Allow SpinBox components to contain fractional values 2022-02-08 15:52:49 +01:00
casper
a0e5d66299 Disable stepSize in all SpinBoxes where stepSize is a non integer value
This should be enabled. However this is a feature gap of QtControls 2.x
2022-02-08 12:01:42 +01:00
casper
f957cc289e Fix Qt warnings
resolve binding loo in `SyncState`
move `updateCostPerMeter` function to root of `MaterialView` such that it is available of all sub components

Cura 8687
2022-02-07 22:01:45 +01:00
casper
1746e24dd9 Make SpinBox a reusable component
Forgot to update Readonly `SpinBox`es to Qt 2 when implementing Cura
8684. As the spinbox is used in various places with the same
functionality it made sense to create a reusable component.

There is still a feature gap in the implementation; The `SpinBox`es
from QtControls 2.x value is defined as an integer. For some use-cases
we do require a fractional value in the `SpinBox`. The only two places
where this is required are the `material_diameter` and
`material_density` fields in the material prefference page.

Cura 8684
2022-02-07 19:59:57 +01:00
Ghostkeeper
2606a3b847
Change remaining MessageDialogs to our version
Contributes to issue CURA-8687.
2022-02-04 15:49:06 +01:00
Ghostkeeper
ee81326d6a
Fix remaining merge conflicts
- When both branches added Controls1 as OldControls, it's not marked as a merge conflict. But the merge removed the need for OldControls, so the import can be removed.
- There was one instance where I had removed the OldControls for a checkbox but there it should remain since the checkboxes are updated in a separate ticket.

Contributes to issue CURA-8684.
2022-01-31 17:08:56 +01:00
Ghostkeeper
6db4a55f6e
Merge branch 'replace_controls_1_for_controls_2' into CURA-8684_QtControls_replacement_Buttons,_Actions_&_'Exclusivity'
Conflicts:
	plugins/ImageReader/ConfigUI.qml
	plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml
	plugins/PerObjectSettingsTool/SettingPickDialog.qml
	resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml
	resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml
	resources/qml/Preferences/GeneralPage.qml
	resources/qml/Preferences/Materials/MaterialsPage.qml
	resources/qml/Preferences/Materials/MaterialsView.qml
	resources/qml/Preferences/ProfilesPage.qml

These conflicts are all arising from headers/includes being updated at the same time, or from the two branches marking the other one's components as needing OldControls.
This introduced more OldControls markers which don't get marked as merge conflicts by Git. This happens when an element could just be left as the original name but from the new import (e.g. a Button stays a Button in Controls 2, but should be marked as from OldControls on the branch that doesn't update the Button).
2022-01-31 16:53:45 +01:00
casper
b2af6308e5 Add validator to material cost/weight spinboxes
This way only valid numbers can be entered

CURA-8684
2022-01-31 15:18:58 +01:00
casper
14767a92c6 Allow mouse selection in SpinBox
CURA-8684
2022-01-31 14:35:21 +01:00
casper
f62a5e7340 Allow decimal point for values input in materials view
CURA-8684
2022-01-30 23:19:11 +01:00
Ghostkeeper
2758957d5c
Use TabRow for material page selection
The contents of the page is done with a simple page that becomes visible or not. The easiest solution I could think of. No StackLayout necessary here.

Contributes to issue CURA-8686.
2022-01-25 13:57:47 +01:00
casper
b47c7c9395 Update materials view preference menu to QtControls 2
CURA-8684
2022-01-24 23:28:25 +01:00
Ghostkeeper
509c9068eb
Convert all ScrollViews to Controls2
This was a bit of a doozy. One was really simple but the other one had me stumped for a while: The Controls2 version doesn't have the viewport property any more, so just use the width.

Contributes to issue CURA-8686.
2022-01-19 13:48:21 +01:00
Ghostkeeper
33edc4a8c9
Fix display of unlinking button
It was not being displayed with Qt 5.15 due to the following error:
MaterialsView.qml:34:5: Unable to assign QStringList to QString
This is correct. And it should not just concatenate all of these material names; it should add a comma between them for human-readable display in the text label above the button.

Fixes #10235.
2021-08-17 13:34:43 +02:00
Konstantinos Karmas
504f6dbe70
Revert "Cura 7813 qml modules version bump" 2021-03-30 09:48:28 +02:00
jelle Spijker
9da321ffb9
Update Layouts, Control.Styles and Dialogs
CURA-7813
2021-03-29 18:04:47 +02:00
jelle Spijker
2986d50745
Update QtQuick and QtQuick.Controls
CURA-7813
2021-03-29 17:55:19 +02:00
Ghostkeeper
0ecefde880
Defensive coding: Don't get the linked material if there is no material
Fixes Sentry issue CURA-17W.
2020-09-18 11:24:39 +02:00
Remco Burema
3636eed964
Instead of selecting first, return only uniques.
part of CURA-6917
2019-11-07 17:19:18 +01:00
Nino van Hooff
6e79f489e2 When multiple linked materials are found, only display the first
CURA-6917
2019-11-07 15:51:22 +01:00
Lipu Fei
38ee4bf208 Remove deprecated functions in MachineManager
CURA-6858
2019-10-22 14:11:40 +02:00
Lipu Fei
59fa73448a Fix material diameter change
CURA-6868
2019-10-15 15:03:35 +02:00
Jaime van Kessel
cadc145008
Prevent infinite recursion in material page if it could not be found 2019-10-08 16:49:54 +02:00
Ghostkeeper
8346e465f6
Turn MaterialManagementModel into a singleton
Just like MaterialManager used to be. There can be only one instance of the page then.
This prevents a crash when Qt deletes the QObject because it's no longer used in the page when you close the preferences screen. But when you open it again it doesn't construct a new one. Now there is always one instance so that's not a problem any more. Also it allows other pages to access this item.

Contributes to issue CURA-6600.
2019-08-27 15:47:41 +02:00
Ghostkeeper
3dc7c7b61c
Move removeMaterial to MaterialManagementModel
Moving away from the MaterialManager.

Contributes to issue CURA-6600.
2019-08-27 15:47:40 +02:00
Ghostkeeper
99ccddefa4
Move setMaterialName to MaterialManagementModel
No longer use the material manager which is deprecated.

Contributes to issue CURA-6600.
2019-08-27 15:47:40 +02:00
Ghostkeeper
be4e754984
Remove cache of material manager
It doesn't make the code much simpler because the cache is also not a local variable.

Contributes to issue CURA-6679.
2019-07-24 16:04:40 +02:00
Lipu Fei
3d410cceb9 Fix change material diameter binding
CURA-6590
2019-07-08 13:40:08 +02:00
Lipu Fei
b36d040ba9 Use rejected instead of visibility hack
CURA-6590
2019-07-08 13:01:42 +02:00
Jaime van Kessel
2cd6b73d12 Ensure that the material selection gets reset when diameter is changed
CURA-6590
2019-07-02 17:59:27 +02:00
Jaime van Kessel
ff0a18603b Remove a few more usages of deprecated functions 2019-05-16 15:20:38 +02:00
Satish
c98a73f8fd Added id's to printer button, installed plugins, material fields and profile tab for integration tests 2019-03-01 12:47:29 +01:00
Diego Prado Gesto
972f0bef43 WIP Fix an error in which the current selected material was not
correctly selected when there is more than one brand (stupid mistake).
Also fix problems when the user changes some material information.

Contributes to CURA-5682.
2018-09-14 10:54:07 +02:00
Diego Prado Gesto
3368428dbb Fix text field alignment.
The color text field was too short in many cases, when the color name is
long.

Contributes to CURA-5682.
2018-09-12 16:57:43 +02:00
Diego Prado Gesto
e3f67f1147 Fix code style.
Contributes to CURA-5682.
2018-09-12 16:37:16 +02:00
Diego Prado Gesto
9ba4c723f7 Fix the linked materials button.
Contributes to CURA-5682.
2018-09-11 22:07:14 +02:00
Ian Paschal
13069a2f99 Some file renaming
Contributes to CURA-5378
2018-08-24 11:06:44 +02:00