mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
Have the job details window remember its last used size
This commit is contained in:
parent
62f21113ef
commit
ecfa32b986
@ -1,67 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>Dialog</class>
|
|
||||||
<widget class="QDialog" name="Dialog">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>664</width>
|
|
||||||
<height>462</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
|
||||||
<string>Details of job</string>
|
|
||||||
</property>
|
|
||||||
<property name="windowIcon">
|
|
||||||
<iconset resource="../../../../resources/images.qrc">
|
|
||||||
<normaloff>:/images/view.png</normaloff>:/images/view.png</iconset>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QPlainTextEdit" name="log">
|
|
||||||
<property name="undoRedoEnabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="lineWrapMode">
|
|
||||||
<enum>QPlainTextEdit::NoWrap</enum>
|
|
||||||
</property>
|
|
||||||
<property name="readOnly">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
|
||||||
<property name="standardButtons">
|
|
||||||
<set>QDialogButtonBox::Ok</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QTextBrowser" name="tb"/>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<resources>
|
|
||||||
<include location="../../../../resources/images.qrc"/>
|
|
||||||
</resources>
|
|
||||||
<connections>
|
|
||||||
<connection>
|
|
||||||
<sender>buttonBox</sender>
|
|
||||||
<signal>accepted()</signal>
|
|
||||||
<receiver>Dialog</receiver>
|
|
||||||
<slot>accept()</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>617</x>
|
|
||||||
<y>442</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>206</x>
|
|
||||||
<y>-5</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
</connections>
|
|
||||||
</ui>
|
|
@ -14,7 +14,7 @@ from PyQt5.Qt import (QAbstractTableModel, QModelIndex, Qt,
|
|||||||
QTimer, pyqtSignal, QIcon, QDialog, QAbstractItemDelegate, QApplication,
|
QTimer, pyqtSignal, QIcon, QDialog, QAbstractItemDelegate, QApplication,
|
||||||
QSize, QStyleOptionProgressBar, QStyle, QToolTip, QFrame,
|
QSize, QStyleOptionProgressBar, QStyle, QToolTip, QFrame,
|
||||||
QHBoxLayout, QVBoxLayout, QSizePolicy, QLabel, QCoreApplication, QAction,
|
QHBoxLayout, QVBoxLayout, QSizePolicy, QLabel, QCoreApplication, QAction,
|
||||||
QByteArray, QSortFilterProxyModel)
|
QByteArray, QSortFilterProxyModel, QTextBrowser, QPlainTextEdit)
|
||||||
|
|
||||||
from calibre.constants import islinux, isbsd
|
from calibre.constants import islinux, isbsd
|
||||||
from calibre.utils.ipc.server import Server
|
from calibre.utils.ipc.server import Server
|
||||||
@ -24,9 +24,9 @@ from calibre.gui2 import (Dispatcher, error_dialog, question_dialog,
|
|||||||
from calibre.gui2.device import DeviceJob
|
from calibre.gui2.device import DeviceJob
|
||||||
from calibre.gui2.dialogs.jobs_ui import Ui_JobsDialog
|
from calibre.gui2.dialogs.jobs_ui import Ui_JobsDialog
|
||||||
from calibre import __appname__, as_unicode
|
from calibre import __appname__, as_unicode
|
||||||
from calibre.gui2.dialogs.job_view_ui import Ui_Dialog
|
|
||||||
from calibre.gui2.progress_indicator import ProgressIndicator
|
from calibre.gui2.progress_indicator import ProgressIndicator
|
||||||
from calibre.gui2.threaded_jobs import ThreadedJobServer, ThreadedJob
|
from calibre.gui2.threaded_jobs import ThreadedJobServer, ThreadedJob
|
||||||
|
from calibre.gui2.widgets2 import Dialog
|
||||||
from calibre.utils.search_query_parser import SearchQueryParser, ParseException
|
from calibre.utils.search_query_parser import SearchQueryParser, ParseException
|
||||||
from calibre.utils.icu import lower
|
from calibre.utils.icu import lower
|
||||||
|
|
||||||
@ -408,24 +408,32 @@ class ProgressBarDelegate(QAbstractItemDelegate): # {{{
|
|||||||
QApplication.style().drawControl(QStyle.CE_ProgressBar, opts, painter)
|
QApplication.style().drawControl(QStyle.CE_ProgressBar, opts, painter)
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
class DetailView(QDialog, Ui_Dialog): # {{{
|
class DetailView(Dialog): # {{{
|
||||||
|
|
||||||
def __init__(self, parent, job):
|
def __init__(self, parent, job):
|
||||||
QDialog.__init__(self, parent)
|
|
||||||
self.setupUi(self)
|
|
||||||
self.setWindowTitle(job.description)
|
|
||||||
self.job = job
|
self.job = job
|
||||||
self.html_view = (hasattr(job, 'html_details') and not getattr(job,
|
self.html_view = hasattr(job, 'html_details') and not getattr(job, 'ignore_html_details', False)
|
||||||
'ignore_html_details', False))
|
Dialog.__init__(self, job.description, 'job-detail-view-dialog', parent)
|
||||||
|
|
||||||
|
def sizeHint(self):
|
||||||
|
return QSize(700, 500)
|
||||||
|
|
||||||
|
def setup_ui(self):
|
||||||
|
self.l = l = QVBoxLayout(self)
|
||||||
if self.html_view:
|
if self.html_view:
|
||||||
self.log.setVisible(False)
|
self.tb = w = QTextBrowser(self)
|
||||||
else:
|
else:
|
||||||
self.tb.setVisible(False)
|
self.log = w = QPlainTextEdit(self)
|
||||||
|
w.setReadOnly(True), w.setLineWrapMode(w.NoWrap)
|
||||||
|
l.addWidget(w)
|
||||||
|
l.addWidget(self.bb)
|
||||||
|
self.bb.clear(), self.bb.setStandardButtons(self.bb.Close)
|
||||||
self.next_pos = 0
|
self.next_pos = 0
|
||||||
self.update()
|
self.update()
|
||||||
self.timer = QTimer(self)
|
self.timer = QTimer(self)
|
||||||
self.timer.timeout.connect(self.update)
|
self.timer.timeout.connect(self.update)
|
||||||
self.timer.start(1000)
|
self.timer.start(1000)
|
||||||
|
if not self.html_view:
|
||||||
v = self.log.verticalScrollBar()
|
v = self.log.verticalScrollBar()
|
||||||
v.setValue(v.maximum())
|
v.setValue(v.maximum())
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user