author | leseb <leseb> | 2002-06-07 20:30:30 (UTC) |
---|---|---|
committer | leseb <leseb> | 2002-06-07 20:30:30 (UTC) |
commit | 9dcd598f9b815511cae884d26b18e3c8913b9fcf (patch) (unidiff) | |
tree | 4b18e7fa7c864b2dca4da76bc89c2a975e80a73c /noncore/graphics | |
parent | 640d964cfdc7467f6cacb513087cd3acda2c04f0 (diff) | |
download | opie-9dcd598f9b815511cae884d26b18e3c8913b9fcf.zip opie-9dcd598f9b815511cae884d26b18e3c8913b9fcf.tar.gz opie-9dcd598f9b815511cae884d26b18e3c8913b9fcf.tar.bz2 |
Make progress in thumbnail view
-rw-r--r-- | noncore/graphics/drawpad/drawpad.cpp | 54 | ||||
-rw-r--r-- | noncore/graphics/drawpad/drawpad.h | 4 | ||||
-rw-r--r-- | noncore/graphics/drawpad/drawpadcanvas.cpp | 31 | ||||
-rw-r--r-- | noncore/graphics/drawpad/thumbnailview.cpp | 184 | ||||
-rw-r--r-- | noncore/graphics/drawpad/thumbnailview.h | 51 |
5 files changed, 233 insertions, 91 deletions
diff --git a/noncore/graphics/drawpad/drawpad.cpp b/noncore/graphics/drawpad/drawpad.cpp index b325323..58c0d09 100644 --- a/noncore/graphics/drawpad/drawpad.cpp +++ b/noncore/graphics/drawpad/drawpad.cpp | |||
@@ -39,4 +39,5 @@ | |||
39 | #include <qaction.h> | 39 | #include <qaction.h> |
40 | #include <qfile.h> | 40 | #include <qfile.h> |
41 | #include <qmessagebox.h> | ||
41 | #include <qpainter.h> | 42 | #include <qpainter.h> |
42 | #include <qspinbox.h> | 43 | #include <qspinbox.h> |
@@ -67,5 +68,5 @@ DrawPad::DrawPad(QWidget* parent, const char* name) | |||
67 | 68 | ||
68 | QAction* deleteAllAction = new QAction(tr("Delete All"), QString::null, 0, this); | 69 | QAction* deleteAllAction = new QAction(tr("Delete All"), QString::null, 0, this); |
69 | connect(deleteAllAction, SIGNAL(activated()), m_pDrawPadCanvas, SLOT(deleteAll())); | 70 | connect(deleteAllAction, SIGNAL(activated()), this, SLOT(deleteAll())); |
70 | deleteAllAction->addTo(toolsPopupMenu); | 71 | deleteAllAction->addTo(toolsPopupMenu); |
71 | 72 | ||
@@ -97,9 +98,9 @@ DrawPad::DrawPad(QWidget* parent, const char* name) | |||
97 | 98 | ||
98 | QAction* clearPageAction = new QAction(tr("Clear Page"), Resource::loadIconSet("drawpad/clear"), QString::null, 0, this); | 99 | QAction* clearPageAction = new QAction(tr("Clear Page"), Resource::loadIconSet("drawpad/clear"), QString::null, 0, this); |
99 | connect(clearPageAction, SIGNAL(activated()), m_pDrawPadCanvas, SLOT(clearPage())); | 100 | connect(clearPageAction, SIGNAL(activated()), this, SLOT(clearPage())); |
100 | clearPageAction->addTo(pageToolBar); | 101 | clearPageAction->addTo(pageToolBar); |
101 | 102 | ||
102 | QAction* deletePageAction = new QAction(tr("Delete Page"), Resource::loadIconSet("trash"), QString::null, 0, this); | 103 | QAction* deletePageAction = new QAction(tr("Delete Page"), Resource::loadIconSet("trash"), QString::null, 0, this); |
103 | connect(deletePageAction, SIGNAL(activated()), m_pDrawPadCanvas, SLOT(deletePage())); | 104 | connect(deletePageAction, SIGNAL(activated()), this, SLOT(deletePage())); |
104 | deletePageAction->addTo(pageToolBar); | 105 | deletePageAction->addTo(pageToolBar); |
105 | 106 | ||
@@ -268,4 +269,34 @@ DrawPad::~DrawPad() | |||
268 | } | 269 | } |
269 | 270 | ||
271 | void DrawPad::clearPage() | ||
272 | { | ||
273 | QMessageBox messageBox(tr("Clear Page"), tr("Do you want to clear\nthe current page?"), | ||
274 | QMessageBox::Information, QMessageBox::Yes, | ||
275 | QMessageBox::No | QMessageBox::Escape | QMessageBox::Default, | ||
276 | QMessageBox::NoButton, this); | ||
277 | |||
278 | messageBox.setButtonText(QMessageBox::Yes, tr("Yes")); | ||
279 | messageBox.setButtonText(QMessageBox::No, tr("No")); | ||
280 | |||
281 | if (messageBox.exec() == QMessageBox::Yes) { | ||
282 | m_pDrawPadCanvas->clearPage(); | ||
283 | } | ||
284 | } | ||
285 | |||
286 | void DrawPad::deletePage() | ||
287 | { | ||
288 | QMessageBox messageBox(tr("Delete Page"), tr("Do you want to delete\nthe current page?"), | ||
289 | QMessageBox::Information, QMessageBox::Yes, | ||
290 | QMessageBox::No | QMessageBox::Escape | QMessageBox::Default, | ||
291 | QMessageBox::NoButton, this); | ||
292 | |||
293 | messageBox.setButtonText(QMessageBox::Yes, tr("Yes")); | ||
294 | messageBox.setButtonText(QMessageBox::No, tr("No")); | ||
295 | |||
296 | if (messageBox.exec() == QMessageBox::Yes) { | ||
297 | m_pDrawPadCanvas->deletePage(); | ||
298 | } | ||
299 | } | ||
300 | |||
270 | void DrawPad::setPointTool() | 301 | void DrawPad::setPointTool() |
271 | { | 302 | { |
@@ -500,4 +531,19 @@ void DrawPad::updateCaption() | |||
500 | } | 531 | } |
501 | 532 | ||
533 | void DrawPad::deleteAll() | ||
534 | { | ||
535 | QMessageBox messageBox(tr("Delete All"), tr("Do you want to delete\nall the pages?"), | ||
536 | QMessageBox::Information, QMessageBox::Yes, | ||
537 | QMessageBox::No | QMessageBox::Escape | QMessageBox::Default, | ||
538 | QMessageBox::NoButton, this); | ||
539 | |||
540 | messageBox.setButtonText(QMessageBox::Yes, tr("Yes")); | ||
541 | messageBox.setButtonText(QMessageBox::No, tr("No")); | ||
542 | |||
543 | if (messageBox.exec() == QMessageBox::Yes) { | ||
544 | m_pDrawPadCanvas->deleteAll(); | ||
545 | } | ||
546 | } | ||
547 | |||
502 | void DrawPad::importPage() | 548 | void DrawPad::importPage() |
503 | { | 549 | { |
@@ -530,5 +576,5 @@ void DrawPad::exportPage() | |||
530 | void DrawPad::thumbnailView() | 576 | void DrawPad::thumbnailView() |
531 | { | 577 | { |
532 | ThumbnailView thumbnailView(m_pDrawPadCanvas->pages(), this); | 578 | ThumbnailView thumbnailView(m_pDrawPadCanvas, this); |
533 | 579 | ||
534 | thumbnailView.showMaximized(); | 580 | thumbnailView.showMaximized(); |
diff --git a/noncore/graphics/drawpad/drawpad.h b/noncore/graphics/drawpad/drawpad.h index b0b3666..01061b4 100644 --- a/noncore/graphics/drawpad/drawpad.h +++ b/noncore/graphics/drawpad/drawpad.h | |||
@@ -40,4 +40,7 @@ public: | |||
40 | 40 | ||
41 | private slots: | 41 | private slots: |
42 | void clearPage(); | ||
43 | void deletePage(); | ||
44 | |||
42 | void setPointTool(); | 45 | void setPointTool(); |
43 | void setLineTool(); | 46 | void setLineTool(); |
@@ -58,4 +61,5 @@ private slots: | |||
58 | void updateCaption(); | 61 | void updateCaption(); |
59 | 62 | ||
63 | void deleteAll(); | ||
60 | void importPage(); | 64 | void importPage(); |
61 | void exportPage(); | 65 | void exportPage(); |
diff --git a/noncore/graphics/drawpad/drawpadcanvas.cpp b/noncore/graphics/drawpad/drawpadcanvas.cpp index 79bef35..252f4d5 100644 --- a/noncore/graphics/drawpad/drawpadcanvas.cpp +++ b/noncore/graphics/drawpad/drawpadcanvas.cpp | |||
@@ -25,5 +25,4 @@ | |||
25 | #include <qbuffer.h> | 25 | #include <qbuffer.h> |
26 | #include <qimage.h> | 26 | #include <qimage.h> |
27 | #include <qmessagebox.h> | ||
28 | #include <qpainter.h> | 27 | #include <qpainter.h> |
29 | #include <qtextcodec.h> | 28 | #include <qtextcodec.h> |
@@ -347,13 +346,4 @@ void DrawPadCanvas::backupPage() | |||
347 | void DrawPadCanvas::deleteAll() | 346 | void DrawPadCanvas::deleteAll() |
348 | { | 347 | { |
349 | QMessageBox messageBox(tr("Delete All"), tr("Do you want to delete\nall the pages?"), | ||
350 | QMessageBox::Information, QMessageBox::Yes, | ||
351 | QMessageBox::No | QMessageBox::Escape | QMessageBox::Default, | ||
352 | QMessageBox::NoButton, this); | ||
353 | |||
354 | messageBox.setButtonText(QMessageBox::Yes, tr("Yes")); | ||
355 | messageBox.setButtonText(QMessageBox::No, tr("No")); | ||
356 | |||
357 | if (messageBox.exec() == QMessageBox::Yes) { | ||
358 | m_pages.clear(); | 348 | m_pages.clear(); |
359 | 349 | ||
@@ -370,5 +360,4 @@ void DrawPadCanvas::deleteAll() | |||
370 | emit pageBackupsChanged(); | 360 | emit pageBackupsChanged(); |
371 | } | 361 | } |
372 | } | ||
373 | 362 | ||
374 | void DrawPadCanvas::newPage() | 363 | void DrawPadCanvas::newPage() |
@@ -397,30 +386,11 @@ void DrawPadCanvas::newPage() | |||
397 | void DrawPadCanvas::clearPage() | 386 | void DrawPadCanvas::clearPage() |
398 | { | 387 | { |
399 | QMessageBox messageBox(tr("Clear Page"), tr("Do you want to clear\nthe current page?"), | ||
400 | QMessageBox::Information, QMessageBox::Yes, | ||
401 | QMessageBox::No | QMessageBox::Escape | QMessageBox::Default, | ||
402 | QMessageBox::NoButton, this); | ||
403 | |||
404 | messageBox.setButtonText(QMessageBox::Yes, tr("Yes")); | ||
405 | messageBox.setButtonText(QMessageBox::No, tr("No")); | ||
406 | |||
407 | if (messageBox.exec() == QMessageBox::Yes) { | ||
408 | m_pages.current()->fill(Qt::white); | 388 | m_pages.current()->fill(Qt::white); |
409 | 389 | ||
410 | viewport()->update(); | 390 | viewport()->update(); |
411 | } | 391 | } |
412 | } | ||
413 | 392 | ||
414 | void DrawPadCanvas::deletePage() | 393 | void DrawPadCanvas::deletePage() |
415 | { | 394 | { |
416 | QMessageBox messageBox(tr("Delete Page"), tr("Do you want to delete\nthe current page?"), | ||
417 | QMessageBox::Information, QMessageBox::Yes, | ||
418 | QMessageBox::No | QMessageBox::Escape | QMessageBox::Default, | ||
419 | QMessageBox::NoButton, this); | ||
420 | |||
421 | messageBox.setButtonText(QMessageBox::Yes, tr("Yes")); | ||
422 | messageBox.setButtonText(QMessageBox::No, tr("No")); | ||
423 | |||
424 | if (messageBox.exec() == QMessageBox::Yes) { | ||
425 | m_pages.remove(m_pages.current()); | 395 | m_pages.remove(m_pages.current()); |
426 | 396 | ||
@@ -439,5 +409,4 @@ void DrawPadCanvas::deletePage() | |||
439 | emit pageBackupsChanged(); | 409 | emit pageBackupsChanged(); |
440 | } | 410 | } |
441 | } | ||
442 | 411 | ||
443 | bool DrawPadCanvas::undoEnabled() | 412 | bool DrawPadCanvas::undoEnabled() |
diff --git a/noncore/graphics/drawpad/thumbnailview.cpp b/noncore/graphics/drawpad/thumbnailview.cpp index 10ade90..1754ce9 100644 --- a/noncore/graphics/drawpad/thumbnailview.cpp +++ b/noncore/graphics/drawpad/thumbnailview.cpp | |||
@@ -14,54 +14,22 @@ | |||
14 | #include "thumbnailview.h" | 14 | #include "thumbnailview.h" |
15 | 15 | ||
16 | #include "drawpadcanvas.h" | ||
16 | #include "page.h" | 17 | #include "page.h" |
17 | 18 | ||
18 | #include <qpe/resource.h> | 19 | #include <qpe/resource.h> |
19 | 20 | ||
21 | #include <qapplication.h> | ||
20 | #include <qheader.h> | 22 | #include <qheader.h> |
21 | #include <qimage.h> | 23 | #include <qimage.h> |
22 | #include <qlayout.h> | 24 | #include <qlayout.h> |
23 | #include <qlistview.h> | 25 | #include <qmessagebox.h> |
24 | #include <qtoolbutton.h> | 26 | #include <qtoolbutton.h> |
25 | 27 | ||
26 | ThumbnailView::ThumbnailView(QList<Page> pages, QWidget* parent, const char* name) | 28 | PageListViewItem::PageListViewItem(Page* page, QListView* parent) |
27 | : QDialog(parent, name, true) | 29 | : QListViewItem(parent) |
28 | { | 30 | { |
29 | setCaption(tr("Thumbnail")); | 31 | m_pPage = page; |
30 | |||
31 | QToolButton* newPageButton = new QToolButton(this); | ||
32 | newPageButton->setIconSet(Resource::loadIconSet("new")); | ||
33 | newPageButton->setAutoRaise(true); | ||
34 | |||
35 | QToolButton* clearPageButton = new QToolButton(this); | ||
36 | clearPageButton->setIconSet(Resource::loadIconSet("drawpad/clear")); | ||
37 | clearPageButton->setAutoRaise(true); | ||
38 | |||
39 | QToolButton* deletePageButton = new QToolButton(this); | ||
40 | deletePageButton->setIconSet(Resource::loadIconSet("trash")); | ||
41 | deletePageButton->setAutoRaise(true); | ||
42 | |||
43 | QToolButton* movePageUpButton = new QToolButton(this); | ||
44 | movePageUpButton->setIconSet(Resource::loadIconSet("up")); | ||
45 | movePageUpButton->setAutoRaise(true); | ||
46 | |||
47 | QToolButton* movePageDownButton = new QToolButton(this); | ||
48 | movePageDownButton->setIconSet(Resource::loadIconSet("down")); | ||
49 | movePageDownButton->setAutoRaise(true); | ||
50 | |||
51 | m_pListView = new QListView(this); | ||
52 | |||
53 | m_pListView->header()->hide(); | ||
54 | m_pListView->setAllColumnsShowFocus(true); | ||
55 | |||
56 | m_pListView->addColumn(tr("Thumbnail")); | ||
57 | m_pListView->addColumn(tr("Information")); | ||
58 | |||
59 | m_pListView->setColumnAlignment(0, Qt::AlignHCenter | Qt::AlignVCenter); | ||
60 | m_pListView->setColumnAlignment(1, Qt::AlignTop); | ||
61 | 32 | ||
62 | QListIterator<Page> iterator(pages); | 33 | QImage image = m_pPage->convertToImage(); |
63 | |||
64 | for (; iterator.current(); ++iterator) { | ||
65 | QImage image = iterator.current()->convertToImage(); | ||
66 | 34 | ||
67 | int previewWidth = 64; | 35 | int previewWidth = 64; |
@@ -87,12 +55,106 @@ ThumbnailView::ThumbnailView(QList<Page> pages, QWidget* parent, const char* nam | |||
87 | QPixmap pixmap(64, 64); | 55 | QPixmap pixmap(64, 64); |
88 | 56 | ||
89 | pixmap.fill(colorGroup().mid()); | 57 | pixmap.fill(listView()->colorGroup().mid()); |
90 | bitBlt(&pixmap, (pixmap.width() - previewPixmap.width()) / 2, | 58 | bitBlt(&pixmap, (pixmap.width() - previewPixmap.width()) / 2, |
91 | (pixmap.height() - previewPixmap.height()) / 2, &previewPixmap); | 59 | (pixmap.height() - previewPixmap.height()) / 2, &previewPixmap); |
92 | 60 | ||
93 | QListViewItem* item = new QListViewItem(m_pListView); | 61 | setPixmap(0, pixmap); |
94 | item->setPixmap(0, pixmap); | 62 | } |
63 | |||
64 | PageListViewItem::~PageListViewItem() | ||
65 | { | ||
66 | } | ||
67 | |||
68 | Page* PageListViewItem::page() const | ||
69 | { | ||
70 | return m_pPage; | ||
71 | } | ||
72 | |||
73 | PageListView::PageListView(DrawPadCanvas* drawPadCanvas, QWidget* parent, const char* name) | ||
74 | : QListView(parent, name) | ||
75 | { | ||
76 | m_pDrawPadCanvas = drawPadCanvas; | ||
77 | |||
78 | header()->hide(); | ||
79 | setVScrollBarMode(QScrollView::AlwaysOn); | ||
80 | setAllColumnsShowFocus(true); | ||
81 | |||
82 | addColumn(tr("Thumbnail")); | ||
83 | addColumn(tr("Information")); | ||
84 | |||
85 | updateView(); | ||
86 | } | ||
87 | |||
88 | PageListView::~PageListView() | ||
89 | { | ||
90 | } | ||
91 | |||
92 | void PageListView::updateView() | ||
93 | { | ||
94 | clear(); | ||
95 | |||
96 | if (m_pDrawPadCanvas) { | ||
97 | QList<Page> pageList = m_pDrawPadCanvas->pages(); | ||
98 | QListIterator<Page> it(pageList); | ||
99 | |||
100 | for (; it.current(); ++it) { | ||
101 | new PageListViewItem(it.current(), this); | ||
102 | } | ||
103 | } | ||
95 | } | 104 | } |
96 | 105 | ||
106 | void PageListView::resizeEvent(QResizeEvent* e) | ||
107 | { | ||
108 | Q_UNUSED(e); | ||
109 | |||
110 | setColumnWidth(1, contentsRect().width() - columnWidth(0) - verticalScrollBar()->width()); | ||
111 | } | ||
112 | |||
113 | Page* PageListView::selected() const | ||
114 | { | ||
115 | Page* page; | ||
116 | |||
117 | PageListViewItem* item = (PageListViewItem*)selectedItem(); | ||
118 | |||
119 | if (item) { | ||
120 | page = item->page(); | ||
121 | } else { | ||
122 | page = NULL; | ||
123 | } | ||
124 | |||
125 | return page; | ||
126 | } | ||
127 | |||
128 | |||
129 | ThumbnailView::ThumbnailView(DrawPadCanvas* drawPadCanvas, QWidget* parent, const char* name) | ||
130 | : QWidget(parent, name, Qt::WType_Modal | Qt::WType_TopLevel) | ||
131 | { | ||
132 | inLoop = false; | ||
133 | m_pDrawPadCanvas = drawPadCanvas; | ||
134 | |||
135 | setCaption(tr("Thumbnail")); | ||
136 | |||
137 | QToolButton* newPageButton = new QToolButton(this); | ||
138 | newPageButton->setIconSet(Resource::loadIconSet("new")); | ||
139 | newPageButton->setAutoRaise(true); | ||
140 | |||
141 | QToolButton* clearPageButton = new QToolButton(this); | ||
142 | clearPageButton->setIconSet(Resource::loadIconSet("drawpad/clear")); | ||
143 | clearPageButton->setAutoRaise(true); | ||
144 | |||
145 | QToolButton* deletePageButton = new QToolButton(this); | ||
146 | deletePageButton->setIconSet(Resource::loadIconSet("trash")); | ||
147 | deletePageButton->setAutoRaise(true); | ||
148 | |||
149 | QToolButton* movePageUpButton = new QToolButton(this); | ||
150 | movePageUpButton->setIconSet(Resource::loadIconSet("up")); | ||
151 | movePageUpButton->setAutoRaise(true); | ||
152 | |||
153 | QToolButton* movePageDownButton = new QToolButton(this); | ||
154 | movePageDownButton->setIconSet(Resource::loadIconSet("down")); | ||
155 | movePageDownButton->setAutoRaise(true); | ||
156 | |||
157 | m_pPageListView = new PageListView(m_pDrawPadCanvas, this); | ||
158 | |||
97 | QVBoxLayout* mainLayout = new QVBoxLayout(this, 4, 4); | 159 | QVBoxLayout* mainLayout = new QVBoxLayout(this, 4, 4); |
98 | QHBoxLayout* buttonLayout = new QHBoxLayout(0); | 160 | QHBoxLayout* buttonLayout = new QHBoxLayout(0); |
@@ -106,16 +168,44 @@ ThumbnailView::ThumbnailView(QList<Page> pages, QWidget* parent, const char* nam | |||
106 | 168 | ||
107 | mainLayout->addLayout(buttonLayout); | 169 | mainLayout->addLayout(buttonLayout); |
108 | mainLayout->addWidget(m_pListView); | 170 | mainLayout->addWidget(m_pPageListView); |
109 | } | 171 | } |
110 | 172 | ||
111 | ThumbnailView::~ThumbnailView() | 173 | ThumbnailView::~ThumbnailView() |
112 | { | 174 | { |
175 | hide(); | ||
113 | } | 176 | } |
114 | 177 | ||
115 | void ThumbnailView::resizeEvent(QResizeEvent* e) | 178 | void ThumbnailView::hide() |
116 | { | 179 | { |
117 | QDialog::resizeEvent(e); | 180 | QWidget::hide(); |
118 | 181 | ||
119 | m_pListView->setColumnWidth(1, m_pListView->contentsRect().width() - m_pListView->columnWidth(0) | 182 | if (inLoop) { |
120 | - m_pListView->verticalScrollBar()->width()); | 183 | inLoop = false; |
184 | qApp->exit_loop(); | ||
185 | } | ||
186 | } | ||
187 | |||
188 | void ThumbnailView::exec() | ||
189 | { | ||
190 | show(); | ||
191 | |||
192 | if (!inLoop) { | ||
193 | inLoop = true; | ||
194 | qApp->enter_loop(); | ||
195 | } | ||
196 | } | ||
197 | |||
198 | void ThumbnailView::deletePage() | ||
199 | { | ||
200 | QMessageBox messageBox(tr("Delete Page"), tr("Do you want to delete\nthe selected page?"), | ||
201 | QMessageBox::Information, QMessageBox::Yes, | ||
202 | QMessageBox::No | QMessageBox::Escape | QMessageBox::Default, | ||
203 | QMessageBox::NoButton, this); | ||
204 | |||
205 | messageBox.setButtonText(QMessageBox::Yes, tr("Yes")); | ||
206 | messageBox.setButtonText(QMessageBox::No, tr("No")); | ||
207 | |||
208 | if (messageBox.exec() == QMessageBox::Yes) { | ||
209 | m_pDrawPadCanvas->deletePage(); | ||
210 | } | ||
121 | } | 211 | } |
diff --git a/noncore/graphics/drawpad/thumbnailview.h b/noncore/graphics/drawpad/thumbnailview.h index c74730d..ae97ff1 100644 --- a/noncore/graphics/drawpad/thumbnailview.h +++ b/noncore/graphics/drawpad/thumbnailview.h | |||
@@ -15,25 +15,58 @@ | |||
15 | #define THUMBNAILVIEW_H | 15 | #define THUMBNAILVIEW_H |
16 | 16 | ||
17 | #include <qdialog.h> | 17 | #include <qwidget.h> |
18 | #include <qlistview.h> | ||
18 | 19 | ||
19 | #include <qlist.h> | 20 | class DrawPadCanvas; |
21 | class Page; | ||
22 | |||
23 | class PageListViewItem : public QListViewItem | ||
24 | { | ||
25 | public: | ||
26 | PageListViewItem(Page* page, QListView* parent); | ||
27 | ~PageListViewItem(); | ||
20 | 28 | ||
21 | class QListView; | 29 | Page* page() const; |
22 | 30 | ||
23 | class Page; | 31 | private: |
32 | Page* m_pPage; | ||
33 | }; | ||
34 | |||
35 | class PageListView : public QListView | ||
36 | { | ||
37 | public: | ||
38 | PageListView(DrawPadCanvas* drawPadCanvas, QWidget* parent = 0, const char* name = 0); | ||
39 | ~PageListView(); | ||
40 | |||
41 | void updateView(); | ||
24 | 42 | ||
25 | class ThumbnailView : public QDialog | 43 | Page* selected() const; |
44 | |||
45 | protected: | ||
46 | void resizeEvent(QResizeEvent* e); | ||
47 | |||
48 | private: | ||
49 | DrawPadCanvas* m_pDrawPadCanvas; | ||
50 | }; | ||
51 | |||
52 | class ThumbnailView : public QWidget | ||
26 | { | 53 | { |
27 | Q_OBJECT | 54 | Q_OBJECT |
28 | 55 | ||
29 | public: | 56 | public: |
30 | ThumbnailView(QList<Page> pages, QWidget* parent = 0, const char* name = 0); | 57 | ThumbnailView(DrawPadCanvas* drawPadCanvas, QWidget* parent = 0, const char* name = 0); |
31 | ~ThumbnailView(); | 58 | ~ThumbnailView(); |
32 | 59 | ||
33 | protected: | 60 | void hide(); |
34 | void resizeEvent(QResizeEvent* e); | 61 | void exec(); |
62 | |||
63 | public slots: | ||
64 | void deletePage(); | ||
35 | 65 | ||
36 | private: | 66 | private: |
37 | QListView* m_pListView; | 67 | bool inLoop; |
68 | DrawPadCanvas* m_pDrawPadCanvas; | ||
69 | |||
70 | PageListView* m_pPageListView; | ||
38 | }; | 71 | }; |
39 | 72 | ||