Implement #1677 (Task tray status boss option)

This commit is contained in:
Kovid Goyal 2009-01-23 12:41:01 -08:00
parent 1f18210a57
commit 3363f70602
5 changed files with 20 additions and 10 deletions

View File

@ -60,6 +60,8 @@ def _config():
help=_('Delete books from library after uploading to device')) help=_('Delete books from library after uploading to device'))
c.add_opt('separate_cover_flow', default=False, c.add_opt('separate_cover_flow', default=False,
help=_('Show the cover flow in a separate window instead of in the main calibre window')) help=_('Show the cover flow in a separate window instead of in the main calibre window'))
c.add_opt('disable_tray_notification', default=False,
help=_('Disable notifications from the system tray icon'))
return ConfigProxy(c) return ConfigProxy(c)
config = _config() config = _config()

View File

@ -186,6 +186,7 @@ class ConfigDialog(QDialog, Ui_Dialog):
single_format = config['save_to_disk_single_format'] single_format = config['save_to_disk_single_format']
self.single_format.setCurrentIndex(BOOK_EXTENSIONS.index(single_format)) self.single_format.setCurrentIndex(BOOK_EXTENSIONS.index(single_format))
self.cover_browse.setValue(config['cover_flow_queue_length']) self.cover_browse.setValue(config['cover_flow_queue_length'])
self.systray_notifications.setChecked(not config['disable_tray_notification'])
from calibre.translations.compiled import translations from calibre.translations.compiled import translations
from calibre.translations import language_codes from calibre.translations import language_codes
from calibre.startup import get_lang from calibre.startup import get_lang
@ -394,6 +395,7 @@ class ConfigDialog(QDialog, Ui_Dialog):
config['toolbar_icon_size'] = self.ICON_SIZES[self.toolbar_button_size.currentIndex()] config['toolbar_icon_size'] = self.ICON_SIZES[self.toolbar_button_size.currentIndex()]
config['show_text_in_toolbar'] = bool(self.show_toolbar_text.isChecked()) config['show_text_in_toolbar'] = bool(self.show_toolbar_text.isChecked())
config['separate_cover_flow'] = bool(self.separate_cover_flow.isChecked()) config['separate_cover_flow'] = bool(self.separate_cover_flow.isChecked())
config['disable_tray_notification'] = not self.systray_notifications.isChecked()
pattern = self.filename_pattern.commit() pattern = self.filename_pattern.commit()
prefs['filename_pattern'] = pattern prefs['filename_pattern'] = pattern
p = {0:'normal', 1:'high', 2:'low'}[self.priority.currentIndex()] p = {0:'normal', 1:'high', 2:'low'}[self.priority.currentIndex()]

View File

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>800</width> <width>800</width>
<height>570</height> <height>581</height>
</rect> </rect>
</property> </property>
<property name="windowTitle" > <property name="windowTitle" >
@ -339,7 +339,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0" > <item row="3" column="0" >
<layout class="QHBoxLayout" name="horizontalLayout" > <layout class="QHBoxLayout" name="horizontalLayout" >
<item> <item>
<widget class="QLabel" name="label_6" > <widget class="QLabel" name="label_6" >
@ -356,7 +356,7 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="7" column="0" > <item row="8" column="0" >
<widget class="QGroupBox" name="groupBox_2" > <widget class="QGroupBox" name="groupBox_2" >
<property name="title" > <property name="title" >
<string>Toolbar</string> <string>Toolbar</string>
@ -404,7 +404,7 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="8" column="0" > <item row="9" column="0" >
<widget class="QGroupBox" name="groupBox" > <widget class="QGroupBox" name="groupBox" >
<property name="title" > <property name="title" >
<string>Select visible &amp;columns in library view</string> <string>Select visible &amp;columns in library view</string>
@ -492,27 +492,34 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="4" column="0" > <item row="5" column="0" >
<widget class="QCheckBox" name="sync_news" > <widget class="QCheckBox" name="sync_news" >
<property name="text" > <property name="text" >
<string>Automatically send downloaded &amp;news to ebook reader</string> <string>Automatically send downloaded &amp;news to ebook reader</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="0" > <item row="6" column="0" >
<widget class="QCheckBox" name="delete_news" > <widget class="QCheckBox" name="delete_news" >
<property name="text" > <property name="text" >
<string>&amp;Delete news from library when it is sent to reader</string> <string>&amp;Delete news from library when it is sent to reader</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="3" column="0" > <item row="4" column="0" >
<widget class="QCheckBox" name="separate_cover_flow" > <widget class="QCheckBox" name="separate_cover_flow" >
<property name="text" > <property name="text" >
<string>Show cover &amp;browser in a separate window (needs restart)</string> <string>Show cover &amp;browser in a separate window (needs restart)</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0" >
<widget class="QCheckBox" name="systray_notifications" >
<property name="text" >
<string>Show &amp;notifications in system tray</string>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="page_2" > <widget class="QWidget" name="page_2" >

View File

@ -6,7 +6,7 @@ from PyQt4.QtGui import QStatusBar, QMovie, QLabel, QWidget, QHBoxLayout, QPixma
QVBoxLayout, QSizePolicy, QToolButton, QIcon, QScrollArea, QFrame QVBoxLayout, QSizePolicy, QToolButton, QIcon, QScrollArea, QFrame
from PyQt4.QtCore import Qt, QSize, SIGNAL, QCoreApplication from PyQt4.QtCore import Qt, QSize, SIGNAL, QCoreApplication
from calibre import fit_image, preferred_encoding, isosx from calibre import fit_image, preferred_encoding, isosx
from calibre.gui2 import qstring_to_unicode from calibre.gui2 import qstring_to_unicode, config
class BookInfoDisplay(QWidget): class BookInfoDisplay(QWidget):
class BookCoverDisplay(QLabel): class BookCoverDisplay(QLabel):
@ -197,7 +197,7 @@ class StatusBar(QStatusBar):
def showMessage(self, msg, timeout=0): def showMessage(self, msg, timeout=0):
ret = QStatusBar.showMessage(self, msg, timeout) ret = QStatusBar.showMessage(self, msg, timeout)
if self.systray is not None: if self.systray is not None and not config['disable_tray_notification']:
if isosx and isinstance(msg, unicode): if isosx and isinstance(msg, unicode):
try: try:
msg = msg.encode(preferred_encoding) msg = msg.encode(preferred_encoding)

View File

@ -58,7 +58,6 @@ entry_points = {
'librarything = calibre.ebooks.metadata.library_thing:main', 'librarything = calibre.ebooks.metadata.library_thing:main',
'mobi2oeb = calibre.ebooks.mobi.reader:main', 'mobi2oeb = calibre.ebooks.mobi.reader:main',
'oeb2mobi = calibre.ebooks.mobi.writer:main', 'oeb2mobi = calibre.ebooks.mobi.writer:main',
'lrf2html = calibre.ebooks.lrf.html.convert_to:main',
'lit2oeb = calibre.ebooks.lit.reader:main', 'lit2oeb = calibre.ebooks.lit.reader:main',
'oeb2lit = calibre.ebooks.lit.writer:main', 'oeb2lit = calibre.ebooks.lit.writer:main',
'comic2lrf = calibre.ebooks.lrf.comic.convert_from:main', 'comic2lrf = calibre.ebooks.lrf.comic.convert_from:main',