61 std::function<std::optional<QString>(
const QString&,
const QString&)> runner);
84 void resetDocument(
const QString& filePath = {});
86 void refreshTable(
const QString& selectId = {});
87 void refreshTableRow(
int documentRow);
88 void refreshDetails();
89 void setDirty(
bool dirty);
90 bool confirmDiscard();
91 bool buildCurrentEntryFromUi(EntryDraft& entry);
93 bool saveCurrentDocument(
const QString& filePath);
94 bool loadFromFile(
const QString& filePath);
95 bool importFromFile(
const QString& filePath);
97 void duplicateCurrentEntry();
98 void deleteCurrentEntry();
99 void editCurrentStyle();
100 void schedulePreviewRefresh();
101 void refreshPreviewNow();
102 int currentDocumentRow()
const;
103 EntryDraft currentEntry()
const;
104 bool writeEntry(
const EntryDraft& entry,
const QString& replacedId = {});
105 void notifySaved(
const QString& filePath);
106 void onTableSelectionChanged();
107 void onTypeFilterChanged();
108 void selectTypeFilter(
const QString& styleType);
110 StyleCatalogDocument m_document;
111 std::function<QString(
const QString&)> m_afterSaveCallback;
112 std::function<QStringList()> m_styleResourceFolderProvider;
113 std::function<std::optional<QString>(
const QString&,
const QString&)> m_styleEditorRunnerForTest;
114 std::function<QString()> m_importPathProviderForTest;
115 bool m_updatingDetails =
false;
117 bool m_formEdited =
false;
119 QString m_shownEntryId;
121 bool m_programmaticSelection =
false;
123 bool m_restoringSelection =
false;
124 int m_lastTypeFilterIndex = 0;
125 std::unique_ptr<StyleCatalogEntryFormBinder> m_formBinder;
126 std::unique_ptr<StyleCatalogTableController> m_tableController;
128 QTableView* m_entryTable =
nullptr;
129 QComboBox* m_typeFilter =
nullptr;
130 QLineEdit* m_idEdit =
nullptr;
131 QLineEdit* m_nameEdit =
nullptr;
132 QLineEdit* m_groupEdit =
nullptr;
133 QLineEdit* m_categoryEdit =
nullptr;
134 QLineEdit* m_displayNameEdit =
nullptr;
135 QLineEdit* m_tagsEdit =
nullptr;
136 QPlainTextEdit* m_descriptionEdit =
nullptr;
137 QPlainTextEdit* m_styleJsonEdit =
nullptr;
138 QPushButton* m_editStyleButton =
nullptr;
139 StylePreviewWidget* m_preview =
nullptr;
140 QTimer* m_previewRefreshTimer =
nullptr;