mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Apply changes being edited when clicking apply in the email preferences list. Fixes #1252758 [Alias not created with Add email](https://bugs.launchpad.net/calibre/+bug/1252758)
This commit is contained in:
parent
e22587dbc2
commit
97049952cc
@ -17,7 +17,7 @@ from calibre.utils.config import ConfigProxy
|
||||
from calibre.gui2 import NONE
|
||||
from calibre.utils.smtp import config as smtp_prefs
|
||||
|
||||
class EmailAccounts(QAbstractTableModel): # {{{
|
||||
class EmailAccounts(QAbstractTableModel): # {{{
|
||||
|
||||
def __init__(self, accounts, subjects, aliases={}):
|
||||
QAbstractTableModel.__init__(self)
|
||||
@ -191,6 +191,10 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
|
||||
# No defaults to restore to
|
||||
|
||||
def commit(self):
|
||||
if self.email_view.state() == self.email_view.EditingState:
|
||||
# Ensure that the cell being edited is committed by switching focus
|
||||
# to some other widget, which automatically closes the open editor
|
||||
self.send_email_widget.setFocus(Qt.OtherFocusReason)
|
||||
to_set = bool(self._email_accounts.accounts)
|
||||
if not self.send_email_widget.set_email_settings(to_set):
|
||||
raise AbortCommit('abort')
|
||||
|
Loading…
x
Reference in New Issue
Block a user