diff --git a/YACReader/YACReader.pri b/YACReader/YACReader.pri index 95f78c38..f8d7aa21 100644 --- a/YACReader/YACReader.pri +++ b/YACReader/YACReader.pri @@ -6,7 +6,7 @@ INCLUDEPATH += $$PWD/../common \ win32 { INCLUDEPATH += $$PWD/../dependencies/poppler/include -LIBS += -L$$PWD/../dependencies/poppler/lib -lpoppler-qt4 +LIBS += -L$$PWD/../dependencies/poppler/lib -lpoppler-qt4 -loleaut32 -lole32 QMAKE_CXXFLAGS_RELEASE += /MP /Ob2 /Oi /Ot /GT /GL QMAKE_LFLAGS_RELEASE += /LTCG CONFIG -= embed_manifest_exe diff --git a/YACReaderLibrary/YACReaderLibrary.pro b/YACReaderLibrary/YACReaderLibrary.pro index de12152d..0c4aa358 100644 --- a/YACReaderLibrary/YACReaderLibrary.pro +++ b/YACReaderLibrary/YACReaderLibrary.pro @@ -16,7 +16,7 @@ DEFINES += SERVER_RELEASE win32 { INCLUDEPATH += ../dependencies/poppler/include -LIBS += -L../dependencies/poppler/lib -lpoppler-qt4 +LIBS += -L../dependencies/poppler/lib -lpoppler-qt4 -loleaut32 -lole32 QMAKE_CXXFLAGS_RELEASE += /MP /Ob2 /Oi /Ot /GT /GL QMAKE_LFLAGS_RELEASE += /LTCG CONFIG -= embed_manifest_exe diff --git a/YACReaderLibrary/comic_vine_client.cpp b/YACReaderLibrary/comic_vine_client.cpp index 9054044a..8d711c98 100644 --- a/YACReaderLibrary/comic_vine_client.cpp +++ b/YACReaderLibrary/comic_vine_client.cpp @@ -39,41 +39,54 @@ ComicVineClient::ComicVineClient(QObject *parent) : } +//CV_SEARCH void ComicVineClient::search(const QString & query, int page) { - CVSearch * search = new CVSearch(query,page); + CVSearch * search = new CVSearch(CV_SEARCH.arg(query).arg(page)); connect(search,SIGNAL(dataReady(const QByteArry &)),this,SLOT(proccessVolumesSearchData(const QByteArry &))); connect(search,SIGNAL(finished()),search,SLOT(deleteLater())); search->get(); } +//CV_SEARCH result void ComicVineClient::proccessVolumesSearchData(const QByteArray & data) { QString xml(data); } +//CV_SERIES_DETAIL void ComicVineClient::getSeriesDetail(const QString & id) { + } +//CV_COMIC_IDS void ComicVineClient::getComicIds(const QString & id, int page) { + } +//CV_COMIC_ID void ComicVineClient::getComicId(const QString & id, int comicNumber) { + } +//CV_COMIC_DETAIL void ComicVineClient::getComicDetail(const QString & id) { + } +//CV_COVER_DETAIL void ComicVineClient::getCoverURL(const QString & id) { + } //CVSearch -CVSearch::CVSearch(const QString & query, int page) - :HttpWorker(CV_SEARCH.arg(query).arg(page)) +CVSearch::CVSearch(const QString & URL) + :HttpWorker(URL) { + } \ No newline at end of file diff --git a/YACReaderLibrary/comic_vine_client.h b/YACReaderLibrary/comic_vine_client.h index 2f03b3af..41806317 100644 --- a/YACReaderLibrary/comic_vine_client.h +++ b/YACReaderLibrary/comic_vine_client.h @@ -28,7 +28,7 @@ private slots: class CVSearch : public HttpWorker { public: - CVSearch(const QString & query, int page=0); + CVSearch(const QString & URL); }; #endif // COMIC_VINE_CLIENT_H diff --git a/YACReaderLibrary/comic_vine_dialog.cpp b/YACReaderLibrary/comic_vine_dialog.cpp index 00e9d4fe..1fc7344a 100644 --- a/YACReaderLibrary/comic_vine_dialog.cpp +++ b/YACReaderLibrary/comic_vine_dialog.cpp @@ -5,6 +5,9 @@ #include #include #include +#include + +#include "yacreader_busy_widget.h" ComicVineDialog::ComicVineDialog(QWidget *parent) : QDialog(parent) @@ -22,12 +25,6 @@ void ComicVineDialog::doLayout() QString dialogButtonsStyleSheet = "QPushButton {border: 1px solid #242424; background: #2e2e2e; color:white; padding: 5px 26px 5px 26px; font-size:12px;font-family:Arial; font-weight:bold;}"; - QLabel * mainTitleLabel = new QLabel(tr("SEARCH")); - QLabel * subTitleLabel = new QLabel(tr("%1 comics selected")); - - mainTitleLabel->setStyleSheet("QLabel {color:white; font-size:18px;font-family:Arial;}"); - subTitleLabel->setStyleSheet("QLabel {color:white; font-size:12px;font-family:Arial;}"); - nextButton = new QPushButton(tr("next")); closeButton = new QPushButton(tr("close")); @@ -35,25 +32,17 @@ void ComicVineDialog::doLayout() closeButton->setStyleSheet(dialogButtonsStyleSheet); content = new QStackedWidget(this); - // QVBoxLayout * mainLayout = new QVBoxLayout; - QHBoxLayout * titleLayout = new QHBoxLayout; - QVBoxLayout * titleLabelsLayout = new QVBoxLayout; + QHBoxLayout * buttonLayout = new QHBoxLayout; - titleLabelsLayout->addWidget(mainTitleLabel); - titleLabelsLayout->addWidget(subTitleLabel); - titleLabelsLayout->setSpacing(0); - - titleLayout->addLayout(titleLabelsLayout); - buttonLayout->addStretch(); buttonLayout->addWidget(nextButton); buttonLayout->addWidget(closeButton); buttonLayout->setContentsMargins(0,0,0,0); - mainLayout->addLayout(titleLayout); + mainLayout->addWidget(titleHeader = new TitleHeader); mainLayout->addWidget(content); mainLayout->addStretch(); mainLayout->addLayout(buttonLayout); @@ -66,17 +55,141 @@ void ComicVineDialog::doLayout() void ComicVineDialog::doStackedWidgets() { - doSeriesQuestion(); + content->addWidget(seriesQuestion = new SeriesQuestion); + content->addWidget(searchSingleComic = new SearchSingleComic); + content->addWidget(searchVolume = new SearchVolume); + doLoading(); } -void ComicVineDialog::doSeriesQuestion() + +void ComicVineDialog::doConnections() +{ + connect(closeButton,SIGNAL(pressed()),this,SLOT(close())); + connect(nextButton,SIGNAL(pressed()),this,SLOT(goNext())); +} + +void ComicVineDialog::goNext() +{ + // + if(content->currentWidget() == seriesQuestion) + { + if(seriesQuestion->getYes()) + { + content->setCurrentWidget(searchVolume); + } + else + { + //titleHeader->setSubtitle + content->setCurrentWidget(searchSingleComic); + } + + } +} + +void ComicVineDialog::setComics(const QList & comics) +{ + this->comics = comics; +} + +void ComicVineDialog::show() +{ + if(comics.length() == 1) + { + ComicDB singleComic = comics[0]; + + if(singleComic.info.title != 0) + titleHeader->setSubtitle(*singleComic.info.title); + else + titleHeader->setSubtitle(QFileInfo(singleComic.path).fileName()); + + content->setCurrentWidget(searchSingleComic); + }else if(comics.length()>1) + { + titleHeader->setSubtitle(tr("%1 comics selected").arg(comics.length())); + content->setCurrentWidget(seriesQuestion); + } + QDialog::show(); +} + +void ComicVineDialog::doLoading() { QWidget * w = new QWidget; QVBoxLayout * l = new QVBoxLayout; + YACReaderBusyWidget * bw = new YACReaderBusyWidget; + + l->addStretch(); + l->addWidget(bw,0,Qt::AlignHCenter); + + l->setContentsMargins(0,0,0,0); + w->setLayout(l); + w->setContentsMargins(0,0,0,0); + + content->addWidget(w); +} + +//--------------------------------------- +//TitleHeader +//--------------------------------------- +TitleHeader::TitleHeader(QWidget * parent ) + :QWidget(parent) +{ + mainTitleLabel = new QLabel(); + subTitleLabel = new QLabel(); + + mainTitleLabel->setStyleSheet("QLabel {color:white; font-size:18px;font-family:Arial;}"); + subTitleLabel->setStyleSheet("QLabel {color:white; font-size:12px;font-family:Arial;}"); + + QHBoxLayout * titleLayout = new QHBoxLayout; + QVBoxLayout * titleLabelsLayout = new QVBoxLayout; + + titleLabelsLayout->addWidget(mainTitleLabel); + titleLabelsLayout->addWidget(subTitleLabel); + titleLabelsLayout->setSpacing(0); + + titleLayout->addLayout(titleLabelsLayout); + titleLayout->setContentsMargins(0,0,0,0); + + setLayout(titleLayout); + + setContentsMargins(0,0,0,0); + + setTitle(tr("SEARCH")); +} + +void TitleHeader::setTitle(const QString & title) +{ + mainTitleLabel->setText(title); +} + +void TitleHeader::setSubtitle(const QString & title) +{ + subTitleLabel->setText(title); +} + +void TitleHeader::showButtons(bool show) +{ + if(show) + { + + } + else + { + + } +} + +//--------------------------------------- +//SeriesQuestion +//--------------------------------------- +SeriesQuestion::SeriesQuestion(QWidget * parent) + :QWidget(parent) +{ + QVBoxLayout * l = new QVBoxLayout; + QLabel * questionLabel = new QLabel(tr("You are trying to get information for various comics at once, are they part of the same series?")); questionLabel->setStyleSheet("QLabel {color:white; font-size:12px;font-family:Arial;}"); - QRadioButton * yes = new QRadioButton(tr("yes")); - QRadioButton * no = new QRadioButton(tr("no")); + yes = new QRadioButton(tr("yes")); + no = new QRadioButton(tr("no")); QString rbStyle = "QRadioButton {margin-left:27px; margin-top:5px; color:white;font-size:12px;font-family:Arial;}" "QRadioButton::indicator {width:11px;height:11px;}" @@ -94,12 +207,87 @@ void ComicVineDialog::doSeriesQuestion() l->addStretch(); l->setContentsMargins(0,0,0,0); - w->setLayout(l); - w->setContentsMargins(0,0,0,0); - content->addWidget(w); + setLayout(l); + setContentsMargins(0,0,0,0); } -void ComicVineDialog::doConnections() +bool SeriesQuestion::getYes() { - connect(closeButton,SIGNAL(pressed()),this,SLOT(close())); + return yes->isChecked(); +} +//--------------------------------------- +//ScrapperLineEdit +//--------------------------------------- +ScrapperLineEdit::ScrapperLineEdit(const QString & title, QWidget * widget) + :QLineEdit(widget) +{ + titleLabel = new QLabel(title,this); + titleLabel->setStyleSheet("QLabel {color:white;}"); + + setStyleSheet(QString("QLineEdit {" + "border:none; background-color: #2E2E2E; color : white; padding-left: %1; padding-bottom: 1px; margin-bottom: 0px;" + "}").arg(titleLabel->sizeHint().width()+6)); + + setFixedHeight(22); +} + +void ScrapperLineEdit::resizeEvent(QResizeEvent *) +{ + QSize szl = titleLabel->sizeHint(); + titleLabel->move(6,(rect().bottom() + 1 - szl.height())/2); +} + +//--------------------------------------- +//SearchSingleComic +//--------------------------------------- +SearchSingleComic::SearchSingleComic(QWidget * parent) + :QWidget(parent) +{ + + QLabel * label = new QLabel(tr("No results found, please provide some aditional information. At least one field is needed.")); + label->setStyleSheet("QLabel {color:white; font-size:12px;font-family:Arial;}"); + + titleEdit = new ScrapperLineEdit(tr("Title:")); + numberEdit = new ScrapperLineEdit(tr("Number:")); + volumeEdit = new ScrapperLineEdit(tr("Series:")); + + numberEdit->setMaximumWidth(126); + + QVBoxLayout * l = new QVBoxLayout; + QHBoxLayout * hl = new QHBoxLayout; + hl->addWidget(titleEdit); + hl->addWidget(numberEdit); + + l->addSpacing(35); + l->addWidget(label); + l->addLayout(hl); + l->addWidget(volumeEdit); + l->addStretch(); + + l->setContentsMargins(0,0,0,0); + setLayout(l); + setContentsMargins(0,0,0,0); +} + +//--------------------------------------- +//SearchVolume +//--------------------------------------- +SearchVolume::SearchVolume(QWidget * parent) + :QWidget(parent) +{ + QLabel * label = new QLabel(tr("No results found, please provide some aditional information.")); + label->setStyleSheet("QLabel {color:white; font-size:12px;font-family:Arial;}"); + + volumeEdit = new ScrapperLineEdit(tr("Series:")); + + QVBoxLayout * l = new QVBoxLayout; + + l->addSpacing(35); + l->addWidget(label); + l->addWidget(volumeEdit); + l->addStretch(); + + l->setContentsMargins(0,0,0,0); + setLayout(l); + setContentsMargins(0,0,0,0); } \ No newline at end of file diff --git a/YACReaderLibrary/comic_vine_dialog.h b/YACReaderLibrary/comic_vine_dialog.h index 514c8d7e..16460370 100644 --- a/YACReaderLibrary/comic_vine_dialog.h +++ b/YACReaderLibrary/comic_vine_dialog.h @@ -2,21 +2,92 @@ #define COMIC_VINE_DIALOG_H #include +#include + +#include "comic_db.h" class QPushButton; class QStackedWidget; +class QLabel; +class QRadioButton; +class ScrapperLineEdit : public QLineEdit +{ + Q_OBJECT +public: + ScrapperLineEdit(const QString & title, QWidget * widget = 0); +protected: + void resizeEvent(QResizeEvent *); +private: + QLabel * titleLabel; +}; + +//---------------------------------------- +class TitleHeader : public QWidget +{ + Q_OBJECT +public: + TitleHeader(QWidget * parent = 0); +public slots: + void setTitle(const QString & title); + void setSubtitle(const QString & title); + void showButtons(bool show); +private: + QLabel * mainTitleLabel; + QLabel * subTitleLabel; +}; + +//---------------------------------------- +class SeriesQuestion : public QWidget +{ + Q_OBJECT +public: + SeriesQuestion(QWidget * parent = 0); + inline bool getYes(); +private: + QRadioButton * yes; + QRadioButton * no; +}; + +//---------------------------------------- +class SearchSingleComic : public QWidget +{ + Q_OBJECT +public: + SearchSingleComic(QWidget * parent = 0); +private: + ScrapperLineEdit * titleEdit; + ScrapperLineEdit * numberEdit; + ScrapperLineEdit * volumeEdit; +}; + +//---------------------------------------- +class SearchVolume : public QWidget +{ + Q_OBJECT +public: + SearchVolume(QWidget * parent = 0); +private: + ScrapperLineEdit * volumeEdit; +}; + +//---------------------------------------- class ComicVineDialog : public QDialog { Q_OBJECT public: explicit ComicVineDialog(QWidget *parent = 0); - + QString databasePath; + QString basePath; + void setComics(const QList & comics); signals: public slots: - + void show(); +protected slots: + void goNext(); private: + TitleHeader * titleHeader; QPushButton * nextButton; QPushButton * closeButton; @@ -28,8 +99,14 @@ private: void doLayout(); void doStackedWidgets(); - void doSeriesQuestion(); + void doLoading(); void doConnections(); + + QList comics; + + SeriesQuestion * seriesQuestion; + SearchSingleComic * searchSingleComic; + SearchVolume * searchVolume; }; #endif // COMIC_VINE_DIALOG_H diff --git a/YACReaderLibrary/library_window.cpp b/YACReaderLibrary/library_window.cpp index c5b79af3..ffc72696 100644 --- a/YACReaderLibrary/library_window.cpp +++ b/YACReaderLibrary/library_window.cpp @@ -1418,6 +1418,16 @@ void LibraryWindow::showProperties() void LibraryWindow::showComicVineScraper() { + QModelIndexList indexList = getSelectedComics(); + + QList comics = dmCV->getComics(indexList); + ComicDB c = comics[0]; + _comicIdEdited = c.id;//static_cast(indexList[0].internalPointer())->data(4).toULongLong(); + + comicVineDialog->databasePath = dm->getDatabase(); + comicVineDialog->basePath = currentPath(); + comicVineDialog->setComics(comics); + comicVineDialog->show(); } diff --git a/common/comic_flow_widget.cpp b/common/comic_flow_widget.cpp deleted file mode 100644 index 364bad47..00000000 --- a/common/comic_flow_widget.cpp +++ /dev/null @@ -1,311 +0,0 @@ -#include "comic_flow_widget.h" - -ComicFlowWidget::ComicFlowWidget(QWidget * parent) - :QWidget(parent) -{ - -} - -ComicFlowWidgetSW::ComicFlowWidgetSW(QWidget * parent) - :ComicFlowWidget(parent) -{ - flow = new ComicFlow(parent); - - connect(flow,SIGNAL(centerIndexChanged(int)),this,SIGNAL(centerIndexChanged(int))); - connect(flow,SIGNAL(selected(unsigned int)),this,SIGNAL(selected(unsigned int))); - - QVBoxLayout * l = new QVBoxLayout; - l->addWidget(flow); - setLayout(l); - - //TODO eleminar "padding" - QPalette Pal(palette()); - // set black background - Pal.setColor(QPalette::Background, Qt::black); - setAutoFillBackground(true); - setPalette(Pal); -} - -QSize ComicFlowWidgetSW::minimumSizeHint() const -{ - return flow->minimumSizeHint(); -} -QSize ComicFlowWidgetSW::sizeHint() const -{ - return flow->sizeHint(); -} - -void ComicFlowWidgetSW::setShowMarks(bool value) -{ - flow->setShowMarks(value); -} -void ComicFlowWidgetSW::setMarks(QVector marks) -{ - flow->setMarks(marks); -} -void ComicFlowWidgetSW::setMarkImage(QImage & image) -{ - flow->setMarkImage(image); -} -void ComicFlowWidgetSW::markSlide(int index) -{ - flow->markSlide(index); -} -void ComicFlowWidgetSW::unmarkSlide(int index) -{ - flow->unmarkSlide(index); -} -void ComicFlowWidgetSW::setSlideSize(QSize size) -{ - flow->setSlideSize(size); -} -void ComicFlowWidgetSW::clear() -{ - flow->clear(); -} -void ComicFlowWidgetSW::setImagePaths(QStringList paths) -{ - flow->setImagePaths(paths); -} -void ComicFlowWidgetSW::setCenterIndex(int index) -{ - flow->setCenterIndex(index); -} -void ComicFlowWidgetSW::showSlide(int index) -{ - flow->showSlide(index); -} -int ComicFlowWidgetSW::centerIndex() -{ - return flow->centerIndex(); -} -void ComicFlowWidgetSW::updateMarks() -{ - flow->updateMarks(); -} -void ComicFlowWidgetSW::setFlowType(PictureFlow::FlowType flowType) -{ - flow->setFlowType(flowType); -} -void ComicFlowWidgetSW::render() -{ - flow->render(); -} -void ComicFlowWidgetSW::keyPressEvent(QKeyEvent* event) -{ - flow->keyPressEvent(event); -} -void ComicFlowWidgetSW::paintEvent(QPaintEvent *event) -{ - flow->paintEvent(event); -} -void ComicFlowWidgetSW::mousePressEvent(QMouseEvent* event) -{ - flow->mousePressEvent(event); -} -void ComicFlowWidgetSW::resizeEvent(QResizeEvent* event) -{ - flow->resizeEvent(event); -} -void ComicFlowWidgetSW::mouseDoubleClickEvent(QMouseEvent* event) -{ - flow->mouseDoubleClickEvent(event); -} -void ComicFlowWidgetSW::updateConfig(QSettings * settings) -{ - //flow->setFlowType(flowType); -} - - -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// -///OpenGL ComicFlow -////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////// - -ComicFlowWidgetGL::ComicFlowWidgetGL(QWidget * parent) - :ComicFlowWidget(parent) -{ - flow = new YACReaderComicFlowGL(parent); - - connect(flow,SIGNAL(centerIndexChanged(int)),this,SIGNAL(centerIndexChanged(int))); - connect(flow,SIGNAL(selected(unsigned int)),this,SIGNAL(selected(unsigned int))); - - QVBoxLayout * l = new QVBoxLayout; - l->addWidget(flow); - l->setContentsMargins(0,0,0,0); - setLayout(l); - - //TODO eleminar "padding" - QPalette Pal(palette()); - // set black background - Pal.setColor(QPalette::Background, Qt::black); - setAutoFillBackground(true); - setPalette(Pal); -} - -QSize ComicFlowWidgetGL::minimumSizeHint() const -{ - return flow->minimumSizeHint(); -} -QSize ComicFlowWidgetGL::sizeHint() const -{ - return flow->sizeHint(); -} - -void ComicFlowWidgetGL::setShowMarks(bool value) -{ - flow->setShowMarks(value); -} -void ComicFlowWidgetGL::setMarks(QVector marks) -{ - flow->setMarks(marks); -} -void ComicFlowWidgetGL::setMarkImage(QImage & image) -{ - flow->setMarkImage(image); -} -void ComicFlowWidgetGL::markSlide(int index) -{ - flow->markSlide(index); -} -void ComicFlowWidgetGL::unmarkSlide(int index) -{ - flow->unmarkSlide(index); -} -void ComicFlowWidgetGL::setSlideSize(QSize size) -{ - flow->setSlideSize(size); -} -void ComicFlowWidgetGL::clear() -{ - flow->clear(); -} -void ComicFlowWidgetGL::setImagePaths(QStringList paths) -{ - flow->setImagePaths(paths); -} -void ComicFlowWidgetGL::setCenterIndex(int index) -{ - flow->setCenterIndex(index); -} -void ComicFlowWidgetGL::showSlide(int index) -{ - flow->showSlide(index); -} -int ComicFlowWidgetGL::centerIndex() -{ - return flow->centerIndex(); -} -void ComicFlowWidgetGL::updateMarks() -{ - flow->updateMarks(); -} -void ComicFlowWidgetGL::setFlowType(PictureFlow::FlowType flowType) -{ - if(flowType == PictureFlow::CoverFlowLike) - flow->setPreset(presetYACReaderFlowClassicConfig); - else if(flowType == PictureFlow::Strip) - flow->setPreset(presetYACReaderFlowStripeConfig); - else if(flowType == PictureFlow::StripOverlapped) - flow->setPreset(presetYACReaderFlowOverlappedStripeConfig); - else - flow->setPreset(defaultYACReaderFlowConfig); -} -void ComicFlowWidgetGL::render() -{ - flow->render(); -} -void ComicFlowWidgetGL::keyPressEvent(QKeyEvent* event) -{ - flow->keyPressEvent(event); -} -void ComicFlowWidgetGL::paintEvent(QPaintEvent *event) -{ - //flow->paintEvent(event); -} -void ComicFlowWidgetGL::mousePressEvent(QMouseEvent* event) -{ - flow->mousePressEvent(event); -} -void ComicFlowWidgetGL::resizeEvent(QResizeEvent* event) -{ - flow->resizeGL(event->size().width(),event->size().height()); -} -void ComicFlowWidgetGL::mouseDoubleClickEvent(QMouseEvent* event) -{ - flow->mouseDoubleClickEvent(event); -} - -void ComicFlowWidgetGL::updateConfig(QSettings * settings) -{ - Performance performance = medium; - - switch (settings->value("performance").toInt()) - { - case 0: - performance = low; - break; - case 1: - performance = medium; - break; - case 2: - performance = high; - break; - case 3: - performance = ultraHigh; - break; - } - - flow->setPerformance(performance); - - switch (settings->value("flowType").toInt()) - { - case 0: - flow->setPreset(presetYACReaderFlowClassicConfig); - return; - case 1: - flow->setPreset(presetYACReaderFlowStripeConfig); - return; - case 2: - flow->setPreset(presetYACReaderFlowOverlappedStripeConfig); - return; - case 3: - flow->setPreset(defaultYACReaderFlowConfig); - return; - case 4: - flow->setPreset(pressetYACReaderFlowDownConfig); - return; - } - - - //custom config - - flow->setCF_RX(settings->value("xRotation").toInt()); - flow->setCF_Y(settings->value("yPosition").toInt()); - flow->setX_Distance(settings->value("coverDistance").toInt()); - flow->setCenter_Distance(settings->value("centralDistance").toInt()); - flow->setCF_Z(settings->value("zoomLevel").toInt()); - flow->setY_Distance(settings->value("yCoverOffset").toInt()); - flow->setZ_Distance(settings->value("zCoverOffset").toInt()); - flow->setRotation(settings->value("coverRotation").toInt()); - flow->setFadeOutDist(settings->value("fadeOutDist").toInt()); - flow->setLightStrenght(settings->value("lightStrength").toInt()); - flow->setMaxAngle(settings->value("maxAngle").toInt()); - -/* flow->setVisibility(settings->value("visibilityDistance").toInt()); - flow->setLightStrenght(settings->value("lightStrength").toInt())*/; - -} - -//void ComicFlowWidgetGL::setCF_RX(int value){ flow->setCF_RX(value);} -//void ComicFlowWidgetGL::setCF_RY(int value){ flow->setCF_RY(value);} -//void ComicFlowWidgetGL::setCF_RZ(int value){ flow->setCF_RZ(value);} -//void ComicFlowWidgetGL::setZoom(int zoom){ flow->setZoom(zoom);} -//void ComicFlowWidgetGL::setRotation(int angle){ flow->setRotation(angle);} -//void ComicFlowWidgetGL::setX_Distance(int distance){ flow->setX_Distance(distance);} -//void ComicFlowWidgetGL::setCenter_Distance(int distance){ flow->setCenter_Distance(distance);} -//void ComicFlowWidgetGL::setZ_Distance(int distance){ flow->setZ_Distance(distance);} -//void ComicFlowWidgetGL::setCF_Y(int value){ flow->setCF_Y(value);} -//void ComicFlowWidgetGL::setY_Distance(int value){ flow->setY_Distance(value);} -//void ComicFlowWidgetGL::setPreset(const Preset & p){ flow->setPreset(p);} \ No newline at end of file diff --git a/common/comic_flow_widget.h b/common/comic_flow_widget.h deleted file mode 100644 index 5709e675..00000000 --- a/common/comic_flow_widget.h +++ /dev/null @@ -1,119 +0,0 @@ -#pragma once - -#include - -#include "pictureflow.h" -#include "comic_flow.h" -#include "yacreader_flow_gl.h" - -class ComicFlowWidget : public QWidget -{ - Q_OBJECT -public: - ComicFlowWidget(QWidget * paret = 0); - -public slots: - virtual void setShowMarks(bool value) = 0; - virtual void setMarks(QVector marks) = 0; - virtual void setMarkImage(QImage & image) = 0; - virtual void markSlide(int index) = 0; - virtual void unmarkSlide(int index) = 0; - virtual void setSlideSize(QSize size) = 0; - virtual void clear() = 0; - virtual void setImagePaths(QStringList paths) = 0; - virtual void setCenterIndex(int index) = 0; - virtual void showSlide(int index) = 0; - virtual int centerIndex() = 0; - virtual void updateMarks() = 0; - virtual void setFlowType(PictureFlow::FlowType flowType) = 0; - virtual void render() = 0; - virtual void updateConfig(QSettings * settings) = 0; -signals: - void centerIndexChanged(int); - void selected(unsigned int); -}; - - -class ComicFlowWidgetSW : public ComicFlowWidget -{ - Q_OBJECT -private: - ComicFlow * flow; -public: - ComicFlowWidgetSW(QWidget * parent = 0); - - void setShowMarks(bool value); - void setMarks(QVector marks); - void setMarkImage(QImage & image); - void markSlide(int index); - void unmarkSlide(int index); - void setSlideSize(QSize size); - void clear(); - void setImagePaths(QStringList paths); - void setCenterIndex(int index); - void showSlide(int index); - int centerIndex(); - void updateMarks(); - void setFlowType(PictureFlow::FlowType flowType); - void render(); - void updateConfig(QSettings * settings); -protected: - void keyPressEvent(QKeyEvent* event); - void paintEvent(QPaintEvent *event); - void mousePressEvent(QMouseEvent* event); - void resizeEvent(QResizeEvent* event); - void mouseDoubleClickEvent(QMouseEvent* event); - QSize minimumSizeHint() const; - QSize sizeHint() const; -}; - -class ComicFlowWidgetGL : public ComicFlowWidget -{ - Q_OBJECT -private: - YACReaderComicFlowGL * flow; -public: - ComicFlowWidgetGL(QWidget * parent = 0); - - void setShowMarks(bool value); - void setMarks(QVector marks); - void setMarkImage(QImage & image); - void markSlide(int index); - void unmarkSlide(int index); - void setSlideSize(QSize size); - void clear(); - void setImagePaths(QStringList paths); - void setCenterIndex(int index); - void showSlide(int index); - int centerIndex(); - void updateMarks(); - void setFlowType(PictureFlow::FlowType flowType); - void render(); - void updateConfig(QSettings * settings); -//public slots: -// void setCF_RX(int value); -// //the Y Rotation of the Coverflow -// void setCF_RY(int value); -// //the Z Rotation of the Coverflow -// void setCF_RZ(int value); -// //perspective -// void setZoom(int zoom); -// void setRotation(int angle); -// //sets the distance between the covers -// void setX_Distance(int distance); -// //sets the distance between the centered and the non centered covers -// void setCenter_Distance(int distance); -// //sets the pushback amount -// void setZ_Distance(int distance); -// void setCF_Y(int value); -// void setY_Distance(int value); -// void setPreset(const Preset & p); -protected: - void keyPressEvent(QKeyEvent* event); - void paintEvent(QPaintEvent *event); - void mousePressEvent(QMouseEvent* event); - void resizeEvent(QResizeEvent* event); - void mouseDoubleClickEvent(QMouseEvent* event); - QSize minimumSizeHint() const; - QSize sizeHint() const; -}; \ No newline at end of file