mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
Save the state of collapsed/expanded categories
Fixes Asana issue 36436828173802
This commit is contained in:
parent
56454a9c7a
commit
fc33b34060
2 changed files with 23 additions and 1 deletions
|
@ -73,6 +73,7 @@ class CuraApplication(QtApplication):
|
||||||
Preferences.getInstance().addPreference("cura/active_machine", "")
|
Preferences.getInstance().addPreference("cura/active_machine", "")
|
||||||
Preferences.getInstance().addPreference("cura/active_mode", "simple")
|
Preferences.getInstance().addPreference("cura/active_mode", "simple")
|
||||||
Preferences.getInstance().addPreference("cura/recent_files", "")
|
Preferences.getInstance().addPreference("cura/recent_files", "")
|
||||||
|
Preferences.getInstance().addPreference("cura/categories_expanded", "")
|
||||||
|
|
||||||
JobQueue.getInstance().jobFinished.connect(self._onJobFinished)
|
JobQueue.getInstance().jobFinished.connect(self._onJobFinished)
|
||||||
|
|
||||||
|
@ -322,6 +323,20 @@ class CuraApplication(QtApplication):
|
||||||
def recentFiles(self):
|
def recentFiles(self):
|
||||||
return self._recent_files
|
return self._recent_files
|
||||||
|
|
||||||
|
@pyqtSlot("QStringList")
|
||||||
|
def setExpandedCategories(self, categories):
|
||||||
|
categories = list(set(categories))
|
||||||
|
categories.sort()
|
||||||
|
joined = ";".join(categories)
|
||||||
|
if joined != Preferences.getInstance().getValue("cura/categories_expanded"):
|
||||||
|
Preferences.getInstance().setValue("cura/categories_expanded", joined)
|
||||||
|
self.expandedCategoriesChanged.emit()
|
||||||
|
|
||||||
|
expandedCategoriesChanged = pyqtSignal()
|
||||||
|
@pyqtProperty("QStringList", notify = expandedCategoriesChanged)
|
||||||
|
def expandedCategories(self):
|
||||||
|
return Preferences.getInstance().getValue("cura/categories_expanded").split(";")
|
||||||
|
|
||||||
outputDevicesChanged = pyqtSignal()
|
outputDevicesChanged = pyqtSignal()
|
||||||
|
|
||||||
@pyqtProperty("QVariantMap", notify = outputDevicesChanged)
|
@pyqtProperty("QVariantMap", notify = outputDevicesChanged)
|
||||||
|
|
|
@ -1,6 +1,13 @@
|
||||||
// Copyright (c) 2015 Ultimaker B.V.
|
// Copyright (c) 2015 Ultimaker B.V.
|
||||||
// Cura is released under the terms of the AGPLv3 or higher.
|
// Cura is released under the terms of the AGPLv3 or higher.
|
||||||
|
|
||||||
|
import QtQuick 2.0
|
||||||
|
|
||||||
|
import QtQuick.Controls 1.2
|
||||||
|
|
||||||
import UM 1.0 as UM
|
import UM 1.0 as UM
|
||||||
|
|
||||||
UM.SettingView { }
|
UM.SettingView {
|
||||||
|
expandedCategories: Printer.expandedCategories;
|
||||||
|
onExpandedCategoriesChanged: Printer.setExpandedCategories(expandedCategories);
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue