mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
728f82cf44
commit
549253460a
@ -158,6 +158,7 @@ class RecipeList(QWidget): # {{{
|
|||||||
self.l = l = QHBoxLayout(self)
|
self.l = l = QHBoxLayout(self)
|
||||||
|
|
||||||
self.view = v = QListView(self)
|
self.view = v = QListView(self)
|
||||||
|
v.doubleClicked.connect(self.item_activated)
|
||||||
v.setModel(CustomRecipeModel(model))
|
v.setModel(CustomRecipeModel(model))
|
||||||
l.addWidget(v)
|
l.addWidget(v)
|
||||||
|
|
||||||
@ -226,6 +227,12 @@ class RecipeList(QWidget): # {{{
|
|||||||
if src is not None:
|
if src is not None:
|
||||||
self.edit_recipe.emit(idx.row(), src)
|
self.edit_recipe.emit(idx.row(), src)
|
||||||
|
|
||||||
|
def item_activated(self, idx):
|
||||||
|
if idx.isValid():
|
||||||
|
src = self.model.script(idx)
|
||||||
|
if src is not None:
|
||||||
|
self.edit_recipe.emit(idx.row(), src)
|
||||||
|
|
||||||
def remove(self):
|
def remove(self):
|
||||||
idx = self.view.currentIndex()
|
idx = self.view.currentIndex()
|
||||||
if idx.isValid():
|
if idx.isValid():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user