mirror of
https://github.com/python-LimeReport/LimeReport.git
synced 2024-12-24 12:34:39 +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 "lrdesignelementsfactory.h"
|
||||
#include "lrglobal.h"
|
||||
#include "lrpagedesignintf.h"
|
||||
|
||||
const QString xmlTag ="PageFooter";
|
||||
|
||||
@ -65,6 +66,28 @@ QColor PageFooter::bandColor() const
|
||||
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
|
||||
{
|
||||
return m_printOnFirstPage;
|
||||
@ -72,7 +95,12 @@ bool PageFooter::printOnFirstPage() const
|
||||
|
||||
void PageFooter::setPrintOnFirstPage(bool printOnFirstPage)
|
||||
{
|
||||
if (m_printOnFirstPage != printOnFirstPage){
|
||||
bool oldValue = m_printOnFirstPage;
|
||||
m_printOnFirstPage = printOnFirstPage;
|
||||
update();
|
||||
notify("printOnFirstPage",oldValue,printOnFirstPage);
|
||||
}
|
||||
}
|
||||
|
||||
bool PageFooter::printOnLastPage() const
|
||||
@ -82,7 +110,12 @@ bool PageFooter::printOnLastPage() const
|
||||
|
||||
void PageFooter::setPrintOnLastPage(bool printOnLastPage)
|
||||
{
|
||||
if (m_printOnLastPage != printOnLastPage){
|
||||
bool oldValue = m_printOnLastPage;
|
||||
m_printOnLastPage = printOnLastPage;
|
||||
update();
|
||||
notify("printOnLastPage",oldValue,printOnLastPage);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace LimeReport
|
||||
|
@ -51,6 +51,8 @@ public:
|
||||
|
||||
protected:
|
||||
QColor bandColor() const;
|
||||
void preparePopUpMenu(QMenu &menu);
|
||||
void processPopUpAction(QAction *action);
|
||||
private:
|
||||
bool m_printOnFirstPage;
|
||||
bool m_printOnLastPage;
|
||||
|
Loading…
Reference in New Issue
Block a user