Author: damoxc

Revision: 6003

Log:
        fix uploading plugins when the daemon is not localhost

Diff:
Modified: branches/1.2_RC/ChangeLog
===================================================================
--- branches/1.2_RC/ChangeLog   2009-12-10 17:26:45 UTC (rev 6002)
+++ branches/1.2_RC/ChangeLog   2009-12-10 17:35:35 UTC (rev 6003)
@@ -17,6 +17,7 @@
          torrent creation
        * Fix crash in Windows when creating a torrent
        * Add button to Other preferences to associate magnet links with Deluge
+       * Fix uploading plugins when the daemon is not localhost
 
 ==== Console ====
        * Fix using the console in Windows, but only in command-line mode

Modified: branches/1.2_RC/deluge/ui/gtkui/preferences.py
===================================================================
--- branches/1.2_RC/deluge/ui/gtkui/preferences.py      2009-12-10 17:26:45 UTC 
(rev 6002)
+++ branches/1.2_RC/deluge/ui/gtkui/preferences.py      2009-12-10 17:35:35 UTC 
(rev 6003)
@@ -932,6 +932,7 @@
             chooser.destroy()
             return
 
+        import base64
         import shutil
         import os.path
         filename = os.path.split(filepath)[1]
@@ -943,9 +944,8 @@
 
         if not client.is_localhost():
             # We need to send this plugin to the daemon
-            client.core.upload_plugin(
-                filename,
-                xmlrpclib.Binary(open(filepath, "rb").read()))
+            filedump = base64.encodestring(open(filepath, "rb").read())
+            client.core.upload_plugin(filename, filedump)
 
         client.core.rescan_plugins()
         chooser.destroy()

Modified: trunk/deluge/ui/gtkui/preferences.py
===================================================================
--- trunk/deluge/ui/gtkui/preferences.py        2009-12-10 17:26:45 UTC (rev 
6002)
+++ trunk/deluge/ui/gtkui/preferences.py        2009-12-10 17:35:35 UTC (rev 
6003)
@@ -17,9 +17,9 @@
 #
 # You should have received a copy of the GNU General Public License
 # along with deluge.    If not, write to:
-#     The Free Software Foundation, Inc.,
-#     51 Franklin Street, Fifth Floor
-#     Boston, MA  02110-1301, USA.
+#      The Free Software Foundation, Inc.,
+#      51 Franklin Street, Fifth Floor
+#      Boston, MA  02110-1301, USA.
 #
 #    In addition, as a special exception, the copyright holders give
 #    permission to link the code of portions of this program with the OpenSSL
@@ -469,6 +469,35 @@
         self.glade.get_widget("chk_show_new_releases").set_active(
             self.gtkui_config["show_new_releases"])
 
+        ## Notification tab ##
+        self.glade.get_widget("chk_ntf_tray_blink").set_active(
+            self.gtkui_config["ntf_tray_blink"])
+        if deluge.common.windows_check():
+            self.glade.get_widget("chk_ntf_popup").set_sensitive(False)
+        else:
+            self.glade.get_widget("chk_ntf_popup").set_active(
+                self.gtkui_config["ntf_popup"])
+        self.glade.get_widget("chk_ntf_email").set_active(
+            self.gtkui_config["ntf_email"])
+        self.glade.get_widget("chk_ntf_sound").set_active(
+            self.gtkui_config["ntf_sound"])
+        if self.gtkui_config["ntf_sound_path"]:
+            
self.glade.get_widget("combo_ntf_sound_path").set_filename(self.gtkui_config["ntf_sound_path"])
+        self.glade.get_widget("txt_ntf_email").set_text(
+            self.gtkui_config["ntf_email_add"])
+        self.glade.get_widget("txt_ntf_server").set_text(
+            self.gtkui_config["ntf_server"])
+        self.glade.get_widget("txt_ntf_username").set_text(
+            self.gtkui_config["ntf_username"])
+        self.glade.get_widget("txt_ntf_pass").set_text(
+            self.gtkui_config["ntf_pass"])
+        if not self.gtkui_config["ntf_security"]:
+            self.glade.get_widget("rad_ntf_none").set_active(True)
+        elif self.gtkui_config["ntf_security"] == 'SSL':
+            self.glade.get_widget("rad_ntf_none").set_active(True)
+        elif self.gtkui_config["ntf_security"] == 'TLS':
+            self.glade.get_widget("rad_ntf_tls").set_active(True)
+
         ## Cache tab ##
         if client.connected():
             self.__update_cache_status()
@@ -634,6 +663,32 @@
         new_gtkui_config["show_rate_in_title"] = \
             self.glade.get_widget("chk_show_rate_in_title").get_active()
 
+        ## Notification tab ##
+        new_gtkui_config["ntf_tray_blink"] = \
+            self.glade.get_widget("chk_ntf_tray_blink").get_active()
+        new_gtkui_config["ntf_popup"] = \
+            self.glade.get_widget("chk_ntf_popup").get_active()
+        new_gtkui_config["ntf_sound"] = \
+            self.glade.get_widget("chk_ntf_sound").get_active()
+        new_gtkui_config["ntf_email"] = \
+            self.glade.get_widget("chk_ntf_email").get_active()
+        new_gtkui_config["ntf_email_add"] = \
+            self.glade.get_widget("txt_ntf_email").get_text()
+        new_gtkui_config["ntf_username"] = \
+            self.glade.get_widget("txt_ntf_username").get_text()
+        new_gtkui_config["ntf_pass"] = \
+            self.glade.get_widget("txt_ntf_pass").get_text()
+        new_gtkui_config["ntf_server"] = \
+            self.glade.get_widget("txt_ntf_server").get_text()
+        new_gtkui_config["ntf_sound_path"] = \
+                self.glade.get_widget("combo_ntf_sound_path").get_filename()
+        if self.glade.get_widget("rad_ntf_none").get_active():
+            new_gtkui_config["ntf_security"] = None
+        elif self.glade.get_widget("rad_ntf_ssl").get_active():
+            new_gtkui_config["ntf_security"] = 'SSL'
+        elif self.glade.get_widget("rad_ntf_tls").get_active():
+            new_gtkui_config["ntf_security"] = 'TLS'
+
         ## Other tab ##
         new_gtkui_config["show_new_releases"] = \
             self.glade.get_widget("chk_show_new_releases").get_active()
@@ -877,6 +932,7 @@
             chooser.destroy()
             return
 
+        import base64
         import shutil
         import os.path
         filename = os.path.split(filepath)[1]
@@ -888,9 +944,8 @@
 
         if not client.is_localhost():
             # We need to send this plugin to the daemon
-            client.core.upload_plugin(
-                filename,
-                xmlrpclib.Binary(open(filepath, "rb").read()))
+            filedump = base64.encodestring(open(filepath, "rb").read())
+            client.core.upload_plugin(filename, filedump)
 
         client.core.rescan_plugins()
         chooser.destroy()


--

You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en.


Reply via email to