Diffstat (limited to 'noncore/graphics/drawpad/drawpad.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/graphics/drawpad/drawpad.cpp | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/noncore/graphics/drawpad/drawpad.cpp b/noncore/graphics/drawpad/drawpad.cpp index 4eb47a5..b0a414e 100644 --- a/noncore/graphics/drawpad/drawpad.cpp +++ b/noncore/graphics/drawpad/drawpad.cpp | |||
@@ -55,9 +55,7 @@ DrawPad::DrawPad(QWidget* parent, const char* name) | |||
55 | 55 | ||
56 | m_pDrawPadCanvas = new DrawPadCanvas(this, this); | 56 | m_pDrawPadCanvas = new DrawPadCanvas(this, this); |
57 | 57 | ||
58 | connect(m_pDrawPadCanvas, SIGNAL(pagesChanged()), this, SLOT(updateNavigationToolButtons())); | 58 | connect(m_pDrawPadCanvas, SIGNAL(pagesChanged()), this, SLOT(updateView())); |
59 | connect(m_pDrawPadCanvas, SIGNAL(pagesChanged()), this, SLOT(updateCaption())); | ||
60 | connect(m_pDrawPadCanvas, SIGNAL(pageBackupsChanged()), this, SLOT(updateUndoRedoToolButtons())); | ||
61 | 59 | ||
62 | setCentralWidget(m_pDrawPadCanvas); | 60 | setCentralWidget(m_pDrawPadCanvas); |
63 | 61 | ||
@@ -542,27 +540,21 @@ void DrawPad::changeBrushColor(const QColor& color) | |||
542 | m_pBrushColorToolButton->popup()->hide(); | 540 | m_pBrushColorToolButton->popup()->hide(); |
543 | } | 541 | } |
544 | 542 | ||
545 | void DrawPad::updateUndoRedoToolButtons() | 543 | void DrawPad::updateView() |
546 | { | ||
547 | m_pUndoAction->setEnabled(m_pDrawPadCanvas->undoEnabled()); | ||
548 | m_pRedoAction->setEnabled(m_pDrawPadCanvas->redoEnabled()); | ||
549 | } | ||
550 | |||
551 | void DrawPad::updateNavigationToolButtons() | ||
552 | { | ||
553 | m_pFirstPageAction->setEnabled(m_pDrawPadCanvas->goPreviousPageEnabled()); | ||
554 | m_pPreviousPageAction->setEnabled(m_pDrawPadCanvas->goPreviousPageEnabled()); | ||
555 | m_pNextPageAction->setEnabled(m_pDrawPadCanvas->goNextPageEnabled()); | ||
556 | m_pLastPageAction->setEnabled(m_pDrawPadCanvas->goNextPageEnabled()); | ||
557 | } | ||
558 | |||
559 | void DrawPad::updateCaption() | ||
560 | { | 544 | { |
561 | uint pagePosition = m_pDrawPadCanvas->pagePosition(); | 545 | uint pagePosition = m_pDrawPadCanvas->pagePosition(); |
562 | uint pageCount = m_pDrawPadCanvas->pageCount(); | 546 | uint pageCount = m_pDrawPadCanvas->pageCount(); |
563 | 547 | ||
564 | setCaption(tr("DrawPad") + " - " + tr("Page") + " " | 548 | setCaption(tr("DrawPad") + " - " + tr("Page") + " " |
565 | + QString::number(pagePosition) + "/" + QString::number(pageCount)); | 549 | + QString::number(pagePosition) + "/" + QString::number(pageCount)); |
550 | |||
551 | m_pUndoAction->setEnabled(m_pDrawPadCanvas->currentPage()->undoEnabled()); | ||
552 | m_pRedoAction->setEnabled(m_pDrawPadCanvas->currentPage()->redoEnabled()); | ||
553 | |||
554 | m_pFirstPageAction->setEnabled(m_pDrawPadCanvas->goPreviousPageEnabled()); | ||
555 | m_pPreviousPageAction->setEnabled(m_pDrawPadCanvas->goPreviousPageEnabled()); | ||
556 | m_pNextPageAction->setEnabled(m_pDrawPadCanvas->goNextPageEnabled()); | ||
557 | m_pLastPageAction->setEnabled(m_pDrawPadCanvas->goNextPageEnabled()); | ||
566 | } | 558 | } |
567 | 559 | ||
568 | void DrawPad::deleteAll() | 560 | void DrawPad::deleteAll() |