Skip to content

Commit

Permalink
Merge pull request #321 from YACReader/develop
Browse files Browse the repository at this point in the history
9.9.2 Release
  • Loading branch information
luisangelsm authored Oct 2, 2022
2 parents 982d582 + 67b7c4a commit 2a9a3fb
Show file tree
Hide file tree
Showing 40 changed files with 1,941 additions and 183 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

Version counting is based on semantic versioning (Major.Feature.Patch)

## 9.9.2

### General
* New builds using Qt6.
* macos builds are notarized.
* Windows builds are codesigned.

### YACReaderLibrary
* Fix potential infinite loop/crash on library updates.
* Fix comic properties dialog sizing.
* Fixes and stability improvements.


## 9.9.1

### YACReader
Expand Down
4 changes: 3 additions & 1 deletion YACReader/YACReader.pro
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,11 @@ win32 {
}

macx {
QT += macextras gui-private
QT += gui-private
CONFIG += objective_c
LIBS += -framework Foundation -framework ApplicationServices -framework AppKit

lessThan(QT_MAJOR_VERSION, 6): QT += macextras
}

QT += network widgets core multimedia svg
Expand Down
2 changes: 1 addition & 1 deletion YACReader/main_window_viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ void MainWindowViewer::createToolBars()

// attach toolbar

comicToolBar->attachToWindow(this->windowHandle());
comicToolBar->attachToWindow(this);

