Implement #1661 (Start minimized in tray)

This commit is contained in:
Kovid Goyal 2009-01-20 09:13:11 -08:00
parent fb0cc73f40
commit 5887406fc5
2 changed files with 5 additions and 1 deletions

View File

@ -296,6 +296,8 @@ class Main(MainWindow, Ui_MainWindow):
self.card_view.connect_dirtied_signal(self.upload_booklists)
self.show()
if self.system_tray_icon.isVisible() and opts.start_in_tray:
self.hide()
self.stack.setCurrentIndex(0)
try:
db = LibraryDatabase2(self.library_path)
@ -1527,6 +1529,8 @@ path_to_ebook to the database.
''')
parser.add_option('--with-library', default=None, action='store',
help=_('Use the library located at the specified path.'))
parser.add_option('--start-in-tray', default=False, action='store_true',
help=_('Start minimized to system tray.'))
parser.add_option('-v', '--verbose', default=0, action='count',
help=_('Log debugging information to console'))
return parser

View File

@ -186,7 +186,7 @@ class RecursiveFetcher(object, LoggingInterface):
if hasattr(err, 'code') and responses.has_key(err.code):
raise FetchError, responses[err.code]
if getattr(err, 'reason', [0])[0] == 104 or \
getattr(err, 'errno', None) == -2: # Connection reset by peer or Name or service not know
getattr(getattr(err, 'args', [None])[0], 'errno', None) == -2: # Connection reset by peer or Name or service not know
self.log_debug('Temporary error, retrying in 1 second')
time.sleep(1)
with closing(self.browser.open(url)) as f: