MCPcopy Create free account
hub / github.com/Palm1r/QodeAssist / showSaveDialog

Method showSaveDialog

ChatView/ChatHistoryStore.cpp:118–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116}
117
118void ChatHistoryStore::showSaveDialog()
119{
120 QString initialDir = historyDir();
121
122 QFileDialog *dialog = new QFileDialog(nullptr, tr("Save Chat History"));
123 dialog->setAcceptMode(QFileDialog::AcceptSave);
124 dialog->setFileMode(QFileDialog::AnyFile);
125 dialog->setNameFilter(tr("JSON files (*.json)"));
126 dialog->setDefaultSuffix("json");
127 if (!initialDir.isEmpty()) {
128 dialog->setDirectory(initialDir);
129 dialog->selectFile(suggestedFileName() + ".json");
130 }
131
132 connect(dialog, &QFileDialog::finished, this, [this, dialog](int result) {
133 if (result == QFileDialog::Accepted) {
134 QStringList files = dialog->selectedFiles();
135 if (!files.isEmpty()) {
136 emit saveRequested(files.first());
137 }
138 }
139 dialog->deleteLater();
140 });
141
142 dialog->open();
143}
144
145void ChatHistoryStore::showLoadDialog()
146{

Callers

nothing calls this directly

Calls 1

isEmptyMethod · 0.45

Tested by

no test coverage detected