From 9d143dbe141fd4733159622e8a7ee24f0b726082 Mon Sep 17 00:00:00 2001 From: Zach Tibbitts Date: Thu, 1 Mar 2007 23:13:42 +0000 Subject: [PATCH] move popups out of trunk --- .../PopupNotifierConfig.glade | 147 ------------------ .../PopupNotifierMessage.glade | 132 ---------------- plugins/PopupNotifications/plugin.py | 114 -------------- 3 files changed, 393 deletions(-) delete mode 100644 plugins/PopupNotifications/PopupNotifierConfig.glade delete mode 100644 plugins/PopupNotifications/PopupNotifierMessage.glade delete mode 100644 plugins/PopupNotifications/plugin.py diff --git a/plugins/PopupNotifications/PopupNotifierConfig.glade b/plugins/PopupNotifications/PopupNotifierConfig.glade deleted file mode 100644 index 89be9613b..000000000 --- a/plugins/PopupNotifications/PopupNotifierConfig.glade +++ /dev/null @@ -1,147 +0,0 @@ - - - - - - - Popup Notifier Configuration - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - False - - - - True - False - 0 - - - - True - GTK_BUTTONBOX_EDGE - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - 0 - - - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - 1 - - - - - 0 - False - True - GTK_PACK_END - - - - - - True - True - 0 - - - - True - Notifications of the following Severity Level and above will be displayed: - False - False - GTK_JUSTIFY_CENTER - True - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - 40 - False - 0 - - - 0 - False - False - - - - - - True - GTK_UPDATE_CONTINUOUS - False - 1 1 4 1 1 0 - - - 0 - True - True - - - - - - True - - False - False - GTK_JUSTIFY_CENTER - True - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - 0 - True - True - - - - - - - diff --git a/plugins/PopupNotifications/PopupNotifierMessage.glade b/plugins/PopupNotifications/PopupNotifierMessage.glade deleted file mode 100644 index dab4eee01..000000000 --- a/plugins/PopupNotifications/PopupNotifierMessage.glade +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - True - Popup Notification - GTK_WINDOW_POPUP - GTK_WIN_POS_NONE - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_SPLASHSCREEN - GDK_GRAVITY_NORTH_WEST - True - True - - - - True - False - 0 - - - - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - GTK_SHADOW_IN - - - - True - False - 0 - - - - True - gtk-dialog-warning - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - False - False - True - GTK_JUSTIFY_LEFT - GTK_WRAP_WORD - False - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - 0 - True - True - - - - - - - - - 0 - True - True - - - - - - True - True - gtk-close - True - GTK_RELIEF_NORMAL - True - - - - 0 - False - False - - - - - - - diff --git a/plugins/PopupNotifications/plugin.py b/plugins/PopupNotifications/plugin.py deleted file mode 100644 index a13a2d581..000000000 --- a/plugins/PopupNotifications/plugin.py +++ /dev/null @@ -1,114 +0,0 @@ -# Popup Notifier plugin - -class plugin_PopupNotifier: - def __init__(self, path, deluge_core, deluge_interface): -# print "PopupNotifierI being created now" - self.parent = deluge_interface - self.location = path - import dcommon, dgtk, pref - try: - import pynotify - self.pynotify = pynotify # We must save this, because as a plugin, our globals will die - except: - dgtk.show_popup_warning(self. parent.window, "PopupNotifier: not all necessary dependencies are installed. To install them, on Ubuntu run: apt-get python-notify notification-daemon") - return - - if not self.pynotify.init("Deluge"): - dgtk.show_popup_warning(self. parent.window, "PopupNotifier: Cannot initialize pynotify, no notifications will be shown.") - - self.severities = { "I": 1, "W": 2, "C": 3, "F": 4 } - - self.severityTexts = { - self.severities["I"]: "Informative - can be easily ignored", - self.severities["W"]: "Warning - may be of interest", - self.severities["C"]: "Critical - should never be ignored", - self.severities["F"]: "Fatal - normal operation will probably not continue" } - - self.severityToUrgency = { "I": pynotify.URGENCY_LOW, - "W": pynotify.URGENCY_NORMAL, - "C": pynotify.URGENCY_NORMAL, - "F": pynotify.URGENCY_CRITICAL } - - self.config = pref.Preferences(dcommon.CONFIG_DIR + '/popupnotify.conf') - - userSeverity = self.config.get('plugin_popupnotifier_severity', default=self.severities["W"]) - - self.minSeverity = int(userSeverity) - - if self.minSeverity is None: - self.minSeverity = self.severities['I'] - - self.icon = "file://" + dccommon.get_pixmap("deluge32.png") - - # Connect signal in the parent - # self.handlerID = self.parent.messageList.connect("insert-text", self.signal) - - def unload(self): -# print "PopupNotifierI is shutting down now" - # self.parent.messageList.disconnect(self.handlerID) - pass - - def update(self): -# print "PopupNotifier Updating..." - pass - - def signal(self, textbuffer, iter, text, length): -# print "Signal occured, need to show: ", text - severity = text[0] - if self.severities[severity] >= self.minSeverity: - startIndex = text.find("] ")+2 - note = self.pynotify.Notification("Deluge", text[startIndex:], self.icon) - note.set_urgency(self.severityToUrgency[severity]) - if not note.show(): - print "Failed to send notification:", text - - def configure(self): - self.gladefile = self.location + "/PopupNotifierConfig.glade" - self.wTree = gtk.glade.XML(self.gladefile, "PopupNotifierConfig") - self.dlg = self.wTree.get_widget("PopupNotifierConfig") - - self.severitySelector = self.wTree.get_widget("severity_selector") - self.severitySelector.set_value(self.minSeverity) - self.severitySelector.connect("change-value", self.dlgChangeValue) - - self.severityDescriptor = self.wTree.get_widget("severity_descriptor") -# self.descriptorTextBuffer = gtk.TextBuffer() -# self.severityDescriptor.set_buffer(self.descriptorTextBuffer) - - self.dlgShowText() - - # Show and run - - self.dlg.show_all() - - if self.dlg.run() == 1: - self.minSeverity = int(self.severitySelector.get_value()) - self.config.set('plugin_popupnotifier_severity', self.minSeverity) -# else: -# print "Cancelled" - - self.dlg.destroy() - self.config.save_to_file() - - def dlgChangeValue(self, range, scroll, value): - self.severitySelector.set_value(round(value)) - self.dlgShowText() - return True - - def dlgShowText(self): - severity = int(self.severitySelector.get_value()) - self.severityDescriptor.set_text(self.severityTexts[severity]) - - -### MAIN - -register_plugin("Popup Notifier", # The name of the plugin - plugin_PopupNotifier, # The plugin's class - "0.2", # The plugin's version number - "Popup Notifier plugin\n\nWritten by Kripkenstein", # A description of the plugin - config=True, # If the plugin can be configured - default=False, # If the plugin should be loaded by default - requires="0.5.0", # Required version of Deluge - interface="gtk", # Required Deluge interface - required_plugins=None # Any plugins that must be loaded before this - )