| 595 | } |
| 596 | |
| 597 | void CFrmRecent::slotExport() |
| 598 | { |
| 599 | QString filename = QFileDialog::getSaveFileName( |
| 600 | this, tr("Export recent"), |
| 601 | RabbitCommon::CDir::Instance()->GetDirUserDocument(), |
| 602 | tr("JSON (*.json)")); |
| 603 | |
| 604 | if (!filename.isEmpty()) { |
| 605 | QFileInfo fi(filename); |
| 606 | if(0 == fi.suffix().compare("json", Qt::CaseInsensitive)) { |
| 607 | if (m_Database.ExportToJsonFile(filename)) { |
| 608 | QMessageBox::information( |
| 609 | this, tr("Success"), |
| 610 | tr("Successfully exported recent to json file")); |
| 611 | } else { |
| 612 | QString szErr = tr("Failed to export recent to json file: %1").arg(filename) + "\n"; |
| 613 | if(!m_Database.GetError().isEmpty()) |
| 614 | szErr += "\n" + tr("Error: ") + m_Database.GetError(); |
| 615 | QMessageBox::critical(this, tr("Failure"), szErr); |
| 616 | } |
| 617 | return; |
| 618 | } |
| 619 | } |
| 620 | } |
| 621 | |
| 622 | void CFrmRecent::InitialDrop() |
| 623 | { |
nothing calls this directly
no test coverage detected