Ticket #2047: 0001-Added-a-hack-to-multi-edit-trackers.patch

File 0001-Added-a-hack-to-multi-edit-trackers.patch, 2.6 KB (added by bluephoenix47, 9 years ago)

git format-patch of mult-edit tracker hack

  • deluge/ui/gtkui/edittrackersdialog.py

    From d1822952c7b1fc7d336e7307aa2d3e1b3a138eb6 Mon Sep 17 00:00:00 2001
    From: "William J. Bowman" <wjb@williamjbowman.com>
    Date: Sun, 4 Nov 2012 21:04:55 -0500
    Subject: [PATCH] Added a hack to multi-edit trackers.
    
    ---
     deluge/ui/gtkui/edittrackersdialog.py | 11 ++++++-----
     deluge/ui/gtkui/menubar.py            |  2 +-
     2 files changed, 7 insertions(+), 6 deletions(-)
    
    diff --git a/deluge/ui/gtkui/edittrackersdialog.py b/deluge/ui/gtkui/edittrackersdialog.py
    index 89de267..5b7560c 100644
    a b  
    4646log = logging.getLogger(__name__) 
    4747 
    4848class EditTrackersDialog: 
    49     def __init__(self, torrent_id, parent=None): 
    50         self.torrent_id = torrent_id 
     49    def __init__(self, torrent_ids, parent=None): 
     50        self.torrent_ids = torrent_ids 
    5151        self.builder = gtk.Builder() 
    5252        # Main dialog 
    5353        self.builder.add_from_file(deluge.common.resource_filename( 
    def __init__(self, torrent_id, parent=None): 
    103103 
    104104    def run(self): 
    105105        # Make sure we have a torrent_id.. if not just return 
    106         if self.torrent_id == None: 
     106        if not self.torrent_ids: 
    107107            return 
    108108 
    109109        # Get the trackers for this torrent 
    110110        session = component.get("SessionProxy") 
    111111        session.get_torrent_status( 
    112             self.torrent_id, ["trackers"] 
     112            self.torrent_ids[0], ["trackers"] 
    113113        ).addCallback(self._on_get_torrent_status) 
    114114        client.force_call() 
    115115 
    def each(model, path, iter, data): 
    132132            self.liststore.foreach(each, None) 
    133133            if self.old_trackers != self.trackers: 
    134134                # Set the torrens trackers 
    135                 client.core.set_torrent_trackers(self.torrent_id, self.trackers) 
     135                for torrent_id in self.torrent_ids: 
     136                    client.core.set_torrent_trackers(torrent_id, self.trackers) 
    136137                self.deferred.callback(gtk.RESPONSE_OK) 
    137138            else: 
    138139                self.deferred.callback(gtk.RESPONSE_CANCEL) 
  • deluge/ui/gtkui/menubar.py

    diff --git a/deluge/ui/gtkui/menubar.py b/deluge/ui/gtkui/menubar.py
    index 23c7472..c076588 100644
    a b def on_menuitem_edittrackers_activate(self, data=None): 
    296296        log.debug("on_menuitem_edittrackers_activate") 
    297297        from edittrackersdialog import EditTrackersDialog 
    298298        dialog = EditTrackersDialog( 
    299             component.get("TorrentView").get_selected_torrent(), 
     299            component.get("TorrentView").get_selected_torrents(), 
    300300            component.get("MainWindow").window) 
    301301        dialog.run() 
    302302