Updated config values names in gtkui.
This commit is contained in:
parent
76bc45a3bf
commit
f221a39bcf
|
@ -151,6 +151,7 @@ class Core(CorePluginBase):
|
||||||
else:
|
else:
|
||||||
status["state"] = "Idle"
|
status["state"] = "Idle"
|
||||||
|
|
||||||
|
status["up_to_date"] = False
|
||||||
status["num_blocked"] = self.num_blocked
|
status["num_blocked"] = self.num_blocked
|
||||||
status["file_progress"] = self.file_progress
|
status["file_progress"] = self.file_progress
|
||||||
status["file_type"] = self.config["list_type"]
|
status["file_type"] = self.config["list_type"]
|
||||||
|
@ -233,24 +234,10 @@ class Core(CorePluginBase):
|
||||||
log.debug("Latest blocklist is already imported")
|
log.debug("Latest blocklist is already imported")
|
||||||
return True
|
return True
|
||||||
|
|
||||||
self.is_importing = True
|
|
||||||
log.debug("Reset IP Filter..")
|
|
||||||
# Does this return a deferred?
|
|
||||||
self.core.reset_ip_filter()
|
|
||||||
|
|
||||||
self.num_blocked = 0
|
self.num_blocked = 0
|
||||||
|
|
||||||
# TODO: Make non-blocking (use deferToThread)
|
# TODO: Open blocklist with appropriate reader
|
||||||
|
# TODO: Import ranges
|
||||||
# Open the file for reading
|
|
||||||
read_list = FORMATS[self.config["listtype"]][1](bl_file)
|
|
||||||
log.debug("Blocklist import starting..")
|
|
||||||
ips = read_list.next()
|
|
||||||
while ips:
|
|
||||||
self.core.block_ip_range(ips)
|
|
||||||
self.num_blocked += 1
|
|
||||||
ips = read_list.next()
|
|
||||||
read_list.close()
|
|
||||||
|
|
||||||
def on_import_complete(self, result):
|
def on_import_complete(self, result):
|
||||||
"""Runs any import clean up functions"""
|
"""Runs any import clean up functions"""
|
||||||
|
|
|
@ -134,7 +134,7 @@ class GtkUI(GtkPluginBase):
|
||||||
# Update the combo box. It's ugly, get over it.
|
# Update the combo box. It's ugly, get over it.
|
||||||
self.glade.get_widget("combobox_types").set_active_iter(
|
self.glade.get_widget("combobox_types").set_active_iter(
|
||||||
self.glade.get_widget("combobox_types").get_model().\
|
self.glade.get_widget("combobox_types").get_model().\
|
||||||
get_iter(FORMATS[config["listtype"]][1]))
|
get_iter(FORMATS[config["list_type"]][1]))
|
||||||
|
|
||||||
self.glade.get_widget("entry_url").set_text(
|
self.glade.get_widget("entry_url").set_text(
|
||||||
config["url"])
|
config["url"])
|
||||||
|
@ -149,7 +149,7 @@ class GtkUI(GtkPluginBase):
|
||||||
|
|
||||||
def _on_apply_prefs(self):
|
def _on_apply_prefs(self):
|
||||||
config = {}
|
config = {}
|
||||||
config["listtype"] = self.glade.get_widget("combobox_types").\
|
config["list_type"] = self.glade.get_widget("combobox_types").\
|
||||||
get_model()[self.glade.get_widget("combobox_types").get_active()][1]
|
get_model()[self.glade.get_widget("combobox_types").get_active()][1]
|
||||||
config["url"] = self.glade.get_widget("entry_url").get_text()
|
config["url"] = self.glade.get_widget("entry_url").get_text()
|
||||||
config["check_after_days"] = self.glade.get_widget("spin_check_days").get_value_as_int()
|
config["check_after_days"] = self.glade.get_widget("spin_check_days").get_value_as_int()
|
||||||
|
|
Loading…
Reference in New Issue