Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

Merge pull request #6672 from Ahl76/feat-assistant-level-auto-switch

Rodneybbfbba34b426
diff --cc toonz/sources/toonz/shortcutpopup.cpp
index 67c411905,535bd0d00..9c92e91c5
--- a/toonz/sources/toonz/shortcutpopup.cpp
+++ b/toonz/sources/toonz/shortcutpopup.cpp
@@@ -46,32 -46,9 +46,33 @@@ ShortcutPopup *ShortcutPopup::s_instanc
#include <QSignalBlocker>
// STD includes
+ #include <string>
#include <vector>
+namespace {
+
+// Persist Configure Shortcuts UI state in the user profile (.env).
+TEnv::StringVar ShortcutPopupExpandedFolders("ShortcutPopupExpandedFolders", "");
+TEnv::IntVar ShortcutPopupExpandedStateSaved("ShortcutPopupExpandedStateSaved",
+ 0);
+TEnv::StringVar ShortcutPopupSearchText("ShortcutPopupSearchText", "");
+
+const QChar kFolderListSeparator(0x1e);
+
+QStringList expandedFoldersFromEnv() {
+ const QString stored =
+ QString::fromStdString((std::string)ShortcutPopupExpandedFolders);
+ if (stored.isEmpty()) return QStringList();
+ return stored.split(kFolderListSeparator, Qt::SkipEmptyParts);
+}
+
+void saveExpandedFoldersToEnv(const QStringList &expandedFolders) {
+ ShortcutPopupExpandedFolders =
+ expandedFolders.join(kFolderListSeparator).toStdString();
+}
+
+} // namespace
+
//=============================================================================
// ShortcutItem
// ------------