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:
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,46 +31,6 @@
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok</set>
</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">
@ -158,8 +118,14 @@ automatic sending of the catalog to the device will not work.</string>
</widget>
</widget>
</item>
</layout>
</widget>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>