mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-27 21:16:09 +01:00
Implement #1661 (Start minimized in tray)
This commit is contained in:
parent
fb0cc73f40
commit
5887406fc5
2 changed files with 5 additions and 1 deletions
|
|
@ -296,6 +296,8 @@ def default_sync(checked):
|
|||
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 @@ def option_parser():
|
|||
''')
|
||||
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
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ def fetch_url(self, url):
|
|||
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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue