-rw-r--r-- | noncore/graphics/drawpad/drawpad.cpp | 19 | ||||
-rw-r--r-- | noncore/graphics/drawpad/drawpad.h | 2 | ||||
-rw-r--r-- | noncore/graphics/drawpad/drawpadcanvas.cpp | 12 | ||||
-rw-r--r-- | noncore/graphics/drawpad/drawpadcanvas.h | 1 |
4 files changed, 34 insertions, 0 deletions
diff --git a/noncore/graphics/drawpad/drawpad.cpp b/noncore/graphics/drawpad/drawpad.cpp index 3331193..d9d0ce0 100644 --- a/noncore/graphics/drawpad/drawpad.cpp +++ b/noncore/graphics/drawpad/drawpad.cpp | |||
@@ -54,6 +54,8 @@ DrawPad::DrawPad(QWidget* parent, const char* name, WFlags /*fl*/ ) | |||
54 | : QMainWindow(parent, name, WStyle_ContextHelp) | 54 | : QMainWindow(parent, name, WStyle_ContextHelp) |
55 | { | 55 | { |
56 | // init members | 56 | // init members |
57 | connect( qApp, SIGNAL(appMessage(const QCString&, const QByteArray&)), | ||
58 | this, SLOT(slotAppMessage(const QCString&, const QByteArray&)) ); | ||
57 | 59 | ||
58 | m_pDrawPadCanvas = new DrawPadCanvas(this, this); | 60 | m_pDrawPadCanvas = new DrawPadCanvas(this, this); |
59 | 61 | ||
@@ -663,3 +665,20 @@ void DrawPad::saveConfig() | |||
663 | config.writeEntry("PenColor", m_pen.color().name()); | 665 | config.writeEntry("PenColor", m_pen.color().name()); |
664 | config.writeEntry("BrushColor", m_brush.color().name()); | 666 | config.writeEntry("BrushColor", m_brush.color().name()); |
665 | } | 667 | } |
668 | |||
669 | |||
670 | /* | ||
671 | * Import a Thumbnail from SCAP or similiar | ||
672 | */ | ||
673 | void DrawPad::slotAppMessage( const QCString& str, const QByteArray& ar ) { | ||
674 | QDataStream stream(ar, IO_ReadOnly ); | ||
675 | /* | ||
676 | * import the pixmap | ||
677 | */ | ||
678 | if ( str == "importPixmap(QPixmap)" ) { | ||
679 | QPixmap pix; | ||
680 | stream >> pix;; | ||
681 | m_pDrawPadCanvas->importPixmap( pix ); | ||
682 | QPEApplication::setKeepRunning(); | ||
683 | } | ||
684 | } | ||
diff --git a/noncore/graphics/drawpad/drawpad.h b/noncore/graphics/drawpad/drawpad.h index 8ba6e58..ba9e47d 100644 --- a/noncore/graphics/drawpad/drawpad.h +++ b/noncore/graphics/drawpad/drawpad.h | |||
@@ -48,6 +48,8 @@ private slots: | |||
48 | void clearPage(); | 48 | void clearPage(); |
49 | void deletePage(); | 49 | void deletePage(); |
50 | 50 | ||
51 | void slotAppMessage( const QCString&, const QByteArray& ); | ||
52 | |||
51 | void setPointTool(); | 53 | void setPointTool(); |
52 | void setLineTool(); | 54 | void setLineTool(); |
53 | void setRectangleTool(); | 55 | void setRectangleTool(); |
diff --git a/noncore/graphics/drawpad/drawpadcanvas.cpp b/noncore/graphics/drawpad/drawpadcanvas.cpp index 446096c..423ef26 100644 --- a/noncore/graphics/drawpad/drawpadcanvas.cpp +++ b/noncore/graphics/drawpad/drawpadcanvas.cpp | |||
@@ -265,6 +265,18 @@ void DrawPadCanvas::importPage(const QString& fileName) | |||
265 | emit pagesChanged(); | 265 | emit pagesChanged(); |
266 | } | 266 | } |
267 | 267 | ||
268 | void DrawPadCanvas::importPixmap( const QPixmap& pix ) { | ||
269 | Page* importedPage = new Page(); | ||
270 | |||
271 | (*importedPage->pixmap()) = pix; | ||
272 | m_pages.insert(m_pages.at()+1, importedPage ); | ||
273 | resizeContents(m_pages.current()->pixmap()->width(), | ||
274 | m_pages.current()->pixmap()->height() ); | ||
275 | viewport()->update(); | ||
276 | |||
277 | emit pagesChanged(); | ||
278 | } | ||
279 | |||
268 | void DrawPadCanvas::exportPage(uint fromPage, uint toPage, const QString& name,const QString& format) | 280 | void DrawPadCanvas::exportPage(uint fromPage, uint toPage, const QString& name,const QString& format) |
269 | { | 281 | { |
270 | if (fromPage == toPage) { | 282 | if (fromPage == toPage) { |
diff --git a/noncore/graphics/drawpad/drawpadcanvas.h b/noncore/graphics/drawpad/drawpadcanvas.h index 80a2a7e..2b3d4a5 100644 --- a/noncore/graphics/drawpad/drawpadcanvas.h +++ b/noncore/graphics/drawpad/drawpadcanvas.h | |||
@@ -36,6 +36,7 @@ public: | |||
36 | 36 | ||
37 | void importPage(const QString& fileName); | 37 | void importPage(const QString& fileName); |
38 | void exportPage(uint fromPage, uint toPage, const QString& name, const QString& format); | 38 | void exportPage(uint fromPage, uint toPage, const QString& name, const QString& format); |
39 | void importPixmap( const QPixmap& ); | ||
39 | 40 | ||
40 | bool goPreviousPageEnabled(); | 41 | bool goPreviousPageEnabled(); |
41 | bool goNextPageEnabled(); | 42 | bool goNextPageEnabled(); |