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; }
void ExportHandler::runExportWithDialog(GladeSearchpath * gladeSearchPath, Settings * settings, Document * doc, Control * control, int current) { XOJ_CHECK_TYPE(ExportHandler); doc->lock(); int count = doc->getPageCount(); ExportDialog * dlg = new ExportDialog(gladeSearchPath, settings, count, current); dlg->show(GTK_WINDOW(control->getWindow()->getWindow())); GList * selected = dlg->getRange(); if (selected) { ExportJob * job = new ExportJob(control, selected, dlg->getFormatType(), dlg->getPngDpi(), dlg->getFolder(), dlg->getFilename()); control->getScheduler()->addJob(job, JOB_PRIORITY_NONE); job->unref(); } delete dlg; doc->unlock(); }