mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
Added a warning message whem too many libraries are created so users are guided to use yacreaderlibrary in the right way.
This commit is contained in:
parent
0aeb0422d8
commit
c06fb71a52
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -21,6 +21,8 @@
|
||||
|
||||
#define LIBRARIES "LIBRARIES"
|
||||
|
||||
#define MAX_LIBRARIES_WARNING_NUM 10
|
||||
|
||||
namespace YACReader
|
||||
{
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user