Polish Fetch from Page, busy cursor.

This commit is contained in:
Jim Miller
2015-05-14 22:52:33 -05:00
parent a5b162b187
commit e5edb7b945
+14 -2
View File
@@ -421,7 +421,7 @@ class FanFicFarePlugin(InterfaceAction):
if prefs['imapsessionpass']:
self.imap_pass = imap_pass
QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
self.busy_cursor()
self.gui.status_bar.show_message(_('Fetching Story URLs from Email...'))
url_list = get_urls_from_imap(prefs['imapserver'],
prefs['imapuser'],
@@ -434,7 +434,7 @@ class FanFicFarePlugin(InterfaceAction):
url_list = url_list - reject_list
self.gui.status_bar.show_message(_('Finished Fetching Story URLs from Email.'),3000)
QApplication.restoreOverrideCursor()
self.restore_cursor()
if url_list:
self.add_dialog("\n".join(url_list),merge=False)
@@ -465,8 +465,14 @@ class FanFicFarePlugin(InterfaceAction):
return
url = u"%s"%d.url.text()
self.busy_cursor()
self.gui.status_bar.show_message(_('Fetching Story URLs from Page...'))
url_list = self.get_urls_from_page(url)
self.gui.status_bar.show_message(_('Finished Fetching Story URLs from Page.'),3000)
self.restore_cursor()
if url_list:
self.add_dialog("\n".join(url_list),merge=d.anthology,anthology_url=url)
else:
@@ -2216,6 +2222,12 @@ class FanFicFarePlugin(InterfaceAction):
return book
def busy_cursor(self):
QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
def restore_cursor(self):
QApplication.restoreOverrideCursor()
def split_text_to_urls(urls):
# remove dups while preserving order.
dups=set()