Skip to content

Commit

Permalink
Merge pull request #313 from YACReader/develop
Browse files Browse the repository at this point in the history
9.9.0 Release
  • Loading branch information
luisangelsm committed Sep 3, 2022
2 parents 7394944 + 102396e commit 4c74e7a
Show file tree
Hide file tree
Showing 386 changed files with 14,579 additions and 6,283 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -67,3 +67,6 @@ YACReaderLibrary/YACReaderLibrary\.xcodeproj/
.DS_Store
compressed_archive/libp7zip
c_x86_64.pch

compile_commands.json
.ccls-cache
33 changes: 33 additions & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,39 @@ Version counting is based on semantic versioning (Major.Feature.Patch)

## WIP

### YACReader
* Show error when opening bad open recent entries
* GoTo page: Fix segfault when entering page numbers greater than comic's page count
(toolbar and page flow)
* Initialize GotoFlow on current page, not cover
* Quick navigation mode: Fix page index error when using both mouse and keyboard for navigation
* Remove obsolete double page mode debug messages
* Support HDPI screens.
* Use one wheel mouse step per page in full page mode.
* Add updated MIME types to .desktop file for .cbz and .cbr
* Add settings to control page turning behaviour on scroll.
* Make forward and backward buttons in a mouse turn pages.
* Don't crash if bookmarks get corrupt for some reason.
* Magnifying glass fixes and improvements.
* Shorcuts customization fixes.

### YACReaderLibrary
* Support HDPI screens.
* Support import legacy XML info in comic files.
* Ensure that comic info exports use .ydb as file suffix.
* Enable arrow keys navigation in the folders tree view.
* Add `Publication Date` column to the comics table view.
* Use a scale effect in the comics grids on mouse over.
* Add system info to the help/about dialog to help reporting bugs.
* Fix selection when clicking on a folder in search mode.
* Fix defaul value for manga/comic mode in folders.
* Add an edit for filtering series results returned by Comic Vine.
* Support editing comics tags sequentially without leaving the edit dialog.
* Fix export/import comics info.

### Server
* Always serve a cover image to the iOS client for any folder that has content (requeries a library content update).

## 9.8.2
### YACReaderLibrary
* Fix opening comics from the continue reading banner.
Expand Down
12 changes: 11 additions & 1 deletion README.md
Expand Up @@ -49,7 +49,17 @@ If you are interested in contributing to the project the first step should be to

Contributions are not restricted to code, you can help the project by bringing new UI/UX ideas, designing new assets, writing manuals or tutorials, translating the apps, etc. If you are interested in DevOps, YACReader uses Azure Pipelines for CI/CD, any improvements in that area are welcome. Testing pre-releases is also really appreciated.

#### Code
#### Dev Setup
YACReader is developed in *c++/Qt*, so the first thing you need to do is to install a *C++* compiler or environment that supports at least *C++17* and *Qt*. In *Windows* I use *Visual Studio Community Edition 2019* as build system and in *macos* I use Xcode, but I do all the coding using *QtCreator*. The project is adding support to *Qt6* and it alreaady compiles under it but it is not ready to ship, so you need to make sure that everything works in both *Qt5* and *Qt6*, you only need to install *Qt5* for now and *CI* will check that everything builds with *Qt6*.

The repo includes binaries for the dependencies needed for *Windows* (MSVC compiler) and *macos* (clang) but you need to configure *7zip/p7zip* dependency manually, please take a look at *compressed_archive/README_7zip.txt*.

##### Running and debuging
YACReader needs to find its dependencies at runtime, make sure that *Qt* binaries are in your *PATH* and the third party binaries are next to the executable. The best way to make sure you have all the thirdparty binaries in place is to check YACReader installation and copying the binaries in your output folder.

If you have the time and the energy, please open a PR with a script that automatizes any of these manual proceses.