#endif
}
Expand Down
9 changes: 7 additions & 2 deletions YACReaderLibrary/YACReaderLibrary.pro
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ CONFIG(force_angle) {
macx {
LIBS += -framework Foundation -framework ApplicationServices -framework AppKit
CONFIG += objective_c
QT += macextras gui-private
QT += gui-private
lessThan(QT_MAJOR_VERSION, 6): QT += macextras
}

#CONFIG += release
Expand Down Expand Up @@ -294,7 +295,11 @@ HEADERS += grid_comics_view.h \
SOURCES += grid_comics_view.cpp \
comics_view_transition.cpp

RESOURCES += qml.qrc
greaterThan(QT_MAJOR_VERSION, 5) {
RESOURCES += qml6.qrc
} else {
RESOURCES += qml.qrc
}
win32:RESOURCES += qml_win.qrc
unix:!macx:RESOURCES += qml_win.qrc
macx:RESOURCES += qml_osx.qrc
Expand Down
5 changes: 1 addition & 4 deletions YACReaderLibrary/classic_comics_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,10 +364,7 @@ void ClassicComicsView::setupSearchingIcon()
h->addWidget(l, 0, Qt::AlignCenter);
searchingIcon->setLayout(h);

QPalette pal(searchingIcon->palette());
pal.setColor(QPalette::Window, Qt::black);
searchingIcon->setAutoFillBackground(true);
searchingIcon->setPalette(pal);
searchingIcon->setStyleSheet(QString("QWidget {border : none; background-color: #000000;}"));

hideSearchingIcon();
}
Expand Down
6 changes: 0 additions & 6 deletions YACReaderLibrary/db/folder_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -606,13 +606,7 @@ void FolderModelProxy::setFilterData(QMap<unsigned long long, FolderItem *> *fil

rootItem = root;

#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
QMap<unsigned long long, FolderItem *>::iterator i;
for (i = filteredItems->begin(); i != filteredItems->end(); ++i)
this->filteredItems.insert(i.key(), i.value());
#else
this->filteredItems.insert(*filteredItems);
#endif

endResetModel();

Expand Down
2 changes: 1 addition & 1 deletion YACReaderLibrary/db_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ void DBHelper::propagateFolderUpdatesToParent(const Folder &folder, QSqlDatabase
{
auto currentParentId = folder.parentId;
auto currentId = folder.id;
while (currentParentId != 1) {
while (currentParentId != 1 && currentParentId != 0) { // currentParentId is 0 if `folder` is the root folder
auto f = loadFolder(currentParentId, db);
currentParentId = f.parentId;
currentId = f.id;
Expand Down
2 changes: 2 additions & 0 deletions YACReaderLibrary/images_osx.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
<file alias="images/empty_folder.png">../images/empty_folder_osx.png</file>
<file alias="images/empty_search.png">../images/empty_search_osx.png</file>
<file>../images/iconSearch.png</file>
<file>../images/[email protected]</file>
<file>../images/clearSearch.png</file>
<file>../images/[email protected]</file>
<file alias="images/lists/default_0.png">../images/lists/default_0_osx.png</file>
<file alias="images/lists/default_1.png">../images/lists/default_1_osx.png</file>
<file alias="images/lists/label_blue.png">../images/lists/label_blue_osx.png</file>
Expand Down
7 changes: 3 additions & 4 deletions YACReaderLibrary/library_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -922,9 +922,6 @@ void LibraryWindow::createToolBars()
libraryToolBar->addSpace(10);

libraryToolBar->addAction(toggleComicsViewAction);
#ifndef Q_OS_MAC
libraryToolBar->addAction(toggleFullScreenAction);
#endif

libraryToolBar->addStretch();

Expand All @@ -935,7 +932,7 @@ void LibraryWindow::createToolBars()

// libraryToolBar->setMovable(false);

libraryToolBar->attachToWindow(this->windowHandle());
libraryToolBar->attachToWindow(this);

#else
libraryToolBar->backButton->setDefaultAction(backAction);
Expand Down Expand Up @@ -1189,6 +1186,8 @@ void LibraryWindow::createConnections()
connect(searchEdit, &YACReaderSearchLineEdit::filterChanged, this, &LibraryWindow::setSearchFilter);
#endif
connect(&comicQueryResultProcessor, &ComicQueryResultProcessor::newData, this, &LibraryWindow::setComicSearchFilterData);
qRegisterMetaType<FolderItem *>("FolderItem *");
qRegisterMetaType<QMap<unsigned long long int, FolderItem *> *>("QMap<unsigned long long int, FolderItem *> *");
connect(folderQueryResultProcessor.get(), &FolderQueryResultProcessor::newData, this, &LibraryWindow::setFolderSearchFilterData);

// ContextMenus
Expand Down
105 changes: 39 additions & 66 deletions YACReaderLibrary/properties_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include "yacreader_field_edit.h"
#include "yacreader_field_plain_text_edit.h"
#include "db_helper.h"
//#include "yacreader_busy_widget.h"

#include <QHBoxLayout>
#include <QApplication>
Expand All @@ -26,7 +25,6 @@ using namespace YACReader;
PropertiesDialog::PropertiesDialog(QWidget *parent)
: QDialog(parent), updated(false)
{

createCoverBox();
createGeneralInfoBox();
createAuthorsBox();
Expand All @@ -35,43 +33,47 @@ PropertiesDialog::PropertiesDialog(QWidget *parent)
createPlotBox();

createTabBar();
auto rootLayout = new QGridLayout;

cover = new QLabel();

mainLayout = new QGridLayout;
// mainLayout->addWidget(coverBox,0,0);
mainLayout->addWidget(tabBar, 0, 1);
mainLayout->setColumnStretch(1, 1);
/*mainLayout->addWidget(authorsBox,1,1);
mainLayout->addWidget(publishingBox,2,1);*/
mainLayout->addWidget(buttonBox, 1, 1, Qt::AlignBottom);
mainLayout->addWidget(tabBar, 0, 0);
mainLayout->addWidget(buttonBox, 1, 0, Qt::AlignBottom);

mainWidget = new QWidget(this);
mainWidget->setAutoFillBackground(true);
mainWidget->setFixedSize(470, 444);
mainWidget->setLayout(mainLayout);
mainLayout->setSizeConstraint(QLayout::SetMinimumSize);

rootLayout->setHorizontalSpacing(0);
rootLayout->setVerticalSpacing(0);

rootLayout->addWidget(cover, 0, 0, Qt::AlignTop);
rootLayout->addWidget(mainWidget, 0, 1);

rootLayout->setColumnStretch(0, 0);
rootLayout->setColumnStretch(1, 1);

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

int heightDesktopResolution = screen->geometry().height();
int widthDesktopResolution = screen->geometry().width();
int sHeight, sWidth;
sHeight = static_cast<int>(heightDesktopResolution * 0.65);
sWidth = static_cast<int>(sHeight * 1.4);
// setCover(QPixmap(":/images/notCover.png"));
this->setLayout(rootLayout);

this->setContentsMargins(0, 0, 0, 0);
rootLayout->setContentsMargins(0, 0, 0, 0);

rootLayout->addWidget(coverBox, 0, 0, Qt::AlignBottom);

this->move(QPoint((widthDesktopResolution - sWidth) / 2, ((heightDesktopResolution - sHeight) - 40) / 2));
setModal(true);

setFixedSize(sizeHint());
mainWidget->move(280, 0);
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
}

QSize PropertiesDialog::sizeHint() const
{
return QSize(750, 444);
return QSize(800, 444);
}

void PropertiesDialog::createTabBar()
Expand All @@ -85,13 +87,13 @@ void PropertiesDialog::createTabBar()

void PropertiesDialog::createCoverBox()
{
coverBox = new QWidget(this);
coverBox = new QWidget;

auto layout = new QHBoxLayout;

QLabel *label = new QLabel(tr("Cover page"));
label->setStyleSheet("QLabel {color: white; font-weight:bold; font-size:14px;}");
layout->addWidget(label);
layout->addWidget(label, 0, Qt::AlignVCenter);
layout->addStretch();

coverPageEdit = new YACReaderFieldEdit();
Expand All @@ -107,48 +109,37 @@ void PropertiesDialog::createCoverBox()

coverPageNumberLabel->setStyleSheet("QLabel {color: white; font-weight:bold; font-size:14px;}");

layout->addWidget(showPreviousCoverPageButton);
layout->addWidget(showPreviousCoverPageButton, 0, Qt::AlignVCenter);
layout->addSpacing(5);
layout->addWidget(coverPageNumberLabel);
layout->addWidget(coverPageNumberLabel, 0, Qt::AlignVCenter);
layout->addSpacing(5);
layout->addWidget(showNextCoverPageButton);
layout->addWidget(showNextCoverPageButton, 0, Qt::AlignVCenter);

coverPageEdit->setStyleSheet("QLineEdit {border:none;}");
layout->setSpacing(0);

coverBox->setLayout(layout);

coverBox->setFixedWidth(280);
coverBox->move(0, 444 - 28);
layout->setContentsMargins(5, 4, 5, 0);
coverBox->setFixedHeight(28);
layout->setContentsMargins(5, 2, 5, 2);

// busyIndicator = new YACReaderBusyWidget(this);
// busyIndicator->move((280-busyIndicator->width())/2,(444-busyIndicator->height()-28)/2);
// busyIndicator->hide();
QPalette p(palette());
p.setColor(QPalette::Window, QColor(0, 0, 0, 200));
coverBox->setAutoFillBackground(true);
coverBox->setPalette(p);

connect(showPreviousCoverPageButton, &QAbstractButton::clicked, this, &PropertiesDialog::loadPreviousCover);
connect(showNextCoverPageButton, &QAbstractButton::clicked, this, &PropertiesDialog::loadNextCover);
}

QFrame *createLine()
{
QFrame *line = new QFrame();
line->setObjectName(QString::fromUtf8("line"));
// line->setGeometry(QRect(320, 150, 118, 3));
line->setFrameShape(QFrame::HLine);
line->setFrameShadow(QFrame::Sunken);

return line;
}

void PropertiesDialog::createGeneralInfoBox()
{
generalInfoBox = new QWidget;

auto generalInfoLayout = new QFormLayout;

generalInfoLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
// generalInfoLayout->setRowWrapPolicy(QFormLayout::WrapAllRows);
generalInfoLayout->setRowWrapPolicy(QFormLayout::WrapAllRows);
generalInfoLayout->addRow(tr("Title:"), title = new YACReaderFieldEdit());

auto number = new QHBoxLayout;
Expand Down Expand Up @@ -185,9 +176,6 @@ void PropertiesDialog::createGeneralInfoBox()

generalInfoLayout->addRow(tr("Size:"), size = new QLabel("size"));

// generalInfoLayout->addRow(tr("Comic Vine link:"), comicVineLink = new QLabel("..."));
// generalInfoLayout->addRow(bottom);

auto main = new QVBoxLayout;
main->addLayout(generalInfoLayout);
main->addStretch();
Expand All @@ -203,7 +191,6 @@ void PropertiesDialog::createAuthorsBox()

auto authorsLayout = new QVBoxLayout;

// authorsLayout->setRowWrapPolicy(QFormLayout::WrapAllRows);
auto h1 = new QHBoxLayout;
auto vl1 = new QVBoxLayout;
auto vr1 = new QVBoxLayout;
Expand All @@ -213,8 +200,7 @@ void PropertiesDialog::createAuthorsBox()
vr1->addWidget(new QLabel(tr("Penciller(s):")));
vr1->addWidget(penciller = new YACReaderFieldPlainTextEdit());
h1->addLayout(vr1);
// authorsLayout->addRow(tr("Writer(s):"), new YACReaderFieldPlainTextEdit());
// authorsLayout->addRow(tr("Penciller(s):"), new YACReaderFieldPlainTextEdit());

auto h2 = new QHBoxLayout;
auto vl2 = new QVBoxLayout;
auto vr2 = new QVBoxLayout;
Expand All @@ -225,9 +211,6 @@ void PropertiesDialog::createAuthorsBox()
vr2->addWidget(colorist = new YACReaderFieldPlainTextEdit());
h2->addLayout(vr2);

// authorsLayout->addRow(tr("Inker(s):"), new YACReaderFieldPlainTextEdit());
// authorsLayout->addRow(tr("Colorist(s):"), new YACReaderFieldPlainTextEdit());

auto h3 = new QHBoxLayout;
auto vl3 = new QVBoxLayout;
auto vr3 = new QVBoxLayout;
Expand All @@ -237,8 +220,6 @@ void PropertiesDialog::createAuthorsBox()
vr3->addWidget(new QLabel(tr("Cover Artist(s):")));
vr3->addWidget(coverArtist = new YACReaderFieldPlainTextEdit());
h3->addLayout(vr3);
// authorsLayout->addRow(tr("Letterer(es):"), new YACReaderFieldPlainTextEdit());
// authorsLayout->addRow(tr("Cover Artist(s):"), new YACReaderFieldPlainTextEdit());

authorsLayout->addLayout(h1);
authorsLayout->addLayout(h2);
Expand Down Expand Up @@ -628,11 +609,15 @@ void PropertiesDialog::setMultipleCover()
last = last.scaledToHeight(444, Qt::SmoothTransformation);

coverImage = QPixmap::fromImage(blurred(last.toImage(), QRect(0, 0, last.width(), last.height()), 15));

cover->setPixmap(coverImage);
}

void PropertiesDialog::setCover(const QPixmap &coverI)
{
coverImage = coverI.scaledToHeight(444, Qt::SmoothTransformation);

cover->setPixmap(coverImage);
}

void PropertiesDialog::setFilename(const QString &nameString)
Expand Down Expand Up @@ -895,16 +880,6 @@ void PropertiesDialog::closeEvent(QCloseEvent *e)
void PropertiesDialog::paintEvent(QPaintEvent *event)
{
QDialog::paintEvent(event);

QPainter p(this);

p.drawPixmap(0, 0, coverImage);

// QPixmap shadow(":/images/social_dialog/shadow.png");
// p.drawPixmap(280-shadow.width(),0,shadow.width(),444,shadow);
p.drawLine(279, 0, 279, 444);
if (sequentialEditing)
p.fillRect(0, 444 - 28, 280, 28, QColor(0, 0, 0, 153));
}

void PropertiesDialog::updateCoverPageNumberLabel(int n)
Expand All @@ -929,7 +904,6 @@ void PropertiesDialog::loadNextCover()
}

showPreviousCoverPageButton->setEnabled(true);
// busyIndicator->show();
if (current + 1 != comics[currentComicIndex].info.coverPage)
coverChanged = true;
else
Expand All @@ -952,7 +926,6 @@ void PropertiesDialog::loadPreviousCover()
}

showNextCoverPageButton->setEnabled(true);
// busyIndicator->show();
if (current - 1 != comics[currentComicIndex].info.coverPage.toInt())
coverChanged = true;
else
Expand Down
Loading

0 comments on commit 2a9a3fb

Please sign in to comment.