mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1494 (main screen refresh)
This commit is contained in:
parent
360701b3af
commit
c667ad16a6
@ -15,7 +15,7 @@ from PyQt4.QtCore import QAbstractTableModel, QVariant, Qt, QString, \
|
||||
from calibre import strftime
|
||||
from calibre.ptempfile import PersistentTemporaryFile
|
||||
from calibre.library.database2 import FIELD_MAP
|
||||
from calibre.gui2 import NONE, TableView, qstring_to_unicode, config,\
|
||||
from calibre.gui2 import NONE, TableView, qstring_to_unicode, config, \
|
||||
error_dialog
|
||||
from calibre.utils.search_query_parser import SearchQueryParser
|
||||
|
||||
|
@ -3,11 +3,11 @@ __copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||
import os, sys, textwrap, collections, traceback, time
|
||||
from xml.parsers.expat import ExpatError
|
||||
from functools import partial
|
||||
from PyQt4.QtCore import Qt, SIGNAL, QObject, QCoreApplication, QUrl, QTimer
|
||||
from PyQt4.QtGui import QPixmap, QColor, QPainter, QMenu, QIcon, QMessageBox, \
|
||||
from PyQt4.Qt import Qt, SIGNAL, QObject, QCoreApplication, QUrl, QTimer, \
|
||||
QModelIndex, QPixmap, QColor, QPainter, QMenu, QIcon, \
|
||||
QToolButton, QDialog, QDesktopServices, QFileDialog, \
|
||||
QSystemTrayIcon, QApplication, QKeySequence, QAction, \
|
||||
QProgressDialog
|
||||
QProgressDialog, QMessageBox
|
||||
from PyQt4.QtSvg import QSvgRenderer
|
||||
|
||||
from calibre import __version__, __appname__, islinux, sanitize_file_name, \
|
||||
@ -308,7 +308,6 @@ class Main(MainWindow, Ui_MainWindow):
|
||||
db = LibraryDatabase2(self.library_path)
|
||||
self.library_view.set_database(db)
|
||||
if self.olddb is not None:
|
||||
from PyQt4.QtGui import QProgressDialog
|
||||
pd = QProgressDialog('', '', 0, 100, self)
|
||||
pd.setWindowModality(Qt.ApplicationModal)
|
||||
pd.setCancelButton(None)
|
||||
@ -798,6 +797,7 @@ class Main(MainWindow, Ui_MainWindow):
|
||||
Edit metadata of selected books in library.
|
||||
'''
|
||||
rows = self.library_view.selectionModel().selectedRows()
|
||||
previous = self.library_view.currentIndex()
|
||||
if not rows or len(rows) == 0:
|
||||
d = error_dialog(self, _('Cannot edit metadata'), _('No books selected'))
|
||||
d.exec_()
|
||||
@ -814,6 +814,9 @@ class Main(MainWindow, Ui_MainWindow):
|
||||
self.library_view.model().db,
|
||||
accepted_callback=accepted)
|
||||
d.exec_()
|
||||
if rows:
|
||||
current = self.library_view.currentIndex()
|
||||
self.library_view.model().current_changed(current, previous)
|
||||
|
||||
def edit_bulk_metadata(self, checked):
|
||||
'''
|
||||
@ -1071,6 +1074,9 @@ class Main(MainWindow, Ui_MainWindow):
|
||||
os.remove(f.name)
|
||||
except:
|
||||
pass
|
||||
if self.current_view() is self.library_view:
|
||||
current = self.library_view.currentIndex()
|
||||
self.library_view.model().current_changed(current, QModelIndex())
|
||||
|
||||
#############################View book######################################
|
||||
|
||||
@ -1203,7 +1209,6 @@ class Main(MainWindow, Ui_MainWindow):
|
||||
newloc = d.database_location
|
||||
if not os.path.exists(os.path.join(newloc, 'metadata.db')):
|
||||
if os.access(self.library_path, os.R_OK):
|
||||
from PyQt4.QtGui import QProgressDialog
|
||||
pd = QProgressDialog('', '', 0, 100, self)
|
||||
pd.setWindowModality(Qt.ApplicationModal)
|
||||
pd.setCancelButton(None)
|
||||
|
Loading…
x
Reference in New Issue
Block a user