#### Code Format
YACReader uses `clang-format` to ensure a common style and avoid deviances from it. CI checks this and will fail if the correct format is not used. `clang-format` needs to be called recursively in all the folders because some of them have the own `.clang-format` file, mainly to exclude changing the format in third-party libraries which are included in the source code. I recommend to configure your development tools to use `clang-format`, you can try to use it manually, but please, do it always before committing changes. I recommend using QtCreator configured properly, you can find a tutorial [here]( https://www.vikingsoftware.com/using-clang-format-with-qtcreator/).

#### CI/CD
Expand Down
2 changes: 1 addition & 1 deletion YACReader.desktop
Expand Up @@ -8,6 +8,6 @@ Terminal=false
Type=Application
StartupNotify=true
Categories=Graphics;Viewer;
MimeType=application/x-cbz;application/x-cbr;application/x-cbt;application/x-cb7;application/x-pdf;application/x-zip;application/x-rar;application/x-7z;inode/directory;
MimeType=application/vnd.comicbook+zip;application/vnd.comicbook-rar;application/x-cbz;application/x-cbr;application/x-cbt;application/x-cb7;application/x-pdf;application/x-zip;application/x-rar;application/x-7z;inode/directory;
Keywords=comic;viewer;pdf;reader;
X-Desktop-File-Install-Version=0.22
1 change: 1 addition & 0 deletions YACReader.pro
@@ -1,3 +1,4 @@
TEMPLATE = subdirs
SUBDIRS = YACReader YACReaderLibrary YACReaderLibraryServer
YACReaderLibrary.depends = YACReader
!CONFIG(no_tests): SUBDIRS += tests
4 changes: 2 additions & 2 deletions YACReader/Info.plist
Expand Up @@ -8,8 +8,6 @@
<string>YACReader.icns</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleGetInfoString</key>
<string>YACReader</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleExecutable</key>
Expand Down Expand Up @@ -141,5 +139,7 @@
</array>
<key>NSRequiresAquaSystemAppearance</key>
<true/>
<key>NSSupportsAutomaticGraphicsSwitching</key>
<true/>
</dict>
</plist>
25 changes: 16 additions & 9 deletions YACReader/YACReader.pro
Expand Up @@ -6,7 +6,7 @@ QMAKE_TARGET_BUNDLE_PREFIX = "com.yacreader"
DEPENDPATH += . \
release

DEFINES += NOMINMAX YACREADER
DEFINES += YACREADER

#load default build flags
include (../config.pri)
Expand Down Expand Up @@ -57,8 +57,10 @@ win32 {
LIBS += -loleaut32 -lole32 -lshell32 -lopengl32 -luser32
}

QMAKE_CXXFLAGS_RELEASE += /MP /Ob2 /Oi /Ot /GT /GL
QMAKE_LFLAGS_RELEASE += /LTCG
msvc {
QMAKE_CXXFLAGS_RELEASE += /MP /Ob2 /Oi /Ot /GT /GL
QMAKE_LFLAGS_RELEASE += /LTCG
}
CONFIG -= embed_manifest_exe
}

Expand All @@ -70,6 +72,8 @@ macx {

QT += network widgets core multimedia svg

greaterThan(QT_MAJOR_VERSION, 5): QT += openglwidgets core5compat

#CONFIG += release
CONFIG -= flat

Expand Down Expand Up @@ -98,7 +102,6 @@ HEADERS += ../common/comic.h \
../common/qnaturalsorting.h \
../common/yacreader_global.h \
../common/yacreader_global_gui.h \
../common/onstart_flow_selection_dialog.h \
../common/comic_db.h \
../common/folder.h \
../common/library_item.h \
Expand Down Expand Up @@ -136,7 +139,6 @@ SOURCES += ../common/comic.cpp \
../common/custom_widgets.cpp \
../common/check_new_version.cpp \
../common/qnaturalsorting.cpp \
../common/onstart_flow_selection_dialog.cpp \
../common/comic_db.cpp \
../common/folder.cpp \
../common/library_item.cpp \
Expand All @@ -154,13 +156,16 @@ SOURCES += ../common/comic.cpp \
}

include(../custom_widgets/custom_widgets_yacreader.pri)
CONFIG(7zip){

CONFIG(7zip) {
include(../compressed_archive/wrapper.pri)
} else:CONFIG(unarr){
} else:CONFIG(unarr) {
include(../compressed_archive/unarr/unarr-wrapper.pri)
} else:CONFIG(libarchive) {
include(../compressed_archive/libarchive/libarchive-wrapper.pri)
} else {
error(No compression backend specified. Did you mess with the build system?)
}
}
include(../shortcuts_management/shortcuts_management.pri)

RESOURCES += yacreader_images.qrc \
Expand All @@ -186,7 +191,9 @@ TRANSLATIONS = yacreader_es.ts \
yacreader_nl.ts \
yacreader_tr.ts \
yacreader_de.ts \
yacreader_zh.ts \
yacreader_zh_CN.ts \
yacreader_zh_TW.ts \
yacreader_zh_HK.ts \
yacreader_it.ts \
yacreader_source.ts

