void MainWindow::exportDialog() { ExportDialog *exportDialog = new ExportDialog(this); connect(exportDialog, &ExportDialog::trainExport, this, &MainWindow::saveToFile); connect(exportDialog, &ExportDialog::ticketExport, this, &MainWindow::ticketsSaveToFile); exportDialog->exec(); }
void db_x509req::store(QModelIndex index) { QList<exportType> types; pki_x509req *req = static_cast<pki_x509req*>(index.internalPointer()); if (!req) return; types << exportType(exportType::PEM, "pem", "PEM") << exportType(exportType::DER, "der", "DER"); ExportDialog *dlg = new ExportDialog(mainwin, tr("Certificate request export"), tr("Certificate request ( *.pem *.der *.csr )"), req, MainWindow::csrImg, types); if (!dlg->exec()) { delete dlg; return; } QString fname = dlg->filename->text(); try { req->writeReq(fname, dlg->type() == exportType::PEM); } catch (errorEx &err) { mainwin->Error(err); } delete dlg; }