author | leseb <leseb> | 2002-03-21 17:33:38 (UTC) |
---|---|---|
committer | leseb <leseb> | 2002-03-21 17:33:38 (UTC) |
commit | 29baf8dcda3d05d91d340b739de0fdd9e37f5749 (patch) (side-by-side diff) | |
tree | 5f2958a16cc1f065cdef3e31c2c9500f8aac2e7b /noncore/graphics/drawpad/drawpad.cpp | |
parent | 60c9126183ea72c08ad5cb77b8939812627aae17 (diff) | |
download | opie-29baf8dcda3d05d91d340b739de0fdd9e37f5749.zip opie-29baf8dcda3d05d91d340b739de0fdd9e37f5749.tar.gz opie-29baf8dcda3d05d91d340b739de0fdd9e37f5749.tar.bz2 |
Enable any size pages
Diffstat (limited to 'noncore/graphics/drawpad/drawpad.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/graphics/drawpad/drawpad.cpp | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/noncore/graphics/drawpad/drawpad.cpp b/noncore/graphics/drawpad/drawpad.cpp index f67bef8..e94187f 100644 --- a/noncore/graphics/drawpad/drawpad.cpp +++ b/noncore/graphics/drawpad/drawpad.cpp @@ -37,7 +37,5 @@ -DrawPad::DrawPad(QWidget* parent, const char* name, WFlags f) - : QMainWindow(parent, name, f) +DrawPad::DrawPad(QWidget* parent, const char* name) + : QMainWindow(parent, name) { - setCaption(tr("DrawPad")); - // init members @@ -45,12 +43,7 @@ DrawPad::DrawPad(QWidget* parent, const char* name, WFlags f) m_pDrawPadCanvas = new DrawPadCanvas(this, this); + connect(m_pDrawPadCanvas, SIGNAL(pagesChanged()), this, SLOT(updateNavigationToolButtons())); + connect(m_pDrawPadCanvas, SIGNAL(pagesChanged()), this, SLOT(updateCaption())); connect(m_pDrawPadCanvas, SIGNAL(pageBackupsChanged()), this, SLOT(updateUndoRedoToolButtons())); - QFile file(Global::applicationFileName("drawpad", "drawpad.xml")); - - if (file.open(IO_ReadOnly)) { - m_pDrawPadCanvas->load(&file); - file.close(); - } - setCentralWidget(m_pDrawPadCanvas); @@ -108,4 +101,2 @@ DrawPad::DrawPad(QWidget* parent, const char* name, WFlags f) - updateUndoRedoToolButtons(); - m_pFirstPageAction = new QAction(tr("First Page"), Resource::loadIconSet("fastback"), QString::null, 0, this); @@ -126,4 +117,2 @@ DrawPad::DrawPad(QWidget* parent, const char* name, WFlags f) - updateNavigationToolButtons(); - // init draw mode toolbar @@ -219,2 +208,13 @@ DrawPad::DrawPad(QWidget* parent, const char* name, WFlags f) brushColorPopupMenu->activateItemAt(1); + + // init pages + + QFile file(Global::applicationFileName("drawpad", "drawpad.xml")); + + if (file.open(IO_ReadOnly)) { + m_pDrawPadCanvas->load(&file); + file.close(); + } else { + m_pDrawPadCanvas->initialPage(); + } } @@ -381 +381,10 @@ void DrawPad::updateNavigationToolButtons() } + +void DrawPad::updateCaption() +{ + uint pagePosition = m_pDrawPadCanvas->pagePosition(); + uint pageCount = m_pDrawPadCanvas->pageCount(); + + setCaption(tr("DrawPad") + " - " + tr("Page") + " " + + QString::number(pagePosition) + "/" + QString::number(pageCount)); +} |