MCPcopy Create free account
hub / github.com/KangLin/RabbitRemoteControl / onExportBookmarks

Method onExportBookmarks

Plugins/WebBrowser/Bookmark/FrmBookmark.cpp:450–475  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

448}
449
450void CFrmBookmark::onExportBookmarks()
451{
452 QString filename = QFileDialog::getSaveFileName(
453 this, tr("Export bookmarks"),
454 RabbitCommon::CDir::Instance()->GetDirUserDocument(),
455 tr("JSON (*.json);; All files (*.*)"));
456
457 if (filename.isEmpty()) return;
458
459 QFileInfo fi(filename);
460 if(0 == fi.suffix().compare("json", Qt::CaseInsensitive)) {
461 if (m_pDatabase->ExportToJsonFile(filename)) {
462 QMessageBox::information(this, tr("Export bookmarks"),
463 tr("Bookmarks successfully exported to file: %1").arg(filename));
464 } else {
465 QMessageBox::critical(this, tr("Export bookmarks"),
466 tr("Failed to export bookmark to file: %1").arg(filename) + "\n\n"
467 + tr("Error: ") + m_pDatabase->GetError());
468 }
469 return;
470 }
471
472 QMessageBox::warning(this, tr("Export bookmarks"),
473 tr("Invalid file: %1").arg(filename) + "\n\n"
474 + tr("Please use html file"));
475}
476
477void CFrmBookmark::onSearchTextChanged(const QString &text)
478{

Callers

nothing calls this directly

Calls 3

ExportToJsonFileMethod · 0.80
GetErrorMethod · 0.80
isEmptyMethod · 0.45

Tested by

no test coverage detected