Fix #1725474 [The window for creating a csv catalog must be stretched way beyond the names of the columns in order to access both scrollbars allowing the user to see all the column names.](https://bugs.launchpad.net/calibre/+bug/1725474)

This commit is contained in:
Kovid Goyal 2017-10-21 09:14:41 +05:30
parent 782e63feb8
commit 2ccdcff309
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 98 additions and 126 deletions

View File

@ -17,6 +17,7 @@ class PluginWidget(QWidget):
HELP = _('Options specific to')+' CSV/XML '+_('output')
sync_enabled = False
formats = set(['csv', 'xml'])
handles_scrolling = True
def __init__(self, parent=None):
QWidget.__init__(self, parent)

View File

@ -8,7 +8,7 @@ __docformat__ = 'restructuredtext en'
import os, sys, importlib
from PyQt5.Qt import QDialog, QCoreApplication, QSize
from PyQt5.Qt import QDialog, QCoreApplication, QSize, QScrollArea
from calibre.customize.ui import config
from calibre.gui2.dialogs.catalog_ui import Ui_Dialog
@ -143,7 +143,12 @@ class Catalog(QDialog, Ui_Dialog):
self.tabs.removeTab(1)
for pw in self.widgets:
if cf in pw.formats:
self.tabs.addTab(pw, pw.TITLE)
if getattr(pw, 'handles_scrolling', False):
self.tabs.addTab(pw, pw.TITLE)
else:
self.sw__mem = s = QScrollArea(self)
s.setWidget(pw), s.setWidgetResizable(True)
self.tabs.addTab(s, pw.TITLE)
break
if hasattr(self.tabs.widget(1),'show_help'):
self.buttonBox.button(self.buttonBox.Help).setVisible(True)

View File

@ -17,8 +17,8 @@
<iconset resource="../../../../resources/images.qrc">
<normaloff>:/images/lt.png</normaloff>:/images/lt.png</iconset>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="count">
<property name="font">
<font>
@ -31,7 +31,94 @@
</property>
</widget>
</item>
<item row="2" column="1">
<item>
<widget class="QTabWidget" name="tabs">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>650</width>
<height>575</height>
</size>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Catalog options</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Catalo&amp;g format:</string>
</property>
<property name="buddy">
<cstring>format</cstring>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QComboBox" name="format"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Catalog &amp;title (existing catalog with the same title will be replaced):</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="buddy">
<cstring>title</cstring>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLineEdit" name="title"/>
</item>
<item row="4" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="0" colspan="2">
<widget class="QCheckBox" name="sync">
<property name="text">
<string>&amp;Send catalog to device automatically</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="3">
<widget class="QCheckBox" name="add_to_library">
<property name="toolTip">
<string>Add the catalog to your calibre library after it is generated.
Note that if you disable adding of the catalog to the library
automatic sending of the catalog to the device will not work.</string>
</property>
<property name="text">
<string>&amp;Add catalog to library</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@ -41,127 +128,6 @@
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QScrollArea" name="scrollArea">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>656</width>
<height>596</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QTabWidget" name="tabs">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>650</width>
<height>575</height>
</size>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Catalog options</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Catalo&amp;g format:</string>
</property>
<property name="buddy">
<cstring>format</cstring>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QComboBox" name="format"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Catalog &amp;title (existing catalog with the same title will be replaced):</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="buddy">
<cstring>title</cstring>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLineEdit" name="title"/>
</item>
<item row="4" column="1">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="0" colspan="2">
<widget class="QCheckBox" name="sync">
<property name="text">
<string>&amp;Send catalog to device automatically</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="3">
<widget class="QCheckBox" name="add_to_library">
<property name="toolTip">
<string>Add the catalog to your calibre library after it is generated.
Note that if you disable adding of the catalog to the library
automatic sending of the catalog to the device will not work.</string>
</property>
<property name="text">
<string>&amp;Add catalog to library</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<resources>