summaryrefslogtreecommitdiff
authorleseb <leseb>2002-06-09 16:06:21 (UTC)
committer leseb <leseb>2002-06-09 16:06:21 (UTC)
commitb59a64c90deba66180e3a778d411296e984f64ea (patch) (unidiff)
tree88ef0767602dd174f5911719ffb346a4fcf7420f
parent29c0d188836a59bff1fbcd1d338fcd3334c0f1f5 (diff)
downloadopie-b59a64c90deba66180e3a778d411296e984f64ea.zip
opie-b59a64c90deba66180e3a778d411296e984f64ea.tar.gz
opie-b59a64c90deba66180e3a778d411296e984f64ea.tar.bz2
Changing page order now works in thumbnail view
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/drawpad/drawpadcanvas.cpp18
-rw-r--r--noncore/graphics/drawpad/drawpadcanvas.h2
-rw-r--r--noncore/graphics/drawpad/thumbnailview.cpp43
-rw-r--r--noncore/graphics/drawpad/thumbnailview.h11
4 files changed, 65 insertions, 9 deletions
diff --git a/noncore/graphics/drawpad/drawpadcanvas.cpp b/noncore/graphics/drawpad/drawpadcanvas.cpp
index c23ee34..bcb6877 100644
--- a/noncore/graphics/drawpad/drawpadcanvas.cpp
+++ b/noncore/graphics/drawpad/drawpadcanvas.cpp
@@ -421,2 +421,20 @@ void DrawPadCanvas::deletePage()
421 421
422void DrawPadCanvas::movePageUp()
423{
424 int index = m_pages.at();
425 Page* page = m_pages.take();
426 m_pages.insert(index - 1, page);
427
428 emit pagesChanged();
429}
430
431void DrawPadCanvas::movePageDown()
432{
433 int index = m_pages.at();
434 Page* page = m_pages.take();
435 m_pages.insert(index + 1, page);
436
437 emit pagesChanged();
438}
439
422bool DrawPadCanvas::undoEnabled() 440bool DrawPadCanvas::undoEnabled()
diff --git a/noncore/graphics/drawpad/drawpadcanvas.h b/noncore/graphics/drawpad/drawpadcanvas.h
index d74d425..39cf752 100644
--- a/noncore/graphics/drawpad/drawpadcanvas.h
+++ b/noncore/graphics/drawpad/drawpadcanvas.h
@@ -57,2 +57,4 @@ public slots:
57 void deletePage(); 57 void deletePage();
58 void movePageUp();
59 void movePageDown();
58 60
diff --git a/noncore/graphics/drawpad/thumbnailview.cpp b/noncore/graphics/drawpad/thumbnailview.cpp
index 0c7934e..428e008 100644
--- a/noncore/graphics/drawpad/thumbnailview.cpp
+++ b/noncore/graphics/drawpad/thumbnailview.cpp
@@ -172,9 +172,11 @@ ThumbnailView::ThumbnailView(DrawPad* drawPad, DrawPadCanvas* drawPadCanvas, QWi
172 172
173 QToolButton* movePageUpButton = new QToolButton(this); 173 m_pMovePageUpButton = new QToolButton(this);
174 movePageUpButton->setIconSet(Resource::loadIconSet("up")); 174 m_pMovePageUpButton->setIconSet(Resource::loadIconSet("up"));
175 movePageUpButton->setAutoRaise(true); 175 m_pMovePageUpButton->setAutoRaise(true);
176 connect(m_pMovePageUpButton, SIGNAL(clicked()), this, SLOT(movePageUp()));
176 177
177 QToolButton* movePageDownButton = new QToolButton(this); 178 m_pMovePageDownButton = new QToolButton(this);
178 movePageDownButton->setIconSet(Resource::loadIconSet("down")); 179 m_pMovePageDownButton->setIconSet(Resource::loadIconSet("down"));
179 movePageDownButton->setAutoRaise(true); 180 m_pMovePageDownButton->setAutoRaise(true);
181 connect(m_pMovePageDownButton, SIGNAL(clicked()), this, SLOT(movePageDown()));
180 182
@@ -190,4 +192,4 @@ ThumbnailView::ThumbnailView(DrawPad* drawPad, DrawPadCanvas* drawPadCanvas, QWi
190 buttonLayout->addStretch(); 192 buttonLayout->addStretch();
191 buttonLayout->addWidget(movePageUpButton); 193 buttonLayout->addWidget(m_pMovePageUpButton);
192 buttonLayout->addWidget(movePageDownButton); 194 buttonLayout->addWidget(m_pMovePageDownButton);
193 195
@@ -195,2 +197,4 @@ ThumbnailView::ThumbnailView(DrawPad* drawPad, DrawPadCanvas* drawPadCanvas, QWi
195 mainLayout->addWidget(m_pPageListView); 197 mainLayout->addWidget(m_pPageListView);
198
199 updateView();
196} 200}
@@ -202,2 +206,8 @@ ThumbnailView::~ThumbnailView()
202 206
207void ThumbnailView::updateView()
208{
209 m_pMovePageUpButton->setEnabled(m_pDrawPadCanvas->goPreviousPageEnabled());
210 m_pMovePageDownButton->setEnabled(m_pDrawPadCanvas->goNextPageEnabled());
211}
212
203void ThumbnailView::hide() 213void ThumbnailView::hide()
@@ -233,2 +243,3 @@ void ThumbnailView::newPage()
233 m_pPageListView->updateView(); 243 m_pPageListView->updateView();
244 updateView();
234 } 245 }
@@ -265,2 +276,3 @@ void ThumbnailView::deletePage()
265 m_pPageListView->updateView(); 276 m_pPageListView->updateView();
277 updateView();
266 } 278 }
@@ -268,2 +280,16 @@ void ThumbnailView::deletePage()
268 280
281void ThumbnailView::movePageUp()
282{
283 m_pDrawPadCanvas->movePageUp();
284 m_pPageListView->updateView();
285 updateView();
286}
287
288void ThumbnailView::movePageDown()
289{
290 m_pDrawPadCanvas->movePageDown();
291 m_pPageListView->updateView();
292 updateView();
293}
294
269void ThumbnailView::changePage() 295void ThumbnailView::changePage()
@@ -271,2 +297,3 @@ void ThumbnailView::changePage()
271 m_pDrawPadCanvas->selectPage(m_pPageListView->selected()); 297 m_pDrawPadCanvas->selectPage(m_pPageListView->selected());
298 updateView();
272} 299}
diff --git a/noncore/graphics/drawpad/thumbnailview.h b/noncore/graphics/drawpad/thumbnailview.h
index 1fdb168..eb748fa 100644
--- a/noncore/graphics/drawpad/thumbnailview.h
+++ b/noncore/graphics/drawpad/thumbnailview.h
@@ -23,2 +23,4 @@ class Page;
23 23
24class QToolButton;
25
24class PageListViewItem : public QListViewItem 26class PageListViewItem : public QListViewItem
@@ -60,3 +62,5 @@ public:
60 ~ThumbnailView(); 62 ~ThumbnailView();
61 63
64 void updateView();
65
62 void hide(); 66 void hide();
@@ -68,2 +72,4 @@ public slots:
68 void deletePage(); 72 void deletePage();
73 void movePageUp();
74 void movePageDown();
69 void changePage(); 75 void changePage();
@@ -76,2 +82,5 @@ private:
76 82
83 QToolButton* m_pMovePageUpButton;
84 QToolButton* m_pMovePageDownButton;
85
77 PageListView* m_pPageListView; 86 PageListView* m_pPageListView;