Expand Down
45 changes: 25 additions & 20 deletions YACReader/bookmarks_dialog.cpp
Expand Up @@ -3,9 +3,9 @@
#include <QGridLayout>
#include <QLabel>
#include <QApplication>
#include <QDesktopWidget>
#include <QFrame>
#include <QImage>
#include <QScreen>

#include "bookmarks.h"

Expand All @@ -14,12 +14,12 @@ BookmarksDialog::BookmarksDialog(QWidget *parent)
{
setModal(true);

//animation = new QPropertyAnimation(this,"windowOpacity");
//animation->setDuration(150);
// animation = new QPropertyAnimation(this,"windowOpacity");
// animation->setDuration(150);

auto layout = new QHBoxLayout();

//bookmarks
// bookmarks
auto bookmarksL = new QGridLayout();

pages.push_back(new QLabel(tr("Lastest Page")));
Expand All @@ -32,7 +32,12 @@ BookmarksDialog::BookmarksDialog(QWidget *parent)
label->setStyleSheet(labelsStyle);
}

int heightDesktopResolution = QApplication::desktop()->screenGeometry().height();
QScreen *screen = parent != nullptr ? parent->window()->screen() : nullptr;
if (screen == nullptr) {
screen = QApplication::screens().constFirst();
}

int heightDesktopResolution = screen != nullptr ? screen->size().height() : 600;
int height, width;
height = heightDesktopResolution * 0.50;
width = height * 0.65;
Expand All @@ -43,7 +48,7 @@ BookmarksDialog::BookmarksDialog(QWidget *parent)
QLabel *l = new QLabel();
l->setFixedSize(coverSize);
l->setScaledContents(false);
//l->setPixmap(QPixmap(":/images/notCover.png"));
// l->setPixmap(QPixmap(":/images/notCover.png"));
l->installEventFilter(this);
images.push_back(l);
}
Expand All @@ -54,7 +59,7 @@ BookmarksDialog::BookmarksDialog(QWidget *parent)
for (int i = 0; i < 3; i++)
bookmarksL->addWidget(images.at(i + 1), 1, i, Qt::AlignCenter);

//last page
// last page
auto lp = new QGridLayout();
lp->addWidget(pages.at(0), 0, 0, Qt::AlignCenter);
lp->addWidget(images.at(0), 1, 0, Qt::AlignCenter);
Expand All @@ -69,7 +74,7 @@ BookmarksDialog::BookmarksDialog(QWidget *parent)

cancel = new QPushButton(tr("Close"));
cancel->setFlat(true);
connect(cancel, SIGNAL(clicked()), this, SLOT(hide()));
connect(cancel, &QAbstractButton::clicked, this, &QWidget::hide);
buttons->addStretch();
buttons->addWidget(cancel);

Expand All @@ -85,7 +90,7 @@ BookmarksDialog::BookmarksDialog(QWidget *parent)

QPalette Pal(palette());
// set black background
Pal.setColor(QPalette::Background, QColor("#454545"));
Pal.setColor(QPalette::Window, QColor(0x454545));
this->setAutoFillBackground(true);
this->setPalette(Pal);

