MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / openFile

Method openFile

app/src/Sessions/Player.cpp:258–276  ·  view source on GitHub ↗

* @brief Prompts the user to pick a .db file from the SQLite workspace folder. */

Source from the content-addressed store, hash-verified

256 * @brief Prompts the user to pick a .db file from the SQLite workspace folder.
257 */
258void Sessions::Player::openFile()
259{
260 auto* dialog = new QFileDialog(qApp->activeWindow(),
261 tr("Open Session File"),
262 Misc::WorkspaceManager::instance().path("Session Databases"),
263 tr("Session files (*.db)"));
264
265 dialog->setFileMode(QFileDialog::ExistingFile);
266 dialog->setAttribute(Qt::WA_DeleteOnClose);
267
268 connect(dialog, &QFileDialog::fileSelected, this, [this](const QString& path) {
269 if (path.isEmpty())
270 return;
271
272 QMetaObject::invokeMethod(this, [this, path]() { openFile(path); }, Qt::QueuedConnection);
273 });
274
275 dialog->open();
276}
277
278/**
279 * @brief Closes the active database, cancels any pending load, restores prior state.

Callers 1

replaySelectedSessionMethod · 0.45

Calls 6

isEmptyMethod · 0.80
disconnectDeviceMethod · 0.80
activeWindowMethod · 0.45
pathMethod · 0.45
openMethod · 0.45
isConnectedMethod · 0.45

Tested by

no test coverage detected