mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-16 03:07:53 -06:00
CURA-3221 Group items into categories for the profile change summary
This commit is contained in:
parent
3be6a0966b
commit
5724ee71d0
1 changed files with 9 additions and 3 deletions
|
@ -7,6 +7,7 @@ from UM.Settings.ContainerRegistry import ContainerRegistry
|
|||
from UM.i18n import i18nCatalog
|
||||
from UM.Settings.SettingFunction import SettingFunction
|
||||
|
||||
from collections import OrderedDict
|
||||
import os
|
||||
|
||||
class UserChangesModel(ListModel):
|
||||
|
@ -35,7 +36,8 @@ class UserChangesModel(ListModel):
|
|||
self._update()
|
||||
|
||||
def _update(self):
|
||||
items = []
|
||||
item_dict = OrderedDict()
|
||||
item_list = []
|
||||
global_stack = Application.getInstance().getGlobalContainerStack()
|
||||
if not global_stack:
|
||||
return
|
||||
|
@ -111,5 +113,9 @@ class UserChangesModel(ListModel):
|
|||
if stack != global_stack:
|
||||
item_to_add["extruder"] = stack.getName()
|
||||
|
||||
items.append(item_to_add)
|
||||
self.setItems(items)
|
||||
if category_label not in item_dict:
|
||||
item_dict[category_label] = []
|
||||
item_dict[category_label].append(item_to_add)
|
||||
for each_item_list in item_dict.values():
|
||||
item_list += each_item_list
|
||||
self.setItems(item_list)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue