19#include "ui_bookmarksexportdialog.h"
29 , m_currentExporter(nullptr)
31 setAttribute(Qt::WA_DeleteOnClose);
36 connect(ui->chooseOutput, &QAbstractButton::clicked,
this, &BookmarksExportDialog::setPath);
37 connect(ui->buttonBox, &QDialogButtonBox::accepted,
this, &BookmarksExportDialog::exportBookmarks);
38 connect(ui->buttonBox, &QDialogButtonBox::rejected,
this, &QWidget::close);
46void BookmarksExportDialog::setPath()
48 Q_ASSERT(m_currentExporter);
50 ui->output->setText(m_currentExporter->
getPath(
this));
53void BookmarksExportDialog::exportBookmarks()
55 Q_ASSERT(m_currentExporter);
57 if (ui->output->text().isEmpty()) {
64 QMessageBox::critical(
this, tr(
"Error!"), m_currentExporter->
errorString());
71void BookmarksExportDialog::init()
76 ui->format->addItem(exporter->name());
79 m_currentExporter = m_exporters.at(0);
BookmarksExportDialog(QWidget *parent=nullptr)
virtual bool exportBookmarks(BookmarkItem *root)=0
virtual QString getPath(QWidget *parent)=0
QString errorString() const