mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-21 13:33:43 +02:00
Implement #734
This commit is contained in:
parent
0603501067
commit
4fbe9c3fa4
1 changed files with 9 additions and 1 deletions
|
|
@ -7,7 +7,7 @@
|
|||
import logging, cStringIO
|
||||
|
||||
from PyQt4.QtCore import Qt, QObject, SIGNAL, QVariant, \
|
||||
QAbstractTableModel, QCoreApplication
|
||||
QAbstractTableModel, QCoreApplication, QTimer
|
||||
from PyQt4.QtGui import QDialog, QItemSelectionModel
|
||||
|
||||
from calibre.gui2.dialogs.fetch_metadata_ui import Ui_FetchMetadata
|
||||
|
|
@ -85,6 +85,10 @@ def __init__(self, parent, isbn, title, author, publisher, timeout):
|
|||
self.author = author.strip()
|
||||
self.publisher = publisher
|
||||
self.previous_row = None
|
||||
self.connect(self.matches, SIGNAL('activated(QModelIndex)'), self.chosen)
|
||||
key = str(self.key.text())
|
||||
if key:
|
||||
QTimer.singleShot(100, self.fetch.click)
|
||||
|
||||
|
||||
|
||||
|
|
@ -152,3 +156,7 @@ def selected_book(self):
|
|||
return self.matches.model().matches[self.matches.currentIndex().row()]
|
||||
except:
|
||||
return None
|
||||
|
||||
def chosen(self, index):
|
||||
self.matches.setCurrentIndex(index)
|
||||
self.accept()
|
||||
|
|
|
|||
Loading…
Reference in a new issue