mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Email to selected in top level menu
Also show error message when no recipients are selected instead of silently doing nothing.
This commit is contained in:
parent
14b40e1559
commit
857ddac1b9
@ -145,6 +145,11 @@ class ShareConnMenu(QMenu): # {{{
|
||||
self.email_to_menu.addAction(action1)
|
||||
self.email_to_and_delete_menu.addAction(action2)
|
||||
map(self.memory.append, (action1, action2))
|
||||
tac1 = DeviceAction('choosemail:', False, False, I('mail.png'),
|
||||
_('Email to selected recipients...'))
|
||||
self.addAction(tac1)
|
||||
tac1.a_s.connect(sync_menu.action_triggered)
|
||||
self.memory.append(tac1)
|
||||
ac = self.addMenu(self.email_to_and_delete_menu)
|
||||
self.email_actions.append(ac)
|
||||
action1.a_s.connect(sync_menu.action_triggered)
|
||||
|
@ -258,6 +258,12 @@ class SelectRecipients(QDialog): # {{{
|
||||
for key in sorted(opts.accounts or (), key=sort_key):
|
||||
self.create_item(opts.aliases.get(key, key), key)
|
||||
|
||||
def accept(self):
|
||||
if not self.ans:
|
||||
return error_dialog(self, _('No recipients'),
|
||||
_('You must select at least one recipient'), show=True)
|
||||
QDialog.accept(self)
|
||||
|
||||
@property
|
||||
def ans(self):
|
||||
opts = email_config().parse()
|
||||
|
Loading…
x
Reference in New Issue
Block a user