2 * This file is a part of QComicBook.
4 * Copyright (C) 2005-2006 Pawel Stolowski <yogin@linux.bydg.org>
6 * QComicBook is free software; you can redestribute it and/or modify it
7 * under terms of GNU General Public License by Free Software Foundation.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY. See GPL for more details.
13 #include "thumbnailswin.h"
14 #include "thumbnailsview.h"
15 #include "thumbnailloader.h"
16 #include "thumbnail.h"
17 #include "thumbnailevent.h"
19 using namespace QComicBook;
21 ThumbnailsWindow::ThumbnailsWindow(Place p, QWidget *parent): QDockWindow(p, parent)
23 setCaption(tr("Thumbnails"));
24 setResizeEnabled(true);
25 setCloseMode(QDockWindow::Always);
27 tview = new ThumbnailsView(this);
29 connect(tview, SIGNAL(requestedPage(int, bool)), this, SIGNAL(requestedPage(int, bool)));
30 connect(this, SIGNAL(orientationChanged(Orientation)), this, SLOT(onOrientationChanged(Orientation)));
33 ThumbnailsWindow::~ThumbnailsWindow()
37 void ThumbnailsWindow::customEvent(QCustomEvent *e)
39 if (e->type() == ThumbnailReady)
41 ThumbnailEvent *evt = dynamic_cast<ThumbnailEvent *>(e);
42 tview->setPage(*evt->getThumbnail());
45 QDockWindow::customEvent(e);
48 void ThumbnailsWindow::onOrientationChanged(Orientation o)
50 tview->setArrangement(o == Qt::Horizontal ? QIconView::TopToBottom : QIconView::LeftToRight);
53 ThumbnailsView* ThumbnailsWindow::view() const