mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #7435 (Open the detailed info dialog for the book.)
This commit is contained in:
parent
3e6bb20ac8
commit
293c2cc725
@ -49,7 +49,6 @@ class Push(Command):
|
||||
print '\n\nPushing to:', host, '\n'
|
||||
threads.append(Thread(target=subprocess.check_call, args=(rcmd,)))
|
||||
threads[-1].start()
|
||||
subprocess.check_call(rcmd)
|
||||
for thread in threads:
|
||||
thread.join()
|
||||
|
||||
|
@ -5,8 +5,8 @@ __docformat__ = 'restructuredtext en'
|
||||
|
||||
import textwrap, os, re
|
||||
|
||||
from PyQt4.QtCore import QCoreApplication, SIGNAL, QModelIndex, QTimer, Qt
|
||||
from PyQt4.QtGui import QDialog, QPixmap, QGraphicsScene, QIcon
|
||||
from PyQt4.Qt import QCoreApplication, SIGNAL, QModelIndex, QTimer, Qt, \
|
||||
QDialog, QPixmap, QGraphicsScene, QIcon, QSize
|
||||
|
||||
from calibre.gui2.dialogs.book_info_ui import Ui_BookInfo
|
||||
from calibre.gui2 import dynamic, open_local_file
|
||||
@ -20,6 +20,8 @@ class BookInfo(QDialog, Ui_BookInfo):
|
||||
Ui_BookInfo.__init__(self)
|
||||
self.setupUi(self)
|
||||
self.cover_pixmap = None
|
||||
self.comments.sizeHint = self.comments_size_hint
|
||||
|
||||
desktop = QCoreApplication.instance().desktop()
|
||||
screen_height = desktop.availableGeometry().height() - 100
|
||||
self.resize(self.size().width(), screen_height)
|
||||
@ -37,12 +39,16 @@ class BookInfo(QDialog, Ui_BookInfo):
|
||||
self.fit_cover.stateChanged.connect(self.toggle_cover_fit)
|
||||
self.cover.resizeEvent = self.cover_view_resized
|
||||
|
||||
def comments_size_hint(self):
|
||||
return QSize(350, 350)
|
||||
|
||||
def toggle_cover_fit(self, state):
|
||||
dynamic.set('book_info_dialog_fit_cover', self.fit_cover.isChecked())
|
||||
self.resize_cover()
|
||||
|
||||
def cover_view_resized(self, event):
|
||||
QTimer.singleShot(1, self.resize_cover)
|
||||
|
||||
def slave(self, current, previous):
|
||||
row = current.row()
|
||||
self.refresh(row)
|
||||
|
@ -47,9 +47,15 @@
|
||||
<property name="title">
|
||||
<string>Comments</string>
|
||||
</property>
|
||||
<layout class="QGridLayout">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QWebView" name="comments">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>350</width>
|
||||
|
Loading…
x
Reference in New Issue
Block a user