mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
foldersView context menu is now dynamic
This commit is contained in:
parent
7e68a34d7e
commit
169ecd485c
@ -723,6 +723,7 @@ void LibraryWindow::createConnections()
|
||||
connect(renameLibraryDialog,SIGNAL(renameLibrary(QString)),this,SLOT(rename(QString)));
|
||||
|
||||
//navigations between view modes (tree,list and flow)
|
||||
connect(foldersView, SIGNAL(pressed(QModelIndex)), this, SLOT(updateFoldersViewConextMenu(QModelIndex)));
|
||||
connect(foldersView, SIGNAL(clicked(QModelIndex)), this, SLOT(loadCovers(QModelIndex)));
|
||||
connect(foldersView, SIGNAL(clicked(QModelIndex)), this, SLOT(updateHistory(QModelIndex)));
|
||||
|
||||
@ -1805,7 +1806,23 @@ void LibraryWindow::updateHistory(const QModelIndex &mi)
|
||||
currentFolderNavigation++;
|
||||
}
|
||||
|
||||
forwardAction->setEnabled(false);
|
||||
forwardAction->setEnabled(false);
|
||||
}
|
||||
|
||||
void LibraryWindow::updateFoldersViewConextMenu(const QModelIndex &mi)
|
||||
{
|
||||
if(!mi.isValid())
|
||||
return;
|
||||
|
||||
TreeItem * item = static_cast<TreeItem *>(mi.internalPointer());
|
||||
bool isFinished = item->data(TreeModel::Finished).toBool();
|
||||
bool isCompleted = item->data(TreeModel::Completed).toBool();
|
||||
|
||||
setFolderAsFinishedAction->setVisible(!isFinished);
|
||||
setFolderAsNotFinishedAction->setVisible(isFinished);
|
||||
|
||||
setFolderAsCompletedAction->setVisible(!isCompleted);
|
||||
setFolderAsNotCompletedAction->setVisible(isCompleted);
|
||||
}
|
||||
|
||||
void LibraryWindow::libraryAlreadyExists(const QString & name)
|
||||
|
@ -279,6 +279,7 @@ public:
|
||||
void backward();
|
||||
void forward();
|
||||
void updateHistory(const QModelIndex & mi);
|
||||
void updateFoldersViewConextMenu(const QModelIndex & mi);
|
||||
void libraryAlreadyExists(const QString & name);
|
||||
void importLibraryPackage();
|
||||
void updateComicsView(quint64 libraryId, const ComicDB & comic);
|
||||
|
Loading…
x
Reference in New Issue
Block a user