mirror of
https://github.com/python-LimeReport/LimeReport.git
synced 2024-12-23 20:22:58 +03:00
Fix #28 signal saveFinished has been added
This commit is contained in:
parent
cb54963db9
commit
2e4ee6ca05
@ -98,6 +98,7 @@ signals:
|
||||
void renderPageFinished(int renderedPageCount);
|
||||
void onLoad(bool& loaded);
|
||||
void onSave();
|
||||
void saveFinished();
|
||||
public slots:
|
||||
void cancelRender();
|
||||
protected:
|
||||
|
@ -233,13 +233,23 @@ void ReportDesignWidget::saveToFile(const QString &fileName){
|
||||
bool ReportDesignWidget::save()
|
||||
{
|
||||
if (!m_report->reportFileName().isEmpty()){
|
||||
return m_report->saveToFile();
|
||||
if (m_report->saveToFile()){
|
||||
m_report->emitSaveFinished();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
m_report->emitSaveReport();
|
||||
if (m_report->isSaved()) return true;
|
||||
return m_report->saveToFile(QFileDialog::getSaveFileName(this,tr("Report file name"),"","Report files (*.lrxml);; All files (*)"));
|
||||
if (m_report->isSaved()) {
|
||||
m_report->emitSaveFinished();
|
||||
return true;
|
||||
}
|
||||
if (m_report->saveToFile(QFileDialog::getSaveFileName(this,tr("Report file name"),"","Report files (*.lrxml);; All files (*)"))){
|
||||
m_report->emitSaveFinished();
|
||||
return true;
|
||||
};
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ReportDesignWidget::loadFromFile(const QString &fileName)
|
||||
|
@ -361,6 +361,11 @@ bool ReportEnginePrivate::emitLoadReport()
|
||||
return result;
|
||||
}
|
||||
|
||||
void ReportEnginePrivate::emitSaveFinished()
|
||||
{
|
||||
emit saveFinished();
|
||||
}
|
||||
|
||||
bool ReportEnginePrivate::isSaved()
|
||||
{
|
||||
foreach (PageDesignIntf* page, m_pages) {
|
||||
@ -598,6 +603,7 @@ ReportEngine::ReportEngine(QObject *parent)
|
||||
connect(d, SIGNAL(renderFinished()), this, SIGNAL(renderFinished()));
|
||||
connect(d, SIGNAL(onSave()), this, SIGNAL(onSave()));
|
||||
connect(d, SIGNAL(onLoad(bool&)), this, SIGNAL(onLoad(bool&)));
|
||||
connect(d, SIGNAL(saveFinished()), this, SIGNAL(saveFinished()));
|
||||
}
|
||||
|
||||
ReportEngine::~ReportEngine()
|
||||
|
@ -98,6 +98,7 @@ signals:
|
||||
void renderPageFinished(int renderedPageCount);
|
||||
void onLoad(bool& loaded);
|
||||
void onSave();
|
||||
void saveFinished();
|
||||
public slots:
|
||||
void cancelRender();
|
||||
protected:
|
||||
|
@ -97,6 +97,7 @@ public:
|
||||
ReportEngine * q_ptr;
|
||||
void emitSaveReport();
|
||||
bool emitLoadReport();
|
||||
void emitSaveFinished();
|
||||
bool isSaved();
|
||||
void setCurrentReportsDir(const QString& dirName);
|
||||
QString currentReportsDir(){ return m_reportsDir;}
|
||||
@ -119,6 +120,7 @@ signals:
|
||||
void renderPageFinished(int renderedPageCount);
|
||||
void onLoad(bool& loaded);
|
||||
void onSave();
|
||||
void saveFinished();
|
||||
public slots:
|
||||
void cancelRender();
|
||||
protected:
|
||||
|
Loading…
Reference in New Issue
Block a user