mirror of
https://github.com/YACReader/yacreader
synced 2025-07-22 15:04:40 -04:00
implemented 'add reading list'
This commit is contained in:
@ -1212,7 +1212,7 @@ void LibraryWindow::loadLibrary(const QString & name)
|
||||
foldersModel->setupModelData(path);
|
||||
foldersView->setModel(foldersModel);
|
||||
|
||||
listsModel->setupModelData(path);
|
||||
listsModel->setupReadingListsData(path);
|
||||
listsView->setModel(listsModel);
|
||||
|
||||
if(foldersModel->rowCount(QModelIndex())>0)
|
||||
@ -1628,7 +1628,20 @@ void LibraryWindow::errorDeletingFolder()
|
||||
|
||||
void LibraryWindow::addNewReadingList()
|
||||
{
|
||||
bool ok;
|
||||
QString newListName = QInputDialog::getText(this, tr("Add new reading lists"),
|
||||
tr("List name:"), QLineEdit::Normal,
|
||||
"", &ok);
|
||||
|
||||
if (ok) {
|
||||
QModelIndexList selectedLists = listsView->selectionModel()->selectedIndexes();
|
||||
if(selectedLists.isEmpty() || listsModel->isReadingList(selectedLists.at(0)))
|
||||
listsModel->addReadingList(newListName); //top level
|
||||
else
|
||||
{
|
||||
listsModel->addReadingListAt(newListName,selectedLists.at(0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LibraryWindow::deleteSelectedReadingList()
|
||||
|
Reference in New Issue
Block a user