Fix comicsViewsManager -> contentViewsManager renaming

This commit is contained in:
Luis Ángel San Martín 2022-10-14 13:11:59 +02:00
parent 374758fd41
commit f1dd6d339d
4 changed files with 33 additions and 33 deletions

View File

@ -294,7 +294,7 @@ void LibraryWindow::doLayout()
sHorizontal->addWidget(rightWidget); sHorizontal->addWidget(rightWidget);
#else #else
sHorizontal->addWidget(comicsViewsManager->containerWidget()); sHorizontal->addWidget(contentViewsManager->containerWidget());
#endif #endif
sHorizontal->setStretchFactor(0, 0); sHorizontal->setStretchFactor(0, 0);
@ -2295,7 +2295,7 @@ void LibraryWindow::toFullScreen()
sideBar->hide(); sideBar->hide();
libraryToolBar->hide(); libraryToolBar->hide();
comicsViewsManager->comicsView->toFullScreen(); contentViewsManager->comicsView->toFullScreen();
showFullScreen(); showFullScreen();
} }
@ -2304,7 +2304,7 @@ void LibraryWindow::toNormal()
{ {
sideBar->show(); sideBar->show();
comicsViewsManager->comicsView->toNormal(); contentViewsManager->comicsView->toNormal();
if (fromMaximized) if (fromMaximized)
showMaximized(); showMaximized();

View File

@ -1,5 +1,5 @@
#ifndef YACREADERCOMICSVIEWSMANAGER_H #ifndef YACREADERCONTENTVIEWSMANAGER_H
#define YACREADERCOMICSVIEWSMANAGER_H #define YACREADERCONTENTVIEWSMANAGER_H
#include <QtWidgets> #include <QtWidgets>
@ -74,4 +74,4 @@ protected slots:
void switchToComicsView(ComicsView *from, ComicsView *to); void switchToComicsView(ComicsView *from, ComicsView *to);
}; };
#endif // COMICSVIEWSMANAGER_H #endif // YACREADERCONTENTVIEWSMANAGER_H

View File

