sidebar-gtk:show/hide zero_hits+trackers
This commit is contained in:
parent
5ebbff177f
commit
9a8f8ce2f9
|
@ -40,6 +40,7 @@ import deluge.component as component
|
||||||
import deluge.common
|
import deluge.common
|
||||||
from deluge.log import LOG as log
|
from deluge.log import LOG as log
|
||||||
from deluge.ui.client import aclient
|
from deluge.ui.client import aclient
|
||||||
|
from deluge.configmanager import ConfigManager
|
||||||
|
|
||||||
STATE_PIX = {
|
STATE_PIX = {
|
||||||
"Downloading":"downloading",
|
"Downloading":"downloading",
|
||||||
|
@ -74,7 +75,9 @@ class FilterTreeView(component.Component):
|
||||||
self.hpaned = glade.get_widget("hpaned")
|
self.hpaned = glade.get_widget("hpaned")
|
||||||
self.scrolled = glade.get_widget("scrolledwindow_sidebar")
|
self.scrolled = glade.get_widget("scrolledwindow_sidebar")
|
||||||
self.sidebar = component.get("SideBar")
|
self.sidebar = component.get("SideBar")
|
||||||
self.is_visible = True
|
self.config = ConfigManager("gtkui.conf")
|
||||||
|
|
||||||
|
|
||||||
self.filters = {}
|
self.filters = {}
|
||||||
self.label_view = gtk.TreeView()
|
self.label_view = gtk.TreeView()
|
||||||
self.sidebar.add_tab(self.label_view, "filters", _("Filters"))
|
self.sidebar.add_tab(self.label_view, "filters", _("Filters"))
|
||||||
|
@ -248,7 +251,13 @@ class FilterTreeView(component.Component):
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
try:
|
try:
|
||||||
aclient.get_filter_tree(self.cb_update_filter_tree)
|
log.debug("--")
|
||||||
|
log.debug(self.config["sidebar_show_trackers"])
|
||||||
|
log.debug(self.config["sidebar_hide_zero"])
|
||||||
|
hide_cat = []
|
||||||
|
if not self.config["sidebar_show_trackers"]:
|
||||||
|
hide_cat = ["tracker_host"]
|
||||||
|
aclient.get_filter_tree(self.cb_update_filter_tree, self.config["sidebar_hide_zero"], hide_cat)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
log.debug(e)
|
log.debug(e)
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -112,7 +112,9 @@ DEFAULT_PREFS = {
|
||||||
"signal_port": 40000,
|
"signal_port": 40000,
|
||||||
"show_sidebar": True,
|
"show_sidebar": True,
|
||||||
"show_toolbar": True,
|
"show_toolbar": True,
|
||||||
"show_statusbar": True
|
"show_statusbar": True,
|
||||||
|
"sidebar_hide_zero":False,
|
||||||
|
"sidebar_show_trackers":True
|
||||||
}
|
}
|
||||||
|
|
||||||
class GtkUI:
|
class GtkUI:
|
||||||
|
|
|
@ -108,6 +108,11 @@ class MenuBar(component.Component):
|
||||||
self.config["show_sidebar"])
|
self.config["show_sidebar"])
|
||||||
self.window.main_glade.get_widget("menuitem_statusbar").set_active(
|
self.window.main_glade.get_widget("menuitem_statusbar").set_active(
|
||||||
self.config["show_statusbar"])
|
self.config["show_statusbar"])
|
||||||
|
self.window.main_glade.get_widget("sidebar_hide_zero").set_active(
|
||||||
|
self.config["sidebar_hide_zero"])
|
||||||
|
self.window.main_glade.get_widget("sidebar_show_trackers").set_active(
|
||||||
|
self.config["sidebar_show_trackers"])
|
||||||
|
|
||||||
|
|
||||||
### Connect Signals ###
|
### Connect Signals ###
|
||||||
self.window.main_glade.signal_autoconnect({
|
self.window.main_glade.signal_autoconnect({
|
||||||
|
@ -136,7 +141,9 @@ class MenuBar(component.Component):
|
||||||
"on_menuitem_faq_activate": self.on_menuitem_faq_activate,
|
"on_menuitem_faq_activate": self.on_menuitem_faq_activate,
|
||||||
"on_menuitem_community_activate": \
|
"on_menuitem_community_activate": \
|
||||||
self.on_menuitem_community_activate,
|
self.on_menuitem_community_activate,
|
||||||
"on_menuitem_about_activate": self.on_menuitem_about_activate
|
"on_menuitem_about_activate": self.on_menuitem_about_activate,
|
||||||
|
"on_menuitem_sidebar_zero_toggled":self.on_menuitem_sidebar_zero_toggled,
|
||||||
|
"on_menuitem_sidebar_trackers_toggled":self.on_menuitem_sidebar_trackers_toggled
|
||||||
})
|
})
|
||||||
|
|
||||||
self.torrentmenu_glade.signal_autoconnect({
|
self.torrentmenu_glade.signal_autoconnect({
|
||||||
|
@ -162,8 +169,7 @@ class MenuBar(component.Component):
|
||||||
"on_menuitem_queue_top_activate": self.on_menuitem_queue_top_activate,
|
"on_menuitem_queue_top_activate": self.on_menuitem_queue_top_activate,
|
||||||
"on_menuitem_queue_up_activate": self.on_menuitem_queue_up_activate,
|
"on_menuitem_queue_up_activate": self.on_menuitem_queue_up_activate,
|
||||||
"on_menuitem_queue_down_activate": self.on_menuitem_queue_down_activate,
|
"on_menuitem_queue_down_activate": self.on_menuitem_queue_down_activate,
|
||||||
"on_menuitem_queue_bottom_activate": self.on_menuitem_queue_bottom_activate,
|
"on_menuitem_queue_bottom_activate": self.on_menuitem_queue_bottom_activate
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
self.change_sensitivity = [
|
self.change_sensitivity = [
|
||||||
|
@ -475,3 +481,9 @@ class MenuBar(component.Component):
|
||||||
def on_menuitem_set_automanaged_off(self, widget):
|
def on_menuitem_set_automanaged_off(self, widget):
|
||||||
for torrent in component.get("TorrentView").get_selected_torrents():
|
for torrent in component.get("TorrentView").get_selected_torrents():
|
||||||
client.set_torrent_auto_managed(torrent, False)
|
client.set_torrent_auto_managed(torrent, False)
|
||||||
|
|
||||||
|
def on_menuitem_sidebar_zero_toggled(self, widget):
|
||||||
|
self.config["sidebar_hide_zero"] = widget.get_active()
|
||||||
|
|
||||||
|
def on_menuitem_sidebar_trackers_toggled(self, widget):
|
||||||
|
self.config["sidebar_show_trackers"] = widget.get_active()
|
||||||
|
|
Loading…
Reference in New Issue