Expand Down Expand Up @@ -133,7 +138,7 @@ bool BookmarksDialog::eventFilter(QObject *obj, QEvent *event)
{
if (event->type() == QEvent::MouseButtonPress) {
if (obj == images.at(0)) {
emit(goToPage(lastPage));
emit goToPage(lastPage);
close();
event->accept();
}
Expand All @@ -142,7 +147,7 @@ bool BookmarksDialog::eventFilter(QObject *obj, QEvent *event)
bool b;
int page = pages.at(i)->text().toInt(&b) - 1;
if (b) {
emit(goToPage(page));
emit goToPage(page);
close();
}
event->accept();
Expand All @@ -161,17 +166,17 @@ void BookmarksDialog::keyPressEvent(QKeyEvent *event)
/*
void BookmarksDialog::show()
{
QDialog::show();
disconnect(animation,SIGNAL(finished()),this,SLOT(close()));
animation->setStartValue(0);
animation->setEndValue(1);
animation->start();
QDialog::show();
disconnect(animation,SIGNAL(finished()),this,SLOT(close()));
animation->setStartValue(0);
animation->setEndValue(1);
animation->start();
}
void BookmarksDialog::hide()
{
connect(animation,SIGNAL(finished()),this,SLOT(close()));
animation->setStartValue(1);
animation->setEndValue(0);
animation->start();
connect(animation,SIGNAL(finished()),this,SLOT(close()));
animation->setStartValue(1);
animation->setEndValue(0);
animation->start();
}*/
6 changes: 3 additions & 3 deletions YACReader/bookmarks_dialog.h
Expand Up @@ -28,15 +28,15 @@ class BookmarksDialog : public QDialog

bool eventFilter(QObject *obj, QEvent *event) override;
void keyPressEvent(QKeyEvent *event) override;
//QPropertyAnimation * animation;
// QPropertyAnimation * animation;

public:
BookmarksDialog(QWidget *parent = nullptr);

public slots:
void setBookmarks(const Bookmarks &bookmarks);
//void show();
//void hide();
// void show();
// void hide();

signals:
void goToPage(unsigned int page);
Expand Down
6 changes: 2 additions & 4 deletions YACReader/configuration.cpp
Expand Up @@ -22,7 +22,7 @@ void Configuration::load(QSettings *settings)
{
this->settings = settings;

//TODO set defaults
// TODO set defaults
if (!settings->contains(PATH))
settings->setValue(PATH, ".");
if (!settings->contains(GO_TO_FLOW_SIZE))
Expand All @@ -41,8 +41,6 @@ void Configuration::load(QSettings *settings)
settings->setValue(DOUBLE_PAGE, false);
if (!settings->contains(BACKGROUND_COLOR))
settings->setValue(BACKGROUND_COLOR, QColor(40, 40, 40));
if (!settings->contains(ALWAYS_ON_TOP))
settings->setValue(ALWAYS_ON_TOP, false);
if (!settings->contains(SHOW_TOOLBARS))
settings->setValue(SHOW_TOOLBARS, true);
if (!settings->contains(QUICK_NAVI_MODE))
Expand All @@ -53,7 +51,7 @@ void Configuration::updateOpenRecentList(QString path)
QStringList list = openRecentList();
list.removeAll(path);
list.prepend(path);
//TODO: Make list lenght configurable
// TODO: Make list lenght configurable
while (list.length() > getOpenRecentSize()) {
list.removeLast();
}
Expand Down
8 changes: 4 additions & 4 deletions YACReader/configuration.h
Expand Up @@ -41,11 +41,11 @@ class Configuration : public QObject
float getZoomLevel() { return settings->value(ZOOM_LEVEL).toFloat(); }
void setZoomLevel(float zl) { settings->setValue(ZOOM_LEVEL, zl); }

//Unified enum based fitmode
// Unified enum based fitmode
YACReader::FitMode getFitMode() { return static_cast<YACReader::FitMode>(settings->value(FITMODE, YACReader::FitMode::FullPage).toInt()); }
void setFitMode(YACReader::FitMode fitMode) { settings->setValue(FITMODE, static_cast<int>(fitMode)); }

//openRecent
// openRecent
int getOpenRecentSize() { return settings->value("recentSize", 25).toInt(); }
QStringList openRecentList() { return settings->value("recentFiles").toStringList(); }
void updateOpenRecentList(QString path);
Expand All @@ -69,8 +69,6 @@ class Configuration : public QObject

QColor getBackgroundColor() { return settings->value(BACKGROUND_COLOR).value<QColor>(); }
void setBackgroundColor(const QColor &color) { settings->value(BACKGROUND_COLOR, color); }
bool getAlwaysOnTop() { return settings->value(ALWAYS_ON_TOP).toBool(); }
void setAlwaysOnTop(bool b) { settings->setValue(ALWAYS_ON_TOP, b); }
bool getShowToolbars() { return settings->value(SHOW_TOOLBARS).toBool(); }
void setShowToolbars(bool b) { settings->setValue(SHOW_TOOLBARS, b); }
bool getShowInformation() { return settings->value(SHOW_INFO, false).toBool(); }
Expand All @@ -81,6 +79,8 @@ class Configuration : public QObject
void setNumDaysBetweenVersionChecks(int days) { return settings->setValue(NUM_DAYS_BETWEEN_VERSION_CHECKS, days); }
bool getQuickNaviMode() { return settings->value(QUICK_NAVI_MODE).toBool(); }
bool getDisableShowOnMouseOver() { return settings->value(DISABLE_MOUSE_OVER_GOTO_FLOW).toBool(); }
bool getDoNotTurnPageOnScroll() { return settings->value(DO_NOT_TURN_PAGE_ON_SCROLL, false).toBool(); }
bool getUseSingleScrollStepToTurnPage() { return settings->value(USE_SINGLE_SCROLL_STEP_TO_TURN_PAGE, false).toBool(); }
};

#endif

0 comments on commit 4c74e7a

Please sign in to comment.