Fix regressions caused by change of author field to combobox

This commit is contained in:
Kovid Goyal 2009-07-09 10:37:43 -06:00
parent 7ab2368c9e
commit 1c8c0400bb
3 changed files with 63 additions and 38 deletions

View File

@ -20,6 +20,36 @@
<string>Book Cover</string>
</property>
<layout class="QGridLayout" name="_2">
<item row="0" column="0">
<layout class="QHBoxLayout" name="_3">
<item>
<widget class="ImageView" name="cover">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../images.qrc">:/images/book.svg</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="opt_prefer_metadata_cover">
<property name="text">
<string>Use cover from &amp;source file</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<layout class="QVBoxLayout" name="_4">
<property name="spacing">
@ -71,36 +101,6 @@
</item>
</layout>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="opt_prefer_metadata_cover">
<property name="text">
<string>Use cover from &amp;source file</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="0">
<layout class="QHBoxLayout" name="_3">
<item>
<widget class="ImageView" name="cover">
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../images.qrc">:/images/book.svg</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
<zorder>opt_prefer_metadata_cover</zorder>
<zorder></zorder>
@ -329,6 +329,19 @@
<header>widgets.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>title</tabstop>
<tabstop>author</tabstop>
<tabstop>author_sort</tabstop>
<tabstop>publisher</tabstop>
<tabstop>tags</tabstop>
<tabstop>series</tabstop>
<tabstop>series_index</tabstop>
<tabstop>comment</tabstop>
<tabstop>cover_path</tabstop>
<tabstop>cover_button</tabstop>
<tabstop>opt_prefer_metadata_cover</tabstop>
</tabstops>
<resources>
<include location="../images.qrc"/>
<include location="../images.qrc"/>

View File

@ -43,8 +43,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>869</width>
<height>696</height>
<width>879</width>
<height>710</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
@ -121,6 +121,9 @@
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>authors</cstring>
</property>
</widget>
</item>
<item row="2" column="0">
@ -661,26 +664,28 @@
<tabstops>
<tabstop>title</tabstop>
<tabstop>swap_button</tabstop>
<tabstop>authors</tabstop>
<tabstop>author_sort</tabstop>
<tabstop>auto_author_sort</tabstop>
<tabstop>rating</tabstop>
<tabstop>publisher</tabstop>
<tabstop>tags</tabstop>
<tabstop>series</tabstop>
<tabstop>tag_editor_button</tabstop>
<tabstop>series</tabstop>
<tabstop>remove_series_button</tabstop>
<tabstop>series_index</tabstop>
<tabstop>isbn</tabstop>
<tabstop>pubdate</tabstop>
<tabstop>comments</tabstop>
<tabstop>fetch_metadata_button</tabstop>
<tabstop>fetch_cover_button</tabstop>
<tabstop>formats</tabstop>
<tabstop>add_format_button</tabstop>
<tabstop>remove_format_button</tabstop>
<tabstop>button_set_cover</tabstop>
<tabstop>remove_format_button</tabstop>
<tabstop>cover_path</tabstop>
<tabstop>cover_button</tabstop>
<tabstop>reset_cover</tabstop>
<tabstop>fetch_cover_button</tabstop>
<tabstop>scrollArea</tabstop>
<tabstop>button_box</tabstop>
</tabstops>

View File

@ -490,13 +490,13 @@ class LineEditECM(object):
class EnLineEdit(LineEditECM, QLineEdit):
'''
Enhanced QLineEdit.
Includes an extended content menu.
'''
pass
@ -593,6 +593,13 @@ class EnComboBox(QComboBox):
def text(self):
return qstring_to_unicode(self.currentText())
def setText(self, text):
idx = self.findText(text, Qt.MatchFixedString)
if idx == -1:
self.insertItem(0, text)
idx = 0
self.setCurrentIndex(idx)
class PythonHighlighter(QSyntaxHighlighter):
Rules = []