diff --git a/plugins/EventLogging/__init__.py b/plugins/EventLogging/__init__.py new file mode 100644 index 000000000..fe8ecfb91 --- /dev/null +++ b/plugins/EventLogging/__init__.py @@ -0,0 +1,291 @@ +# Copyright (C) 2007 - Micah Bucy +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + +### Initialization ### + +plugin_name = _("Event Logging") +plugin_author = "Micah Bucy" +plugin_version = "0.1" +plugin_description = _(""" +Adds a tab with log of selected events. + +Event messages come from libtorrent alerts. +If you want those strings translated to your locale, +you'll have to report the issue with libtorrent, not deluge. +""") + +def deluge_init(deluge_path): + global path + path = deluge_path + +def enable(core, interface): + global path + return EventLogging(path, core, interface) + +### The Plugin ### +import deluge +import gtk +from EventLogging.tab_log import LogManager + +class EventLogging: + + def __init__(self, path, core, interface): + print "Loading LogEvents plugin..." + self.manager = core + self.parent = interface + # Create an options file and try to load existing Values + self.config_file = deluge.common.CONFIG_DIR + "/event_logging.conf" + self.config = deluge.pref.Preferences(self.config_file) + try: + self.config.load() + except IOError: + # File does not exist + pass + + self.glade = gtk.glade.XML(path + "/event_logging_preferences.glade") + self.dialog = self.glade.get_widget("dialog") + self.glade.signal_autoconnect({ + 'toggle_ui': self.toggle_ui + }) + self.viewport = gtk.Viewport() + self.scrolledWindow = gtk.ScrolledWindow() + self.scrolledWindow.add(self.viewport) + self.scrolledWindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) + + self.topWidget = self.scrolledWindow + + self.parentNotebook = self.parent.notebook + + self.parentNotebook.append_page(self.topWidget, gtk.Label(_("Event Log"))) + self.viewport.show() + self.scrolledWindow.show() + self.tab_log = LogManager(self.viewport, self.manager) + if self.config.get("enable_finished"): + self.manager.connect_event(self.manager.constants['EVENT_FINISHED'], self.tab_log.handle_event) + if self.config.get("enable_peer_error"): + self.manager.connect_event(self.manager.constants['EVENT_PEER_ERROR'], self.tab_log.handle_event) + if self.config.get("enable_invalid_request"): + self.manager.connect_event(self.manager.constants['EVENT_INVALID_REQUEST'], self.tab_log.handle_event) + if self.config.get("enable_file_error"): + self.manager.connect_event(self.manager.constants['EVENT_FILE_ERROR'], self.tab_log.handle_event) + if self.config.get("enable_hash_failed_error"): + self.manager.connect_event(self.manager.constants['EVENT_HASH_FAILED_ERROR'], self.tab_log.handle_event) + if self.config.get("enable_peer_ban_error"): + self.manager.connect_event(self.manager.constants['EVENT_PEER_BAN_ERROR'], self.tab_log.handle_event) + if self.config.get("enable_fastresume_rejected_error"): + self.manager.connect_event(self.manager.constants['EVENT_FASTRESUME_REJECTED_ERROR'], self.tab_log.handle_event) + if self.config.get("enable_tracker_announce"): + self.manager.connect_event(self.manager.constants['EVENT_TRACKER_ANNOUNCE'], self.tab_log.handle_event) + if self.config.get("enable_tracker_reply"): + self.manager.connect_event(self.manager.constants['EVENT_TRACKER_REPLY'], self.tab_log.handle_event) + if self.config.get("enable_tracker_alert"): + self.manager.connect_event(self.manager.constants['EVENT_TRACKER_ALERT'], self.tab_log.handle_event) + if self.config.get("enable_tracker_warning"): + self.manager.connect_event(self.manager.constants['EVENT_TRACKER_WARNING'], self.tab_log.handle_event) + if self.config.get("enable_storage_moved"): + self.manager.connect_event(self.manager.constants['EVENT_STORAGE_MOVED'], self.tab_log.handle_event) + if self.config.get("enable_piece_finished"): + self.manager.connect_event(self.manager.constants['EVENT_PIECE_FINISHED'], self.tab_log.handle_event) + if self.config.get("enable_block_downloading"): + self.manager.connect_event(self.manager.constants['EVENT_BLOCK_DOWNLOADING'], self.tab_log.handle_event) + if self.config.get("enable_block_finished"): + self.manager.connect_event(self.manager.constants['EVENT_BLOCK_FINISHED'], self.tab_log.handle_event) + if self.config.get("enable_other"): + self.manager.connect_event(self.manager.constants['EVENT_OTHER'], self.tab_log.handle_event) + self.tab_log.prepare_log_store() + + def unload(self): + self.config.save(self.config_file) + if self.config.get("enable_finished"): + self.manager.disconnect_event(self.manager.constants['EVENT_FINISHED'], self.tab_log.handle_event) + if self.config.get("enable_peer_error"): + self.manager.disconnect_event(self.manager.constants['EVENT_PEER_ERROR'], self.tab_log.handle_event) + if self.config.get("enable_invalid_request"): + self.manager.disconnect_event(self.manager.constants['EVENT_INVALID_REQUEST'], self.tab_log.handle_event) + if self.config.get("enable_file_error"): + self.manager.disconnect_event(self.manager.constants['EVENT_FILE_ERROR'], self.tab_log.handle_event) + if self.config.get("enable_hash_failed_error"): + self.manager.disconnect_event(self.manager.constants['EVENT_HASH_FAILED_ERROR'], self.tab_log.handle_event) + if self.config.get("enable_peer_ban_error"): + self.manager.disconnect_event(self.manager.constants['EVENT_PEER_BAN_ERROR'], self.tab_log.handle_event) + if self.config.get("enable_fastresume_rejected_error"): + self.manager.disconnect_event(self.manager.constants['EVENT_FASTRESUME_REJECTED_ERROR'], self.tab_log.handle_event) + if self.config.get("enable_tracker_announce"): + self.manager.disconnect_event(self.manager.constants['EVENT_TRACKER_ANNOUNCE'], self.tab_log.handle_event) + if self.config.get("enable_tracker_reply"): + self.manager.disconnect_event(self.manager.constants['EVENT_TRACKER_REPLY'], self.tab_log.handle_event) + if self.config.get("enable_tracker_alert"): + self.manager.disconnect_event(self.manager.constants['EVENT_TRACKER_ALERT'], self.tab_log.handle_event) + if self.config.get("enable_tracker_warning"): + self.manager.disconnect_event(self.manager.constants['EVENT_TRACKER_WARNING'], self.tab_log.handle_event) + if self.config.get("enable_storage_moved"): + self.manager.disconnect_event(self.manager.constants['EVENT_STORAGE_MOVED'], self.tab_log.handle_event) + if self.config.get("enable_piece_finished"): + self.manager.disconnect_event(self.manager.constants['EVENT_PIECE_FINISHED'], self.tab_log.handle_event) + if self.config.get("enable_block_downloading"): + self.manager.disconnect_event(self.manager.constants['EVENT_BLOCK_DOWNLOADING'], self.tab_log.handle_event) + if self.config.get("enable_block_finished"): + self.manager.disconnect_event(self.manager.constants['EVENT_BLOCK_FINISHED'], self.tab_log.handle_event) + if self.config.get("enable_other"): + self.manager.connect_event(self.manager.constants['EVENT_OTHER'], self.tab_log.handle_event) + self.tab_log.clear_log_store() + numPages = self.parentNotebook.get_n_pages() + for page in xrange(numPages): + if self.parentNotebook.get_nth_page(page) == self.topWidget: + self.parentNotebook.remove_page(page) + break + + def update(self): + pass + + def toggle_ui(self, widget): + value = widget.get_active() + if widget == self.glade.get_widget("chk_finished"): + if value: + self.manager.connect_event(self.manager.constants['EVENT_FINISHED'], self.tab_log.handle_event) + else: + self.manager.disconnect_event(self.manager.constants['EVENT_FINISHED'], self.tab_log.handle_event) + if widget == self.glade.get_widget("chk_peer_error"): + if value: + self.manager.connect_event(self.manager.constants['EVENT_PEER_ERROR'], self.tab_log.handle_event) + else: + self.manager.disconnect_event(self.manager.constants['EVENT_PEER_ERROR'], self.tab_log.handle_event) + if widget == self.glade.get_widget("chk_invalid_request"): + if value: + self.manager.connect_event(self.manager.constants['EVENT_INVALID_REQUEST'], self.tab_log.handle_event) + else: + self.manager.disconnect_event(self.manager.constants['EVENT_INVALID_REQUEST'], self.tab_log.handle_event) + if widget == self.glade.get_widget("chk_file_error"): + if value: + self.manager.connect_event(self.manager.constants['EVENT_FILE_ERROR'], self.tab_log.handle_event) + else: + self.manager.disconnect_event(self.manager.constants['EVENT_FILE_ERROR'], self.tab_log.handle_event) + if widget == self.glade.get_widget("chk_hash_failed_error"): + if value: + self.manager.connect_event(self.manager.constants['EVENT_HASH_FAILED_ERROR'], self.tab_log.handle_event) + else: + self.manager.disconnect_event(self.manager.constants['EVENT_HASH_FAILED_ERROR'], self.tab_log.handle_event) + if widget == self.glade.get_widget("chk_peer_ban_error"): + if value: + self.manager.connect_event(self.manager.constants['EVENT_PEER_BAN_ERROR'], self.tab_log.handle_event) + else: + self.manager.disconnect_event(self.manager.constants['EVENT_PEER_BAN_ERROR'], self.tab_log.handle_event) + if widget == self.glade.get_widget("chk_fastresume_rejected_error"): + if value: + self.manager.connect_event(self.manager.constants['EVENT_FASTRESUME_REJECTED_ERROR'], self.tab_log.handle_event) + else: + self.manager.disconnect_event(self.manager.constants['EVENT_FASTRESUME_REJECTED_ERROR'], self.tab_log.handle_event) + if widget == self.glade.get_widget("chk_tracker_announce"): + if value: + self.manager.disconnect_event(self.manager.constants['EVENT_TRACKER_ANNOUNCE'], self.tab_log.handle_event) + else: + self.manager.connect_event(self.manager.constants['EVENT_TRACKER_ANNOUNCE'], self.tab_log.handle_event) + if widget == self.glade.get_widget("chk_tracker_reply"): + if value: + self.manager.connect_event(self.manager.constants['EVENT_TRACKER_REPLY'], self.tab_log.handle_event) + else: + self.manager.disconnect_event(self.manager.constants['EVENT_TRACKER_REPLY'], self.tab_log.handle_event) + if widget == self.glade.get_widget("chk_tracker_alert"): + if value: + self.manager.connect_event(self.manager.constants['EVENT_TRACKER_ALERT'], self.tab_log.handle_event) + else: + self.manager.disconnect_event(self.manager.constants['EVENT_TRACKER_ALERT'], self.tab_log.handle_event) + if widget == self.glade.get_widget("chk_tracker_warning"): + if value: + self.manager.connect_event(self.manager.constants['EVENT_TRACKER_WARNING'], self.tab_log.handle_event) + else: + self.manager.disconnect_event(self.manager.constants['EVENT_TRACKER_WARNING'], self.tab_log.handle_event) + if widget == self.glade.get_widget("chk_storage_moved"): + if value: + self.manager.connect_event(self.manager.constants['EVENT_STORAGE_MOVED'], self.tab_log.handle_event) + else: + self.manager.disconnect_event(self.manager.constants['EVENT_STORAGE_MOVED'], self.tab_log.handle_event) + if widget == self.glade.get_widget("chk_piece_finished"): + if value: + self.manager.connect_event(self.manager.constants['EVENT_PIECE_FINISHED'], self.tab_log.handle_event) + else: + self.manager.disconnect_event(self.manager.constants['EVENT_PIECE_FINISHED'], self.tab_log.handle_event) + if widget == self.glade.get_widget("chk_block_downloading"): + if value: + self.manager.connect_event(self.manager.constants['EVENT_BLOCK_DOWNLOADING'], self.tab_log.handle_event) + else: + self.manager.disconnect_event(self.manager.constants['EVENT_BLOCK_DOWNLOADING'], self.tab_log.handle_event) + if widget == self.glade.get_widget("chk_block_finished"): + if value: + self.manager.disconnect_event(self.manager.constants['EVENT_BLOCK_FINISHED'], self.tab_log.handle_event) + else: + self.manager.connect_event(self.manager.constants['EVENT_BLOCK_FINISHED'], self.tab_log.handle_event) + if widget == self.glade.get_widget("chk_other"): + if value: + self.manager.disconnect_event(self.manager.constants['EVENT_OTHER'], self.tab_log.handle_event) + else: + self.manager.connect_event(self.manager.constants['EVENT_OTHER'], self.tab_log.handle_event) + + def configure(self): + try: + self.glade.get_widget("chk_finished").set_active(self.config.get("enable_finished")) + self.glade.get_widget("chk_peer_error").set_active(self.config.get("enable_peer_error")) + self.glade.get_widget("chk_invalid_request").set_active(self.config.get("enable_invalid_request")) + self.glade.get_widget("chk_file_error").set_active(self.config.get("enable_file_error")) + self.glade.get_widget("chk_hash_failed_error").set_active(self.config.get("enable_hash_failed_error")) + self.glade.get_widget("chk_peer_ban_error").set_active(self.config.get("enable_peer_ban_error")) + self.glade.get_widget("chk_fastresume_rejected_error").set_active(self.config.get("enable_fastresume_rejected_error")) + self.glade.get_widget("chk_tracker_announce").set_active(self.config.get("enable_tracker_announce")) + self.glade.get_widget("chk_tracker_reply").set_active(self.config.get("enable_tracker_reply")) + self.glade.get_widget("chk_tracker_alert").set_active(self.config.get("enable_tracker_alert")) + self.glade.get_widget("chk_tracker_warning").set_active(self.config.get("enable_tracker_warning")) + self.glade.get_widget("chk_storage_moved").set_active(self.config.get("enable_storage_moved")) + self.glade.get_widget("chk_piece_finished").set_active(self.config.get("enable_piece_finished")) + self.glade.get_widget("chk_block_downloading").set_active(self.config.get("enable_block_downloading")) + self.glade.get_widget("chk_block_finished").set_active(self.config.get("enable_block_finished")) + self.glade.get_widget("chk_other").set_active(self.config.get("enable_other")) + except: + self.glade.get_widget("chk_finished").set_active(False) + self.glade.get_widget("chk_peer_error").set_active(False) + self.glade.get_widget("chk_invalid_request").set_active(False) + self.glade.get_widget("chk_file_error").set_active(False) + self.glade.get_widget("chk_hash_failed_error").set_active(False) + self.glade.get_widget("chk_peer_ban_error").set_active(False) + self.glade.get_widget("chk_fastresume_rejected_error").set_active(False) + self.glade.get_widget("chk_tracker_announce").set_active(False) + self.glade.get_widget("chk_tracker_reply").set_active(False) + self.glade.get_widget("chk_tracker_alert").set_active(False) + self.glade.get_widget("chk_tracker_warning").set_active(False) + self.glade.get_widget("chk_storage_moved").set_active(False) + self.glade.get_widget("chk_piece_finished").set_active(False) + self.glade.get_widget("chk_block_downloading").set_active(False) + self.glade.get_widget("chk_block_finished").set_active(False) + self.glade.get_widget("chk_other").set_active(False) + self.dialog.show() + response = self.dialog.run() + self.dialog.hide() + if response: + self.config.set("enable_finished", self.glade.get_widget("chk_finished").get_active()) + self.config.set("enable_peer_error", self.glade.get_widget("chk_peer_error").get_active()) + self.config.set("enable_invalid_request", self.glade.get_widget("chk_invalid_request").get_active()) + self.config.set("enable_file_error", self.glade.get_widget("chk_file_error").get_active()) + self.config.set("enable_hash_failed_error", self.glade.get_widget("chk_hash_failed_error").get_active()) + self.config.set("enable_peer_ban_error", self.glade.get_widget("chk_peer_ban_error").get_active()) + self.config.set("enable_fastresume_rejected_error", self.glade.get_widget("chk_fastresume_rejected_error").get_active()) + self.config.set("enable_tracker_announce", self.glade.get_widget("chk_tracker_announce").get_active()) + self.config.set("enable_tracker_reply", self.glade.get_widget("chk_tracker_reply").get_active()) + self.config.set("enable_tracker_alert", self.glade.get_widget("chk_tracker_alert").get_active()) + self.config.set("enable_tracker_warning", self.glade.get_widget("chk_tracker_warning").get_active()) + self.config.set("enable_storage_moved", self.glade.get_widget("chk_storage_moved").get_active()) + self.config.set("enable_piece_finished", self.glade.get_widget("chk_piece_finished").get_active()) + self.config.set("enable_block_downloading", self.glade.get_widget("chk_block_downloading").get_active()) + self.config.set("enable_block_finished", self.glade.get_widget("chk_block_finished").get_active()) + self.config.set("enable_other", self.glade.get_widget("chk_other").get_active()) diff --git a/plugins/EventLogging/event_logging_preferences.glade b/plugins/EventLogging/event_logging_preferences.glade new file mode 100644 index 000000000..538ecea18 --- /dev/null +++ b/plugins/EventLogging/event_logging_preferences.glade @@ -0,0 +1,306 @@ + + + + + + 5 + Event Logging Preferences + 400 + 150 + False + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK + 2 + + + True + 17 + + + True + Select events to log + + + + + True + True + Torrent finished + True + 0 + True + + + + 1 + 2 + + + + + True + True + Peer messages + True + 0 + True + + + + 2 + 3 + + + + + True + True + Invalid request + True + 0 + True + + + + 3 + 4 + + + + + True + True + File error + True + 0 + True + + + + 4 + 5 + + + + + True + True + Hash failed error + True + 0 + True + + + + 5 + 6 + + + + + True + True + Peer ban error + True + 0 + True + + + + 6 + 7 + + + + + True + True + Fastresume rejected error + True + 0 + True + + + + 7 + 8 + + + + + True + True + Tracker announce + True + 0 + True + + + + 8 + 9 + + + + + True + True + Tracker reply + True + 0 + True + + + + 9 + 10 + + + + + True + True + Tracker alert + True + 0 + True + + + + 10 + 11 + + + + + True + True + Tracker warning + True + 0 + True + + + + 11 + 12 + + + + + True + True + Storage moved + True + 0 + True + + + + 12 + 13 + + + + + True + True + Piece finished + True + 0 + True + + + + 13 + 14 + + + + + True + True + Block downloading + True + 0 + True + + + + 14 + 15 + + + + + True + True + Block finished + True + 0 + True + + + + 15 + 16 + + + + + True + True + Other + True + 0 + True + + + + 16 + 17 + + + + + False + False + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_ENTER_NOTIFY_MASK + GTK_BUTTONBOX_END + + + True + gtk-cancel + True + 0 + + + + + True + gtk-ok + True + 1 + + + 1 + + + + + False + GTK_PACK_END + + + + + + + diff --git a/plugins/EventLogging/tab_log.py b/plugins/EventLogging/tab_log.py new file mode 100644 index 000000000..a42dae013 --- /dev/null +++ b/plugins/EventLogging/tab_log.py @@ -0,0 +1,82 @@ +import gtk + +class LogManager(object): + def __init__(self, viewport, manager): + self.viewport = viewport + self.vbox = None + self.manager = manager + + def clear_log_store(self): + if not self.vbox is None: + self.vbox.destroy() + self.vbox = None + + def prepare_log_store(self): + self.vbox = gtk.VBox() + self.viewport.add(self.vbox) + self.vbox.show_all() + + def handle_event(self, event): + event_message = None + if event['event_type'] is self.manager.constants['EVENT_FINISHED']: + event_message = _("Torrent finished") + " {"+ _("event message: ") + event['message'] + ", "\ + + _("torrent: ") + self.manager.unique_IDs[event['unique_ID']].filename + "}" + if event['event_type'] is self.manager.constants['EVENT_PEER_ERROR']: + event_message = _("Peer message") + " {" + _("event message: ") + event['message'] + ", " + _("ip address: ")\ + + event['ip'] + ", " + _("client: ") + event['client_ID'] + "}" + if event['event_type'] is self.manager.constants['EVENT_INVALID_REQUEST']: + event_message = _("Invalid request") + " {" + _("event message: ") + event['message'] + ", " + _("client: ")\ + + event['client_ID'] + "}" + if event['event_type'] is self.manager.constants['EVENT_FILE_ERROR']: + event_message = _("File error") + " {" + _("event message: ") + event['message'] + ", " + _("torrent: ")\ + + self.manager.unique_IDs[event['unique_ID']].filename + "}" + if event['event_type'] is self.manager.constants['EVENT_HASH_FAILED_ERROR']: + event_message = _("Hash failed error") + " {" + _("event message: ") + event['message'] + ", "\ + + _("torrent: ") + self.manager.unique_IDs[event['unique_ID']].filename + ", "\ + + _("piece index: ") + str(event['piece_index']) + "}" + if event['event_type'] is self.manager.constants['EVENT_PEER_BAN_ERROR']: + event_message = _("Peer ban error") + " {" + _("event message: ") + event['message'] + ", " + _("ip address: ")\ + + event['ip'] + ", " + _("torrent: ") + self.manager.unique_IDs[event['unique_ID']].filename + "}" + if event['event_type'] is self.manager.constants['EVENT_FASTRESUME_REJECTED_ERROR']: + event_message = _("Fastresume rejected error") + event['message'] + ", "\ + + _("torrent: ") + self.manager.unique_IDs[event['unique_ID']].filename + "}" + if event['event_type'] is self.manager.constants['EVENT_TRACKER_ANNOUNCE']: + event_message = _("Tracker announce") + " {" + _("event message: ") + event['message'] + ", "\ + + _("torrent: ") + self.manager.unique_IDs[event['unique_ID']].filename + "}" + if event['event_type'] is self.manager.constants['EVENT_TRACKER_REPLY']: + event_message = _("Tracker reply") + " {" + _("event message: ") + event['message'] + ", "\ + + _("torrent: ") + self.manager.unique_IDs[event['unique_ID']].filename + "}" + if event['event_type'] is self.manager.constants['EVENT_TRACKER_ALERT']: + event_message = _("Tracker alert") + " {" + _("event message: ") + event['message'] + ", "\ + + _("torrent: ") + self.manager.unique_IDs[event['unique_ID']].filename + ", "\ + + _("status code: ") + str(event['status_code']) + ", " + _("Times in a row: ")\ + + str(event['times_in_row']) + "}" + if event['event_type'] is self.manager.constants['EVENT_TRACKER_WARNING']: + event_message = _("Tracker warning") + " {" + _("event message: ") + event['message'] + ", "\ + + _("torrent: ") + self.manager.unique_IDs[event['unique_ID']].filename + "}" + if event['event_type'] is self.manager.constants['EVENT_STORAGE_MOVED']: + event_message = _("Storage moved") + " {" + _("event message: ") + event['message'] + ", "\ + + _("torrent: ") + self.manager.unique_IDs[event['unique_ID']].filename + "}" + if event['event_type'] is self.manager.constants['EVENT_PIECE_FINISHED']: + event_message = _("Piece finished") + " {" + _("event message: ") + event['message'] + ", "\ + + _("torrent: ") + self.manager.unique_IDs[event['unique_ID']].filename + ", "\ + + _("piece index: ") + str(event['piece_index']) + "}" + if event['event_type'] is self.manager.constants['EVENT_BLOCK_DOWNLOADING']: + event_message = _("Block downloading") + " {" + _("event message: ") + event['message'] + ", "\ + + _("torrent: ") + self.manager.unique_IDs[event['unique_ID']].filename + ", "\ + + _("piece index: ") + str(event['piece_index']) + ", " + _("block index: ")\ + + str(event['block_index']) + ", " + _("peer speed: ") + event['peer_speed'] + "}" + if event['event_type'] is self.manager.constants['EVENT_BLOCK_FINISHED']: + event_message = _("Block finished") + " {" + _("event message: ") + event['message'] + ", "\ + + _("torrent: ") + self.manager.unique_IDs[event['unique_ID']].filename + ", "\ + + _("piece index: ") + str(event['piece_index']) + ", " + _("block index: ")\ + + str(event['block_index']) + "}" + if event['event_type'] is self.manager.constants['EVENT_OTHER']: + event_message = _("Other") + " {" + _("event message: ") + event['message'] + "}" + if not event_message is None: + label = gtk.Label() + label.set_text(event_message) + label.set_alignment(0,0) + label.set_selectable(True) + self.vbox.pack_start(label, expand=False) + label.show() diff --git a/po/POTFILES.in b/po/POTFILES.in index 045bf8ec4..ed4ca5ba7 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -32,3 +32,8 @@ plugins/BlocklistImport/test.py plugins/BlocklistImport/peerguardian.py plugins/TorrentPieces/__init__.py plugins/TorrentPieces/tab_pieces.py +plugins/EventLogging/__init__.py +plugins/EventLogging/tab_log.py +plugins/EventLogging/event_logging_preferences.glade +plugins/TorrentNotification/__init__.py +plugins/TorrentNotification/notification_preferences.glade diff --git a/setup.py b/setup.py index 3267fa50a..b76e128c8 100644 --- a/setup.py +++ b/setup.py @@ -152,8 +152,8 @@ if boosttype == "nomt": 'boost_thread', 'z', 'pthread', 'ssl'] print 'Libraries nomt' elif boosttype == "mt": - librariestype = ['boost_filesystem-mt', 'boost_date_time-mt', - 'boost_thread-mt', 'z', 'pthread', 'ssl'] + librariestype = ['boost_filesystem', 'boost_date_time', + 'boost_thread', 'z', 'pthread', 'ssl'] print 'Libraries mt' def fetchCpp():