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'
|
print '\n\nPushing to:', host, '\n'
|
||||||
threads.append(Thread(target=subprocess.check_call, args=(rcmd,)))
|
threads.append(Thread(target=subprocess.check_call, args=(rcmd,)))
|
||||||
threads[-1].start()
|
threads[-1].start()
|
||||||
subprocess.check_call(rcmd)
|
|
||||||
for thread in threads:
|
for thread in threads:
|
||||||
thread.join()
|
thread.join()
|
||||||
|
|
||||||
|
@ -5,8 +5,8 @@ __docformat__ = 'restructuredtext en'
|
|||||||
|
|
||||||
import textwrap, os, re
|
import textwrap, os, re
|
||||||
|
|
||||||
from PyQt4.QtCore import QCoreApplication, SIGNAL, QModelIndex, QTimer, Qt
|
from PyQt4.Qt import QCoreApplication, SIGNAL, QModelIndex, QTimer, Qt, \
|
||||||
from PyQt4.QtGui import QDialog, QPixmap, QGraphicsScene, QIcon
|
QDialog, QPixmap, QGraphicsScene, QIcon, QSize
|
||||||
|
|
||||||
from calibre.gui2.dialogs.book_info_ui import Ui_BookInfo
|
from calibre.gui2.dialogs.book_info_ui import Ui_BookInfo
|
||||||
from calibre.gui2 import dynamic, open_local_file
|
from calibre.gui2 import dynamic, open_local_file
|
||||||
@ -20,6 +20,8 @@ class BookInfo(QDialog, Ui_BookInfo):
|
|||||||
Ui_BookInfo.__init__(self)
|
Ui_BookInfo.__init__(self)
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
self.cover_pixmap = None
|
self.cover_pixmap = None
|
||||||
|
self.comments.sizeHint = self.comments_size_hint
|
||||||
|
|
||||||
desktop = QCoreApplication.instance().desktop()
|
desktop = QCoreApplication.instance().desktop()
|
||||||
screen_height = desktop.availableGeometry().height() - 100
|
screen_height = desktop.availableGeometry().height() - 100
|
||||||
self.resize(self.size().width(), screen_height)
|
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.fit_cover.stateChanged.connect(self.toggle_cover_fit)
|
||||||
self.cover.resizeEvent = self.cover_view_resized
|
self.cover.resizeEvent = self.cover_view_resized
|
||||||
|
|
||||||
|
def comments_size_hint(self):
|
||||||
|
return QSize(350, 350)
|
||||||
|
|
||||||
def toggle_cover_fit(self, state):
|
def toggle_cover_fit(self, state):
|
||||||
dynamic.set('book_info_dialog_fit_cover', self.fit_cover.isChecked())
|
dynamic.set('book_info_dialog_fit_cover', self.fit_cover.isChecked())
|
||||||
self.resize_cover()
|
self.resize_cover()
|
||||||
|
|
||||||
def cover_view_resized(self, event):
|
def cover_view_resized(self, event):
|
||||||
QTimer.singleShot(1, self.resize_cover)
|
QTimer.singleShot(1, self.resize_cover)
|
||||||
|
|
||||||
def slave(self, current, previous):
|
def slave(self, current, previous):
|
||||||
row = current.row()
|
row = current.row()
|
||||||
self.refresh(row)
|
self.refresh(row)
|
||||||
|
@ -47,9 +47,15 @@
|
|||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Comments</string>
|
<string>Comments</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
<item row="0" column="0">
|
<item>
|
||||||
<widget class="QWebView" name="comments">
|
<widget class="QWebView" name="comments">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>350</width>
|
<width>350</width>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user