mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
commit
fa3e5eac14
16
CHANGELOG.md
16
CHANGELOG.md
@ -2,6 +2,22 @@
|
|||||||
|
|
||||||
Version counting is based on semantic versioning (Major.Feature.Patch)
|
Version counting is based on semantic versioning (Major.Feature.Patch)
|
||||||
|
|
||||||
|
## WIP
|
||||||
|
|
||||||
|
### YACReader
|
||||||
|
* Fix segfault (or worse) when exiting YACReader while processing a comic.
|
||||||
|
* Fix last read page calculation in double page mode.
|
||||||
|
|
||||||
|
### YACReaderLibrary
|
||||||
|
* Fix drag&drop in the comics grid view.
|
||||||
|
* Detect back/forward mouse buttons to move back and forward through the browsing history.
|
||||||
|
* Fix crash when disabling the server.
|
||||||
|
|
||||||
|
### All apps
|
||||||
|
* Run logger in a dedicated thread to avoid segfaults at application shutdown
|
||||||
|
* Add support for poppler-qt6 pdf backend
|
||||||
|
* Remove image allocation limit.
|
||||||
|
|
||||||
## 9.10
|
## 9.10
|
||||||
|
|
||||||
### YACReader
|
### YACReader
|
||||||
|
@ -214,28 +214,16 @@ win32 {
|
|||||||
$(COPY) $$shell_path($${SOURCE_QM_DIR}) $$shell_path($${DEPLOYMENT_OUT_QM_DIR})
|
$(COPY) $$shell_path($${SOURCE_QM_DIR}) $$shell_path($${DEPLOYMENT_OUT_QM_DIR})
|
||||||
} else {
|
} else {
|
||||||
LRELEASE_DIR = ../release/languages/
|
LRELEASE_DIR = ../release/languages/
|
||||||
|
QM_FILES_INSTALL_PATH = $$DATADIR/yacreader/languages
|
||||||
}
|
}
|
||||||
|
|
||||||
unix:!macx {
|
unix:!macx {
|
||||||
# set install prefix if it's empty
|
|
||||||
isEmpty(PREFIX) {
|
|
||||||
PREFIX = /usr
|
|
||||||
}
|
|
||||||
isEmpty(BINDIR) {
|
|
||||||
BINDIR = $$PREFIX/bin
|
|
||||||
}
|
|
||||||
isEmpty(LIBDIR) {
|
|
||||||
LIBDIR = $$PREFIX/lib
|
|
||||||
}
|
|
||||||
isEmpty(DATADIR) {
|
|
||||||
DATADIR = $$PREFIX/share
|
|
||||||
}
|
|
||||||
|
|
||||||
DEFINES += "LIBDIR=\\\"$$LIBDIR\\\"" "DATADIR=\\\"$$DATADIR\\\""
|
DEFINES += "LIBDIR=\\\"$$LIBDIR\\\"" "DATADIR=\\\"$$DATADIR\\\""
|
||||||
|
|
||||||
#MAKE INSTALL
|
#MAKE INSTALL
|
||||||
|
|
||||||
INSTALLS += bin docs icon desktop translation manpage
|
INSTALLS += bin docs icon desktop manpage
|
||||||
|
|
||||||
bin.path = $$BINDIR
|
bin.path = $$BINDIR
|
||||||
isEmpty(DESTDIR) {
|
isEmpty(DESTDIR) {
|
||||||
@ -256,9 +244,6 @@ icon.files = ../YACReader.svg
|
|||||||
desktop.path = $$DATADIR/applications
|
desktop.path = $$DATADIR/applications
|
||||||
desktop.files = ../YACReader.desktop
|
desktop.files = ../YACReader.desktop
|
||||||
|
|
||||||
translation.path = $$DATADIR/yacreader/languages
|
|
||||||
translation.files = ../release/languages/yacreader_*
|
|
||||||
|
|
||||||
manpage.path = $$DATADIR/man/man1
|
manpage.path = $$DATADIR/man/man1
|
||||||
manpage.files = ../YACReader.1
|
manpage.files = ../YACReader.1
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QTranslator>
|
#include <QTranslator>
|
||||||
#include <QCommandLineParser>
|
#include <QCommandLineParser>
|
||||||
|
#include <QImageReader>
|
||||||
|
|
||||||
#include "main_window_viewer.h"
|
#include "main_window_viewer.h"
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
@ -97,6 +98,10 @@ int main(int argc, char *argv[])
|
|||||||
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
|
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
|
||||||
QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
|
QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
|
||||||
|
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
QImageReader::setAllocationLimit(0);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(_MSC_VER) && defined(_DEBUG)
|
#if defined(_MSC_VER) && defined(_DEBUG)
|
||||||
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
|
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
|
||||||
#endif
|
#endif
|
||||||
|
@ -382,20 +382,23 @@ Render::Render()
|
|||||||
|
|
||||||
Render::~Render()
|
Render::~Render()
|
||||||
{
|
{
|
||||||
if (comic != nullptr) {
|
for (auto *pr : pageRenders) {
|
||||||
comic->moveToThread(QApplication::instance()->thread());
|
if (pr != nullptr && pr->wait()) {
|
||||||
comic->deleteLater();
|
delete pr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (PageRender *pr, pageRenders)
|
|
||||||
if (pr != nullptr) {
|
|
||||||
if (pr->wait())
|
|
||||||
delete pr;
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO move to share_ptr
|
// TODO move to share_ptr
|
||||||
foreach (ImageFilter *filter, filters)
|
for (auto *filter : filters) {
|
||||||
delete filter;
|
delete filter;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (comic != nullptr) {
|
||||||
|
comic->invalidate();
|
||||||
|
comic->deleteLater();
|
||||||
|
comic->thread()->quit();
|
||||||
|
comic->thread()->wait();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Este método se encarga de forzar el renderizado de las páginas.
|
// Este método se encarga de forzar el renderizado de las páginas.
|
||||||
// Actualiza el buffer según es necesario.
|
// Actualiza el buffer según es necesario.
|
||||||
|
@ -1128,7 +1128,9 @@ void Viewer::updateComic(ComicDB &comic)
|
|||||||
if (!doublePage || (doublePage && render->currentPageIsDoublePage() == false)) {
|
if (!doublePage || (doublePage && render->currentPageIsDoublePage() == false)) {
|
||||||
comic.info.currentPage = render->getIndex() + 1;
|
comic.info.currentPage = render->getIndex() + 1;
|
||||||
} else {
|
} else {
|
||||||
if (!(render->getIndex() + 1 == comic.info.currentPage || render->getIndex() + 2 == comic.info.currentPage)) {
|
if (doublePage && render->currentPageIsDoublePage() && (render->getIndex() + 2 >= render->numPages())) {
|
||||||
|
comic.info.currentPage = std::min(render->numPages(), render->getIndex() + 2);
|
||||||
|
} else {
|
||||||
comic.info.currentPage = std::min(render->numPages(), render->getIndex() + 1);
|
comic.info.currentPage = std::min(render->numPages(), render->getIndex() + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -307,6 +307,7 @@ win32 {
|
|||||||
$(COPY) $$shell_path($${SOURCE_QM_DIR}) $$shell_path($${DEPLOYMENT_OUT_QM_DIR})
|
$(COPY) $$shell_path($${SOURCE_QM_DIR}) $$shell_path($${DEPLOYMENT_OUT_QM_DIR})
|
||||||
} else {
|
} else {
|
||||||
LRELEASE_DIR = ../release/languages/
|
LRELEASE_DIR = ../release/languages/
|
||||||
|
QM_FILES_INSTALL_PATH = $$DATADIR/yacreader/languages
|
||||||
}
|
}
|
||||||
|
|
||||||
#QML/GridView
|
#QML/GridView
|
||||||
@ -328,24 +329,11 @@ unix:!macx:RESOURCES += qml_win.qrc
|
|||||||
macx:RESOURCES += qml_osx.qrc
|
macx:RESOURCES += qml_osx.qrc
|
||||||
|
|
||||||
unix:!macx {
|
unix:!macx {
|
||||||
#set install prefix if it's empty
|
|
||||||
isEmpty(PREFIX) {
|
|
||||||
PREFIX = /usr
|
|
||||||
}
|
|
||||||
isEmpty(BINDIR) {
|
|
||||||
BINDIR = $$PREFIX/bin
|
|
||||||
}
|
|
||||||
isEmpty(LIBDIR) {
|
|
||||||
LIBDIR = $$PREFIX/lib
|
|
||||||
}
|
|
||||||
isEmpty(DATADIR) {
|
|
||||||
DATADIR = $$PREFIX/share
|
|
||||||
}
|
|
||||||
|
|
||||||
DEFINES += "LIBDIR=\\\"$$LIBDIR\\\"" "DATADIR=\\\"$$DATADIR\\\"" "BINDIR=\\\"$$BINDIR\\\""
|
DEFINES += "LIBDIR=\\\"$$LIBDIR\\\"" "DATADIR=\\\"$$DATADIR\\\"" "BINDIR=\\\"$$BINDIR\\\""
|
||||||
|
|
||||||
#MAKE INSTALL
|
#MAKE INSTALL
|
||||||
INSTALLS += bin icon desktop server translation manpage
|
INSTALLS += bin icon desktop server manpage
|
||||||
|
|
||||||
bin.path = $$BINDIR
|
bin.path = $$BINDIR
|
||||||
isEmpty(DESTDIR) {
|
isEmpty(DESTDIR) {
|
||||||
@ -363,9 +351,6 @@ icon.files = ../YACReaderLibrary.svg
|
|||||||
desktop.path = $$DATADIR/applications
|
desktop.path = $$DATADIR/applications
|
||||||
desktop.files = ../YACReaderLibrary.desktop
|
desktop.files = ../YACReaderLibrary.desktop
|
||||||
|
|
||||||
translation.path = $$DATADIR/yacreader/languages
|
|
||||||
translation.files = ../release/languages/yacreaderlibrary_*
|
|
||||||
|
|
||||||
manpage.path = $$DATADIR/man/man1
|
manpage.path = $$DATADIR/man/man1
|
||||||
manpage.files = ../YACReaderLibrary.1
|
manpage.files = ../YACReaderLibrary.1
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,7 @@ ComicVineDialog::ComicVineDialog(QWidget *parent)
|
|||||||
: QDialog(parent)
|
: QDialog(parent)
|
||||||
{
|
{
|
||||||
setWindowFlags(Qt::Window);
|
setWindowFlags(Qt::Window);
|
||||||
|
setModal(true);
|
||||||
|
|
||||||
doLayout();
|
doLayout();
|
||||||
doStackedWidgets();
|
doStackedWidgets();
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
#include <QGraphicsItemAnimation>
|
#include <QGraphicsItemAnimation>
|
||||||
#include <QTimeLine>
|
#include <QTimeLine>
|
||||||
// TODO: is QGLWidget needed here???
|
// TODO: is QGLWidget needed here???
|
||||||
//#include <QGLWidget>
|
// #include <QGLWidget>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QElapsedTimer>
|
#include <QElapsedTimer>
|
||||||
#include <QToolButton>
|
#include <QToolButton>
|
||||||
|
@ -27,38 +27,31 @@ void InitialComicInfoExtractor::extract()
|
|||||||
#ifndef NO_PDF
|
#ifndef NO_PDF
|
||||||
if (fi.suffix().compare("pdf", Qt::CaseInsensitive) == 0) {
|
if (fi.suffix().compare("pdf", Qt::CaseInsensitive) == 0) {
|
||||||
#if defined Q_OS_MAC && defined USE_PDFKIT
|
#if defined Q_OS_MAC && defined USE_PDFKIT
|
||||||
MacOSXPDFComic *pdfComic = new MacOSXPDFComic();
|
auto pdfComic = std::make_unique<MacOSXPDFComic>();
|
||||||
if (!pdfComic->openComic(_fileSource)) {
|
if (!pdfComic->openComic(_fileSource)) {
|
||||||
delete pdfComic;
|
|
||||||
// QImage p;
|
|
||||||
// p.load(":/images/notCover.png");
|
|
||||||
// p.save(_target);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#elif defined USE_PDFIUM
|
#elif defined USE_PDFIUM
|
||||||
auto pdfComic = new PdfiumComic();
|
auto pdfComic = std::make_unique<PdfiumComic>();
|
||||||
if (!pdfComic->openComic(_fileSource)) {
|
if (!pdfComic->openComic(_fileSource)) {
|
||||||
delete pdfComic;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
Poppler::Document *pdfComic = Poppler::Document::load(_fileSource);
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
auto pdfComic = Poppler::Document::load(_fileSource);
|
||||||
|
#else
|
||||||
|
auto _pdfComic = Poppler::Document::load(_fileSource);
|
||||||
|
auto pdfComic = std::unique_ptr<Poppler::Document>(_pdfComic);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!pdfComic) {
|
if (!pdfComic) {
|
||||||
QLOG_WARN() << "Extracting cover: unable to open PDF file " << _fileSource;
|
QLOG_WARN() << "Extracting cover: unable to open PDF file " << _fileSource;
|
||||||
// delete pdfComic; //TODO check if the delete is needed
|
|
||||||
pdfComic = 0;
|
|
||||||
// QImage p;
|
|
||||||
// p.load(":/images/notCover.png");
|
|
||||||
// p.save(_target);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#if !defined USE_PDFKIT && !defined USE_PDFIUM
|
#if !defined USE_PDFKIT && !defined USE_PDFIUM
|
||||||
// poppler only, not mac
|
// poppler only, not mac
|
||||||
if (pdfComic->isLocked()) {
|
if (pdfComic->isLocked()) {
|
||||||
QLOG_WARN() << "Extracting cover: unable to open PDF file " << _fileSource;
|
QLOG_WARN() << "Extracting cover: unable to open PDF file " << _fileSource;
|
||||||
delete pdfComic;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -75,11 +68,7 @@ void InitialComicInfoExtractor::extract()
|
|||||||
saveCover(_target, p);
|
saveCover(_target, p);
|
||||||
} else if (_target != "") {
|
} else if (_target != "") {
|
||||||
QLOG_WARN() << "Extracting cover: requested cover index greater than numPages " << _fileSource;
|
QLOG_WARN() << "Extracting cover: requested cover index greater than numPages " << _fileSource;
|
||||||
// QImage p;
|
|
||||||
// p.load(":/images/notCover.png");
|
|
||||||
// p.save(_target);
|
|
||||||
}
|
}
|
||||||
delete pdfComic;
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@
|
|||||||
|
|
||||||
#include "comic_vine_dialog.h"
|
#include "comic_vine_dialog.h"
|
||||||
#include "api_key_dialog.h"
|
#include "api_key_dialog.h"
|
||||||
//#include "yacreader_social_dialog.h"
|
// #include "yacreader_social_dialog.h"
|
||||||
|
|
||||||
#include "comics_view.h"
|
#include "comics_view.h"
|
||||||
|
|
||||||
@ -139,6 +139,29 @@ void LibraryWindow::afterLaunchTasks()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool LibraryWindow::eventFilter(QObject *object, QEvent *event)
|
||||||
|
{
|
||||||
|
if (this->isActiveWindow()) {
|
||||||
|
if (event->type() == QEvent::MouseButtonRelease) {
|
||||||
|
auto mouseEvent = static_cast<QMouseEvent *>(event);
|
||||||
|
|
||||||
|
if (mouseEvent->button() == Qt::ForwardButton) {
|
||||||
|
forwardAction->trigger();
|
||||||
|
event->accept();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mouseEvent->button() == Qt::BackButton) {
|
||||||
|
backAction->trigger();
|
||||||
|
event->accept();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return QMainWindow::eventFilter(object, event);
|
||||||
|
}
|
||||||
|
|
||||||
void LibraryWindow::createSettings()
|
void LibraryWindow::createSettings()
|
||||||
{
|
{
|
||||||
settings = new QSettings(YACReader::getSettingsPath() + "/YACReaderLibrary.ini", QSettings::IniFormat); // TODO unificar la creación del fichero de config con el servidor
|
settings = new QSettings(YACReader::getSettingsPath() + "/YACReaderLibrary.ini", QSettings::IniFormat); // TODO unificar la creación del fichero de config con el servidor
|
||||||
|
@ -434,6 +434,8 @@ public slots:
|
|||||||
|
|
||||||
void afterLaunchTasks();
|
void afterLaunchTasks();
|
||||||
|
|
||||||
|
bool eventFilter(QObject *object, QEvent *event) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//! @brief Exits search mode if it is active.
|
//! @brief Exits search mode if it is active.
|
||||||
//! @return true If the search mode was active when this function was called.
|
//! @return true If the search mode was active when this function was called.
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
#include <QLibrary>
|
#include <QLibrary>
|
||||||
#endif
|
#endif
|
||||||
#include <QCommandLineParser>
|
#include <QCommandLineParser>
|
||||||
|
#include <QImageReader>
|
||||||
|
|
||||||
#include "yacreader_global.h"
|
#include "yacreader_global.h"
|
||||||
#include "yacreader_http_server.h"
|
#include "yacreader_http_server.h"
|
||||||
@ -130,6 +131,10 @@ int main(int argc, char **argv)
|
|||||||
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
|
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
|
||||||
QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
|
QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
|
||||||
|
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
QImageReader::setAllocationLimit(0);
|
||||||
|
#endif
|
||||||
|
|
||||||
QApplication app(argc, argv);
|
QApplication app(argc, argv);
|
||||||
|
|
||||||
#ifdef FORCE_ANGLE
|
#ifdef FORCE_ANGLE
|
||||||
@ -269,6 +274,8 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
app.installEventFilter(mw);
|
||||||
|
|
||||||
int ret = app.exec();
|
int ret = app.exec();
|
||||||
|
|
||||||
QLOG_INFO() << "YACReaderLibrary closed with exit code :" << ret;
|
QLOG_INFO() << "YACReaderLibrary closed with exit code :" << ret;
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -20,73 +20,73 @@ SplitView {
|
|||||||
color: info_container.color
|
color: info_container.color
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: main
|
id: main
|
||||||
clip: true
|
clip: true
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
id: backgroundImg
|
id: backgroundImg
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
source: backgroundImage
|
source: backgroundImage
|
||||||
fillMode: Image.PreserveAspectCrop
|
fillMode: Image.PreserveAspectCrop
|
||||||
smooth: true
|
smooth: true
|
||||||
mipmap: true
|
mipmap: true
|
||||||
asynchronous : true
|
asynchronous : true
|
||||||
cache: false //TODO clear cache only when it is needed
|
cache: false //TODO clear cache only when it is needed
|
||||||
opacity: 0
|
opacity: 0
|
||||||
visible: false
|
visible: false
|
||||||
}
|
}
|
||||||
|
|
||||||
FastBlur {
|
FastBlur {
|
||||||
anchors.fill: backgroundImg
|
anchors.fill: backgroundImg
|
||||||
source: backgroundImg
|
source: backgroundImg
|
||||||
radius: backgroundBlurRadius
|
radius: backgroundBlurRadius
|
||||||
opacity: backgroundBlurOpacity
|
opacity: backgroundBlurOpacity
|
||||||
visible: backgroundBlurVisible
|
visible: backgroundBlurVisible
|
||||||
}
|
}
|
||||||
|
|
||||||
color: backgroundColor
|
color: backgroundColor
|
||||||
width: parent.width - (info_container.visible ? info_container.width : 0)
|
width: parent.width - (info_container.visible ? info_container.width : 0)
|
||||||
SplitView.fillWidth: true
|
SplitView.fillWidth: true
|
||||||
SplitView.minimumWidth: coverWidth + 100
|
SplitView.minimumWidth: coverWidth + 100
|
||||||
height: parent.height
|
height: parent.height
|
||||||
anchors.margins: 0
|
anchors.margins: 0
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
id: appDelegate
|
id: appDelegate
|
||||||
Rectangle
|
Rectangle
|
||||||
{
|
{
|
||||||
id: cell
|
id: cell
|
||||||
width: grid.cellWidth
|
width: grid.cellWidth
|
||||||
height: grid.cellHeight
|
height: grid.cellHeight
|
||||||
color: "#00000000"
|
color: "#00000000"
|
||||||
|
|
||||||
scale: mouseArea.containsMouse ? 1.025 : 1
|
scale: mouseArea.containsMouse ? 1.025 : 1
|
||||||
|
|
||||||
Behavior on scale {
|
Behavior on scale {
|
||||||
NumberAnimation { duration: 90 }
|
NumberAnimation { duration: 90 }
|
||||||
}
|
}
|
||||||
|
|
||||||
DropShadow {
|
DropShadow {
|
||||||
anchors.fill: realCell
|
anchors.fill: realCell
|
||||||
transparentBorder: true
|
transparentBorder: true
|
||||||
horizontalOffset: 0
|
horizontalOffset: 0
|
||||||
verticalOffset: 0
|
verticalOffset: 0
|
||||||
radius: 10.0
|
radius: 10.0
|
||||||
//samples: 17
|
//samples: 17
|
||||||
color: "#FF000000"
|
color: "#FF000000"
|
||||||
source: realCell
|
source: realCell
|
||||||
visible: (Qt.platform.os === "osx") ? false : true;
|
visible: (Qt.platform.os === "osx") ? false : true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: realCell
|
id: realCell
|
||||||
|
|
||||||
property int position : 0
|
property int position : 0
|
||||||
property bool dragging: false;
|
property bool dragging: false;
|
||||||
Drag.active: mouseArea.drag.active
|
Drag.active: mouseArea.drag.active
|
||||||
Drag.hotSpot.x: 32
|
Drag.hotSpot.x: 32
|
||||||
Drag.hotSpot.y: 32
|
Drag.hotSpot.y: 32
|
||||||
Drag.dragType: Drag.Automatic
|
Drag.dragType: Drag.Automatic
|
||||||
//Drag.mimeData: { "x": 1 }
|
//Drag.mimeData: { "x": 1 }
|
||||||
Drag.proposedAction: Qt.CopyAction
|
Drag.proposedAction: Qt.CopyAction
|
||||||
@ -397,267 +397,227 @@ Rectangle {
|
|||||||
id: comicRating
|
id: comicRating
|
||||||
anchors {bottom: realCell.bottom; right: ratingImage.left; margins: 4}
|
anchors {bottom: realCell.bottom; right: ratingImage.left; margins: 4}
|
||||||
text: rating>0?rating:"-"
|
text: rating>0?rating:"-"
|
||||||
color: textColor
|
color: textColor
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: scrollView
|
id: scrollView
|
||||||
objectName: "topScrollView"
|
objectName: "topScrollView"
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: 0
|
|
||||||
children: grid
|
|
||||||
|
|
||||||
color: "transparent"
|
|
||||||
|
|
||||||
function scrollToOrigin() {
|
|
||||||
grid.contentY = grid.originY
|
|
||||||
grid.contentX = grid.originX
|
|
||||||
}
|
|
||||||
|
|
||||||
DropArea {
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
anchors.margins: 0
|
||||||
|
children: grid
|
||||||
|
|
||||||
onEntered: {
|
color: "transparent"
|
||||||
if(drag.hasUrls)
|
|
||||||
{
|
function scrollToOrigin() {
|
||||||
if(dropManager.canDropUrls(drag.urls, drag.action))
|
grid.contentY = grid.originY
|
||||||
{
|
grid.contentX = grid.originX
|
||||||
drag.accepted = true;
|
|
||||||
}else
|
|
||||||
drag.accepted = false;
|
|
||||||
}
|
|
||||||
else if (dropManager.canDropFormats(drag.formats)) {
|
|
||||||
drag.accepted = true;
|
|
||||||
} else
|
|
||||||
drag.accepted = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onDropped: {
|
property Component currentComicView: Component {
|
||||||
if(drop.hasUrls && dropManager.canDropUrls(drop.urls, drop.action))
|
id: currentComicView
|
||||||
{
|
|
||||||
dropManager.droppedFiles(drop.urls, drop.action);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
if (dropManager.canDropFormats(drop.formats))
|
|
||||||
{
|
|
||||||
var destItem = grid.itemAt(drop.x,drop.y + grid.contentY);
|
|
||||||
var destLocalX = grid.mapToItem(destItem,drop.x,drop.y + grid.contentY).x
|
|
||||||
var realIndex = grid.indexAt(drop.x,drop.y + grid.contentY);
|
|
||||||
|
|
||||||
if(realIndex === -1)
|
|
||||||
realIndex = grid.count - 1;
|
|
||||||
|
|
||||||
var destIndex = destLocalX < (grid.cellWidth / 2) ? realIndex : realIndex + 1;
|
|
||||||
dropManager.droppedComicsForResortingAt(drop.getDataAsString(), destIndex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
property Component currentComicView: Component {
|
|
||||||
id: currentComicView
|
|
||||||
Rectangle {
|
|
||||||
id: currentComicViewTopView
|
|
||||||
color: "#00000000"
|
|
||||||
|
|
||||||
height: showCurrentComic ? 270 : 20
|
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
color: (Qt.platform.os === "osx") ? "#88FFFFFF" : "#88000000"
|
id: currentComicViewTopView
|
||||||
|
color: "#00000000"
|
||||||
|
|
||||||
id: currentComicVisualView
|
height: showCurrentComic ? 270 : 20
|
||||||
|
|
||||||
width: main.width
|
Rectangle {
|
||||||
height: 250
|
color: (Qt.platform.os === "osx") ? "#88FFFFFF" : "#88000000"
|
||||||
|
|
||||||
visible: showCurrentComic
|
id: currentComicVisualView
|
||||||
|
|
||||||
//cover
|
width: main.width
|
||||||
Image {
|
height: 250
|
||||||
id: currentCoverElement
|
|
||||||
anchors.fill: parent
|
|
||||||
|
|
||||||
anchors.leftMargin: 15
|
visible: showCurrentComic
|
||||||
anchors.topMargin: 15
|
|
||||||
anchors.bottomMargin: 15
|
|
||||||
anchors.rightMargin: 15
|
|
||||||
horizontalAlignment: Image.AlignLeft
|
|
||||||
anchors {horizontalCenter: parent.horizontalCenter; top: parent.top; topMargin: 0}
|
|
||||||
source: comicsList.getCoverUrlPathForComicHash(currentComicInfo.hash.toString())
|
|
||||||
fillMode: Image.PreserveAspectFit
|
|
||||||
smooth: true
|
|
||||||
mipmap: true
|
|
||||||
asynchronous : true
|
|
||||||
cache: false //TODO clear cache only when it is needed
|
|
||||||
}
|
|
||||||
|
|
||||||
DropShadow {
|
//cover
|
||||||
anchors.fill: currentCoverElement
|
Image {
|
||||||
horizontalOffset: 0
|
id: currentCoverElement
|
||||||
verticalOffset: 0
|
anchors.fill: parent
|
||||||
radius: 8.0
|
|
||||||
transparentBorder: true
|
|
||||||
//samples: 17
|
|
||||||
color: "#FF000000"
|
|
||||||
source: currentCoverElement
|
|
||||||
visible: (Qt.platform.os === "osx") ? false : true;
|
|
||||||
}
|
|
||||||
|
|
||||||
ColumnLayout
|
anchors.leftMargin: 15
|
||||||
{
|
anchors.topMargin: 15
|
||||||
id: currentComicInfoView
|
anchors.bottomMargin: 15
|
||||||
|
anchors.rightMargin: 15
|
||||||
x: currentCoverElement.anchors.rightMargin + currentCoverElement.paintedWidth + currentCoverElement.anchors.rightMargin
|
horizontalAlignment: Image.AlignLeft
|
||||||
//y: currentCoverElement.anchors.topMargin
|
anchors {horizontalCenter: parent.horizontalCenter; top: parent.top; topMargin: 0}
|
||||||
|
source: comicsList.getCoverUrlPathForComicHash(currentComicInfo.hash.toString())
|
||||||
anchors.top: currentCoverElement.top
|
fillMode: Image.PreserveAspectFit
|
||||||
anchors.right: parent.right
|
smooth: true
|
||||||
anchors.left: readButton.left
|
mipmap: true
|
||||||
|
asynchronous : true
|
||||||
spacing: 9
|
cache: false //TODO clear cache only when it is needed
|
||||||
|
|
||||||
Text {
|
|
||||||
Layout.topMargin: 7
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.rightMargin: 20
|
|
||||||
|
|
||||||
Layout.alignment: Qt.AlignTop | Qt.AlignLeft
|
|
||||||
|
|
||||||
id: currentComicInfoTitleView
|
|
||||||
|
|
||||||
color: infoTitleColor
|
|
||||||
font.family: "Arial"
|
|
||||||
font.bold: true
|
|
||||||
font.pixelSize: 21
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
|
|
||||||
text: currentComic.getTitleIncludingNumber()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Flow {
|
DropShadow {
|
||||||
spacing: 0
|
anchors.fill: currentCoverElement
|
||||||
Layout.alignment: Qt.AlignTop | Qt.AlignLeft
|
horizontalOffset: 0
|
||||||
Layout.fillWidth: true
|
verticalOffset: 0
|
||||||
Layout.fillHeight: false
|
radius: 8.0
|
||||||
|
transparentBorder: true
|
||||||
|
//samples: 17
|
||||||
|
color: "#FF000000"
|
||||||
|
source: currentCoverElement
|
||||||
|
visible: (Qt.platform.os === "osx") ? false : true;
|
||||||
|
}
|
||||||
|
|
||||||
id: currentComicDetailsFlowView
|
ColumnLayout
|
||||||
property font infoFont: Qt.font({
|
{
|
||||||
family: "Arial",
|
id: currentComicInfoView
|
||||||
pixelSize: 14
|
|
||||||
});
|
x: currentCoverElement.anchors.rightMargin + currentCoverElement.paintedWidth + currentCoverElement.anchors.rightMargin
|
||||||
property string infoFlowTextColor: infoTextColor
|
//y: currentCoverElement.anchors.topMargin
|
||||||
|
|
||||||
|
anchors.top: currentCoverElement.top
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.left: readButton.left
|
||||||
|
|
||||||
|
spacing: 9
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: currentComicInfoVolume
|
Layout.topMargin: 7
|
||||||
color: currentComicDetailsFlowView.infoFlowTextColor
|
Layout.fillWidth: true
|
||||||
font: currentComicDetailsFlowView.infoFont
|
Layout.rightMargin: 20
|
||||||
text: currentComicInfo.volume ? currentComicInfo.volume : ""
|
|
||||||
rightPadding: 20
|
Layout.alignment: Qt.AlignTop | Qt.AlignLeft
|
||||||
visible: currentComicInfo.volume ? true : false
|
|
||||||
|
id: currentComicInfoTitleView
|
||||||
|
|
||||||
|
color: infoTitleColor
|
||||||
|
font.family: "Arial"
|
||||||
|
font.bold: true
|
||||||
|
font.pixelSize: 21
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
|
||||||
|
text: currentComic.getTitleIncludingNumber()
|
||||||
}
|
}
|
||||||
|
|
||||||
Text {
|
Flow {
|
||||||
id: currentComicInfoNumbering
|
spacing: 0
|
||||||
color: currentComicDetailsFlowView.infoFlowTextColor
|
Layout.alignment: Qt.AlignTop | Qt.AlignLeft
|
||||||
font: currentComicDetailsFlowView.infoFont
|
Layout.fillWidth: true
|
||||||
text: currentComicInfo.number + "/" + currentComicInfo.count
|
Layout.fillHeight: false
|
||||||
rightPadding: 20
|
|
||||||
visible : currentComicInfo.number ? true : false
|
|
||||||
}
|
|
||||||
|
|
||||||
Text {
|
id: currentComicDetailsFlowView
|
||||||
id: currentComicInfoGenre
|
property font infoFont: Qt.font({
|
||||||
color: currentComicDetailsFlowView.infoFlowTextColor
|
family: "Arial",
|
||||||
font: currentComicDetailsFlowView.infoFont
|
pixelSize: 14
|
||||||
text: currentComicInfo.genere ? currentComicInfo.genere : ""
|
});
|
||||||
rightPadding: 20
|
property string infoFlowTextColor: infoTextColor
|
||||||
visible: currentComicInfo.genere ? true : false
|
|
||||||
}
|
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: currentComicInfoDate
|
id: currentComicInfoVolume
|
||||||
color: currentComicDetailsFlowView.infoFlowTextColor
|
color: currentComicDetailsFlowView.infoFlowTextColor
|
||||||
font: currentComicDetailsFlowView.infoFont
|
font: currentComicDetailsFlowView.infoFont
|
||||||
text: currentComicInfo.date ? currentComicInfo.date : ""
|
text: currentComicInfo.volume ? currentComicInfo.volume : ""
|
||||||
rightPadding: 20
|
rightPadding: 20
|
||||||
visible: currentComicInfo.date ? true : false
|
visible: currentComicInfo.volume ? true : false
|
||||||
}
|
}
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: currentComicInfoPages
|
id: currentComicInfoNumbering
|
||||||
color: currentComicDetailsFlowView.infoFlowTextColor
|
color: currentComicDetailsFlowView.infoFlowTextColor
|
||||||
font: currentComicDetailsFlowView.infoFont
|
font: currentComicDetailsFlowView.infoFont
|
||||||
text: (currentComicInfo.numPages ? currentComicInfo.numPages : "") + " pages"
|
text: currentComicInfo.number + "/" + currentComicInfo.count
|
||||||
rightPadding: 20
|
rightPadding: 20
|
||||||
visible: currentComicInfo.numPages ? true : false
|
visible : currentComicInfo.number ? true : false
|
||||||
}
|
}
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: currentComicInfoShowInComicVine
|
id: currentComicInfoGenre
|
||||||
font: currentComicDetailsFlowView.infoFont
|
color: currentComicDetailsFlowView.infoFlowTextColor
|
||||||
color: "#ffcc00"
|
font: currentComicDetailsFlowView.infoFont
|
||||||
text: "Show in Comic Vine"
|
text: currentComicInfo.genere ? currentComicInfo.genere : ""
|
||||||
visible: currentComicInfo.comicVineID ? true : false
|
rightPadding: 20
|
||||||
MouseArea {
|
visible: currentComicInfo.genere ? true : false
|
||||||
anchors.fill: parent
|
}
|
||||||
onClicked: {
|
|
||||||
Qt.openUrlExternally("http://www.comicvine.com/comic/4000-%1/".arg(comicInfo.comicVineID));
|
Text {
|
||||||
|
id: currentComicInfoDate
|
||||||
|
color: currentComicDetailsFlowView.infoFlowTextColor
|
||||||
|
font: currentComicDetailsFlowView.infoFont
|
||||||
|
text: currentComicInfo.date ? currentComicInfo.date : ""
|
||||||
|
rightPadding: 20
|
||||||
|
visible: currentComicInfo.date ? true : false
|
||||||
|
}
|
||||||
|
|
||||||
|
Text {
|
||||||
|
id: currentComicInfoPages
|
||||||
|
color: currentComicDetailsFlowView.infoFlowTextColor
|
||||||
|
font: currentComicDetailsFlowView.infoFont
|
||||||
|
text: (currentComicInfo.numPages ? currentComicInfo.numPages : "") + " pages"
|
||||||
|
rightPadding: 20
|
||||||
|
visible: currentComicInfo.numPages ? true : false
|
||||||
|
}
|
||||||
|
|
||||||
|
Text {
|
||||||
|
id: currentComicInfoShowInComicVine
|
||||||
|
font: currentComicDetailsFlowView.infoFont
|
||||||
|
color: "#ffcc00"
|
||||||
|
text: "Show in Comic Vine"
|
||||||
|
visible: currentComicInfo.comicVineID ? true : false
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
onClicked: {
|
||||||
|
Qt.openUrlExternally("http://www.comicvine.com/comic/4000-%1/".arg(comicInfo.comicVineID));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
ScrollView {
|
ScrollView {
|
||||||
Layout.topMargin: 6
|
Layout.topMargin: 6
|
||||||
Layout.rightMargin: 30
|
Layout.rightMargin: 30
|
||||||
Layout.bottomMargin: 5
|
Layout.bottomMargin: 5
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.maximumHeight: (currentComicVisualView.height * 0.32)
|
Layout.maximumHeight: (currentComicVisualView.height * 0.32)
|
||||||
Layout.maximumWidth: 960
|
|
||||||
|
|
||||||
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
|
||||||
|
|
||||||
contentWidth: -1
|
|
||||||
contentItem: currentComicInfoSinopsis
|
|
||||||
|
|
||||||
id: synopsisScroller
|
|
||||||
|
|
||||||
clip: true
|
|
||||||
|
|
||||||
Text {
|
|
||||||
Layout.maximumWidth: 960
|
Layout.maximumWidth: 960
|
||||||
|
|
||||||
width: synopsisScroller.width
|
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
||||||
|
|
||||||
id: currentComicInfoSinopsis
|
contentWidth: -1
|
||||||
color: infoTitleColor
|
contentItem: currentComicInfoSinopsis
|
||||||
font.family: "Arial"
|
|
||||||
font.pixelSize: 14
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
|
|
||||||
text: '<html><head><style>
|
id: synopsisScroller
|
||||||
|
|
||||||
|
clip: true
|
||||||
|
|
||||||
|
Text {
|
||||||
|
Layout.maximumWidth: 960
|
||||||
|
|
||||||
|
width: synopsisScroller.width
|
||||||
|
|
||||||
|
id: currentComicInfoSinopsis
|
||||||
|
color: infoTitleColor
|
||||||
|
font.family: "Arial"
|
||||||
|
font.pixelSize: 14
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
|
||||||
|
text: '<html><head><style>
|
||||||
a {
|
a {
|
||||||
color: #FFCB00;
|
color: #FFCB00;
|
||||||
text-decoration:none;
|
text-decoration:none;
|
||||||
}
|
}
|
||||||
</style></head><body>' + currentComicInfo.synopsis ?? "" + '</body></html>'
|
</style></head><body>' + currentComicInfo.synopsis ?? "" + '</body></html>'
|
||||||
visible: currentComicInfo.synopsis ?? false
|
visible: currentComicInfo.synopsis ?? false
|
||||||
textFormat: Text.RichText
|
textFormat: Text.RichText
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
containmentMask: null
|
containmentMask: null
|
||||||
text: "Read"
|
text: "Read"
|
||||||
id: readButton
|
id: readButton
|
||||||
x: currentCoverElement.anchors.rightMargin + currentCoverElement.paintedWidth + currentCoverElement.anchors.rightMargin
|
x: currentCoverElement.anchors.rightMargin + currentCoverElement.paintedWidth + currentCoverElement.anchors.rightMargin
|
||||||
anchors.bottom: currentCoverElement.bottom
|
anchors.bottom: currentCoverElement.bottom
|
||||||
anchors.bottomMargin: 15
|
anchors.bottomMargin: 15
|
||||||
|
|
||||||
onClicked: comicOpener.triggerOpenCurrentComic()
|
onClicked: comicOpener.triggerOpenCurrentComic()
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
implicitWidth: 100
|
implicitWidth: 100
|
||||||
implicitHeight: 30
|
implicitHeight: 30
|
||||||
@ -677,203 +637,243 @@ Rectangle {
|
|||||||
color: "white"
|
color: "white"
|
||||||
text: readButton.text
|
text: readButton.text
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DropShadow {
|
DropShadow {
|
||||||
anchors.fill: readButton
|
anchors.fill: readButton
|
||||||
transparentBorder: true
|
transparentBorder: true
|
||||||
horizontalOffset: 0
|
horizontalOffset: 0
|
||||||
verticalOffset: 0
|
verticalOffset: 0
|
||||||
radius: 8.0
|
radius: 8.0
|
||||||
//samples: 17
|
//samples: 17
|
||||||
color: "#AA000000"
|
color: "#AA000000"
|
||||||
source: readButton
|
source: readButton
|
||||||
visible: ((Qt.platform.os === "osx") ? false : true) && !readButton.pressed
|
visible: ((Qt.platform.os === "osx") ? false : true) && !readButton.pressed
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
GridView {
|
GridView {
|
||||||
id:grid
|
id:grid
|
||||||
objectName: "grid"
|
objectName: "grid"
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
cellHeight: cellCustomHeight
|
cellHeight: cellCustomHeight
|
||||||
header: currentComicView
|
header: currentComicView
|
||||||
focus: true
|
focus: true
|
||||||
model: comicsList
|
model: comicsList
|
||||||
delegate: appDelegate
|
delegate: appDelegate
|
||||||
anchors.topMargin: 0
|
anchors.topMargin: 0
|
||||||
anchors.bottomMargin: 10
|
anchors.bottomMargin: 10
|
||||||
anchors.leftMargin: 0
|
anchors.leftMargin: 0
|
||||||
anchors.rightMargin: 0
|
anchors.rightMargin: 0
|
||||||
pixelAligned: true
|
pixelAligned: true
|
||||||
highlightFollowsCurrentItem: true
|
highlightFollowsCurrentItem: true
|
||||||
|
|
||||||
currentIndex: 0
|
currentIndex: 0
|
||||||
cacheBuffer: 0
|
cacheBuffer: 0
|
||||||
|
|
||||||
interactive: true
|
interactive: true
|
||||||
|
|
||||||
move: Transition {
|
move: Transition {
|
||||||
NumberAnimation { properties: "x,y"; duration: 250 }
|
NumberAnimation { properties: "x,y"; duration: 250 }
|
||||||
}
|
|
||||||
|
|
||||||
moveDisplaced: Transition {
|
|
||||||
NumberAnimation { properties: "x,y"; duration: 250 }
|
|
||||||
}
|
|
||||||
|
|
||||||
remove: Transition {
|
|
||||||
ParallelAnimation {
|
|
||||||
NumberAnimation { property: "opacity"; to: 0; duration: 250 }
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
removeDisplaced: Transition {
|
|
||||||
NumberAnimation { properties: "x,y"; duration: 250 }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
displaced: Transition {
|
|
||||||
NumberAnimation { properties: "x,y"; duration: 250 }
|
|
||||||
}
|
|
||||||
|
|
||||||
function numCellsPerRow() {
|
|
||||||
return Math.floor(width / cellCustomWidth);
|
|
||||||
}
|
|
||||||
|
|
||||||
onWidthChanged: {
|
|
||||||
calculateCellWidths(cellCustomWidth);
|
|
||||||
}
|
|
||||||
|
|
||||||
function calculateCellWidths(cWidth) {
|
|
||||||
var wholeCells = Math.floor(width / cWidth);
|
|
||||||
var rest = width - (cWidth * wholeCells)
|
|
||||||
|
|
||||||
grid.cellWidth = cWidth + Math.floor(rest / wholeCells);
|
|
||||||
}
|
|
||||||
|
|
||||||
WheelHandler {
|
|
||||||
onWheel: {
|
|
||||||
if (grid.contentHeight <= grid.height) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var newValue = Math.min((grid.contentHeight - grid.height - (showCurrentComic ? 270 : 20)), (Math.max(grid.originY , grid.contentY - event.angleDelta.y)));
|
|
||||||
grid.contentY = newValue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ScrollBar.vertical: ScrollBar {
|
|
||||||
visible: grid.contentHeight > grid.height
|
|
||||||
|
|
||||||
contentItem: Item {
|
|
||||||
implicitWidth: 12
|
|
||||||
implicitHeight: 26
|
|
||||||
Rectangle {
|
|
||||||
color: "#88424242"
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.topMargin: 6
|
|
||||||
anchors.leftMargin: 3
|
|
||||||
anchors.rightMargin: 2
|
|
||||||
anchors.bottomMargin: 6
|
|
||||||
border.color: "#AA313131"
|
|
||||||
border.width: 1
|
|
||||||
radius: 3.5
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Keys.onPressed: {
|
|
||||||
if (event.modifiers & Qt.ControlModifier || event.modifiers & Qt.ShiftModifier) {
|
|
||||||
event.accepted = true
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var numCells = grid.numCellsPerRow();
|
|
||||||
var ci = 0;
|
|
||||||
if (event.key === Qt.Key_Right) {
|
|
||||||
ci = Math.min(grid.currentIndex+1,grid.count - 1);
|
|
||||||
}
|
|
||||||
else if (event.key === Qt.Key_Left) {
|
|
||||||
ci = Math.max(0,grid.currentIndex-1);
|
|
||||||
}
|
|
||||||
else if (event.key === Qt.Key_Up) {
|
|
||||||
ci = Math.max(0,grid.currentIndex-numCells);
|
|
||||||
}
|
|
||||||
else if (event.key === Qt.Key_Down) {
|
|
||||||
ci = Math.min(grid.currentIndex+numCells,grid.count - 1);
|
|
||||||
} else {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
event.accepted = true;
|
|
||||||
grid.currentIndex = -1
|
|
||||||
comicsSelectionHelper.clear();
|
|
||||||
currentIndexHelper.setCurrentIndex(ci);
|
|
||||||
grid.currentIndex = ci;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: info_container
|
|
||||||
objectName: "infoContainer"
|
|
||||||
SplitView.preferredWidth: 350
|
|
||||||
SplitView.minimumWidth: 350
|
|
||||||
SplitView.maximumWidth: 960
|
|
||||||
height: parent.height
|
|
||||||
|
|
||||||
color: infoBackgroundColor
|
|
||||||
|
|
||||||
visible: showInfo
|
|
||||||
|
|
||||||
Flickable{
|
|
||||||
id: infoFlickable
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: 0
|
|
||||||
|
|
||||||
contentWidth: infoView.width
|
|
||||||
contentHeight: infoView.height
|
|
||||||
|
|
||||||
ComicInfoView {
|
|
||||||
id: infoView
|
|
||||||
width: info_container.width
|
|
||||||
}
|
|
||||||
|
|
||||||
WheelHandler {
|
|
||||||
onWheel: {
|
|
||||||
if (infoFlickable.contentHeight <= infoFlickable.height) {
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var newValue = Math.min((infoFlickable.contentHeight - infoFlickable.height), (Math.max(infoFlickable.originY , infoFlickable.contentY - event.angleDelta.y)));
|
moveDisplaced: Transition {
|
||||||
infoFlickable.contentY = newValue;
|
NumberAnimation { properties: "x,y"; duration: 250 }
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
ScrollBar.vertical: ScrollBar {
|
remove: Transition {
|
||||||
visible: infoFlickable.contentHeight > infoFlickable.height
|
ParallelAnimation {
|
||||||
|
NumberAnimation { property: "opacity"; to: 0; duration: 250 }
|
||||||
|
|
||||||
contentItem: Item {
|
}
|
||||||
implicitWidth: 12
|
}
|
||||||
implicitHeight: 26
|
|
||||||
Rectangle {
|
removeDisplaced: Transition {
|
||||||
color: "#424246"
|
NumberAnimation { properties: "x,y"; duration: 250 }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
displaced: Transition {
|
||||||
|
NumberAnimation { properties: "x,y"; duration: 250 }
|
||||||
|
}
|
||||||
|
|
||||||
|
function numCellsPerRow() {
|
||||||
|
return Math.floor(width / cellCustomWidth);
|
||||||
|
}
|
||||||
|
|
||||||
|
onWidthChanged: {
|
||||||
|
calculateCellWidths(cellCustomWidth);
|
||||||
|
}
|
||||||
|
|
||||||
|
function calculateCellWidths(cWidth) {
|
||||||
|
var wholeCells = Math.floor(width / cWidth);
|
||||||
|
var rest = width - (cWidth * wholeCells)
|
||||||
|
|
||||||
|
grid.cellWidth = cWidth + Math.floor(rest / wholeCells);
|
||||||
|
}
|
||||||
|
|
||||||
|
WheelHandler {
|
||||||
|
onWheel: {
|
||||||
|
if (grid.contentHeight <= grid.height) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var newValue = Math.min((grid.contentHeight - grid.height - (showCurrentComic ? 270 : 20)), (Math.max(grid.originY , grid.contentY - event.angleDelta.y)));
|
||||||
|
grid.contentY = newValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ScrollBar.vertical: ScrollBar {
|
||||||
|
visible: grid.contentHeight > grid.height
|
||||||
|
|
||||||
|
contentItem: Item {
|
||||||
|
implicitWidth: 12
|
||||||
|
implicitHeight: 26
|
||||||
|
Rectangle {
|
||||||
|
color: "#88424242"
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.topMargin: 6
|
||||||
|
anchors.leftMargin: 3
|
||||||
|
anchors.rightMargin: 2
|
||||||
|
anchors.bottomMargin: 6
|
||||||
|
border.color: "#AA313131"
|
||||||
|
border.width: 1
|
||||||
|
radius: 3.5
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Keys.onPressed: {
|
||||||
|
if (event.modifiers & Qt.ControlModifier || event.modifiers & Qt.ShiftModifier) {
|
||||||
|
event.accepted = true
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var numCells = grid.numCellsPerRow();
|
||||||
|
var ci = 0;
|
||||||
|
if (event.key === Qt.Key_Right) {
|
||||||
|
ci = Math.min(grid.currentIndex+1,grid.count - 1);
|
||||||
|
}
|
||||||
|
else if (event.key === Qt.Key_Left) {
|
||||||
|
ci = Math.max(0,grid.currentIndex-1);
|
||||||
|
}
|
||||||
|
else if (event.key === Qt.Key_Up) {
|
||||||
|
ci = Math.max(0,grid.currentIndex-numCells);
|
||||||
|
}
|
||||||
|
else if (event.key === Qt.Key_Down) {
|
||||||
|
ci = Math.min(grid.currentIndex+numCells,grid.count - 1);
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
event.accepted = true;
|
||||||
|
grid.currentIndex = -1
|
||||||
|
comicsSelectionHelper.clear();
|
||||||
|
currentIndexHelper.setCurrentIndex(ci);
|
||||||
|
grid.currentIndex = ci;
|
||||||
|
}
|
||||||
|
|
||||||
|
DropArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.topMargin: 6
|
|
||||||
anchors.leftMargin: 5
|
onEntered: drag => {
|
||||||
anchors.rightMargin: 4
|
if(drag.hasUrls)
|
||||||
anchors.bottomMargin: 6
|
{
|
||||||
radius: 2
|
if(dropManager.canDropUrls(drag.urls, drag.action))
|
||||||
|
{
|
||||||
|
drag.accepted = true;
|
||||||
|
}else
|
||||||
|
drag.accepted = false;
|
||||||
|
}
|
||||||
|
else if (dropManager.canDropFormats(drag.formats)) {
|
||||||
|
drag.accepted = true;
|
||||||
|
} else
|
||||||
|
drag.accepted = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
onDropped: drop => {
|
||||||
|
if(drop.hasUrls && dropManager.canDropUrls(drop.urls, drop.action))
|
||||||
|
{
|
||||||
|
dropManager.droppedFiles(drop.urls, drop.action);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if (dropManager.canDropFormats(drop.formats))
|
||||||
|
{
|
||||||
|
var destItem = grid.itemAt(drop.x,drop.y + grid.contentY);
|
||||||
|
var destLocalX = grid.mapToItem(destItem,drop.x,drop.y + grid.contentY).x
|
||||||
|
var realIndex = grid.indexAt(drop.x,drop.y + grid.contentY);
|
||||||
|
|
||||||
|
if(realIndex === -1)
|
||||||
|
realIndex = grid.count - 1;
|
||||||
|
|
||||||
|
var destIndex = destLocalX < (grid.cellWidth / 2) ? realIndex : realIndex + 1;
|
||||||
|
dropManager.droppedComicsForResortingAt("", destIndex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
Rectangle {
|
||||||
|
id: info_container
|
||||||
|
objectName: "infoContainer"
|
||||||
|
SplitView.preferredWidth: 350
|
||||||
|
SplitView.minimumWidth: 350
|
||||||
|
SplitView.maximumWidth: 960
|
||||||
|
height: parent.height
|
||||||
|
|
||||||
|
color: infoBackgroundColor
|
||||||
|
|
||||||
|
visible: showInfo
|
||||||
|
|
||||||
|
Flickable{
|
||||||
|
id: infoFlickable
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.margins: 0
|
||||||
|
|
||||||
|
contentWidth: infoView.width
|
||||||
|
contentHeight: infoView.height
|
||||||
|
|
||||||
|
ComicInfoView {
|
||||||
|
id: infoView
|
||||||
|
width: info_container.width
|
||||||
|
}
|
||||||
|
|
||||||
|
WheelHandler {
|
||||||
|
onWheel: {
|
||||||
|
if (infoFlickable.contentHeight <= infoFlickable.height) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var newValue = Math.min((infoFlickable.contentHeight - infoFlickable.height), (Math.max(infoFlickable.originY , infoFlickable.contentY - event.angleDelta.y)));
|
||||||
|
infoFlickable.contentY = newValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ScrollBar.vertical: ScrollBar {
|
||||||
|
visible: infoFlickable.contentHeight > infoFlickable.height
|
||||||
|
|
||||||
|
contentItem: Item {
|
||||||
|
implicitWidth: 12
|
||||||
|
implicitHeight: 26
|
||||||
|
Rectangle {
|
||||||
|
color: "#424246"
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.topMargin: 6
|
||||||
|
anchors.leftMargin: 5
|
||||||
|
anchors.rightMargin: 4
|
||||||
|
anchors.bottomMargin: 6
|
||||||
|
radius: 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
#include "static.h"
|
#include "static.h"
|
||||||
#include "yacreader_http_server.h"
|
#include "yacreader_http_server.h"
|
||||||
//#include "dualfilelogger.h"
|
// #include "dualfilelogger.h"
|
||||||
#include "httplistener.h"
|
#include "httplistener.h"
|
||||||
#include "requestmapper.h"
|
#include "requestmapper.h"
|
||||||
#include "staticfilecontroller.h"
|
#include "staticfilecontroller.h"
|
||||||
|
@ -167,8 +167,13 @@ ServerConfigDialog::ServerConfigDialog(QWidget *parent)
|
|||||||
if (settings->value(SERVER_ON, true).toBool()) {
|
if (settings->value(SERVER_ON, true).toBool()) {
|
||||||
check->setChecked(true);
|
check->setChecked(true);
|
||||||
generateQR();
|
generateQR();
|
||||||
} else
|
} else {
|
||||||
|
ip->setDisabled(true);
|
||||||
|
port->setDisabled(true);
|
||||||
|
accept->setDisabled(true);
|
||||||
|
|
||||||
check->setChecked(false);
|
check->setChecked(false);
|
||||||
|
}
|
||||||
|
|
||||||
performanceWorkaroundCheck->setChecked(settings->value(REMOTE_BROWSE_PERFORMANCE_WORKAROUND, false).toBool());
|
performanceWorkaroundCheck->setChecked(settings->value(REMOTE_BROWSE_PERFORMANCE_WORKAROUND, false).toBool());
|
||||||
|
|
||||||
@ -184,14 +189,18 @@ void ServerConfigDialog::enableServer(int status)
|
|||||||
settings->beginGroup("libraryConfig");
|
settings->beginGroup("libraryConfig");
|
||||||
|
|
||||||
if (status == Qt::Checked) {
|
if (status == Qt::Checked) {
|
||||||
|
ip->setDisabled(false);
|
||||||
|
port->setDisabled(false);
|
||||||
|
accept->setDisabled(false);
|
||||||
httpServer->start();
|
httpServer->start();
|
||||||
this->generateQR();
|
this->generateQR();
|
||||||
settings->setValue(SERVER_ON, true);
|
settings->setValue(SERVER_ON, true);
|
||||||
} else {
|
} else {
|
||||||
httpServer->stop();
|
httpServer->stop();
|
||||||
qrCode->setPixmap(QPixmap());
|
qrCode->setPixmap(QPixmap());
|
||||||
ip->clear();
|
ip->setDisabled(true);
|
||||||
port->setText("");
|
port->setDisabled(true);
|
||||||
|
accept->setDisabled(true);
|
||||||
settings->setValue(SERVER_ON, false);
|
settings->setValue(SERVER_ON, false);
|
||||||
}
|
}
|
||||||
settings->endGroup();
|
settings->endGroup();
|
||||||
|
@ -130,13 +130,6 @@ contains(QMAKE_TARGET.arch, x86_64) {
|
|||||||
|
|
||||||
unix:!macx {
|
unix:!macx {
|
||||||
#set install prefix if it's empty
|
#set install prefix if it's empty
|
||||||
isEmpty(PREFIX) {
|
|
||||||
PREFIX = /usr
|
|
||||||
}
|
|
||||||
|
|
||||||
BINDIR = $$PREFIX/bin
|
|
||||||
LIBDIR = $$PREFIX/lib
|
|
||||||
DATADIR = $$PREFIX/share
|
|
||||||
|
|
||||||
DEFINES += "LIBDIR=\\\"$$LIBDIR\\\"" "DATADIR=\\\"$$DATADIR\\\"" "BINDIR=\\\"$$BINDIR\\\""
|
DEFINES += "LIBDIR=\\\"$$LIBDIR\\\"" "DATADIR=\\\"$$DATADIR\\\"" "BINDIR=\\\"$$BINDIR\\\""
|
||||||
|
|
||||||
@ -150,7 +143,7 @@ DEFINES += "LIBDIR=\\\"$$LIBDIR\\\"" "DATADIR=\\\"$$DATADIR\\\"" "BINDIR=\\\"$$
|
|||||||
}
|
}
|
||||||
|
|
||||||
CONFIG(server_standalone) {
|
CONFIG(server_standalone) {
|
||||||
INSTALLS += bin server translation systemd
|
INSTALLS += bin server systemd
|
||||||
}
|
}
|
||||||
else:CONFIG(server_bundled) {
|
else:CONFIG(server_bundled) {
|
||||||
INSTALLS += bin systemd
|
INSTALLS += bin systemd
|
||||||
@ -169,9 +162,6 @@ server.files = ../release/server
|
|||||||
systemd.path = $$LIBDIR/systemd/user
|
systemd.path = $$LIBDIR/systemd/user
|
||||||
systemd.files = yacreaderlibraryserver.service
|
systemd.files = yacreaderlibraryserver.service
|
||||||
|
|
||||||
translation.path = $$DATADIR/yacreader/languages
|
|
||||||
translation.files = ../release/languages/yacreaderlibrary_*
|
|
||||||
|
|
||||||
# TODO: We need a manpage for yaclibserver
|
# TODO: We need a manpage for yaclibserver
|
||||||
#manpage.path = $$DATADIR/man/man1
|
#manpage.path = $$DATADIR/man/man1
|
||||||
#manpage.files = ../YACReaderLibrary.1
|
#manpage.files = ../YACReaderLibrary.1
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
//#include <QtCore>
|
// #include <QtCore>
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QSysInfo>
|
#include <QSysInfo>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QCommandLineParser>
|
#include <QCommandLineParser>
|
||||||
|
#include <QImageReader>
|
||||||
|
|
||||||
#include "comic_db.h"
|
#include "comic_db.h"
|
||||||
#include "db_helper.h"
|
#include "db_helper.h"
|
||||||
@ -81,6 +82,10 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
QCoreApplication app(argc, argv);
|
QCoreApplication app(argc, argv);
|
||||||
|
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
QImageReader::setAllocationLimit(0);
|
||||||
|
#endif
|
||||||
|
|
||||||
app.setApplicationName("YACReaderLibrary");
|
app.setApplicationName("YACReaderLibrary");
|
||||||
app.setOrganizationName("YACReader");
|
app.setOrganizationName("YACReader");
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ parameters:
|
|||||||
qt_version: '6.2.2'
|
qt_version: '6.2.2'
|
||||||
qt_spec: 'msvc2019_64'
|
qt_spec: 'msvc2019_64'
|
||||||
qt_aqt_spec: 'win64_msvc2019_64'
|
qt_aqt_spec: 'win64_msvc2019_64'
|
||||||
vc_redist_url: 'https://aka.ms/vs/16/release/vc_redist.x64.exe'
|
vc_redist_url: 'https://aka.ms/vs/17/release/vc_redist.x64.exe'
|
||||||
vc_redist_file_name: 'vc_redist.x64.exe'
|
vc_redist_file_name: 'vc_redist.x64.exe'
|
||||||
vc_vars: 'vcvars64.bat'
|
vc_vars: 'vcvars64.bat'
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ parameters:
|
|||||||
qt_version: '5.15.2'
|
qt_version: '5.15.2'
|
||||||
qt_spec: 'msvc2019_64'
|
qt_spec: 'msvc2019_64'
|
||||||
qt_aqt_spec: 'win64_msvc2019_64'
|
qt_aqt_spec: 'win64_msvc2019_64'
|
||||||
vc_redist_url: 'https://aka.ms/vs/16/release/vc_redist.x64.exe'
|
vc_redist_url: 'https://aka.ms/vs/17/release/vc_redist.x64.exe'
|
||||||
vc_redist_file_name: 'vc_redist.x64.exe'
|
vc_redist_file_name: 'vc_redist.x64.exe'
|
||||||
vc_vars: 'vcvars64.bat'
|
vc_vars: 'vcvars64.bat'
|
||||||
|
|
||||||
|
@ -234,7 +234,7 @@ jobs:
|
|||||||
qt_version: '5.15.2'
|
qt_version: '5.15.2'
|
||||||
qt_spec: 'msvc2019_64'
|
qt_spec: 'msvc2019_64'
|
||||||
qt_aqt_spec: 'win64_msvc2019_64'
|
qt_aqt_spec: 'win64_msvc2019_64'
|
||||||
vc_redist_url: 'https://aka.ms/vs/16/release/vc_redist.x64.exe'
|
vc_redist_url: 'https://aka.ms/vs/17/release/vc_redist.x64.exe'
|
||||||
vc_redist_file_name: 'vc_redist.x64.exe'
|
vc_redist_file_name: 'vc_redist.x64.exe'
|
||||||
vc_vars: 'vcvars64.bat'
|
vc_vars: 'vcvars64.bat'
|
||||||
|
|
||||||
@ -249,7 +249,7 @@ jobs:
|
|||||||
qt_version: '6.3.1'
|
qt_version: '6.3.1'
|
||||||
qt_spec: 'msvc2019_64'
|
qt_spec: 'msvc2019_64'
|
||||||
qt_aqt_spec: 'win64_msvc2019_64'
|
qt_aqt_spec: 'win64_msvc2019_64'
|
||||||
vc_redist_url: 'https://aka.ms/vs/16/release/vc_redist.x64.exe'
|
vc_redist_url: 'https://aka.ms/vs/17/release/vc_redist.x64.exe'
|
||||||
vc_redist_file_name: 'vc_redist.x64.exe'
|
vc_redist_file_name: 'vc_redist.x64.exe'
|
||||||
vc_vars: 'vcvars64.bat'
|
vc_vars: 'vcvars64.bat'
|
||||||
|
|
||||||
@ -264,7 +264,7 @@ jobs:
|
|||||||
qt_version: '5.15.2'
|
qt_version: '5.15.2'
|
||||||
qt_spec: 'msvc2019'
|
qt_spec: 'msvc2019'
|
||||||
qt_aqt_spec: 'win32_msvc2019'
|
qt_aqt_spec: 'win32_msvc2019'
|
||||||
vc_redist_url: 'https://aka.ms/vs/16/release/vc_redist.x86.exe'
|
vc_redist_url: 'https://aka.ms/vs/17/release/vc_redist.x86.exe'
|
||||||
vc_redist_file_name: 'vc_redist.x86.exe'
|
vc_redist_file_name: 'vc_redist.x86.exe'
|
||||||
vc_vars: 'vcvars32.bat'
|
vc_vars: 'vcvars32.bat'
|
||||||
|
|
||||||
|
@ -115,10 +115,6 @@ LaunchYACReaderLibrary=Start YACreaderLibrary after finishing installation
|
|||||||
LaunchYACReader=Start YACreader after finishing installation
|
LaunchYACReader=Start YACreader after finishing installation
|
||||||
|
|
||||||
[Run]
|
[Run]
|
||||||
Filename: {tmp}\vc_redist.{#PLATFORM}.exe; \
|
|
||||||
Parameters: "/uninstall /quiet /norestart"; \
|
|
||||||
StatusMsg: "Uninstalling VC++ Redistributables..."
|
|
||||||
|
|
||||||
Filename: {tmp}\vc_redist.{#PLATFORM}.exe; \
|
Filename: {tmp}\vc_redist.{#PLATFORM}.exe; \
|
||||||
Parameters: "/install /quiet /norestart"; \
|
Parameters: "/install /quiet /norestart"; \
|
||||||
StatusMsg: "Installing VC++ Redistributables..."
|
StatusMsg: "Installing VC++ Redistributables..."
|
||||||
|
@ -124,10 +124,6 @@ LaunchYACReaderLibrary=Start YACreaderLibrary after finishing installation
|
|||||||
LaunchYACReader=Start YACreader after finishing installation
|
LaunchYACReader=Start YACreader after finishing installation
|
||||||
|
|
||||||
[Run]
|
[Run]
|
||||||
Filename: {tmp}\vc_redist.{#PLATFORM}.exe; \
|
|
||||||
Parameters: "/uninstall /quiet /norestart"; \
|
|
||||||
StatusMsg: "Uninstalling VC++ Redistributables..."
|
|
||||||
|
|
||||||
Filename: {tmp}\vc_redist.{#PLATFORM}.exe; \
|
Filename: {tmp}\vc_redist.{#PLATFORM}.exe; \
|
||||||
Parameters: "/install /quiet /norestart"; \
|
Parameters: "/install /quiet /norestart"; \
|
||||||
StatusMsg: "Installing VC++ Redistributables..."
|
StatusMsg: "Installing VC++ Redistributables..."
|
||||||
|
@ -796,24 +796,27 @@ bool PDFComic::load(const QString &path, const ComicDB &comic)
|
|||||||
void PDFComic::process()
|
void PDFComic::process()
|
||||||
{
|
{
|
||||||
#if defined Q_OS_MAC && defined USE_PDFKIT
|
#if defined Q_OS_MAC && defined USE_PDFKIT
|
||||||
pdfComic = new MacOSXPDFComic();
|
pdfComic = std::make_unique<MacOSXPDFComic>();
|
||||||
if (!pdfComic->openComic(_path)) {
|
if (!pdfComic->openComic(_path)) {
|
||||||
delete pdfComic;
|
|
||||||
emit errorOpening();
|
emit errorOpening();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#elif defined USE_PDFIUM
|
#elif defined USE_PDFIUM
|
||||||
pdfComic = new PdfiumComic();
|
pdfComic = std::make_unique<PdfiumComic>();
|
||||||
if (!pdfComic->openComic(_path)) {
|
if (!pdfComic->openComic(_path)) {
|
||||||
delete pdfComic;
|
|
||||||
emit errorOpening();
|
emit errorOpening();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
pdfComic = Poppler::Document::load(_path);
|
pdfComic = Poppler::Document::load(_path);
|
||||||
|
#else
|
||||||
|
auto _pdfComic = Poppler::Document::load(_path);
|
||||||
|
pdfComic = std::unique_ptr<Poppler::Document>(_pdfComic);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!pdfComic) {
|
if (!pdfComic) {
|
||||||
// delete pdfComic;
|
|
||||||
// pdfComic = 0;
|
|
||||||
moveToThread(QCoreApplication::instance()->thread());
|
moveToThread(QCoreApplication::instance()->thread());
|
||||||
emit errorOpening();
|
emit errorOpening();
|
||||||
return;
|
return;
|
||||||
@ -824,7 +827,6 @@ void PDFComic::process()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// pdfComic->setRenderHint(Poppler::Document::Antialiasing, true);
|
|
||||||
pdfComic->setRenderHint(Poppler::Document::TextAntialiasing, true);
|
pdfComic->setRenderHint(Poppler::Document::TextAntialiasing, true);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -853,7 +855,6 @@ void PDFComic::process()
|
|||||||
int buffered_index = _index;
|
int buffered_index = _index;
|
||||||
for (int i = buffered_index; i < nPages; i++) {
|
for (int i = buffered_index; i < nPages; i++) {
|
||||||
if (_invalidated) {
|
if (_invalidated) {
|
||||||
delete pdfComic;
|
|
||||||
moveToThread(QCoreApplication::instance()->thread());
|
moveToThread(QCoreApplication::instance()->thread());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -862,14 +863,12 @@ void PDFComic::process()
|
|||||||
}
|
}
|
||||||
for (int i = 0; i < buffered_index; i++) {
|
for (int i = 0; i < buffered_index; i++) {
|
||||||
if (_invalidated) {
|
if (_invalidated) {
|
||||||
delete pdfComic;
|
|
||||||
moveToThread(QCoreApplication::instance()->thread());
|
moveToThread(QCoreApplication::instance()->thread());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
renderPage(i);
|
renderPage(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
delete pdfComic;
|
|
||||||
moveToThread(QCoreApplication::instance()->thread());
|
moveToThread(QCoreApplication::instance()->thread());
|
||||||
emit imagesLoaded();
|
emit imagesLoaded();
|
||||||
}
|
}
|
||||||
@ -883,15 +882,16 @@ void PDFComic::renderPage(int page)
|
|||||||
QImage img = pdfComic->getPage(page);
|
QImage img = pdfComic->getPage(page);
|
||||||
if (!img.isNull()) {
|
if (!img.isNull()) {
|
||||||
#else
|
#else
|
||||||
Poppler::Page *pdfpage = pdfComic->page(page);
|
std::unique_ptr<Poppler::Page> pdfpage(pdfComic->page(page));
|
||||||
if (pdfpage) {
|
if (pdfpage) {
|
||||||
QImage img = pdfpage->renderToImage(150, 150);
|
QImage img = pdfpage->renderToImage(150, 150);
|
||||||
delete pdfpage;
|
|
||||||
#endif
|
#endif
|
||||||
QByteArray ba;
|
QByteArray ba;
|
||||||
QBuffer buf(&ba);
|
QBuffer buf(&ba);
|
||||||
|
buf.open(QIODevice::WriteOnly);
|
||||||
img.save(&buf, "jpg", 96);
|
img.save(&buf, "jpg", 96);
|
||||||
_pages[page] = ba;
|
_pages[page] = ba;
|
||||||
|
buf.close();
|
||||||
emit imageLoaded(page);
|
emit imageLoaded(page);
|
||||||
emit imageLoaded(page, _pages[page]);
|
emit imageLoaded(page, _pages[page]);
|
||||||
}
|
}
|
||||||
|
@ -12,8 +12,8 @@
|
|||||||
#include "pdf_comic.h"
|
#include "pdf_comic.h"
|
||||||
#endif // NO_PDF
|
#endif // NO_PDF
|
||||||
class ComicDB;
|
class ComicDB;
|
||||||
//#define EXTENSIONS << "*.jpg" << "*.jpeg" << "*.png" << "*.gif" << "*.tiff" << "*.tif" << "*.bmp" Comic::getSupportedImageFormats()
|
|
||||||
//#define EXTENSIONS_LITERAL << ".jpg" << ".jpeg" << ".png" << ".gif" << ".tiff" << ".tif" << ".bmp" //Comic::getSupportedImageLiteralFormats()
|
// #define EXTENSIONS_LITERAL << ".jpg" << ".jpeg" << ".png" << ".gif" << ".tiff" << ".tif" << ".bmp" //Comic::getSupportedImageLiteralFormats()
|
||||||
class Comic : public QObject
|
class Comic : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -165,13 +165,14 @@ class PDFComic : public Comic
|
|||||||
private:
|
private:
|
||||||
// pdf
|
// pdf
|
||||||
#if defined Q_OS_MAC && defined USE_PDFKIT
|
#if defined Q_OS_MAC && defined USE_PDFKIT
|
||||||
MacOSXPDFComic *pdfComic;
|
std::unique_ptr<MacOSXPDFComic> pdfComic;
|
||||||
#elif defined USE_PDFIUM
|
#elif defined USE_PDFIUM
|
||||||
PdfiumComic *pdfComic;
|
std::unique_ptr<PdfiumComic> pdfComic;
|
||||||
#else
|
#else
|
||||||
Poppler::Document *pdfComic;
|
std::unique_ptr<Poppler::Document> pdfComic;
|
||||||
#endif
|
#endif
|
||||||
void renderPage(int page);
|
void renderPage(int page);
|
||||||
|
|
||||||
// void run();
|
// void run();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#include <QImage>
|
#include <QImage>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QMutex>
|
#include <QMutex>
|
||||||
|
#include <QtGlobal>
|
||||||
|
|
||||||
#if defined Q_OS_MAC && defined USE_PDFKIT
|
#if defined Q_OS_MAC && defined USE_PDFKIT
|
||||||
class MacOSXPDFComic
|
class MacOSXPDFComic
|
||||||
@ -45,6 +46,10 @@ private:
|
|||||||
QFile pdfFile;
|
QFile pdfFile;
|
||||||
};
|
};
|
||||||
#else
|
#else
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
#include <poppler-qt6.h>
|
||||||
|
#else
|
||||||
#include "poppler-qt5.h"
|
#include "poppler-qt5.h"
|
||||||
|
#endif // QT_VERSION
|
||||||
#endif // Q_OS_MAC
|
#endif // Q_OS_MAC
|
||||||
#endif // PDF_COMIC_H
|
#endif // PDF_COMIC_H
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#include <QMetaType>
|
#include <QMetaType>
|
||||||
#include <QAbstractItemModel>
|
#include <QAbstractItemModel>
|
||||||
|
|
||||||
#define VERSION "9.10.0"
|
#define VERSION "9.11.0"
|
||||||
|
|
||||||
#define REMOTE_BROWSE_PERFORMANCE_WORKAROUND "REMOTE_BROWSE_PERFORMANCE_WORKAROUND"
|
#define REMOTE_BROWSE_PERFORMANCE_WORKAROUND "REMOTE_BROWSE_PERFORMANCE_WORKAROUND"
|
||||||
#define IMPORT_COMIC_INFO_XML_METADATA "IMPORT_COMIC_INFO_XML_METADATA"
|
#define IMPORT_COMIC_INFO_XML_METADATA "IMPORT_COMIC_INFO_XML_METADATA"
|
||||||
|
16
config.pri
16
config.pri
@ -93,4 +93,20 @@ macx:!CONFIG(pdfkit):!CONFIG(pdfium):!CONFIG(no_pdf) {
|
|||||||
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x050900
|
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x050900
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unix:!macx {
|
||||||
|
# set install prefix if it's empty
|
||||||
|
isEmpty(PREFIX) {
|
||||||
|
PREFIX = /usr
|
||||||
|
}
|
||||||
|
isEmpty(BINDIR) {
|
||||||
|
BINDIR = $$PREFIX/bin
|
||||||
|
}
|
||||||
|
isEmpty(LIBDIR) {
|
||||||
|
LIBDIR = $$PREFIX/lib
|
||||||
|
}
|
||||||
|
isEmpty(DATADIR) {
|
||||||
|
DATADIR = $$PREFIX/share
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
DEFINES += QT_DEPRECATED_WARNINGS
|
DEFINES += QT_DEPRECATED_WARNINGS
|
||||||
|
@ -46,25 +46,20 @@ YACReader::WhatsNewDialog::WhatsNewDialog(QWidget *parent)
|
|||||||
"color:#858585;");
|
"color:#858585;");
|
||||||
|
|
||||||
auto text = new QLabel();
|
auto text = new QLabel();
|
||||||
text->setText("New release with the following updates:<br/>"
|
text->setText("A small update with a bunch of fixes:<br/>"
|
||||||
"<br/>"
|
"<br/>"
|
||||||
"<span style=\"font-weight:600\">YACReader</span><br/>"
|
"<span style=\"font-weight:600\">YACReader</span><br/>"
|
||||||
" • Fixed color selection dialog appearing as a subwindow in macos.<br/>"
|
" • Fix crash when exiting YACReader while it is processing a comic.<br/>"
|
||||||
" • Better support for HDPI screens (SVG icons).<br/>"
|
" • Fix last read page calculation in double page mode.<br/>"
|
||||||
"<br/>"
|
"<br/>"
|
||||||
"<span style=\"font-weight:600\">YACReaderLibrary</span><br/>"
|
"<span style=\"font-weight:600\">YACReaderLibrary</span><br/>"
|
||||||
" • New folder content view that replaces the old `subfolders in this folder` view shown when folders don't have direct comics. You may need to update your libraries to make folders display properly.<br/>"
|
" • Fix drag&drop in the comics grid view.<br/>"
|
||||||
" • Continue Reading view that it is shown for the root folder.<br/>"
|
" • Detect back/forward mouse buttons to move back and forward through the browsing history.<br/>"
|
||||||
" • UI gets updated when YACReaderLibrary gets updates from YACReader or YACReader for iOS.<br/>"
|
" • Fix crash when disabling the server.<br/>"
|
||||||
" • Fixed going forward history navigation.<br/>"
|
|
||||||
" • Fixed selected folder restoration after folder updates.<br/>"
|
|
||||||
" • Add option to delete metadata from comics.<br/>"
|
|
||||||
" • Better support for HDPI screens (SVG icons).<br/>"
|
|
||||||
" • Importing ComicInfo.XML is now optional, you can change the behavior in Settings -> General.<br/>"
|
|
||||||
" • Add option to scan XML metadata from all the comics in a folder.<br/>"
|
|
||||||
"<br/>"
|
"<br/>"
|
||||||
"<span style=\"font-weight:600\">Server</span><br/>"
|
"<span style=\"font-weight:600\">All apps</span><br/>"
|
||||||
" • New webui status page (reachable by navigating to server::port/webui).<br/>"
|
" • Add support for poppler-qt6 pdf backend (only relevat if you are building YACReader yourself).<br/>"
|
||||||
|
" • Remove image allocation limit in Qt6.<br/>"
|
||||||
"<br/>"
|
"<br/>"
|
||||||
"NOTE: Importing metadata from ComicInfo.XML in now disabled by default, if you want you can enable it Settings -> General.<br/>"
|
"NOTE: Importing metadata from ComicInfo.XML in now disabled by default, if you want you can enable it Settings -> General.<br/>"
|
||||||
"<br/>"
|
"<br/>"
|
||||||
|
33
dependencies/pdf_backend.pri
vendored
33
dependencies/pdf_backend.pri
vendored
@ -55,18 +55,31 @@ CONFIG(poppler) {
|
|||||||
LIBS += -L$$PWD/poppler/dependencies/bin
|
LIBS += -L$$PWD/poppler/dependencies/bin
|
||||||
}
|
}
|
||||||
if(unix|mingw):!macx {
|
if(unix|mingw):!macx {
|
||||||
!contains(QT_CONFIG, no-pkg-config):packagesExist(poppler-qt5) {
|
greaterThan (QT_MAJOR_VERSION, 5) {
|
||||||
message("Using system provided installation of poppler-qt5 found by pkg-config.")
|
!contains(QT_CONFIG, no-pkg-config):packagesExist(poppler-qt6) {
|
||||||
CONFIG += link_pkgconfig
|
message("Using system provided installation of poppler-qt6 found by pkg-config.")
|
||||||
PKGCONFIG += poppler-qt5
|
CONFIG += link_pkgconfig
|
||||||
} else:!macx:exists(/usr/include/poppler/qt5) {
|
PKGCONFIG += poppler-qt6
|
||||||
message("Using system provided installation of poppler-qt5.")
|
} else:!macx:exists(/usr/include/poppler/qt6) {
|
||||||
INCLUDEPATH += /usr/include/poppler/qt5
|
message("Using system provided installation of poppler-qt6.")
|
||||||
LIBS += -lpoppler-qt5
|
INCLUDEPATH += /usr/include/poppler/qt6
|
||||||
|
LIBS += -lpoppler-qt6
|
||||||
|
} else {
|
||||||
|
error("Could not find poppler-qt6")
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
error("Could not find poppler-qt5")
|
!contains(QT_CONFIG, no-pkg-config):packagesExist(poppler-qt5) {
|
||||||
|
message("Using system provided installation of poppler-qt5 found by pkg-config.")
|
||||||
|
CONFIG += link_pkgconfig
|
||||||
|
PKGCONFIG += poppler-qt5
|
||||||
|
} else:!macx:exists(/usr/include/poppler/qt5) {
|
||||||
|
message("Using system provided installation of poppler-qt5.")
|
||||||
|
INCLUDEPATH += /usr/include/poppler/qt5
|
||||||
|
LIBS += -lpoppler-qt5
|
||||||
|
} else {
|
||||||
|
error("Could not find poppler-qt5")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
unix:macx {
|
unix:macx {
|
||||||
error (Poppler backend is currently not supported on macOS)
|
error (Poppler backend is currently not supported on macOS)
|
||||||
|
2
third_party/QsLog/QsLog.pri
vendored
2
third_party/QsLog/QsLog.pri
vendored
@ -1,7 +1,7 @@
|
|||||||
INCLUDEPATH += $$PWD
|
INCLUDEPATH += $$PWD
|
||||||
#DEFINES += QS_LOG_LINE_NUMBERS # automatically writes the file and line for each log message
|
#DEFINES += QS_LOG_LINE_NUMBERS # automatically writes the file and line for each log message
|
||||||
#DEFINES += QS_LOG_DISABLE # logging code is replaced with a no-op
|
#DEFINES += QS_LOG_DISABLE # logging code is replaced with a no-op
|
||||||
#DEFINES += QS_LOG_SEPARATE_THREAD # messages are queued and written from a separate thread
|
DEFINES += QS_LOG_SEPARATE_THREAD # messages are queued and written from a separate thread
|
||||||
#DEFINES += QS_LOG_WIN_PRINTF_CONSOLE # Use fprintf instead of OutputDebugString on Windows
|
#DEFINES += QS_LOG_WIN_PRINTF_CONSOLE # Use fprintf instead of OutputDebugString on Windows
|
||||||
#DEFINES += QS_LOG_WINDOW # allows easily showing log messages in a UI
|
#DEFINES += QS_LOG_WINDOW # allows easily showing log messages in a UI
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user