Skip to content

Commit

Permalink
Open novel on double-click, closes #1369
Browse files Browse the repository at this point in the history
  • Loading branch information
zkovari committed Oct 3, 2024
1 parent a41d647 commit 97ade98
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main/python/plotlyst/view/home_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ def __init__(self):
self._shelvesTreeView.novelsShelveSelected.connect(self.reset)
self._shelvesTreeView.newNovelRequested.connect(self._add_new_novel)
self._shelvesTreeView.novelDeletionRequested.connect(self._on_delete)
self._shelvesTreeView.novelOpenRequested.connect(self.loadNovel)

self.ui.pageNovelDisplay.installEventFilter(
VisibilityToggleEventFilter(self.ui.btnNovelSettings, self.ui.pageNovelDisplay))
Expand Down
2 changes: 2 additions & 0 deletions src/main/python/plotlyst/view/widget/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class ShelvesTreeView(TreeView):
novelSelected = pyqtSignal(NovelDescriptor)
novelChanged = pyqtSignal(NovelDescriptor)
novelDeletionRequested = pyqtSignal(NovelDescriptor)
novelOpenRequested = pyqtSignal(NovelDescriptor)
novelsShelveSelected = pyqtSignal()
newNovelRequested = pyqtSignal()

Expand Down Expand Up @@ -119,6 +120,7 @@ def setNovels(self, novels: List[NovelDescriptor]):
node.selectionChanged.connect(partial(self._novelSelectionChanged, node))
node.iconChanged.connect(partial(self.novelChanged.emit, novel))
node.deleted.connect(partial(self.novelDeletionRequested.emit, novel))
node.doubleClicked.connect(partial(self.novelOpenRequested.emit, novel))

def updateNovel(self, novel: NovelDescriptor):
self._novels[novel].refresh()
Expand Down

0 comments on commit 97ade98

Please sign in to comment.