From 353712864a3f5cfcb1595aafc9e1e4ebafb90063 Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Thu, 31 May 2018 18:49:57 +0300 Subject: [PATCH] Signals renaming fixed --- include/lrreportengine.h | 1 + limereport/lrreportdesignwidget.cpp | 4 +- limereport/lrreportdesignwidget.h | 2 +- limereport/objectsbrowser/lrobjectbrowser.cpp | 46 +++++++++---------- limereport/objectsbrowser/lrobjectbrowser.h | 4 +- limereport/scriptbrowser/lrscriptbrowser.cpp | 18 ++++---- limereport/scriptbrowser/lrscriptbrowser.h | 6 +-- 7 files changed, 41 insertions(+), 40 deletions(-) diff --git a/include/lrreportengine.h b/include/lrreportengine.h index 3b01f4f..a188cef 100644 --- a/include/lrreportengine.h +++ b/include/lrreportengine.h @@ -125,6 +125,7 @@ signals: void saveFinished(); void loadFinished(); void printedToPDF(QString fileName); + void getAviableLanguages(QList* languages); void currentDefaulLanguageChanged(QLocale::Language); QLocale::Language getCurrentDefaultLanguage(); diff --git a/limereport/lrreportdesignwidget.cpp b/limereport/lrreportdesignwidget.cpp index 8d48f61..1a2904b 100644 --- a/limereport/lrreportdesignwidget.cpp +++ b/limereport/lrreportdesignwidget.cpp @@ -798,7 +798,7 @@ void ReportDesignWidget::slotPagesLoadFinished() { applySettings(); //setActivePage(m_report->pageAt(0)); - emit loaded(); + emit loadFinished(); } void ReportDesignWidget::slotDialogDeleted(QString dialogName) @@ -856,7 +856,7 @@ void ReportDesignWidget::slotReportLoaded() createTabs(); m_scriptEditor->setPlainText(m_report->scriptContext()->initScript()); m_scriptEditor->restoreState(editorState); - emit loaded(); + emit loadFinished(); m_dialogChanged = false; } diff --git a/limereport/lrreportdesignwidget.h b/limereport/lrreportdesignwidget.h index 7f67bb5..6204d69 100644 --- a/limereport/lrreportdesignwidget.h +++ b/limereport/lrreportdesignwidget.h @@ -186,7 +186,7 @@ signals: void multiItemSelected(); void commandHistoryChanged(); void cleared(); - void loaded(); + void loadFinished(); void activePageChanged(); void activePageUpdated(LimeReport::PageDesignIntf*); void bandAdded(LimeReport::PageDesignIntf*, LimeReport::BandDesignIntf*); diff --git a/limereport/objectsbrowser/lrobjectbrowser.cpp b/limereport/objectsbrowser/lrobjectbrowser.cpp index 508f7a9..2b51db5 100644 --- a/limereport/objectsbrowser/lrobjectbrowser.cpp +++ b/limereport/objectsbrowser/lrobjectbrowser.cpp @@ -35,7 +35,7 @@ namespace LimeReport{ ObjectBrowser::ObjectBrowser(QWidget *parent) - :QWidget(parent), m_report(NULL), m_mainWindow(NULL), + :QWidget(parent), m_designerWidget(NULL), m_mainWindow(NULL), m_changingItemSelection(false), m_movingItem(false) { QVBoxLayout *layout = new QVBoxLayout(this); @@ -47,28 +47,28 @@ ObjectBrowser::ObjectBrowser(QWidget *parent) m_treeView->setSelectionMode(QAbstractItemView::ExtendedSelection); } -void ObjectBrowser::setReportEditor(ReportDesignWidget *report) +void ObjectBrowser::setReportEditor(ReportDesignWidget *designerWidget) { - m_report=report; - connect(m_report,SIGNAL(cleared()),this,SLOT(slotClear())); - connect(m_report, SIGNAL(loadFinished()), this, SLOT(slotReportLoaded())); - connect(m_report, SIGNAL(activePageChanged()), this, SLOT(slotActivePageChanged())); + m_designerWidget=designerWidget; + connect(m_designerWidget,SIGNAL(cleared()),this,SLOT(slotClear())); + connect(m_designerWidget, SIGNAL(loadFinished()), this, SLOT(slotReportLoaded())); + connect(m_designerWidget, SIGNAL(activePageChanged()), this, SLOT(slotActivePageChanged())); - connect(m_report,SIGNAL(itemAdded(LimeReport::PageDesignIntf*,LimeReport::BaseDesignIntf*)), + connect(m_designerWidget,SIGNAL(itemAdded(LimeReport::PageDesignIntf*,LimeReport::BaseDesignIntf*)), this, SLOT(slotItemAdded(LimeReport::PageDesignIntf*,LimeReport::BaseDesignIntf*))); - connect(m_report, SIGNAL(itemDeleted(LimeReport::PageDesignIntf*,LimeReport::BaseDesignIntf*)), + connect(m_designerWidget, SIGNAL(itemDeleted(LimeReport::PageDesignIntf*,LimeReport::BaseDesignIntf*)), this, SLOT(slotItemDeleted(LimeReport::PageDesignIntf*,LimeReport::BaseDesignIntf*))); - connect(m_report, SIGNAL(bandAdded(LimeReport::PageDesignIntf*,LimeReport::BandDesignIntf*)), + connect(m_designerWidget, SIGNAL(bandAdded(LimeReport::PageDesignIntf*,LimeReport::BandDesignIntf*)), this, SLOT(slotBandAdded(LimeReport::PageDesignIntf*,LimeReport::BandDesignIntf*))); - connect(m_report, SIGNAL(bandDeleted(LimeReport::PageDesignIntf*,LimeReport::BandDesignIntf*)), + connect(m_designerWidget, SIGNAL(bandDeleted(LimeReport::PageDesignIntf*,LimeReport::BandDesignIntf*)), this, SLOT(slotBandDeleted(LimeReport::PageDesignIntf*,LimeReport::BandDesignIntf*))); connect(m_treeView, SIGNAL(itemSelectionChanged()), this, SLOT(slotObjectTreeItemSelectionChanged()) ); - connect(m_report, SIGNAL(itemSelected(LimeReport::BaseDesignIntf*)), + connect(m_designerWidget, SIGNAL(itemSelected(LimeReport::BaseDesignIntf*)), this, SLOT(slotItemSelected(LimeReport::BaseDesignIntf*))); - connect(m_report, SIGNAL(multiItemSelected()), + connect(m_designerWidget, SIGNAL(multiItemSelected()), this, SLOT(slotMultiItemSelected()) ); - connect(m_report, SIGNAL(activePageUpdated(LimeReport::PageDesignIntf*)), + connect(m_designerWidget, SIGNAL(activePageUpdated(LimeReport::PageDesignIntf*)), this, SLOT(slotActivePageUpdated(LimeReport::PageDesignIntf*))); connect(m_treeView, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(slotItemDoubleClicked(QTreeWidgetItem*,int))); @@ -113,15 +113,15 @@ void ObjectBrowser::buildTree(BaseDesignIntf* ignoredItem){ m_treeView->clear(); m_itemsMap.clear(); - if (!m_report->activePage()) return; + if (!m_designerWidget->activePage()) return; ObjectBrowserNode *topLevelItem=new ObjectBrowserNode(m_treeView); - topLevelItem->setText(0,m_report->activePage()->objectName()); - topLevelItem->setObject(m_report->activePage()); - m_itemsMap.insert(m_report->activePage(),topLevelItem); + topLevelItem->setText(0,m_designerWidget->activePage()->objectName()); + topLevelItem->setObject(m_designerWidget->activePage()); + m_itemsMap.insert(m_designerWidget->activePage(),topLevelItem); m_treeView->addTopLevelItem(topLevelItem); - QList itemsList = m_report->activePage()->items(); + QList itemsList = m_designerWidget->activePage()->items(); foreach (QGraphicsItem* item, itemsList) { if (item != ignoredItem){ BaseDesignIntf* reportItem = dynamic_cast(item); @@ -212,20 +212,20 @@ void ObjectBrowser::slotItemDeleted(PageDesignIntf *, BaseDesignIntf *item) void ObjectBrowser::slotObjectTreeItemSelectionChanged() { - if (!m_changingItemSelection && m_report->activePage()){ + if (!m_changingItemSelection && m_designerWidget->activePage()){ m_changingItemSelection = true; - m_report->activePage()->clearSelection(); + m_designerWidget->activePage()->clearSelection(); foreach(QTreeWidgetItem* item, m_treeView->selectedItems()){ ObjectBrowserNode* tn = dynamic_cast(item); if (tn){ BaseDesignIntf* si = dynamic_cast(tn->object()); if (si) { - m_report->activePage()->animateItem(si); + m_designerWidget->activePage()->animateItem(si); si->setSelected(true); QPointF p = si->mapToScene(si->pos()); if (si->parentItem()) p = si->parentItem()->mapToScene(si->pos()); - m_report->activeView()->centerOn(p); + m_designerWidget->activeView()->centerOn(p); } } } @@ -256,7 +256,7 @@ void ObjectBrowser::slotMultiItemSelected() m_treeView->selectionModel()->clear(); - foreach(QGraphicsItem* item, m_report->activePage()->selectedItems()){ + foreach(QGraphicsItem* item, m_designerWidget->activePage()->selectedItems()){ BaseDesignIntf* bg = dynamic_cast(item); if (bg){ ObjectBrowserNode* node = m_itemsMap.value(bg); diff --git a/limereport/objectsbrowser/lrobjectbrowser.h b/limereport/objectsbrowser/lrobjectbrowser.h index 9d9482b..c82fb27 100644 --- a/limereport/objectsbrowser/lrobjectbrowser.h +++ b/limereport/objectsbrowser/lrobjectbrowser.h @@ -53,7 +53,7 @@ class ObjectBrowser :public QWidget Q_OBJECT public: ObjectBrowser(QWidget *parent=0); - void setReportEditor(LimeReport::ReportDesignWidget* report); + void setReportEditor(LimeReport::ReportDesignWidget* designerWidget); void setMainWindow(QMainWindow* mainWindow); protected: void fillNode(QTreeWidgetItem *parentNode, BaseDesignIntf *reportItem, BaseDesignIntf* ignoredItem = 0); @@ -78,7 +78,7 @@ private slots: void slotActivePageUpdated(LimeReport::PageDesignIntf*); void slotItemParentChanged(BaseDesignIntf* item, BaseDesignIntf* parent); private: - ReportDesignWidget* m_report; + ReportDesignWidget* m_designerWidget; QMainWindow* m_mainWindow; QTreeWidget* m_treeView; QMap m_itemsMap; diff --git a/limereport/scriptbrowser/lrscriptbrowser.cpp b/limereport/scriptbrowser/lrscriptbrowser.cpp index 98d0568..148ddb7 100644 --- a/limereport/scriptbrowser/lrscriptbrowser.cpp +++ b/limereport/scriptbrowser/lrscriptbrowser.cpp @@ -54,13 +54,13 @@ ScriptBrowser::~ScriptBrowser() delete ui; } -void ScriptBrowser::setReportEditor(ReportDesignWidget* report) +void ScriptBrowser::setReportEditor(ReportDesignWidget* designerWidget) { - m_report=report; - connect(m_report,SIGNAL(cleared()),this,SLOT(slotClear())); - connect(m_report,SIGNAL(loaded()),this,SLOT(slotUpdate())); + m_designerWidget=designerWidget; + connect(m_designerWidget,SIGNAL(cleared()),this,SLOT(slotClear())); + connect(m_designerWidget,SIGNAL(loadFinished()),this,SLOT(slotUpdate())); #ifdef HAVE_UI_LOADER - connect(m_report->scriptContext(), SIGNAL(dialogAdded(QString)), this, SLOT(slotDialogAdded(QString))); + connect(m_designerWidget->scriptContext(), SIGNAL(dialogAdded(QString)), this, SLOT(slotDialogAdded(QString))); #endif updateFunctionTree(); } @@ -163,9 +163,9 @@ void ScriptBrowser::on_tbAddDialog_clicked() QWidget* widget = loader.load(&file); QDialog* dialog = dynamic_cast(widget); if (dialog){ - if (!m_report->scriptContext()->containsDialog(dialog->objectName())){ + if (!m_designerWidget->scriptContext()->containsDialog(dialog->objectName())){ file.seek(0); - m_report->scriptContext()->addDialog(dialog->objectName(),file.readAll()); + m_designerWidget->scriptContext()->addDialog(dialog->objectName(),file.readAll()); //updateDialogsTree(); } else { QMessageBox::critical(this,tr("Error"),tr("Dialog with name: %1 already exists").arg(dialog->objectName())); @@ -186,14 +186,14 @@ void ScriptBrowser::on_tbAddDialog_clicked() void ScriptBrowser::on_tbRunDialog_clicked() { if (ui->twDialogs->currentItem()&& ui->twDialogs->currentItem()->parent()==0){ - m_report->scriptContext()->previewDialog(ui->twDialogs->currentItem()->text(0)); + m_designerWidget->scriptContext()->previewDialog(ui->twDialogs->currentItem()->text(0)); } } void ScriptBrowser::on_tbDeleteDialog_clicked() { if (ui->twDialogs->currentItem()&& ui->twDialogs->currentItem()->parent()==0){ - m_report->scriptContext()->deleteDialog(ui->twDialogs->currentItem()->text(0)); + m_designerWidget->scriptContext()->deleteDialog(ui->twDialogs->currentItem()->text(0)); updateDialogsTree(); } } diff --git a/limereport/scriptbrowser/lrscriptbrowser.h b/limereport/scriptbrowser/lrscriptbrowser.h index 54bf077..a004eef 100644 --- a/limereport/scriptbrowser/lrscriptbrowser.h +++ b/limereport/scriptbrowser/lrscriptbrowser.h @@ -48,8 +48,8 @@ class ScriptBrowser : public QWidget public: explicit ScriptBrowser(QWidget *parent = 0); ~ScriptBrowser(); - void setReportEditor(LimeReport::ReportDesignWidget* report); - inline ReportDesignWidget* reportEditor(){return m_report;} + void setReportEditor(LimeReport::ReportDesignWidget* designerWidget); + inline ReportDesignWidget* reportEditor(){return m_designerWidget;} void updateFunctionTree(); #ifdef HAVE_UI_LOADER void updateDialogsTree(); @@ -71,7 +71,7 @@ private slots: private: Ui::ScriptBrowser *ui; - ReportDesignWidget* m_report; + ReportDesignWidget* m_designerWidget; }; } // namespace LimeReport