mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Busy cursor
This commit is contained in:
parent
0e23eed1b7
commit
fbd0b6003e
@ -109,7 +109,7 @@ class FetchMetadata(QDialog, Ui_FetchMetadata):
|
||||
# args.extend(('--publisher', self.publisher))
|
||||
|
||||
self.fetch.setEnabled(False)
|
||||
|
||||
self.setCursor(Qt.WaitCursor)
|
||||
QCoreApplication.instance().processEvents()
|
||||
|
||||
args.append(key)
|
||||
@ -125,7 +125,7 @@ class FetchMetadata(QDialog, Ui_FetchMetadata):
|
||||
self.matches.selectionModel().select(self.model.index(0, 0),
|
||||
QItemSelectionModel.Select | QItemSelectionModel.Rows)
|
||||
self.fetch.setEnabled(True)
|
||||
|
||||
self.unsetCursor()
|
||||
|
||||
|
||||
def selected_book(self):
|
||||
|
@ -18,7 +18,7 @@ add/remove formats
|
||||
'''
|
||||
import os, urllib
|
||||
|
||||
from PyQt4.QtCore import SIGNAL, QObject, QCoreApplication
|
||||
from PyQt4.QtCore import SIGNAL, QObject, QCoreApplication, Qt
|
||||
from PyQt4.QtGui import QPixmap, QListWidgetItem, QErrorMessage, QDialog
|
||||
|
||||
|
||||
@ -204,6 +204,7 @@ class MetadataSingleDialog(QDialog, Ui_MetadataSingleDialog):
|
||||
isbn = qstring_to_unicode(self.isbn.text())
|
||||
if isbn:
|
||||
self.fetch_cover_button.setEnabled(False)
|
||||
self.setCursor(Qt.WaitCursor)
|
||||
QCoreApplication.instance().processEvents()
|
||||
try:
|
||||
src = urllib.urlopen('http://www.librarything.com/isbn/'+isbn).read()
|
||||
@ -222,6 +223,7 @@ class MetadataSingleDialog(QDialog, Ui_MetadataSingleDialog):
|
||||
error_dialog(self, 'Could not fetch cover', 'Could not fetch cover. Error %s'%(err,)).exec_()
|
||||
finally:
|
||||
self.fetch_cover_button.setEnabled(True)
|
||||
self.unsetCursor()
|
||||
else:
|
||||
error_dialog(self, 'Cannot fetch cover', 'You must specify the ISBN identifier for this book.').exec_()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user