Save IMAP tweaks and strings for translation.

This commit is contained in:
Jim Miller 2015-02-15 09:24:21 -06:00
parent 83ea401eaf
commit 3de15229ac
5 changed files with 401 additions and 318 deletions

View file

@ -1155,7 +1155,7 @@ class ImapTab(QWidget):
row+=1
label = QLabel(_('IMAP User Name'))
tooltip = _("Name of IMAP user. Eg: yourname@gmail.com\nNote that Gmail addresses need to have IMAP enabled in Gmail Settings first.")
tooltip = _("Name of IMAP user. Eg: yourname@gmail.com\nNote that Gmail accounts need to have IMAP enabled in Gmail Settings first.")
label.setToolTip(tooltip)
self.l.addWidget(label,row,0)
self.imapuser = QLineEdit(self)
@ -1165,7 +1165,7 @@ class ImapTab(QWidget):
row+=1
label = QLabel(_('IMAP User Password'))
tooltip = _("IMAP password. If left empty, FFDL will ask you for your password when you .")
tooltip = _("IMAP password. If left empty, FFDL will ask you for your password when you use the feature.")
label.setToolTip(tooltip)
self.l.addWidget(label,row,0)
self.imappass = QLineEdit(self)
@ -1175,8 +1175,8 @@ class ImapTab(QWidget):
self.l.addWidget(self.imappass,row,1)
row+=1
self.imapsessionpass = QCheckBox(_('Remember Password for Session (when not entered above)'),self)
self.imapsessionpass.setToolTip(_('If checked, and no password is entered above, FFDL will remember your password until you close calibre or change libraries.'))
self.imapsessionpass = QCheckBox(_('Remember Password for Session (when not saved above)'),self)
self.imapsessionpass.setToolTip(_('If checked, and no password is entered above, FFDL will remember your password until you close calibre or change Libraries.'))
self.imapsessionpass.setChecked(prefs['imapsessionpass'])
self.l.addWidget(self.imapsessionpass,row,0,1,-1)
row+=1

View file

@ -1447,7 +1447,7 @@ class EmailPassDialog(QDialog):
self.setLayout(self.l)
self.setWindowTitle(_('Password'))
self.l.addWidget(QLabel(_("Enter Email Password for %s:"%user)),0,0,1,2)
self.l.addWidget(QLabel(_("Enter Email Password for %s:")%user),0,0,1,2)
# self.l.addWidget(QLabel(_("Password:")),1,0)
self.passwd = QLineEdit(self)

View file

@ -399,10 +399,8 @@ class FanFictionDownLoaderPlugin(InterfaceAction):
def get_urls_from_imap_menu(self):
if not prefs['imapserver'] or not prefs['imapuser'] or not prefs['imapfolder']:
info_dialog(self.gui, _('Email Settings not Configured'),
_('FFDL Email Settings are not configured.'),
show=True,
show_copy_button=False)
s=_('FFDL Email Settings are not configured.')
info_dialog(self.gui, s, s, show=True, show_copy_button=False)
return
imap_pass = None

File diff suppressed because it is too large Load diff

View file

@ -213,11 +213,14 @@ def get_urls_from_imap(srv,user,passwd,folder,markread=True):
urllist=[]
for part in email_message.walk():
try:
#print("part mime:%s"%part.get_content_type())
if part.get_content_type() == 'text/plain':
urllist.extend(get_urls_from_text(part.get_payload(decode=True)))
if part.get_content_type() == 'text/html':
urllist.extend(get_urls_from_html(part.get_payload(decode=True)))
if part.get_content_type() == 'text/plain':
urllist.extend(get_urls_from_text(part.get_payload(decode=True)))
if part.get_content_type() == 'text/html':
urllist.extend(get_urls_from_html(part.get_payload(decode=True)))
except Exception as e:
print("Failed to read email content: %s"%e)
#print "urls:%s"%get_urls_from_text(get_first_text_block(email_message))
if urllist and markread: