mirror of
https://git.deluge-torrent.org/deluge
synced 2025-10-03 07:38:38 +00:00
finish up notification - now fully works including email
This commit is contained in:
parent
2ca1a61f32
commit
cf42970943
9 changed files with 53 additions and 4 deletions
|
@ -51,6 +51,8 @@ class DetailsTab(Tab):
|
||||||
self._child_widget = glade.get_widget("details_tab")
|
self._child_widget = glade.get_widget("details_tab")
|
||||||
self._tab_label = glade.get_widget("details_tab_label")
|
self._tab_label = glade.get_widget("details_tab_label")
|
||||||
|
|
||||||
|
self._child_widget.connect("button-press-event", self.on_button_press_event)
|
||||||
|
|
||||||
self.label_widgets = [
|
self.label_widgets = [
|
||||||
(glade.get_widget("summary_name"), None, ("name",)),
|
(glade.get_widget("summary_name"), None, ("name",)),
|
||||||
(glade.get_widget("summary_total_size"), deluge.common.fsize, ("total_size",)),
|
(glade.get_widget("summary_total_size"), deluge.common.fsize, ("total_size",)),
|
||||||
|
@ -61,6 +63,10 @@ class DetailsTab(Tab):
|
||||||
(glade.get_widget("summary_hash"), str, ("hash",))
|
(glade.get_widget("summary_hash"), str, ("hash",))
|
||||||
]
|
]
|
||||||
|
|
||||||
|
def on_button_press_event(self, widget, event):
|
||||||
|
from deluge.ui.gtkui.notification import Notification
|
||||||
|
Notification().stop_blink()
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
# Get the first selected torrent
|
# Get the first selected torrent
|
||||||
selected = component.get("TorrentView").get_selected_torrents()
|
selected = component.get("TorrentView").get_selected_torrents()
|
||||||
|
|
|
@ -376,6 +376,8 @@ class FilesTab(Tab):
|
||||||
def _on_button_press_event(self, widget, event):
|
def _on_button_press_event(self, widget, event):
|
||||||
"""This is a callback for showing the right-click context menu."""
|
"""This is a callback for showing the right-click context menu."""
|
||||||
log.debug("on_button_press_event")
|
log.debug("on_button_press_event")
|
||||||
|
from deluge.ui.gtkui.notification import Notification
|
||||||
|
Notification().stop_blink()
|
||||||
# We only care about right-clicks
|
# We only care about right-clicks
|
||||||
if event.button == 3:
|
if event.button == 3:
|
||||||
x, y = event.get_coords()
|
x, y = event.get_coords()
|
||||||
|
|
|
@ -44,6 +44,8 @@ class OptionsTab(Tab):
|
||||||
self._child_widget = glade.get_widget("options_tab")
|
self._child_widget = glade.get_widget("options_tab")
|
||||||
self._tab_label = glade.get_widget("options_tab_label")
|
self._tab_label = glade.get_widget("options_tab_label")
|
||||||
|
|
||||||
|
self._child_widget.connect("button-press-event", self.on_button_press_event)
|
||||||
|
|
||||||
self.spin_max_download = glade.get_widget("spin_max_download")
|
self.spin_max_download = glade.get_widget("spin_max_download")
|
||||||
self.spin_max_upload = glade.get_widget("spin_max_upload")
|
self.spin_max_upload = glade.get_widget("spin_max_upload")
|
||||||
self.spin_max_connections = glade.get_widget("spin_max_connections")
|
self.spin_max_connections = glade.get_widget("spin_max_connections")
|
||||||
|
@ -63,6 +65,10 @@ class OptionsTab(Tab):
|
||||||
"on_button_edit_trackers_clicked": self._on_button_edit_trackers_clicked
|
"on_button_edit_trackers_clicked": self._on_button_edit_trackers_clicked
|
||||||
})
|
})
|
||||||
|
|
||||||
|
def on_button_press_event(self, widget, event):
|
||||||
|
from deluge.ui.gtkui.notification import Notification
|
||||||
|
Notification().stop_blink()
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
# Get the first selected torrent
|
# Get the first selected torrent
|
||||||
torrent_id = component.get("TorrentView").get_selected_torrents()
|
torrent_id = component.get("TorrentView").get_selected_torrents()
|
||||||
|
|
|
@ -63,6 +63,8 @@ class PeersTab(Tab):
|
||||||
self._child_widget = glade.get_widget("peers_tab")
|
self._child_widget = glade.get_widget("peers_tab")
|
||||||
self._tab_label = glade.get_widget("peers_tab_label")
|
self._tab_label = glade.get_widget("peers_tab_label")
|
||||||
|
|
||||||
|
self._child_widget.connect("button-press-event", self.on_button_press_event)
|
||||||
|
|
||||||
self.listview = glade.get_widget("peers_listview")
|
self.listview = glade.get_widget("peers_listview")
|
||||||
# country pixbuf, ip, client, downspeed, upspeed, country code, int_ip, seed/peer icon
|
# country pixbuf, ip, client, downspeed, upspeed, country code, int_ip, seed/peer icon
|
||||||
self.liststore = gtk.ListStore(gtk.gdk.Pixbuf, str, str, int, int, str, gobject.TYPE_UINT, gtk.gdk.Pixbuf)
|
self.liststore = gtk.ListStore(gtk.gdk.Pixbuf, str, str, int, int, str, gobject.TYPE_UINT, gtk.gdk.Pixbuf)
|
||||||
|
@ -148,6 +150,10 @@ class PeersTab(Tab):
|
||||||
|
|
||||||
self.torrent_id = None
|
self.torrent_id = None
|
||||||
|
|
||||||
|
def on_button_press_event(self, widget, event):
|
||||||
|
from deluge.ui.gtkui.notification import Notification
|
||||||
|
Notification().stop_blink()
|
||||||
|
|
||||||
def save_state(self):
|
def save_state(self):
|
||||||
filename = "peers_tab.state"
|
filename = "peers_tab.state"
|
||||||
state = []
|
state = []
|
||||||
|
|
|
@ -426,8 +426,7 @@ class Preferences(component.Component):
|
||||||
self.gtkui_config["ntf_email"])
|
self.gtkui_config["ntf_email"])
|
||||||
self.glade.get_widget("chk_ntf_sound").set_active(
|
self.glade.get_widget("chk_ntf_sound").set_active(
|
||||||
self.gtkui_config["ntf_sound"])
|
self.gtkui_config["ntf_sound"])
|
||||||
self.glade.get_widget("combo_ntf_sound_path").set_filename(
|
self.glade.get_widget("combo_ntf_sound_path").set_filename(self.gtkui_config["ntf_sound_path"])
|
||||||
self.gtkui_config["ntf_sound_path"])
|
|
||||||
self.glade.get_widget("txt_ntf_email").set_text(
|
self.glade.get_widget("txt_ntf_email").set_text(
|
||||||
self.gtkui_config["ntf_email_add"])
|
self.gtkui_config["ntf_email_add"])
|
||||||
self.glade.get_widget("txt_ntf_server").set_text(
|
self.glade.get_widget("txt_ntf_server").set_text(
|
||||||
|
|
|
@ -75,6 +75,8 @@ class Signals(component.Component):
|
||||||
self.args_from_external)
|
self.args_from_external)
|
||||||
self.receiver.connect_to_signal("torrent_state_changed",
|
self.receiver.connect_to_signal("torrent_state_changed",
|
||||||
self.torrent_state_changed)
|
self.torrent_state_changed)
|
||||||
|
self.receiver.connect_to_signal("torrent_finished",
|
||||||
|
self.torrent_finished)
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
try:
|
try:
|
||||||
|
@ -86,6 +88,12 @@ class Signals(component.Component):
|
||||||
"""Connects a callback to a signal"""
|
"""Connects a callback to a signal"""
|
||||||
self.receiver.connect_to_signal(signal, callback)
|
self.receiver.connect_to_signal(signal, callback)
|
||||||
|
|
||||||
|
def torrent_finished(self, torrent_id):
|
||||||
|
log.debug("torrent_finished signal received..")
|
||||||
|
log.debug("torrent id: %s", torrent_id)
|
||||||
|
from deluge.ui.gtkui.notification import Notification
|
||||||
|
Notification().notify(torrent_id)
|
||||||
|
|
||||||
def torrent_added_signal(self, torrent_id):
|
def torrent_added_signal(self, torrent_id):
|
||||||
log.debug("torrent_added signal received..")
|
log.debug("torrent_added signal received..")
|
||||||
log.debug("torrent id: %s", torrent_id)
|
log.debug("torrent id: %s", torrent_id)
|
||||||
|
|
|
@ -68,6 +68,8 @@ class StatisticsTab(Tab):
|
||||||
self._child_widget = glade.get_widget("statistics_tab")
|
self._child_widget = glade.get_widget("statistics_tab")
|
||||||
self._tab_label = glade.get_widget("statistics_tab_label")
|
self._tab_label = glade.get_widget("statistics_tab_label")
|
||||||
|
|
||||||
|
self._child_widget.connect("button-press-event", self.on_button_press_event)
|
||||||
|
|
||||||
self.label_widgets = [
|
self.label_widgets = [
|
||||||
(glade.get_widget("summary_pieces"), fpeer_size_second, ("num_pieces", "piece_length")),
|
(glade.get_widget("summary_pieces"), fpeer_size_second, ("num_pieces", "piece_length")),
|
||||||
(glade.get_widget("summary_availability"), fratio, ("distributed_copies",)),
|
(glade.get_widget("summary_availability"), fratio, ("distributed_copies",)),
|
||||||
|
@ -146,3 +148,7 @@ class StatisticsTab(Tab):
|
||||||
widget[0].set_text("")
|
widget[0].set_text("")
|
||||||
|
|
||||||
component.get("MainWindow").main_glade.get_widget("progressbar").set_fraction(0.0)
|
component.get("MainWindow").main_glade.get_widget("progressbar").set_fraction(0.0)
|
||||||
|
|
||||||
|
def on_button_press_event(self, widget, event):
|
||||||
|
from deluge.ui.gtkui.notification import Notification
|
||||||
|
Notification().stop_blink()
|
||||||
|
|
|
@ -235,6 +235,17 @@ class SystemTray(component.Component):
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
log.debug("Unable to disable system tray: %s", e)
|
log.debug("Unable to disable system tray: %s", e)
|
||||||
|
|
||||||
|
def on_set_tray_flashing_off(self):
|
||||||
|
"""makes the tray icon stop blinking"""
|
||||||
|
if self.tray.get_blinking():
|
||||||
|
log.debug("stop blinking the tray icon..")
|
||||||
|
self.tray.set_blinking(False)
|
||||||
|
|
||||||
|
def on_set_tray_flashing_on(self):
|
||||||
|
"""makes the tray icon blink"""
|
||||||
|
log.debug("start blinking the tray icon..")
|
||||||
|
self.tray.set_blinking(True)
|
||||||
|
|
||||||
def on_enable_system_tray_set(self, key, value):
|
def on_enable_system_tray_set(self, key, value):
|
||||||
"""Called whenever the 'enable_system_tray' config key is modified"""
|
"""Called whenever the 'enable_system_tray' config key is modified"""
|
||||||
if value:
|
if value:
|
||||||
|
@ -244,6 +255,7 @@ class SystemTray(component.Component):
|
||||||
|
|
||||||
def on_tray_clicked(self, icon):
|
def on_tray_clicked(self, icon):
|
||||||
"""Called when the tray icon is left clicked."""
|
"""Called when the tray icon is left clicked."""
|
||||||
|
self.on_set_tray_flashing_off()
|
||||||
if self.window.active():
|
if self.window.active():
|
||||||
self.window.hide()
|
self.window.hide()
|
||||||
else:
|
else:
|
||||||
|
@ -254,6 +266,7 @@ class SystemTray(component.Component):
|
||||||
|
|
||||||
def on_tray_popup(self, status_icon, button, activate_time):
|
def on_tray_popup(self, status_icon, button, activate_time):
|
||||||
"""Called when the tray icon is right clicked."""
|
"""Called when the tray icon is right clicked."""
|
||||||
|
self.on_set_tray_flashing_off()
|
||||||
if self.window.visible():
|
if self.window.visible():
|
||||||
self.tray_glade.get_widget("menuitem_show_deluge").set_active(True)
|
self.tray_glade.get_widget("menuitem_show_deluge").set_active(True)
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -446,6 +446,9 @@ class TorrentView(listview.ListView, component.Component):
|
||||||
def on_button_press_event(self, widget, event):
|
def on_button_press_event(self, widget, event):
|
||||||
"""This is a callback for showing the right-click context menu."""
|
"""This is a callback for showing the right-click context menu."""
|
||||||
log.debug("on_button_press_event")
|
log.debug("on_button_press_event")
|
||||||
|
from deluge.ui.gtkui.notification import Notification
|
||||||
|
Notification().stop_blink()
|
||||||
|
|
||||||
# We only care about right-clicks
|
# We only care about right-clicks
|
||||||
if event.button == 3:
|
if event.button == 3:
|
||||||
x, y = event.get_coords()
|
x, y = event.get_coords()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue