Updated config values names in gtkui.

This commit is contained in:
John Garland 2009-07-05 06:20:19 +00:00
parent 76bc45a3bf
commit f221a39bcf
2 changed files with 5 additions and 18 deletions

View File

@ -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"""

View File

@ -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()