Merge from trunk

This commit is contained in:
Charles Haley 2010-07-10 15:39:12 +01:00
commit 67076db63f
7 changed files with 47 additions and 46 deletions

View File

@ -21,7 +21,7 @@ class Epubcheck(ePubFixer):
def long_description(self): def long_description(self):
return _('Workarounds for bugs in the latest release of epubcheck. ' return _('Workarounds for bugs in the latest release of epubcheck. '
'epubcheck reports many things as errors that are not ' 'epubcheck reports many things as errors that are not '
'actually errors. %prog will try to detect these and replace ' 'actually errors. epub-fix will try to detect these and replace '
'them with constructs that epubcheck likes. This may cause ' 'them with constructs that epubcheck likes. This may cause '
'significant changes to your epub, complain to the epubcheck ' 'significant changes to your epub, complain to the epubcheck '
'project.') 'project.')

View File

@ -18,7 +18,7 @@ class Unmanifested(ePubFixer):
@property @property
def long_description(self): def long_description(self):
return _('Fix unmanifested files. %prog can either add them to ' return _('Fix unmanifested files. epub-fix can either add them to '
'the manifest or delete them as specified by the ' 'the manifest or delete them as specified by the '
'delete unmanifested option.') 'delete unmanifested option.')

View File

@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>599</width> <width>953</width>
<height>516</height> <height>516</height>
</rect> </rect>
</property> </property>
@ -14,7 +14,7 @@
<string>TabWidget</string> <string>TabWidget</string>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>2</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="tab"> <widget class="QWidget" name="tab">
<attribute name="title"> <attribute name="title">
@ -177,50 +177,37 @@ Title match ignores leading indefinite articles (&quot;the&quot;, &quot;a&quot;,
<attribute name="title"> <attribute name="title">
<string>Sending to &amp;device</string> <string>Sending to &amp;device</string>
</attribute> </attribute>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QGridLayout" name="gridLayout_2">
<item> <item row="0" column="0" colspan="2">
<widget class="QComboBox" name="manage_device_metadata"> <widget class="QLabel" name="label_4">
<item>
<property name="text"> <property name="text">
<string extracomment="foobar">Manual management. Calibre updates cached metadata and adds collections, but never removes them</string> <string>Metadata &amp;management:</string>
</property> </property>
</item> <property name="buddy">
<item> <cstring>manage_device_metadata</cstring>
<property name="text">
<string>Calibre manages metadata when sending books. Calibre updates cached metadata, and adds/remove collections</string>
</property> </property>
</item>
<item>
<property name="text">
<string>Calibre manages metadata at device connection. Calibre updates cached metadata, and adds/removes collections</string>
</property>
</item>
</widget> </widget>
</item> </item>
<item> <item row="1" column="0" colspan="3">
<widget class="QLabel" name="label_41"> <widget class="QLabel" name="label_41">
<property name="text"> <property name="text">
<string>Choose 'Manual Management', to have Calibre update the metadata cache (not the book) and add collections when a book is sent. With this option, calibre will never remove a collection. Choose 'Calibre manages metadata when sending books' to have Calibre update the metadata cache and add/remove collections for a book when it is sent to the device. Choose 'Calibre manages metadata when device is connected' to have Calibre update the metadata cache and add/remove collections when calibre connects to the device and when you send a book. </string> <string>&lt;li&gt;&lt;b&gt;Manual Management&lt;/b&gt;: Calibre updates the metadata and adds collections only when a book is sent. With this option, calibre will never remove a collection.&lt;/li&gt;
</property> &lt;li&gt;&lt;b&gt;Only on send&lt;/b&gt;: Calibre updates metadata and adds/removes collections for a book only when it is sent to the device. &lt;/li&gt;
<property name="textFormat"> &lt;li&gt;&lt;b&gt;Automatic management&lt;/b&gt;: Calibre automatically keeps metadata on the device in sync with the calibre library, on every connect&lt;/li&gt;&lt;/ul&gt;</string>
<enum>Qt::PlainText</enum>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property> </property>
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="2" column="0">
<widget class="QLabel" name="label_42"> <widget class="QLabel" name="label_42">
<property name="text"> <property name="text">
<string/> <string/>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="3" column="0" colspan="3">
<widget class="QLabel" name="label_43"> <widget class="QLabel" name="label_43">
<property name="text"> <property name="text">
<string>Here you can control how calibre will save your books when you click the Send to Device button. This setting can be overriden for individual devices by customizing the device interface plugins in Preferences-&gt;Plugins</string> <string>Here you can control how calibre will save your books when you click the Send to Device button. This setting can be overriden for individual devices by customizing the device interface plugins in Preferences-&gt;Plugins</string>
@ -230,9 +217,28 @@ Title match ignores leading indefinite articles (&quot;the&quot;, &quot;a&quot;,
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="4" column="0" colspan="3">
<widget class="SaveTemplate" name="send_template" native="true"/> <widget class="SaveTemplate" name="send_template" native="true"/>
</item> </item>
<item row="0" column="2">
<widget class="QComboBox" name="manage_device_metadata">
<item>
<property name="text">
<string extracomment="foobar">Manual management</string>
</property>
</item>
<item>
<property name="text">
<string>Only on send</string>
</property>
</item>
<item>
<property name="text">
<string>Automatic management</string>
</property>
</item>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</widget> </widget>

View File

@ -409,7 +409,8 @@ class StatusBar(QStatusBar): # {{{
self.clearMessage() self.clearMessage()
def message_changed(self, msg): def message_changed(self, msg):
if not msg or msg.isEmpty() or msg.isNull(): if not msg or msg.isEmpty() or msg.isNull() or \
not unicode(msg).strip():
extra = '' extra = ''
if self.device_string: if self.device_string:
extra = ' ..::.. ' + self.device_string extra = ' ..::.. ' + self.device_string

View File

@ -8,13 +8,13 @@ __docformat__ = 'restructuredtext en'
from PyQt4.Qt import QIcon, Qt, QWidget, QAction, QToolBar, QSize, QVariant, \ from PyQt4.Qt import QIcon, Qt, QWidget, QAction, QToolBar, QSize, QVariant, \
QAbstractListModel, QFont, QApplication, QPalette, pyqtSignal, QToolButton, \ QAbstractListModel, QFont, QApplication, QPalette, pyqtSignal, QToolButton, \
QModelIndex, QListView, QAbstractButton, QPainter, QPixmap, QColor, \ QModelIndex, QListView, QAbstractButton, QPainter, QPixmap, QColor, \
QVBoxLayout, QSizePolicy, QLabel, QHBoxLayout, QComboBox QVBoxLayout, QSizePolicy, QLabel, QHBoxLayout
from calibre.constants import __appname__, filesystem_encoding from calibre.constants import __appname__, filesystem_encoding
from calibre.gui2.search_box import SearchBox2, SavedSearchBox from calibre.gui2.search_box import SearchBox2, SavedSearchBox
from calibre.gui2.widgets import ComboBoxWithHelp
from calibre.gui2.throbber import ThrobbingButton from calibre.gui2.throbber import ThrobbingButton
from calibre.gui2 import NONE from calibre.gui2 import NONE
from calibre.gui2.widgets import ComboBoxWithHelp
from calibre import human_readable from calibre import human_readable
class ToolBar(QToolBar): # {{{ class ToolBar(QToolBar): # {{{

View File

@ -7,7 +7,7 @@ Created on 10 Jun 2010
class SearchRestrictionMixin(object): class SearchRestrictionMixin(object):
def __init__(self): def __init__(self):
self.search_restriction.initialize(help_text=_('Restrict To')) self.search_restriction.initialize(help_text=_('Restrict to'))
self.search_restriction.activated[int].connect(self.apply_search_restriction) self.search_restriction.activated[int].connect(self.apply_search_restriction)
self.library_view.model().count_changed_signal.connect(self.restriction_count_changed) self.library_view.model().count_changed_signal.connect(self.restriction_count_changed)
self.search_restriction.setSizeAdjustPolicy(self.search_restriction.AdjustToMinimumContentsLengthWithIcon) self.search_restriction.setSizeAdjustPolicy(self.search_restriction.AdjustToMinimumContentsLengthWithIcon)

View File

@ -1,4 +1,3 @@
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>' __copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
''' '''
Miscellaneous widgets used in the GUI Miscellaneous widgets used in the GUI
@ -546,8 +545,7 @@ class ComboBoxWithHelp(QComboBox):
''' '''
def __init__(self, parent=None): def __init__(self, parent=None):
QComboBox.__init__(self, parent) QComboBox.__init__(self, parent)
self.normal_background = 'rgb(255, 255, 255, 0%)' self.currentIndexChanged[int].connect(self.index_changed)
self.connect(self, SIGNAL('currentIndexChanged(int)'), self.index_changed)
self.help_text = '' self.help_text = ''
self.state_set = False self.state_set = False
@ -559,14 +557,10 @@ class ComboBoxWithHelp(QComboBox):
if not self.state_set: if not self.state_set:
if self.currentIndex() == 0: if self.currentIndex() == 0:
self.setItemText(0, self.help_text) self.setItemText(0, self.help_text)
self.setStyleSheet( self.setStyleSheet('QComboBox { color: gray }')
'QComboBox { color: gray; background-color: %s; }' %
self.normal_background)
else: else:
self.setItemText(0, '') self.setItemText(0, '')
self.setStyleSheet( self.setStyleSheet('QComboBox { color: black }')
'QComboBox { color: black; background-color: %s; }' %
self.normal_background)
def index_changed(self, index): def index_changed(self, index):
self.state_set = False self.state_set = False