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:
Luis Ángel San Martín 2017-09-14 09:30:36 +02:00
parent 0aeb0422d8
commit c06fb71a52
3 changed files with 13 additions and 0 deletions

View File

@ -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) void LibraryWindow::selectSubfolder(const QModelIndex &mi, int child)
{ {
QModelIndex dest = foldersModel->index(child,0,mi); QModelIndex dest = foldersModel->index(child,0,mi);
@ -1823,6 +1831,7 @@ void LibraryWindow::setCurrentComicUnreaded() {
} }
void LibraryWindow::createLibrary() { void LibraryWindow::createLibrary() {
checkMaxNumLibraries();
createLibraryDialog->open(libraries); createLibraryDialog->open(libraries);
} }
@ -1861,6 +1870,7 @@ void LibraryWindow::openLastCreated()
void LibraryWindow::showAddLibrary() void LibraryWindow::showAddLibrary()
{ {
checkMaxNumLibraries();
addLibraryDialog->open(); addLibraryDialog->open();
} }

View File

@ -375,6 +375,7 @@ public slots:
void onAddComicsToLabel(); void onAddComicsToLabel();
void setToolbarTitle(const QModelIndex & modelIndex); void setToolbarTitle(const QModelIndex & modelIndex);
void saveSelectedCoversTo(); void saveSelectedCoversTo();
void checkMaxNumLibraries();
private: private:
//fullscreen mode in Windows for preventing this bug: QTBUG-41309 https://bugreports.qt.io/browse/QTBUG-41309 //fullscreen mode in Windows for preventing this bug: QTBUG-41309 https://bugreports.qt.io/browse/QTBUG-41309

View File

@ -21,6 +21,8 @@
#define LIBRARIES "LIBRARIES" #define LIBRARIES "LIBRARIES"
#define MAX_LIBRARIES_WARNING_NUM 10
namespace YACReader namespace YACReader
{ {