show alert and stop action when trying to change priorities with compact allocation
This commit is contained in:
parent
b6c99ce1c2
commit
a6f22ccc09
12
src/files.py
12
src/files.py
|
@ -37,9 +37,11 @@ import gtk
|
||||||
|
|
||||||
import common
|
import common
|
||||||
import dgtk
|
import dgtk
|
||||||
|
import pref
|
||||||
|
|
||||||
class FilesBaseManager(object):
|
class FilesBaseManager(object):
|
||||||
def __init__(self, file_store):
|
def __init__(self, file_store):
|
||||||
|
self.config = pref.Preferences()
|
||||||
file_glade = gtk.glade.XML(common.get_glade_file("file_tab_menu.glade"),
|
file_glade = gtk.glade.XML(common.get_glade_file("file_tab_menu.glade"),
|
||||||
domain='deluge')
|
domain='deluge')
|
||||||
self.file_menu = file_glade.get_widget("file_tab_menu")
|
self.file_menu = file_glade.get_widget("file_tab_menu")
|
||||||
|
@ -90,7 +92,17 @@ class FilesBaseManager(object):
|
||||||
def file_unselect_all(self, widget):
|
def file_unselect_all(self, widget):
|
||||||
self.file_view.get_selection().unselect_all()
|
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):
|
def priority_clicked(self, widget):
|
||||||
|
if self.config.get("use_compact_storage"):
|
||||||
|
self.compact_warning(widget)
|
||||||
|
else:
|
||||||
widget_name = widget.get_name()
|
widget_name = widget.get_name()
|
||||||
priority = {'priority_dont_download': common.PRIORITY_DONT_DOWNLOAD,
|
priority = {'priority_dont_download': common.PRIORITY_DONT_DOWNLOAD,
|
||||||
'priority_normal': common.PRIORITY_NORMAL,
|
'priority_normal': common.PRIORITY_NORMAL,
|
||||||
|
|
Loading…
Reference in New Issue