mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Welcome wizard: Prerentially use the kindle email address set as default when more than one such address exists. Fixes #1007932 (share-by-email incorrect address selected in Welcome Wizard)
This commit is contained in:
parent
d921a2a475
commit
2152c0044c
@ -418,9 +418,17 @@ class KindlePage(QWizardPage, KindleUI):
|
|||||||
|
|
||||||
def initializePage(self):
|
def initializePage(self):
|
||||||
opts = smtp_prefs().parse()
|
opts = smtp_prefs().parse()
|
||||||
for x in opts.accounts.keys():
|
accs = []
|
||||||
|
has_default = False
|
||||||
|
for x, ac in opts.accounts.iteritems():
|
||||||
|
default = ac[2]
|
||||||
if x.strip().endswith('@kindle.com'):
|
if x.strip().endswith('@kindle.com'):
|
||||||
self.to_address.setText(x)
|
accs.append((x, default))
|
||||||
|
if default: has_default = True
|
||||||
|
if has_default:
|
||||||
|
accs = [x for x in accs if x[1]]
|
||||||
|
if accs:
|
||||||
|
self.to_address.setText(accs[0])
|
||||||
def x():
|
def x():
|
||||||
t = unicode(self.to_address.text())
|
t = unicode(self.to_address.text())
|
||||||
if t.strip():
|
if t.strip():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user