Author: andar

Revision: 6027

Log:
        Fix #768 save tracker list for create torrent dialog

Diff:
Modified: branches/1.2_RC/ChangeLog
===================================================================
--- branches/1.2_RC/ChangeLog   2009-12-14 18:20:51 UTC (rev 6026)
+++ branches/1.2_RC/ChangeLog   2009-12-14 18:46:08 UTC (rev 6027)
@@ -31,6 +31,7 @@
        * Fix #594 tray password dialog freeze in Windows
        * Made the password dialog prettier
        * Fix #1086 deprecated gtk.Tooltips usage
+       * Fix #768 save tracker list for create torrent dialog
 
 ==== Console ====
        * Fix using the console in Windows, but only in command-line mode

Modified: branches/1.2_RC/deluge/ui/gtkui/createtorrentdialog.py
===================================================================
--- branches/1.2_RC/deluge/ui/gtkui/createtorrentdialog.py      2009-12-14 
18:20:51 UTC (rev 6026)
+++ branches/1.2_RC/deluge/ui/gtkui/createtorrentdialog.py      2009-12-14 
18:46:08 UTC (rev 6027)
@@ -118,7 +118,7 @@
         psize = int(psize) * 1024
         if metric[0] == 'M':
             psize *= 1024
-            
+
         return psize
 
     def adjust_piece_size(self):
@@ -322,7 +322,7 @@
 
             def hide_progress(result):
                 self.glade.get_widget("progress_dialog").hide_all()
-                
+
             deferToThread(self.create_torrent,
                     path,
                     tracker,
@@ -389,7 +389,10 @@
         dialog = glade.get_widget("add_tracker_dialog")
         dialog.set_transient_for(self.dialog)
         textview = glade.get_widget("textview_trackers")
-        textview.get_buffer().set_text("")
+        if self.config["createtorrent.trackers"]:
+            
textview.get_buffer().set_text("\n".join(self.config["createtorrent.trackers"]))
+        else:
+            textview.get_buffer().set_text("")
         textview.grab_focus()
         response = dialog.run()
 
@@ -398,6 +401,8 @@
             trackers = []
             b = textview.get_buffer()
             lines = b.get_text(b.get_start_iter(), 
b.get_end_iter()).strip().split("\n")
+            self.config["createtorrent.trackers"] = lines
+            log.debug("lines: %s", lines)
             for l in lines:
                 if deluge.common.is_url(l):
                     trackers.append(l)

Modified: branches/1.2_RC/deluge/ui/gtkui/gtkui.py
===================================================================
--- branches/1.2_RC/deluge/ui/gtkui/gtkui.py    2009-12-14 18:20:51 UTC (rev 
6026)
+++ branches/1.2_RC/deluge/ui/gtkui/gtkui.py    2009-12-14 18:46:08 UTC (rev 
6027)
@@ -152,7 +152,8 @@
     "sidebar_show_zero": False,
     "sidebar_show_trackers": True,
     "sidebar_position": 170,
-    "show_rate_in_title": False
+    "show_rate_in_title": False,
+    "createtorrent.trackers": []
 }
 
 class GtkUI(object):

Modified: trunk/deluge/ui/gtkui/createtorrentdialog.py
===================================================================
--- trunk/deluge/ui/gtkui/createtorrentdialog.py        2009-12-14 18:20:51 UTC 
(rev 6026)
+++ trunk/deluge/ui/gtkui/createtorrentdialog.py        2009-12-14 18:46:08 UTC 
(rev 6027)
@@ -118,7 +118,7 @@
         psize = int(psize) * 1024
         if metric[0] == 'M':
             psize *= 1024
-            
+
         return psize
 
     def adjust_piece_size(self):
@@ -322,7 +322,7 @@
 
             def hide_progress(result):
                 self.glade.get_widget("progress_dialog").hide_all()
-                
+
             deferToThread(self.create_torrent,
                     path,
                     tracker,
@@ -389,7 +389,10 @@
         dialog = glade.get_widget("add_tracker_dialog")
         dialog.set_transient_for(self.dialog)
         textview = glade.get_widget("textview_trackers")
-        textview.get_buffer().set_text("")
+        if self.config["createtorrent.trackers"]:
+            
textview.get_buffer().set_text("\n".join(self.config["createtorrent.trackers"]))
+        else:
+            textview.get_buffer().set_text("")
         textview.grab_focus()
         response = dialog.run()
 
@@ -398,6 +401,8 @@
             trackers = []
             b = textview.get_buffer()
             lines = b.get_text(b.get_start_iter(), 
b.get_end_iter()).strip().split("\n")
+            self.config["createtorrent.trackers"] = lines
+            log.debug("lines: %s", lines)
             for l in lines:
                 if deluge.common.is_url(l):
                     trackers.append(l)

Modified: trunk/deluge/ui/gtkui/gtkui.py
===================================================================
--- trunk/deluge/ui/gtkui/gtkui.py      2009-12-14 18:20:51 UTC (rev 6026)
+++ trunk/deluge/ui/gtkui/gtkui.py      2009-12-14 18:46:08 UTC (rev 6027)
@@ -152,7 +152,8 @@
     "sidebar_show_zero": False,
     "sidebar_show_trackers": True,
     "sidebar_position": 170,
-    "show_rate_in_title": False
+    "show_rate_in_title": False,
+    "createtorrent.trackers": []
 }
 
 class GtkUI(object):


--

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


Reply via email to