mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Connect/share menu: Re-organize to make it a little less easy to select email and delete instead of just email by mistake
This commit is contained in:
parent
1803453fb9
commit
dece4f236f
@ -74,23 +74,29 @@ class ShareConnMenu(QMenu): # {{{
|
|||||||
opts = email_config().parse()
|
opts = email_config().parse()
|
||||||
if opts.accounts:
|
if opts.accounts:
|
||||||
self.email_to_menu = QMenu(_('Email to')+'...', self)
|
self.email_to_menu = QMenu(_('Email to')+'...', self)
|
||||||
|
ac = self.addMenu(self.email_to_menu)
|
||||||
|
self.email_actions.append(ac)
|
||||||
|
self.email_to_and_delete_menu = QMenu(
|
||||||
|
_('Email to and delete from library')+'...', self)
|
||||||
keys = sorted(opts.accounts.keys())
|
keys = sorted(opts.accounts.keys())
|
||||||
for account in keys:
|
for account in keys:
|
||||||
formats, auto, default = opts.accounts[account]
|
formats, auto, default = opts.accounts[account]
|
||||||
dest = 'mail:'+account+';'+formats
|
dest = 'mail:'+account+';'+formats
|
||||||
action1 = DeviceAction(dest, False, False, I('mail.png'),
|
action1 = DeviceAction(dest, False, False, I('mail.png'),
|
||||||
_('Email to')+' '+account)
|
account)
|
||||||
action2 = DeviceAction(dest, True, False, I('mail.png'),
|
action2 = DeviceAction(dest, True, False, I('mail.png'),
|
||||||
_('Email to')+' '+account+ _(' and delete from library'))
|
account + ' ' + _('(delete from library)'))
|
||||||
map(self.email_to_menu.addAction, (action1, action2))
|
self.email_to_menu.addAction(action1)
|
||||||
|
self.email_to_and_delete_menu.addAction(action2)
|
||||||
map(self.memory.append, (action1, action2))
|
map(self.memory.append, (action1, action2))
|
||||||
if default:
|
if default:
|
||||||
map(self.addAction, (action1, action2))
|
ac = DeviceAction(dest, False, False,
|
||||||
map(self.email_actions.append, (action1, action2))
|
I('mail.png'), _('Email to') + ' ' +account)
|
||||||
self.email_to_menu.addSeparator()
|
self.addAction(ac)
|
||||||
|
self.email_actions.append(ac)
|
||||||
action1.a_s.connect(sync_menu.action_triggered)
|
action1.a_s.connect(sync_menu.action_triggered)
|
||||||
action2.a_s.connect(sync_menu.action_triggered)
|
action2.a_s.connect(sync_menu.action_triggered)
|
||||||
ac = self.addMenu(self.email_to_menu)
|
ac = self.addMenu(self.email_to_and_delete_menu)
|
||||||
self.email_actions.append(ac)
|
self.email_actions.append(ac)
|
||||||
else:
|
else:
|
||||||
ac = self.addAction(_('Setup email based sharing of books'))
|
ac = self.addAction(_('Setup email based sharing of books'))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user