mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 22:58:58 +08:00
CURA-3221 Group items into categories for the profile change summary
This commit is contained in:
parent
3be6a0966b
commit
5724ee71d0
@ -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…
x
Reference in New Issue
Block a user