diff --git a/src/core.py b/src/core.py index 7b97b6fad..9b643d3a3 100644 --- a/src/core.py +++ b/src/core.py @@ -658,8 +658,8 @@ class Manager: size = deluge_core.get_torrent_state(unique_ID)["total_size"] avail = self.calc_free_space(torrent.save_dir) print "Torrent Size", size - print "Available Space", avail -# size = avail + 1 #debug! +# print "Available Space", avail + size = avail + 1 #debug! if size > avail: # Not enough free space torrent.user_paused = True no_space = True diff --git a/src/interface.py b/src/interface.py index bff752e3d..276dcfc60 100644 --- a/src/interface.py +++ b/src/interface.py @@ -774,7 +774,6 @@ class DelugeGTK: path = dialogs.show_directory_chooser_dialog(self.window) if path is None: return - try: unique_id = self.manager.add_torrent(torrent, path, self.config.get('use_compact_storage', bool, default=False)) @@ -783,9 +782,14 @@ class DelugeGTK: except core.InvalidEncodingError, e: print "InvalidEncodingError", e dialogs.show_popup_warning(self.window, _("An error occured while trying to add the torrent. It's possible your .torrent file is corrupted.")) - except core.InsufficientFreeSpaceError, e: + except core.DuplicateTorrentError, e: + dialogs.show_popup_warning(self.window, _("The torrent you've added seems to already be in Deluge.")) + except core.InsufficientFreeSpaceError, e: nice_need = common.fsize(e.needed_space) nice_free = common.fsize(e.free_space) + dialogs.show_popup_warning(self.window, _("There is not enough free disk space to complete your download.") + "\n" + \ + _("Space Needed:") + " " + nice_need + "\n" + \ + _("Available Space:") + " " + nice_free)