author | leseb <leseb> | 2002-06-06 20:51:27 (UTC) |
---|---|---|
committer | leseb <leseb> | 2002-06-06 20:51:27 (UTC) |
commit | 43bde653ce03f4c5202860f4e23c7612144a38f0 (patch) (unidiff) | |
tree | aa89f01ade2667699e2d9ba69daabb9810e48c35 /noncore/graphics/drawpad/drawpad.cpp | |
parent | 38946b6ef966a154d979d7dd254cf463f6dadbe5 (diff) | |
download | opie-43bde653ce03f4c5202860f4e23c7612144a38f0.zip opie-43bde653ce03f4c5202860f4e23c7612144a38f0.tar.gz opie-43bde653ce03f4c5202860f4e23c7612144a38f0.tar.bz2 |
New page class, thumbnail view draft
Diffstat (limited to 'noncore/graphics/drawpad/drawpad.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/graphics/drawpad/drawpad.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/noncore/graphics/drawpad/drawpad.cpp b/noncore/graphics/drawpad/drawpad.cpp index 74787e5..b325323 100644 --- a/noncore/graphics/drawpad/drawpad.cpp +++ b/noncore/graphics/drawpad/drawpad.cpp | |||
@@ -16,24 +16,25 @@ | |||
16 | #include "drawpadcanvas.h" | 16 | #include "drawpadcanvas.h" |
17 | #include "ellipsetool.h" | 17 | #include "ellipsetool.h" |
18 | #include "erasetool.h" | 18 | #include "erasetool.h" |
19 | #include "exportdialog.h" | 19 | #include "exportdialog.h" |
20 | #include "filledellipsetool.h" | 20 | #include "filledellipsetool.h" |
21 | #include "filledrectangletool.h" | 21 | #include "filledrectangletool.h" |
22 | #include "filltool.h" | 22 | #include "filltool.h" |
23 | #include "importdialog.h" | 23 | #include "importdialog.h" |
24 | #include "linetool.h" | 24 | #include "linetool.h" |
25 | #include "pointtool.h" | 25 | #include "pointtool.h" |
26 | #include "rectangletool.h" | 26 | #include "rectangletool.h" |
27 | #include "texttool.h" | 27 | #include "texttool.h" |
28 | #include "thumbnailview.h" | ||
28 | 29 | ||
29 | #include <opie/colordialog.h> | 30 | #include <opie/colordialog.h> |
30 | #include <opie/colorpopupmenu.h> | 31 | #include <opie/colorpopupmenu.h> |
31 | 32 | ||
32 | #include <qpe/applnk.h> | 33 | #include <qpe/applnk.h> |
33 | #include <qpe/global.h> | 34 | #include <qpe/global.h> |
34 | #include <qpe/qpemenubar.h> | 35 | #include <qpe/qpemenubar.h> |
35 | #include <qpe/qpetoolbar.h> | 36 | #include <qpe/qpetoolbar.h> |
36 | #include <qpe/resource.h> | 37 | #include <qpe/resource.h> |
37 | 38 | ||
38 | #include <qaction.h> | 39 | #include <qaction.h> |
39 | #include <qfile.h> | 40 | #include <qfile.h> |
@@ -69,24 +70,30 @@ DrawPad::DrawPad(QWidget* parent, const char* name) | |||
69 | deleteAllAction->addTo(toolsPopupMenu); | 70 | deleteAllAction->addTo(toolsPopupMenu); |
70 | 71 | ||
71 | toolsPopupMenu->insertSeparator(); | 72 | toolsPopupMenu->insertSeparator(); |
72 | 73 | ||
73 | QAction* importPageAction = new QAction(tr("Import"), tr("Import..."), 0, this); | 74 | QAction* importPageAction = new QAction(tr("Import"), tr("Import..."), 0, this); |
74 | connect(importPageAction, SIGNAL(activated()), this, SLOT(importPage())); | 75 | connect(importPageAction, SIGNAL(activated()), this, SLOT(importPage())); |
75 | importPageAction->addTo(toolsPopupMenu); | 76 | importPageAction->addTo(toolsPopupMenu); |
76 | 77 | ||
77 | QAction* exportPageAction = new QAction(tr("Export"), tr("Export..."), 0, this); | 78 | QAction* exportPageAction = new QAction(tr("Export"), tr("Export..."), 0, this); |
78 | connect(exportPageAction, SIGNAL(activated()), this, SLOT(exportPage())); | 79 | connect(exportPageAction, SIGNAL(activated()), this, SLOT(exportPage())); |
79 | exportPageAction->addTo(toolsPopupMenu); | 80 | exportPageAction->addTo(toolsPopupMenu); |
80 | 81 | ||
82 | toolsPopupMenu->insertSeparator(); | ||
83 | |||
84 | QAction* thumbnailViewAction = new QAction(tr("Thumbnail View"), tr("Thumbnail View..."), 0, this); | ||
85 | connect(thumbnailViewAction, SIGNAL(activated()), this, SLOT(thumbnailView())); | ||
86 | thumbnailViewAction->addTo(toolsPopupMenu); | ||
87 | |||
81 | menuBar->insertItem(tr("Tools"), toolsPopupMenu); | 88 | menuBar->insertItem(tr("Tools"), toolsPopupMenu); |
82 | 89 | ||
83 | // init page toolbar | 90 | // init page toolbar |
84 | 91 | ||
85 | QPEToolBar* pageToolBar = new QPEToolBar(this); | 92 | QPEToolBar* pageToolBar = new QPEToolBar(this); |
86 | 93 | ||
87 | QAction* newPageAction = new QAction(tr("New Page"), Resource::loadIconSet("new"), QString::null, 0, this); | 94 | QAction* newPageAction = new QAction(tr("New Page"), Resource::loadIconSet("new"), QString::null, 0, this); |
88 | connect(newPageAction, SIGNAL(activated()), m_pDrawPadCanvas, SLOT(newPage())); | 95 | connect(newPageAction, SIGNAL(activated()), m_pDrawPadCanvas, SLOT(newPage())); |
89 | newPageAction->addTo(pageToolBar); | 96 | newPageAction->addTo(pageToolBar); |
90 | 97 | ||
91 | QAction* clearPageAction = new QAction(tr("Clear Page"), Resource::loadIconSet("drawpad/clear"), QString::null, 0, this); | 98 | QAction* clearPageAction = new QAction(tr("Clear Page"), Resource::loadIconSet("drawpad/clear"), QString::null, 0, this); |
92 | connect(clearPageAction, SIGNAL(activated()), m_pDrawPadCanvas, SLOT(clearPage())); | 99 | connect(clearPageAction, SIGNAL(activated()), m_pDrawPadCanvas, SLOT(clearPage())); |
@@ -510,12 +517,20 @@ void DrawPad::importPage() | |||
510 | 517 | ||
511 | void DrawPad::exportPage() | 518 | void DrawPad::exportPage() |
512 | { | 519 | { |
513 | ExportDialog exportDialog(m_pDrawPadCanvas->pagePosition(), m_pDrawPadCanvas->pageCount(), this); | 520 | ExportDialog exportDialog(m_pDrawPadCanvas->pagePosition(), m_pDrawPadCanvas->pageCount(), this); |
514 | 521 | ||
515 | exportDialog.showMaximized(); | 522 | exportDialog.showMaximized(); |
516 | 523 | ||
517 | if (exportDialog.exec() == QDialog::Accepted) { | 524 | if (exportDialog.exec() == QDialog::Accepted) { |
518 | m_pDrawPadCanvas->exportPage(exportDialog.selectedFromPage(), exportDialog.selectedToPage(), | 525 | m_pDrawPadCanvas->exportPage(exportDialog.selectedFromPage(), exportDialog.selectedToPage(), |
519 | exportDialog.selectedName(), exportDialog.selectedFormat()); | 526 | exportDialog.selectedName(), exportDialog.selectedFormat()); |
520 | } | 527 | } |
521 | } | 528 | } |
529 | |||
530 | void DrawPad::thumbnailView() | ||
531 | { | ||
532 | ThumbnailView thumbnailView(m_pDrawPadCanvas->pages(), this); | ||
533 | |||
534 | thumbnailView.showMaximized(); | ||
535 | thumbnailView.exec(); | ||
536 | } | ||