src/mainwindow.cpp
/**
 * Export transaction history into a CSV file
 */
Export transaction history into a CSV file
Export transaction history into a CSV file
void MainWindow::exportTransactions() {
    QString exportName = "hush-transactions-" + QDateTime::currentDateTime().toString("yyyyMMdd") + ".csv";
    QUrl csvName = QFileDialog::getSaveFileUrl(this,
            tr("Export transactions"), exportName, "CSV file (*.csv)");
    if (csvName.isEmpty())
        return;
    if (!rpc->getTransactionsModel()->exportToCsv(csvName.toLocalFile())) {
        QMessageBox::critical(this, tr("Error"),
            tr("Error exporting transactions, file was not saved"), QMessageBox::Ok);
    }
}
void MainWindow :: exportTransactions ( ) { QString exportName = " " + QDateTime :: currentDateTime ( ) . toString ( " " ) + " " ; QUrl csvName = QFileDialog :: getSaveFileUrl ( this , tr ( " " ) , exportName , " " ) ; if ( csvName . isEmpty ( ) ) return ; if ( ! rpc -> getTransactionsModel ( ) -> exportToCsv ( csvName . toLocalFile ( ) ) ) { QMessageBox :: critical ( this , tr ( " " ) , tr ( " " ) , QMessageBox :: Ok ) ; } }
Export transaction history into a CSV file
Export transaction history into a CSV file
// First, get the export file name