0
0
mirror of https://github.com/fralx/LimeReport.git synced 2024-12-24 16:44:39 +03:00

Signals renaming fixed

This commit is contained in:
Arin Alexander 2018-05-31 18:49:57 +03:00
parent 8d8bea869e
commit 353712864a
7 changed files with 41 additions and 40 deletions

View File

@ -125,6 +125,7 @@ signals:
void saveFinished();
void loadFinished();
void printedToPDF(QString fileName);
void getAviableLanguages(QList<QLocale::Language>* languages);
void currentDefaulLanguageChanged(QLocale::Language);
QLocale::Language getCurrentDefaultLanguage();

View File

@ -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;
}

View File

@ -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*);

View File

@ -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<QGraphicsItem*> itemsList = m_report->activePage()->items();
QList<QGraphicsItem*> itemsList = m_designerWidget->activePage()->items();
foreach (QGraphicsItem* item, itemsList) {
if (item != ignoredItem){
BaseDesignIntf* reportItem = dynamic_cast<BaseDesignIntf*>(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<ObjectBrowserNode*>(item);
if (tn){
BaseDesignIntf* si = dynamic_cast<BaseDesignIntf*>(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<BaseDesignIntf*>(item);
if (bg){
ObjectBrowserNode* node = m_itemsMap.value(bg);

View File

@ -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<QObject*, ObjectBrowserNode*> m_itemsMap;

View File

@ -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<QDialog*>(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();
}
}

View File

@ -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