diff --git a/calibre-plugin/config.py b/calibre-plugin/config.py
index f04c9fdf..2929b2a2 100644
--- a/calibre-plugin/config.py
+++ b/calibre-plugin/config.py
@@ -357,6 +357,7 @@ class ConfigWidget(QWidget):
prefs['imapmarkread'] = self.imap_tab.imapmarkread.isChecked()
prefs['imapsessionpass'] = self.imap_tab.imapsessionpass.isChecked()
prefs['auto_reject_from_email'] = self.imap_tab.auto_reject_from_email.isChecked()
+ prefs['download_from_email_immediately'] = self.imap_tab.download_from_email_immediately.isChecked()
prefs.save_to_db()
@@ -1414,6 +1415,12 @@ class ImapTab(QWidget):
self.l.addWidget(self.auto_reject_from_email,row,0,1,-1)
row+=1
+ self.download_from_email_immediately = QCheckBox(_('Download from Email Immediately'),self)
+ self.download_from_email_immediately.setToolTip(_('If checked, FanFicFare will start downloading story URLs from emails immediately.
Otherwise the usual Download from URLs dialog will appear.'))
+ self.download_from_email_immediately.setChecked(prefs['download_from_email_immediately'])
+ self.l.addWidget(self.download_from_email_immediately,row,0,1,-1)
+ row+=1
+
label = QLabel(_("It's safest if you create a separate email account that you use only "
"for your story update notices. FanFicFare and calibre cannot guarantee that "
"malicious code cannot get your email password once you've entered it. "
diff --git a/calibre-plugin/dialogs.py b/calibre-plugin/dialogs.py
index 3b358213..61e87cac 100644
--- a/calibre-plugin/dialogs.py
+++ b/calibre-plugin/dialogs.py
@@ -258,6 +258,7 @@ class AddNewDialog(SizePersistedDialog):
self.l.addWidget(self.url)
self.merge = self.newmerge = False
+ self.extraoptions = {}
# elements to hide when doing merge.
self.mergehide = []
diff --git a/calibre-plugin/fff_plugin.py b/calibre-plugin/fff_plugin.py
index 37ddde31..e5fa3d40 100644
--- a/calibre-plugin/fff_plugin.py
+++ b/calibre-plugin/fff_plugin.py
@@ -460,21 +460,29 @@ class FanFicFarePlugin(InterfaceAction):
reject_list = set([x for x in url_list if rejecturllist.check(adapters.getNormalStoryURLSite(x)[0])])
url_list = url_list - reject_list
- self.gui.status_bar.show_message(_('Finished Fetching Story URLs from Email.'),3000)
+ self.gui.status_bar.show_message(_('No Valid Story URLs Found in Unread Emails.'),3000)
self.restore_cursor()
-
- if url_list:
- self.add_dialog("\n".join(url_list),merge=False)
- else:
-
- msg = _('No Valid Story URLs Found in Unread Emails.')
- if reject_list:
- msg = msg + '
'+(_('(%d Story URLs Skipped, on Rejected URL List)')%len(reject_list))+'
' - info_dialog(self.gui, _('Get Story URLs from Email'), - msg, - show=True, - show_copy_button=False) + if prefs['download_from_email_immediately']: + ## do imap fetch w/o GUI elements + if url_list: + self.prep_downloads(self.add_new_dialog.get_fff_options(), + "\n".join(url_list)) + else: + self.gui.status_bar.show_message(_('Finished Fetching Story URLs from Email.'),3000) + + else: + if url_list: + self.add_dialog("\n".join(url_list),merge=False) + else: + msg = _('No Valid Story URLs Found in Unread Emails.') + if reject_list: + msg = msg + ''+(_('(%d Story URLs Skipped, on Rejected URL List)')%len(reject_list))+'
' + info_dialog(self.gui, _('Get Story URLs from Email'), + msg, + show=True, + show_copy_button=False) + def get_urls_from_page_menu(self,anthology=False): urltxt = "" diff --git a/calibre-plugin/prefs.py b/calibre-plugin/prefs.py index cc5350f7..a8eaabcf 100644 --- a/calibre-plugin/prefs.py +++ b/calibre-plugin/prefs.py @@ -116,6 +116,7 @@ default_prefs['imapsessionpass'] = False default_prefs['imapfolder'] = 'INBOX' default_prefs['imapmarkread'] = True default_prefs['auto_reject_from_email'] = False +default_prefs['download_from_email_immediately'] = False def set_library_config(library_config,db): db.prefs.set_namespaced(PREFS_NAMESPACE,