@ -20,8 +20,8 @@
#include "QsLog.h" #include "QsLog.h"
YACReaderNavigationController::YACReaderNavigationController(LibraryWindow *parent, YACReaderContentViewsManager *comicsViewsManager) YACReaderNavigationController::YACReaderNavigationController(LibraryWindow *parent, YACReaderContentViewsManager *contentViewsManager)
: QObject(parent), libraryWindow(parent), comicsViewsManager(comicsViewsManager) : QObject(parent), libraryWindow(parent), contentViewsManager(contentViewsManager)
{ {
setupConnections(); setupConnections();
} }
@ -61,13 +61,13 @@ void YACReaderNavigationController::loadFolderInfo(const QModelIndex &modelIndex
// configure views // configure views
if (libraryWindow->comicsModel->rowCount() > 0) { if (libraryWindow->comicsModel->rowCount() > 0) {
// updateView // updateView
comicsViewsManager->comicsView->setModel(libraryWindow->comicsModel); contentViewsManager->comicsView->setModel(libraryWindow->comicsModel);
comicsViewsManager->showComicsView(); contentViewsManager->showComicsView();
libraryWindow->disableComicsActions(false); libraryWindow->disableComicsActions(false);
} else { } else {
// showEmptyFolder // showEmptyFolder
loadEmptyFolderInfo(modelIndex); loadEmptyFolderInfo(modelIndex);
comicsViewsManager->showEmptyFolderView(); contentViewsManager->showEmptyFolderView();
libraryWindow->disableComicsActions(true); libraryWindow->disableComicsActions(true);
} }
@ -110,25 +110,25 @@ void YACReaderNavigationController::loadSpecialListInfo(const QModelIndex &model
break; break;
} }
comicsViewsManager->comicsView->setModel(libraryWindow->comicsModel); contentViewsManager->comicsView->setModel(libraryWindow->comicsModel);
if (libraryWindow->comicsModel->rowCount() > 0) { if (libraryWindow->comicsModel->rowCount() > 0) {
comicsViewsManager->showComicsView(); contentViewsManager->showComicsView();
libraryWindow->disableComicsActions(false); libraryWindow->disableComicsActions(false);
} else { } else {
// setup empty special list widget // setup empty special list widget
switch (type) { switch (type) {
case ReadingListModel::Favorites: case ReadingListModel::Favorites:
comicsViewsManager->emptySpecialList->setPixmap(QPixmap(":/images/empty_favorites.png")); contentViewsManager->emptySpecialList->setPixmap(QPixmap(":/images/empty_favorites.png"));
comicsViewsManager->emptySpecialList->setText(tr("No favorites")); contentViewsManager->emptySpecialList->setText(tr("No favorites"));
break; break;
case ReadingListModel::Reading: case ReadingListModel::Reading:
comicsViewsManager->emptySpecialList->setPixmap(QPixmap(":/images/empty_current_readings.png")); contentViewsManager->emptySpecialList->setPixmap(QPixmap(":/images/empty_current_readings.png"));
comicsViewsManager->emptySpecialList->setText(tr("You are not reading anything yet, come on!!")); contentViewsManager->emptySpecialList->setText(tr("You are not reading anything yet, come on!!"));
break; break;
} }
comicsViewsManager->showEmptySpecialList(); contentViewsManager->showEmptySpecialList();
libraryWindow->disableComicsActions(true); libraryWindow->disableComicsActions(true);
} }
} }
@ -138,18 +138,18 @@ void YACReaderNavigationController::loadLabelInfo(const QModelIndex &modelIndex)
qulonglong id = modelIndex.data(ReadingListModel::IDRole).toULongLong(); qulonglong id = modelIndex.data(ReadingListModel::IDRole).toULongLong();
// check comics in label with id = id // check comics in label with id = id
libraryWindow->comicsModel->setupLabelModelData(id, libraryWindow->foldersModel->getDatabase()); libraryWindow->comicsModel->setupLabelModelData(id, libraryWindow->foldersModel->getDatabase());
comicsViewsManager->comicsView->setModel(libraryWindow->comicsModel); contentViewsManager->comicsView->setModel(libraryWindow->comicsModel);
// configure views // configure views
if (libraryWindow->comicsModel->rowCount() > 0) { if (libraryWindow->comicsModel->rowCount() > 0) {
// updateView // updateView
comicsViewsManager->showComicsView(); contentViewsManager->showComicsView();
libraryWindow->disableComicsActions(false); libraryWindow->disableComicsActions(false);
} else { } else {
// showEmptyFolder // showEmptyFolder
// loadEmptyLabelInfo(); //there is no info in an empty label by now, TODO design something // loadEmptyLabelInfo(); //there is no info in an empty label by now, TODO design something
comicsViewsManager->emptyLabelWidget->setColor((YACReader::LabelColors)modelIndex.data(ReadingListModel::LabelColorRole).toInt()); contentViewsManager->emptyLabelWidget->setColor((YACReader::LabelColors)modelIndex.data(ReadingListModel::LabelColorRole).toInt());
comicsViewsManager->showEmptyLabelView(); contentViewsManager->showEmptyLabelView();
libraryWindow->disableComicsActions(true); libraryWindow->disableComicsActions(true);
} }
} }
@ -159,15 +159,15 @@ void YACReaderNavigationController::loadReadingListInfo(const QModelIndex &model
qulonglong id = modelIndex.data(ReadingListModel::IDRole).toULongLong(); qulonglong id = modelIndex.data(ReadingListModel::IDRole).toULongLong();
// check comics in label with id = id // check comics in label with id = id
libraryWindow->comicsModel->setupReadingListModelData(id, libraryWindow->foldersModel->getDatabase()); libraryWindow->comicsModel->setupReadingListModelData(id, libraryWindow->foldersModel->getDatabase());
comicsViewsManager->comicsView->setModel(libraryWindow->comicsModel); contentViewsManager->comicsView->setModel(libraryWindow->comicsModel);
// configure views // configure views
if (libraryWindow->comicsModel->rowCount() > 0) { if (libraryWindow->comicsModel->rowCount() > 0) {
// updateView // updateView
comicsViewsManager->showComicsView(); contentViewsManager->showComicsView();
libraryWindow->disableComicsActions(false); libraryWindow->disableComicsActions(false);
} else { } else {
comicsViewsManager->showEmptyReadingListWidget(); contentViewsManager->showEmptyReadingListWidget();
libraryWindow->disableComicsActions(true); libraryWindow->disableComicsActions(true);
} }
} }
@ -260,10 +260,10 @@ void YACReaderNavigationController::loadEmptyFolderInfo(const QModelIndex &model
readingComicsModel->setupReadingModelData(libraryWindow->foldersModel->getDatabase()); readingComicsModel->setupReadingModelData(libraryWindow->foldersModel->getDatabase());
} }
comicsViewsManager->folderContentView->setContinueReadingModel(readingComicsModel); contentViewsManager->folderContentView->setContinueReadingModel(readingComicsModel);
auto subFolderModel = libraryWindow->foldersModel->getSubfoldersModel(modelIndex); auto subFolderModel = libraryWindow->foldersModel->getSubfoldersModel(modelIndex);
comicsViewsManager->folderContentView->setModel(modelIndex, subFolderModel); contentViewsManager->folderContentView->setModel(modelIndex, subFolderModel);
} }
void YACReaderNavigationController::loadPreviousStatus() void YACReaderNavigationController::loadPreviousStatus()
@ -279,10 +279,10 @@ void YACReaderNavigationController::setupConnections()
connect(libraryWindow->foldersView, &YACReaderTreeView::clicked, this, &YACReaderNavigationController::selectedFolder); connect(libraryWindow->foldersView, &YACReaderTreeView::clicked, this, &YACReaderNavigationController::selectedFolder);
connect(libraryWindow->listsView, &QAbstractItemView::clicked, this, &YACReaderNavigationController::selectedList); connect(libraryWindow->listsView, &QAbstractItemView::clicked, this, &YACReaderNavigationController::selectedList);
connect(libraryWindow->historyController, &YACReaderHistoryController::modelIndexSelected, this, &YACReaderNavigationController::selectedIndexFromHistory); connect(libraryWindow->historyController, &YACReaderHistoryController::modelIndexSelected, this, &YACReaderNavigationController::selectedIndexFromHistory);
connect(comicsViewsManager->folderContentView, &FolderContentView::subfolderSelected, this, &YACReaderNavigationController::selectSubfolder); connect(contentViewsManager->folderContentView, &FolderContentView::subfolderSelected, this, &YACReaderNavigationController::selectSubfolder);
connect(comicsViewsManager->folderContentView, &FolderContentView::openComic, libraryWindow, QOverload<const ComicDB &, const ComicModel::Mode>::of(&LibraryWindow::openComic)); connect(contentViewsManager->folderContentView, &FolderContentView::openComic, libraryWindow, QOverload<const ComicDB &, const ComicModel::Mode>::of(&LibraryWindow::openComic));
connect(comicsViewsManager->folderContentView, &FolderContentView::openFolderContextMenu, libraryWindow, &LibraryWindow::showGridFoldersContextMenu); connect(contentViewsManager->folderContentView, &FolderContentView::openFolderContextMenu, libraryWindow, &LibraryWindow::showGridFoldersContextMenu);
connect(comicsViewsManager->folderContentView, &FolderContentView::openContinueReadingComicContextMenu, libraryWindow, &LibraryWindow::showContinueReadingContextMenu); connect(contentViewsManager->folderContentView, &FolderContentView::openContinueReadingComicContextMenu, libraryWindow, &LibraryWindow::showContinueReadingContextMenu);
connect(libraryWindow->comicsModel, &ComicModel::isEmpty, this, &YACReaderNavigationController::reselectCurrentSource); connect(libraryWindow->comicsModel, &ComicModel::isEmpty, this, &YACReaderNavigationController::reselectCurrentSource);
} }

View File

@ -10,7 +10,7 @@ class YACReaderNavigationController : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit YACReaderNavigationController(LibraryWindow *parent, YACReaderContentViewsManager *comicsViewsManager); explicit YACReaderNavigationController(LibraryWindow *parent, YACReaderContentViewsManager *contentViewsManager);
signals: signals:
@ -44,7 +44,7 @@ public slots:
private: private:
void setupConnections(); void setupConnections();
LibraryWindow *libraryWindow; LibraryWindow *libraryWindow;
YACReaderContentViewsManager *comicsViewsManager; YACReaderContentViewsManager *contentViewsManager;
// convenience methods // convenience methods
qulonglong folderModelIndexToID(const QModelIndex &mi); qulonglong folderModelIndexToID(const QModelIndex &mi);