From e4b8701b2183bdb2223ff9c298bd4dc7ee8c5a63 Mon Sep 17 00:00:00 2001 From: Sanych Date: Thu, 16 Nov 2023 10:49:06 +0300 Subject: [PATCH] External control unsaved changes --- limereport/lrreportdesignwindow.cpp | 4 ++-- limereport/lrreportdesignwindow.h | 4 ++-- limereport/lrreportdesignwindowintrerface.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/limereport/lrreportdesignwindow.cpp b/limereport/lrreportdesignwindow.cpp index cc0800c..3f3cf4c 100644 --- a/limereport/lrreportdesignwindow.cpp +++ b/limereport/lrreportdesignwindow.cpp @@ -977,9 +977,9 @@ QSettings*ReportDesignWindow::settings() } } -void ReportDesignWindow::slotNewReport() +void ReportDesignWindow::slotNewReport(bool needCheck) { - if (checkNeedToSave()) { + if (!needCheck || checkNeedToSave()) { m_lblReportName->setText(""); startNewReport(); m_deletePageAction->setEnabled(false); diff --git a/limereport/lrreportdesignwindow.h b/limereport/lrreportdesignwindow.h index 8aa9448..a93711e 100644 --- a/limereport/lrreportdesignwindow.h +++ b/limereport/lrreportdesignwindow.h @@ -71,10 +71,10 @@ public: QSettings* settings(); void restoreSetting(); void setShowProgressDialog(bool value){m_showProgressDialog = value;} - void newReport() { slotNewReport();} + void newReport(bool needCheck = true) { slotNewReport(needCheck);} QImage previewImage(int pageN = 0); private slots: - void slotNewReport(); + void slotNewReport(bool needCheck = true); void slotNewPage(); void slotDeletePage(); void slotNewTextItem(); diff --git a/limereport/lrreportdesignwindowintrerface.h b/limereport/lrreportdesignwindowintrerface.h index 23c5b93..3aacfdd 100644 --- a/limereport/lrreportdesignwindowintrerface.h +++ b/limereport/lrreportdesignwindowintrerface.h @@ -17,7 +17,7 @@ public: virtual QSettings* settings() = 0; virtual void restoreSetting() = 0; virtual void setShowProgressDialog(bool value) = 0; - virtual void newReport() = 0; + virtual void newReport(bool needCheck = true) = 0; }; } // namespace LimeReport