Fix #7435 (Open the detailed info dialog for the book.)

This commit is contained in:
Kovid Goyal 2010-11-06 10:35:46 -06:00
parent 3e6bb20ac8
commit 293c2cc725
3 changed files with 16 additions and 5 deletions

View File

@ -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()

View File

@ -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)

View File

@ -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>