diff --git a/YACReaderLibrary/library_window.cpp b/YACReaderLibrary/library_window.cpp index c1a2d813..e59c1363 100644 --- a/YACReaderLibrary/library_window.cpp +++ b/YACReaderLibrary/library_window.cpp @@ -1727,6 +1727,14 @@ void LibraryWindow::saveSelectedCoversTo() } } +void LibraryWindow::checkMaxNumLibraries() +{ + int numLibraries = libraries.getNames().length(); + if(numLibraries >= MAX_LIBRARIES_WARNING_NUM) { + QMessageBox::warning(this,tr("You are adding too many libraries."),tr("You are adding too many libraries.\n\nYou probably only need one library in your top level comics folder, you can browse any subfolders using the folders section in the left sidebar.\n\nYACReaderLibrary will not stop you from creating more libraries but you should keep the number of libraries low.")); + } +} + void LibraryWindow::selectSubfolder(const QModelIndex &mi, int child) { QModelIndex dest = foldersModel->index(child,0,mi); @@ -1823,6 +1831,7 @@ void LibraryWindow::setCurrentComicUnreaded() { } void LibraryWindow::createLibrary() { + checkMaxNumLibraries(); createLibraryDialog->open(libraries); } @@ -1861,6 +1870,7 @@ void LibraryWindow::openLastCreated() void LibraryWindow::showAddLibrary() { + checkMaxNumLibraries(); addLibraryDialog->open(); } diff --git a/YACReaderLibrary/library_window.h b/YACReaderLibrary/library_window.h index e4ec675a..98796e1a 100644 --- a/YACReaderLibrary/library_window.h +++ b/YACReaderLibrary/library_window.h @@ -375,6 +375,7 @@ public slots: void onAddComicsToLabel(); void setToolbarTitle(const QModelIndex & modelIndex); void saveSelectedCoversTo(); + void checkMaxNumLibraries(); private: //fullscreen mode in Windows for preventing this bug: QTBUG-41309 https://bugreports.qt.io/browse/QTBUG-41309 diff --git a/common/yacreader_global.h b/common/yacreader_global.h index c55a04c3..5fcf2b8c 100644 --- a/common/yacreader_global.h +++ b/common/yacreader_global.h @@ -21,6 +21,8 @@ #define LIBRARIES "LIBRARIES" +#define MAX_LIBRARIES_WARNING_NUM 10 + namespace YACReader {