mirror of
https://github.com/python-LimeReport/LimeReport.git
synced 2024-12-25 04:54:40 +03:00
Context items added to pagefooter band
This commit is contained in:
parent
7c92ecfc5f
commit
3f96bf298e
@ -30,6 +30,7 @@
|
|||||||
#include "lrpagefooter.h"
|
#include "lrpagefooter.h"
|
||||||
#include "lrdesignelementsfactory.h"
|
#include "lrdesignelementsfactory.h"
|
||||||
#include "lrglobal.h"
|
#include "lrglobal.h"
|
||||||
|
#include "lrpagedesignintf.h"
|
||||||
|
|
||||||
const QString xmlTag ="PageFooter";
|
const QString xmlTag ="PageFooter";
|
||||||
|
|
||||||
@ -65,6 +66,28 @@ QColor PageFooter::bandColor() const
|
|||||||
return QColor(246,120,12);
|
return QColor(246,120,12);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PageFooter::preparePopUpMenu(QMenu &menu)
|
||||||
|
{
|
||||||
|
QAction* action = menu.addAction(tr("Print on first page"));
|
||||||
|
action->setCheckable(true);
|
||||||
|
action->setChecked(printOnFirstPage());
|
||||||
|
|
||||||
|
action = menu.addAction(tr("Print on last page"));
|
||||||
|
action->setCheckable(true);
|
||||||
|
action->setChecked(printOnLastPage());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void PageFooter::processPopUpAction(QAction *action)
|
||||||
|
{
|
||||||
|
if (action->text().compare(tr("Print on first page")) == 0){
|
||||||
|
page()->setPropertyToSelectedItems("printOnFirstPage",action->isChecked());
|
||||||
|
}
|
||||||
|
if (action->text().compare(tr("Print on last page")) == 0){
|
||||||
|
page()->setPropertyToSelectedItems("printOnLastPage",action->isChecked());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool PageFooter::printOnFirstPage() const
|
bool PageFooter::printOnFirstPage() const
|
||||||
{
|
{
|
||||||
return m_printOnFirstPage;
|
return m_printOnFirstPage;
|
||||||
@ -72,7 +95,12 @@ bool PageFooter::printOnFirstPage() const
|
|||||||
|
|
||||||
void PageFooter::setPrintOnFirstPage(bool printOnFirstPage)
|
void PageFooter::setPrintOnFirstPage(bool printOnFirstPage)
|
||||||
{
|
{
|
||||||
|
if (m_printOnFirstPage != printOnFirstPage){
|
||||||
|
bool oldValue = m_printOnFirstPage;
|
||||||
m_printOnFirstPage = printOnFirstPage;
|
m_printOnFirstPage = printOnFirstPage;
|
||||||
|
update();
|
||||||
|
notify("printOnFirstPage",oldValue,printOnFirstPage);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PageFooter::printOnLastPage() const
|
bool PageFooter::printOnLastPage() const
|
||||||
@ -82,7 +110,12 @@ bool PageFooter::printOnLastPage() const
|
|||||||
|
|
||||||
void PageFooter::setPrintOnLastPage(bool printOnLastPage)
|
void PageFooter::setPrintOnLastPage(bool printOnLastPage)
|
||||||
{
|
{
|
||||||
|
if (m_printOnLastPage != printOnLastPage){
|
||||||
|
bool oldValue = m_printOnLastPage;
|
||||||
m_printOnLastPage = printOnLastPage;
|
m_printOnLastPage = printOnLastPage;
|
||||||
|
update();
|
||||||
|
notify("printOnLastPage",oldValue,printOnLastPage);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace LimeReport
|
} // namespace LimeReport
|
||||||
|
@ -51,6 +51,8 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
QColor bandColor() const;
|
QColor bandColor() const;
|
||||||
|
void preparePopUpMenu(QMenu &menu);
|
||||||
|
void processPopUpAction(QAction *action);
|
||||||
private:
|
private:
|
||||||
bool m_printOnFirstPage;
|
bool m_printOnFirstPage;
|
||||||
bool m_printOnLastPage;
|
bool m_printOnLastPage;
|
||||||
|
Loading…
Reference in New Issue
Block a user