show alert and stop action when trying to change priorities with compact allocation

This commit is contained in:
Marcos Pinto 2007-07-21 21:04:10 +00:00
parent b6c99ce1c2
commit a6f22ccc09
1 changed files with 22 additions and 10 deletions

View File

@ -37,9 +37,11 @@ import gtk
import common
import dgtk
import pref
class FilesBaseManager(object):
def __init__(self, file_store):
self.config = pref.Preferences()
file_glade = gtk.glade.XML(common.get_glade_file("file_tab_menu.glade"),
domain='deluge')
self.file_menu = file_glade.get_widget("file_tab_menu")
@ -90,7 +92,17 @@ class FilesBaseManager(object):
def file_unselect_all(self, widget):
self.file_view.get_selection().unselect_all()
def compact_warning(self, widget):
msgBox = gtk.MessageDialog(parent = None, buttons = gtk.BUTTONS_OK,
message_format = (_("File priority can only be set when using full allocation.\nPlease change your preference to disable compact allocation, then remove and readd this torrent.")))
msgBox.run()
msgBox.destroy()
def priority_clicked(self, widget):
if self.config.get("use_compact_storage"):
self.compact_warning(widget)
else:
widget_name = widget.get_name()
priority = {'priority_dont_download': common.PRIORITY_DONT_DOWNLOAD,
'priority_normal': common.PRIORITY_NORMAL,