url checks for add torrent

This commit is contained in:
Marcos Pinto 2007-09-17 20:38:32 +00:00
parent b6faa81c26
commit d953c8d8b4
2 changed files with 4 additions and 2 deletions

View File

@ -64,7 +64,7 @@ class AddTorrentUrl:
self.response = self.dlg.run()
url = self.entry.get_text()
self.dlg.destroy()
if self.response == 1:
if self.response == 1 and deluge.common.is_url(url):
return url
else:
return None

View File

@ -102,7 +102,9 @@ class MenuBar:
def on_menuitem_addurl_activate(self, data=None):
log.debug("on_menuitem_addurl_activate")
from addtorrenturl import AddTorrentUrl
functions.add_torrent_url(AddTorrentUrl().run())
result = AddTorrentUrl().run()
if result is not None:
functions.add_torrent_url(result)
def on_menuitem_clear_activate(self, data=None):
log.debug("on_menuitem_clear_activate")