| 448 | } |
| 449 | |
| 450 | void 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 | |
| 477 | void CFrmBookmark::onSearchTextChanged(const QString &text) |
| 478 | { |
nothing calls this directly
no test coverage detected