mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00
exporter: OK button to close dialog after exported
This commit is contained in:
parent
226263f77c
commit
b4873feb41
@ -31,7 +31,8 @@ VExporter::VExporter(MarkdownConverterType p_mdType, QWidget *p_parent)
|
|||||||
: QDialog(p_parent), m_webViewer(NULL), m_mdType(p_mdType),
|
: QDialog(p_parent), m_webViewer(NULL), m_mdType(p_mdType),
|
||||||
m_file(NULL), m_type(ExportType::PDF), m_source(ExportSource::Invalid),
|
m_file(NULL), m_type(ExportType::PDF), m_source(ExportSource::Invalid),
|
||||||
m_noteState(NoteState::NotReady), m_state(ExportState::Idle),
|
m_noteState(NoteState::NotReady), m_state(ExportState::Idle),
|
||||||
m_pageLayout(QPageLayout(QPageSize(QPageSize::A4), QPageLayout::Portrait, QMarginsF(0.0, 0.0, 0.0, 0.0)))
|
m_pageLayout(QPageLayout(QPageSize(QPageSize::A4), QPageLayout::Portrait, QMarginsF(0.0, 0.0, 0.0, 0.0))),
|
||||||
|
m_exported(false)
|
||||||
{
|
{
|
||||||
initMarkdownTemplate();
|
initMarkdownTemplate();
|
||||||
|
|
||||||
@ -266,6 +267,14 @@ bool VExporter::isNoteStateFailed() const
|
|||||||
|
|
||||||
void VExporter::startExport()
|
void VExporter::startExport()
|
||||||
{
|
{
|
||||||
|
QPushButton *cancelBtn = m_btnBox->button(QDialogButtonBox::Cancel);
|
||||||
|
|
||||||
|
if (m_exported) {
|
||||||
|
cancelBtn->show();
|
||||||
|
m_exported = false;
|
||||||
|
accept();
|
||||||
|
}
|
||||||
|
|
||||||
int exportedNum = 0;
|
int exportedNum = 0;
|
||||||
enableUserInput(false);
|
enableUserInput(false);
|
||||||
V_ASSERT(m_state == ExportState::Idle);
|
V_ASSERT(m_state == ExportState::Idle);
|
||||||
@ -347,7 +356,9 @@ exit:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (exportedNum) {
|
if (exportedNum) {
|
||||||
|
m_exported = true;
|
||||||
m_openBtn->show();
|
m_openBtn->show();
|
||||||
|
cancelBtn->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_state = ExportState::Idle;
|
m_state = ExportState::Idle;
|
||||||
|
@ -112,6 +112,9 @@ private:
|
|||||||
|
|
||||||
QPageLayout m_pageLayout;
|
QPageLayout m_pageLayout;
|
||||||
|
|
||||||
|
// Whether a PDF has been exported.
|
||||||
|
bool m_exported;
|
||||||
|
|
||||||
// The default directory.
|
// The default directory.
|
||||||
static QString s_defaultPathDir;
|
static QString s_defaultPathDir;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user