summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/drawpad/drawpadcanvas.cpp5
-rw-r--r--noncore/graphics/drawpad/drawpadcanvas.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/noncore/graphics/drawpad/drawpadcanvas.cpp b/noncore/graphics/drawpad/drawpadcanvas.cpp
index 58192d3..db6288f 100644
--- a/noncore/graphics/drawpad/drawpadcanvas.cpp
+++ b/noncore/graphics/drawpad/drawpadcanvas.cpp
@@ -300,32 +300,37 @@ void DrawPadCanvas::exportPage(uint fromPage, uint toPage, const QString& name,c
300 QIODevice* ioDevice = fileManager.saveFile(docLnk); 300 QIODevice* ioDevice = fileManager.saveFile(docLnk);
301 QImageIO imageIO(ioDevice, format); 301 QImageIO imageIO(ioDevice, format);
302 302
303 QImage image = m_pages.at(i - 1)->convertToImage(); 303 QImage image = m_pages.at(i - 1)->convertToImage();
304 imageIO.setImage(image); 304 imageIO.setImage(image);
305 imageIO.write(); 305 imageIO.write();
306 delete ioDevice; 306 delete ioDevice;
307 } 307 }
308 } 308 }
309} 309}
310 310
311QPixmap* DrawPadCanvas::currentPage() 311QPixmap* DrawPadCanvas::currentPage()
312{ 312{
313 return m_pages.current(); 313 return m_pages.current();
314} 314}
315 315
316QList<QPixmap> DrawPadCanvas::pages()
317{
318 return m_pages;
319}
320
316uint DrawPadCanvas::pagePosition() 321uint DrawPadCanvas::pagePosition()
317{ 322{
318 return (m_pages.at() + 1); 323 return (m_pages.at() + 1);
319} 324}
320 325
321uint DrawPadCanvas::pageCount() 326uint DrawPadCanvas::pageCount()
322{ 327{
323 return m_pages.count(); 328 return m_pages.count();
324} 329}
325 330
326void DrawPadCanvas::deleteAll() 331void DrawPadCanvas::deleteAll()
327{ 332{
328 QMessageBox messageBox(tr("Delete All"), tr("Do you want to delete\nall the pages?"), 333 QMessageBox messageBox(tr("Delete All"), tr("Do you want to delete\nall the pages?"),
329 QMessageBox::Information, QMessageBox::Yes, 334 QMessageBox::Information, QMessageBox::Yes,
330 QMessageBox::No | QMessageBox::Escape | QMessageBox::Default, 335 QMessageBox::No | QMessageBox::Escape | QMessageBox::Default,
331 QMessageBox::NoButton, this); 336 QMessageBox::NoButton, this);
diff --git a/noncore/graphics/drawpad/drawpadcanvas.h b/noncore/graphics/drawpad/drawpadcanvas.h
index 90dd951..a1a9466 100644
--- a/noncore/graphics/drawpad/drawpadcanvas.h
+++ b/noncore/graphics/drawpad/drawpadcanvas.h
@@ -31,32 +31,33 @@ public:
31 DrawPadCanvas(DrawPad* drawPad, QWidget* parent = 0, const char* name = 0); 31 DrawPadCanvas(DrawPad* drawPad, QWidget* parent = 0, const char* name = 0);
32 ~DrawPadCanvas(); 32 ~DrawPadCanvas();
33 33
34 void load(QIODevice* ioDevice); 34 void load(QIODevice* ioDevice);
35 void initialPage(); 35 void initialPage();
36 void save(QIODevice* ioDevice); 36 void save(QIODevice* ioDevice);
37 37
38 void importPage(const QString& fileName); 38 void importPage(const QString& fileName);
39 void exportPage(uint fromPage, uint toPage, const QString& name, const QString& format); 39 void exportPage(uint fromPage, uint toPage, const QString& name, const QString& format);
40 40
41 bool undoEnabled(); 41 bool undoEnabled();
42 bool redoEnabled(); 42 bool redoEnabled();
43 bool goPreviousPageEnabled(); 43 bool goPreviousPageEnabled();
44 bool goNextPageEnabled(); 44 bool goNextPageEnabled();
45 45
46 QPixmap* currentPage(); 46 QPixmap* currentPage();
47 QList<QPixmap> pages();
47 uint pagePosition(); 48 uint pagePosition();
48 uint pageCount(); 49 uint pageCount();
49 50
50public slots: 51public slots:
51 void deleteAll(); 52 void deleteAll();
52 void newPage(); 53 void newPage();
53 void clearPage(); 54 void clearPage();
54 void deletePage(); 55 void deletePage();
55 56
56 void undo(); 57 void undo();
57 void redo(); 58 void redo();
58 59
59 void goFirstPage(); 60 void goFirstPage();
60 void goPreviousPage(); 61 void goPreviousPage();
61 void goNextPage(); 62 void goNextPage();
62 void goLastPage(); 63 void goLastPage();