View | Details | Raw Unified | Return to bug 207558 | Differences between
and this patch

Collapse All | Expand All

(-)deluge-1.3-stable/deluge/core/core.py (-7 / +10 lines)
Lines 409-423 Link Here
409
    @export
409
    @export
410
    def pause_all_torrents(self):
410
    def pause_all_torrents(self):
411
        """Pause all torrents in the session"""
411
        """Pause all torrents in the session"""
412
        for torrent in self.torrentmanager.torrents.values():
412
        if not self.session.is_paused():
413
            torrent.pause()
413
            self.session.pause()
414
            component.get("EventManager").emit(SessionPausedEvent())
414
415
415
    @export
416
    @export
416
    def resume_all_torrents(self):
417
    def resume_all_torrents(self):
417
        """Resume all torrents in the session"""
418
        """Resume all torrents in the session"""
418
        for torrent in self.torrentmanager.torrents.values():
419
        if self.session.is_paused():
419
            torrent.resume()
420
            self.session.resume()
420
        component.get("EventManager").emit(SessionResumedEvent())
421
            for torrent in self.torrentmanager.torrents.values():
422
                torrent.update_state()
423
            component.get("EventManager").emit(SessionResumedEvent())
421
424
422
    @export
425
    @export
423
    def resume_torrent(self, torrent_ids):
426
    def resume_torrent(self, torrent_ids):
Lines 434-442 Link Here
434
            # Torrent was probaly removed meanwhile
437
            # Torrent was probaly removed meanwhile
435
            return {}
438
            return {}
436
439
437
        # Get the leftover fields and ask the plugin manager to fill them
440
        # Get any remaining keys from plugin manager or 'all' if no keys specified.
438
        leftover_fields = list(set(keys) - set(status.keys()))
441
        leftover_fields = list(set(keys) - set(status.keys()))
439
        if len(leftover_fields) > 0:
442
        if len(leftover_fields) > 0 or len(keys) == 0:
440
            status.update(self.pluginmanager.get_status(torrent_id, leftover_fields))
443
            status.update(self.pluginmanager.get_status(torrent_id, leftover_fields))
441
        return status
444
        return status
442
445
(-)deluge-1.3-stable/deluge/core/filtermanager.py (-1 / +3 lines)
Lines 169-175 Link Here
169
        for torrent_id in list(torrent_ids):
169
        for torrent_id in list(torrent_ids):
170
            status = status_func(torrent_id, filter_dict.keys()) #status={key:value}
170
            status = status_func(torrent_id, filter_dict.keys()) #status={key:value}
171
            for field, values in filter_dict.iteritems():
171
            for field, values in filter_dict.iteritems():
172
                if (not status[field] in values) and torrent_id in torrent_ids:
172
                if field in status and status[field] in values:
173
                    continue
174
                elif torrent_id in torrent_ids:
173
                    torrent_ids.remove(torrent_id)
175
                    torrent_ids.remove(torrent_id)
174
176
175
        return torrent_ids
177
        return torrent_ids
(-)deluge-1.3-stable/deluge/core/pluginmanager.py (+2 lines)
Lines 92-97 Link Here
92
    def get_status(self, torrent_id, fields):
92
    def get_status(self, torrent_id, fields):
93
        """Return the value of status fields for the selected torrent_id."""
93
        """Return the value of status fields for the selected torrent_id."""
94
        status = {}
94
        status = {}
95
        if len(fields) == 0:
96
            fields = self.status_fields.keys()
95
        for field in fields:
97
        for field in fields:
96
            try:
98
            try:
97
                status[field] = self.status_fields[field](torrent_id)
99
                status[field] = self.status_fields[field](torrent_id)
(-)deluge-1.3-stable/deluge/core/torrentmanager.py (-2 / +5 lines)
Lines 674-682 Link Here
674
        state = TorrentManagerState()
674
        state = TorrentManagerState()
675
        # Create the state for each Torrent and append to the list
675
        # Create the state for each Torrent and append to the list
676
        for torrent in self.torrents.values():
676
        for torrent in self.torrents.values():
677
            paused = False
677
            if self.session.is_paused():
678
            if torrent.state == "Paused":
678
                paused = torrent.handle.is_paused()
679
            elif torrent.state == "Paused":
679
                paused = True
680
                paused = True
681
            else:
682
                paused = False
680
683
681
            torrent_state = TorrentState(
684
            torrent_state = TorrentState(
682
                torrent.torrent_id,
685
                torrent.torrent_id,
(-)deluge-1.3-stable/deluge/httpdownloader.py (-1 / +17 lines)
Lines 211-217 Link Here
211
    factory = HTTPDownloader(url, filename, callback, headers, force_filename, allow_compression)
211
    factory = HTTPDownloader(url, filename, callback, headers, force_filename, allow_compression)
212
    if scheme == "https":
212
    if scheme == "https":
213
        from twisted.internet import ssl
213
        from twisted.internet import ssl
214
        reactor.connectSSL(host, port, factory, ssl.ClientContextFactory())
214
        # ClientTLSOptions in Twisted >= 14, see ticket #2765 for details on this addition.
215
        try:
216
            from twisted.internet._sslverify import ClientTLSOptions
217
        except ImportError:
218
            ctx_factory = ssl.ClientContextFactory()
219
        else:
220
            class TLSSNIContextFactory(ssl.ClientContextFactory):
221
                """
222
                A custom context factory to add a server name for TLS connections.
223
                """
224
                def getContext(self, hostname=None, port=None):
225
                    ctx = ssl.ClientContextFactory.getContext(self)
226
                    ClientTLSOptions(host, ctx)
227
                    return ctx
228
            ctx_factory = TLSSNIContextFactory()
229
230
        reactor.connectSSL(host, port, factory, ctx_factory)
215
    else:
231
    else:
216
        reactor.connectTCP(host, port, factory)
232
        reactor.connectTCP(host, port, factory)
217
233
(-)deluge-1.3-stable/deluge/plugins/blocklist/blocklist/core.py (-2 / +2 lines)
Lines 425-436 Link Here
425
425
426
    def pause_session(self):
426
    def pause_session(self):
427
        if not self.core.session.is_paused():
427
        if not self.core.session.is_paused():
428
            self.core.session.pause()
428
            self.core.pause_all_torrents()
429
            self.need_to_resume_session = True
429
            self.need_to_resume_session = True
430
        else:
430
        else:
431
            self.need_to_resume_session = False
431
            self.need_to_resume_session = False
432
432
433
    def resume_session(self, result):
433
    def resume_session(self, result):
434
        self.core.session.resume()
434
        self.core.resume_all_torrents()
435
        self.need_to_resume_session = False
435
        self.need_to_resume_session = False
436
        return result
436
        return result
(-)deluge-1.3-stable/deluge/plugins/label/label/data/label_options.glade (-2 lines)
Lines 10-16 Link Here
10
    <property name="destroy_with_parent">True</property>
10
    <property name="destroy_with_parent">True</property>
11
    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
11
    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
12
    <property name="skip_taskbar_hint">True</property>
12
    <property name="skip_taskbar_hint">True</property>
13
    <property name="has_separator">False</property>
14
    <child internal-child="vbox">
13
    <child internal-child="vbox">
15
      <widget class="GtkVBox" id="dialog-vbox1">
14
      <widget class="GtkVBox" id="dialog-vbox1">
16
        <property name="visible">True</property>
15
        <property name="visible">True</property>
Lines 650-656 Link Here
650
    <property name="destroy_with_parent">True</property>
649
    <property name="destroy_with_parent">True</property>
651
    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
650
    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
652
    <property name="skip_taskbar_hint">True</property>
651
    <property name="skip_taskbar_hint">True</property>
653
    <property name="has_separator">False</property>
654
    <signal name="close" handler="on_label_cancel"/>
652
    <signal name="close" handler="on_label_cancel"/>
655
    <child internal-child="vbox">
653
    <child internal-child="vbox">
656
      <widget class="GtkVBox" id="dialog-vbox2">
654
      <widget class="GtkVBox" id="dialog-vbox2">
(-)deluge-1.3-stable/deluge/plugins/notifications/notifications/gtkui.py (-1 / +2 lines)
Lines 227-233 Link Here
227
        return ''
227
        return ''
228
228
229
    def _on_torrent_finished_event_popup(self, torrent_id):
229
    def _on_torrent_finished_event_popup(self, torrent_id):
230
        d = client.core.get_torrent_status(torrent_id, ["name", "num_files"])
230
        d = client.core.get_torrent_status(torrent_id, ["name", "file_progress"])
231
        d.addCallback(self._on_torrent_finished_event_got_torrent_status)
231
        d.addCallback(self._on_torrent_finished_event_got_torrent_status)
232
        d.addErrback(self._on_torrent_finished_event_torrent_status_failure)
232
        d.addErrback(self._on_torrent_finished_event_torrent_status_failure)
233
        return d
233
        return d
Lines 239-244 Link Here
239
        log.debug("Handler for TorrentFinishedEvent GTKUI called. "
239
        log.debug("Handler for TorrentFinishedEvent GTKUI called. "
240
                  "Got Torrent Status")
240
                  "Got Torrent Status")
241
        title = _("Finished Torrent")
241
        title = _("Finished Torrent")
242
        torrent_status["num_files"] = torrent_status["file_progress"].count(1.0)
242
        message = _("The torrent \"%(name)s\" including %(num_files)i file(s) "
243
        message = _("The torrent \"%(name)s\" including %(num_files)i file(s) "
243
                    "has finished downloading.") % torrent_status
244
                    "has finished downloading.") % torrent_status
244
        return title, message
245
        return title, message
(-)deluge-1.3-stable/deluge/plugins/scheduler/scheduler/core.py (-4 / +4 lines)
Lines 127-135 Link Here
127
        """
127
        """
128
        core_config = deluge.configmanager.ConfigManager("core.conf")
128
        core_config = deluge.configmanager.ConfigManager("core.conf")
129
        for setting in CONTROLLED_SETTINGS:
129
        for setting in CONTROLLED_SETTINGS:
130
            component.get("PreferencesManager").do_config_set_func(setting, core_config[setting])
130
            core_config.apply_set_functions(setting)
131
        # Resume the session if necessary
131
        # Resume the session if necessary
132
        component.get("Core").session.resume()
132
        component.get("Core").resume_all_torrents()
133
133
134
    def do_schedule(self, timer=True):
134
    def do_schedule(self, timer=True):
135
        """
135
        """
Lines 153-162 Link Here
153
            settings.active_seeds = self.config["low_active_up"]
153
            settings.active_seeds = self.config["low_active_up"]
154
            session.set_settings(settings)
154
            session.set_settings(settings)
155
            # Resume the session if necessary
155
            # Resume the session if necessary
156
            component.get("Core").session.resume()
156
            component.get("Core").resume_all_torrents()
157
        elif state == "Red":
157
        elif state == "Red":
158
            # This is Red (Stop), so pause the libtorrent session
158
            # This is Red (Stop), so pause the libtorrent session
159
            component.get("Core").session.pause()
159
            component.get("Core").pause_all_torrents()
160
160
161
        if state != self.state:
161
        if state != self.state:
162
            # The state has changed since last update so we need to emit an event
162
            # The state has changed since last update so we need to emit an event
(-)deluge-1.3-stable/deluge/plugins/scheduler/scheduler/gtkui.py (-8 / +8 lines)
Lines 77-96 Link Here
77
77
78
    #redraw the whole thing
78
    #redraw the whole thing
79
    def expose(self, widget, event):
79
    def expose(self, widget, event):
80
        self.context = self.window.cairo_create()
80
        context = self.window.cairo_create()
81
        self.context.rectangle(event.area.x, event.area.y, event.area.width, event.area.height)
81
        context.rectangle(event.area.x, event.area.y, event.area.width, event.area.height)
82
        self.context.clip()
82
        context.clip()
83
83
84
        width = self.window.get_size()[0]
84
        width = self.window.get_size()[0]
85
        height = self.window.get_size()[1]
85
        height = self.window.get_size()[1]
86
86
87
        for y in xrange(7):
87
        for y in xrange(7):
88
            for x in xrange(24):
88
            for x in xrange(24):
89
                self.context.set_source_rgba(self.colors[self.button_state[x][y]][0], self.colors[self.button_state[x][y]][1], self.colors[self.button_state[x][y]][2], 0.7)
89
                context.set_source_rgba(self.colors[self.button_state[x][y]][0], self.colors[self.button_state[x][y]][1], self.colors[self.button_state[x][y]][2], 0.7)
90
                self.context.rectangle(width*(6*x/145.0+1/145.0), height*(6*y/43.0+1/43.0), 5*width/145.0, 5*height/43.0)
90
                context.rectangle(width*(6*x/145.0+1/145.0), height*(6*y/43.0+1/43.0), 5*width/145.0, 5*height/43.0)
91
                self.context.fill_preserve()
91
                context.fill_preserve()
92
                self.context.set_source_rgba(0.5, 0.5, 0.5, 0.5)
92
                context.set_source_rgba(0.5, 0.5, 0.5, 0.5)
93
                self.context.stroke()
93
                context.stroke()
94
94
95
    #coordinates --> which box
95
    #coordinates --> which box
96
    def get_point(self, event):
96
    def get_point(self, event):
(-)deluge-1.3-stable/deluge/ui/gtkui/addtorrentdialog.py (-1 / +5 lines)
Lines 251-262 Link Here
251
251
252
        for uri in uris:
252
        for uri in uris:
253
            s = uri.split("&")[0][20:]
253
            s = uri.split("&")[0][20:]
254
            info_hash = None
254
            if len(s) == 32:
255
            if len(s) == 32:
255
                info_hash = base64.b32decode(s).encode("hex")
256
                info_hash = base64.b32decode(s).encode("hex")
256
            elif len(s) == 40:
257
            elif len(s) == 40:
257
                info_hash = s
258
                info_hash = s
259
            if info_hash is None:
260
                log.error("Invalid info_hash in uri: %s", uri)
261
                continue
258
            if info_hash in self.infos:
262
            if info_hash in self.infos:
259
                log.debug("Torrent already in list!")
263
                log.debug("Torrent already in list: %s", uri)
260
                continue
264
                continue
261
            name = None
265
            name = None
262
            for i in uri.split("&"):
266
            for i in uri.split("&"):
(-)deluge-1.3-stable/deluge/ui/gtkui/connectionmanager.py (-2 / +6 lines)
Lines 39-44 Link Here
39
import time
39
import time
40
import hashlib
40
import hashlib
41
from twisted.internet import reactor
41
from twisted.internet import reactor
42
from socket import gethostbyname
42
43
43
import deluge.component as component
44
import deluge.component as component
44
import deluge.common
45
import deluge.common
Lines 303-310 Link Here
303
            user = row[HOSTLIST_COL_USER]
304
            user = row[HOSTLIST_COL_USER]
304
            password = row[HOSTLIST_COL_PASS]
305
            password = row[HOSTLIST_COL_PASS]
305
306
306
            if client.connected() and \
307
            if client.connected() and (
307
                (host, port, "localclient" if not user and host in ("127.0.0.1", "localhost") else user) == client.connection_info():
308
                gethostbyname(host),
309
                port,
310
                "localclient" if not user and host in ("127.0.0.1", "localhost") else user
311
                    ) == client.connection_info():
308
                def on_info(info):
312
                def on_info(info):
309
                    if not self.running:
313
                    if not self.running:
310
                        return
314
                        return
(-)deluge-1.3-stable/deluge/ui/gtkui/edittrackersdialog.py (-1 / +4 lines)
Lines 133-142 Link Here
133
            tracker = self.liststore.get_value(selected, 1)
133
            tracker = self.liststore.get_value(selected, 1)
134
            self.glade.get_widget("entry_edit_tracker").set_text(tracker)
134
            self.glade.get_widget("entry_edit_tracker").set_text(tracker)
135
            self.edit_tracker_entry.show()
135
            self.edit_tracker_entry.show()
136
            self.glade.get_widget("edit_tracker_entry").grab_focus()
136
            self.edit_tracker_entry.grab_focus()
137
            self.dialog.set_sensitive(False)
137
138
138
    def on_button_edit_cancel_clicked(self, widget):
139
    def on_button_edit_cancel_clicked(self, widget):
139
        log.debug("on_button_edit_cancel_clicked")
140
        log.debug("on_button_edit_cancel_clicked")
141
        self.dialog.set_sensitive(True)
140
        self.edit_tracker_entry.hide()
142
        self.edit_tracker_entry.hide()
141
143
142
    def on_button_edit_ok_clicked(self, widget):
144
    def on_button_edit_ok_clicked(self, widget):
Lines 144-149 Link Here
144
        selected = self.get_selected()
146
        selected = self.get_selected()
145
        tracker = self.glade.get_widget("entry_edit_tracker").get_text()
147
        tracker = self.glade.get_widget("entry_edit_tracker").get_text()
146
        self.liststore.set_value(selected, 1, tracker)
148
        self.liststore.set_value(selected, 1, tracker)
149
        self.dialog.set_sensitive(True)
147
        self.edit_tracker_entry.hide()
150
        self.edit_tracker_entry.hide()
148
151
149
    def on_button_up_clicked(self, widget):
152
    def on_button_up_clicked(self, widget):
(-)deluge-1.3-stable/deluge/ui/gtkui/glade/add_torrent_dialog.glade (-2 lines)
Lines 1017-1023 Link Here
1017
    <property name="destroy_with_parent">True</property>
1017
    <property name="destroy_with_parent">True</property>
1018
    <property name="type_hint">dialog</property>
1018
    <property name="type_hint">dialog</property>
1019
    <property name="decorated">False</property>
1019
    <property name="decorated">False</property>
1020
    <property name="has_separator">False</property>
1021
    <child internal-child="vbox">
1020
    <child internal-child="vbox">
1022
      <widget class="GtkVBox" id="dialog-vbox4">
1021
      <widget class="GtkVBox" id="dialog-vbox4">
1023
        <property name="visible">True</property>
1022
        <property name="visible">True</property>
Lines 1176-1182 Link Here
1176
    <property name="destroy_with_parent">True</property>
1175
    <property name="destroy_with_parent">True</property>
1177
    <property name="type_hint">dialog</property>
1176
    <property name="type_hint">dialog</property>
1178
    <property name="decorated">False</property>
1177
    <property name="decorated">False</property>
1179
    <property name="has_separator">False</property>
1180
    <child internal-child="vbox">
1178
    <child internal-child="vbox">
1181
      <widget class="GtkVBox" id="dialog-vbox5">
1179
      <widget class="GtkVBox" id="dialog-vbox5">
1182
        <property name="visible">True</property>
1180
        <property name="visible">True</property>
(-)deluge-1.3-stable/deluge/ui/gtkui/glade/connection_manager.glade (-2 lines)
Lines 10-16 Link Here
10
    <property name="window_position">GTK_WIN_POS_CENTER</property>
10
    <property name="window_position">GTK_WIN_POS_CENTER</property>
11
    <property name="destroy_with_parent">True</property>
11
    <property name="destroy_with_parent">True</property>
12
    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
12
    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
13
    <property name="has_separator">False</property>
14
    <child internal-child="vbox">
13
    <child internal-child="vbox">
15
      <widget class="GtkVBox" id="dialog-vbox3">
14
      <widget class="GtkVBox" id="dialog-vbox3">
16
        <property name="visible">True</property>
15
        <property name="visible">True</property>
Lines 211-217 Link Here
211
    <property name="default_height">300</property>
210
    <property name="default_height">300</property>
212
    <property name="destroy_with_parent">True</property>
211
    <property name="destroy_with_parent">True</property>
213
    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
212
    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
214
    <property name="has_separator">False</property>
215
    <child internal-child="vbox">
213
    <child internal-child="vbox">
216
      <widget class="GtkVBox" id="dialog-vbox2">
214
      <widget class="GtkVBox" id="dialog-vbox2">
217
        <property name="visible">True</property>
215
        <property name="visible">True</property>
(-)deluge-1.3-stable/deluge/ui/gtkui/glade/create_torrent_dialog.glade (-3 lines)
Lines 696-702 Link Here
696
    <property name="destroy_with_parent">True</property>
696
    <property name="destroy_with_parent">True</property>
697
    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
697
    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
698
    <property name="decorated">False</property>
698
    <property name="decorated">False</property>
699
    <property name="has_separator">False</property>
700
    <child internal-child="vbox">
699
    <child internal-child="vbox">
701
      <widget class="GtkVBox" id="dialog-vbox7">
700
      <widget class="GtkVBox" id="dialog-vbox7">
702
        <property name="visible">True</property>
701
        <property name="visible">True</property>
Lines 840-846 Link Here
840
    <property name="title" translatable="yes">Creating Torrent</property>
839
    <property name="title" translatable="yes">Creating Torrent</property>
841
    <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
840
    <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
842
    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
841
    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
843
    <property name="has_separator">False</property>
844
    <child internal-child="vbox">
842
    <child internal-child="vbox">
845
      <widget class="GtkVBox" id="dialog-vbox2">
843
      <widget class="GtkVBox" id="dialog-vbox2">
846
        <property name="visible">True</property>
844
        <property name="visible">True</property>
Lines 879-885 Link Here
879
    <property name="destroy_with_parent">True</property>
877
    <property name="destroy_with_parent">True</property>
880
    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
878
    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
881
    <property name="decorated">False</property>
879
    <property name="decorated">False</property>
882
    <property name="has_separator">False</property>
883
    <child internal-child="vbox">
880
    <child internal-child="vbox">
884
      <widget class="GtkVBox" id="dialog-vbox4">
881
      <widget class="GtkVBox" id="dialog-vbox4">
885
        <property name="visible">True</property>
882
        <property name="visible">True</property>
(-)deluge-1.3-stable/deluge/ui/gtkui/glade/dgtkpopups.glade (-1 lines)
Lines 157-163 Link Here
157
    <property name="skip_taskbar_hint">True</property>
157
    <property name="skip_taskbar_hint">True</property>
158
    <property name="skip_pager_hint">True</property>
158
    <property name="skip_pager_hint">True</property>
159
    <property name="decorated">False</property>
159
    <property name="decorated">False</property>
160
    <property name="has_separator">False</property>
161
    <child internal-child="vbox">
160
    <child internal-child="vbox">
162
      <widget class="GtkVBox" id="dialog-vbox3">
161
      <widget class="GtkVBox" id="dialog-vbox3">
163
        <property name="visible">True</property>
162
        <property name="visible">True</property>
(-)deluge-1.3-stable/deluge/ui/gtkui/glade/edit_trackers.glade (-3 lines)
Lines 11-17 Link Here
11
    <property name="default_width">400</property>
11
    <property name="default_width">400</property>
12
    <property name="destroy_with_parent">True</property>
12
    <property name="destroy_with_parent">True</property>
13
    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
13
    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
14
    <property name="has_separator">False</property>
15
    <child internal-child="vbox">
14
    <child internal-child="vbox">
16
      <widget class="GtkVBox" id="dialog-vbox1">
15
      <widget class="GtkVBox" id="dialog-vbox1">
17
        <property name="visible">True</property>
16
        <property name="visible">True</property>
Lines 226-232 Link Here
226
    <property name="destroy_with_parent">True</property>
225
    <property name="destroy_with_parent">True</property>
227
    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
226
    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
228
    <property name="decorated">False</property>
227
    <property name="decorated">False</property>
229
    <property name="has_separator">False</property>
230
    <child internal-child="vbox">
228
    <child internal-child="vbox">
231
      <widget class="GtkVBox" id="dialog-vbox2">
229
      <widget class="GtkVBox" id="dialog-vbox2">
232
        <property name="visible">True</property>
230
        <property name="visible">True</property>
Lines 382-388 Link Here
382
    <property name="destroy_with_parent">True</property>
380
    <property name="destroy_with_parent">True</property>
383
    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
381
    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
384
    <property name="decorated">False</property>
382
    <property name="decorated">False</property>
385
    <property name="has_separator">False</property>
386
    <child internal-child="vbox">
383
    <child internal-child="vbox">
387
      <widget class="GtkVBox" id="dialog-vbox4">
384
      <widget class="GtkVBox" id="dialog-vbox4">
388
        <property name="visible">True</property>
385
        <property name="visible">True</property>
(-)deluge-1.3-stable/deluge/ui/gtkui/glade/main_window.glade (-2 lines)
Lines 2280-2286 Link Here
2280
    <property name="resizable">False</property>
2280
    <property name="resizable">False</property>
2281
    <property name="window_position">center-on-parent</property>
2281
    <property name="window_position">center-on-parent</property>
2282
    <property name="type_hint">dialog</property>
2282
    <property name="type_hint">dialog</property>
2283
    <property name="has_separator">False</property>
2284
    <child internal-child="vbox">
2283
    <child internal-child="vbox">
2285
      <widget class="GtkVBox" id="dialog-vbox3">
2284
      <widget class="GtkVBox" id="dialog-vbox3">
2286
        <property name="visible">True</property>
2285
        <property name="visible">True</property>
Lines 2477-2483 Link Here
2477
    <property name="window_position">center-on-parent</property>
2476
    <property name="window_position">center-on-parent</property>
2478
    <property name="icon_name">deluge</property>
2477
    <property name="icon_name">deluge</property>
2479
    <property name="type_hint">dialog</property>
2478
    <property name="type_hint">dialog</property>
2480
    <property name="has_separator">False</property>
2481
    <child internal-child="vbox">
2479
    <child internal-child="vbox">
2482
      <widget class="GtkVBox" id="dialog-vbox2">
2480
      <widget class="GtkVBox" id="dialog-vbox2">
2483
        <property name="visible">True</property>
2481
        <property name="visible">True</property>
(-)deluge-1.3-stable/deluge/ui/gtkui/glade/move_storage_dialog.glade (-1 lines)
Lines 10-16 Link Here
10
    <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
10
    <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
11
    <property name="destroy_with_parent">True</property>
11
    <property name="destroy_with_parent">True</property>
12
    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
12
    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
13
    <property name="has_separator">False</property>
14
    <child internal-child="vbox">
13
    <child internal-child="vbox">
15
      <widget class="GtkVBox" id="dialog-vbox4">
14
      <widget class="GtkVBox" id="dialog-vbox4">
16
        <property name="visible">True</property>
15
        <property name="visible">True</property>
(-)deluge-1.3-stable/deluge/ui/gtkui/glade/preferences_dialog.glade (-1 lines)
Lines 11-17 Link Here
11
    <property name="default_height">560</property>
11
    <property name="default_height">560</property>
12
    <property name="destroy_with_parent">True</property>
12
    <property name="destroy_with_parent">True</property>
13
    <property name="type_hint">dialog</property>
13
    <property name="type_hint">dialog</property>
14
    <property name="has_separator">False</property>
15
    <signal name="configure_event" handler="on_pref_dialog_configure_event"/>
14
    <signal name="configure_event" handler="on_pref_dialog_configure_event"/>
16
    <signal name="delete_event" handler="on_pref_dialog_delete_event"/>
15
    <signal name="delete_event" handler="on_pref_dialog_delete_event"/>
17
    <child internal-child="vbox">
16
    <child internal-child="vbox">
(-)deluge-1.3-stable/deluge/ui/gtkui/glade/queuedtorrents.glade (-1 lines)
Lines 11-17 Link Here
11
    <property name="default_height">300</property>
11
    <property name="default_height">300</property>
12
    <property name="destroy_with_parent">True</property>
12
    <property name="destroy_with_parent">True</property>
13
    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
13
    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
14
    <property name="has_separator">False</property>
15
    <child internal-child="vbox">
14
    <child internal-child="vbox">
16
      <widget class="GtkVBox" id="dialog-vbox1">
15
      <widget class="GtkVBox" id="dialog-vbox1">
17
        <property name="visible">True</property>
16
        <property name="visible">True</property>
(-)deluge-1.3-stable/deluge/ui/gtkui/glade/remove_torrent_dialog.glade (-1 lines)
Lines 10-16 Link Here
10
    <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
10
    <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
11
    <property name="destroy_with_parent">True</property>
11
    <property name="destroy_with_parent">True</property>
12
    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
12
    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
13
    <property name="has_separator">False</property>
14
    <child internal-child="vbox">
13
    <child internal-child="vbox">
15
      <widget class="GtkVBox" id="dialog-vbox1">
14
      <widget class="GtkVBox" id="dialog-vbox1">
16
        <property name="visible">True</property>
15
        <property name="visible">True</property>
(-)deluge-1.3-stable/deluge/ui/gtkui/listview.py (-6 / +9 lines)
Lines 429-436 Link Here
429
        if self.liststore is not None:
429
        if self.liststore is not None:
430
            self.liststore.foreach(copy_row, (new_list, self.columns))
430
            self.liststore.foreach(copy_row, (new_list, self.columns))
431
        self.liststore = new_list
431
        self.liststore = new_list
432
        self.create_model_filter()
433
        return
434
432
435
    def update_treeview_column(self, header, add=True):
433
    def update_treeview_column(self, header, add=True):
436
        """Update TreeViewColumn based on ListView column mappings"""
434
        """Update TreeViewColumn based on ListView column mappings"""
Lines 503-508 Link Here
503
            del self.liststore_columns[index]
501
            del self.liststore_columns[index]
504
        # Create a new liststore
502
        # Create a new liststore
505
        self.create_new_liststore()
503
        self.create_new_liststore()
504
        # Create new model for the treeview
505
        self.create_model_filter()
506
506
507
        # Re-create the menu
507
        # Re-create the menu
508
        self.create_checklist_menu()
508
        self.create_checklist_menu()
Lines 547-553 Link Here
547
        # Create a new list with the added column
547
        # Create a new list with the added column
548
        self.create_new_liststore()
548
        self.create_new_liststore()
549
549
550
        if column_type == None:
550
        # Happens only on columns added after the torrent list has been loaded
551
        if self.model_filter:
552
            self.create_model_filter()
553
554
        if column_type is None:
551
            return
555
            return
552
556
553
        self.update_treeview_column(header)
557
        self.update_treeview_column(header)
Lines 630-644 Link Here
630
    def add_progress_column(self, header, col_types=[float, str], sortid=0,
634
    def add_progress_column(self, header, col_types=[float, str], sortid=0,
631
                            hidden=False, position=None, status_field=None,
635
                            hidden=False, position=None, status_field=None,
632
                            function=None, column_type="progress",
636
                            function=None, column_type="progress",
633
                            default=True):
637
                            sort_func=None, default=True):
634
        """Add a progress column to the listview."""
638
        """Add a progress column to the listview."""
635
639
636
        render = gtk.CellRendererProgress()
640
        render = gtk.CellRendererProgress()
637
        self.add_column(header, render, col_types, hidden, position,
641
        self.add_column(header, render, col_types, hidden, position,
638
                        status_field, sortid, function=function,
642
                        status_field, sortid, function=function,
639
                        column_type=column_type, value=0, text=1,
643
                        column_type=column_type, value=0, text=1,
640
                        default=default)
644
                        sort_func=sort_func, default=default)
641
642
        return True
645
        return True
643
646
644
    def add_texticon_column(self, header, col_types=[str, str], sortid=1,
647
    def add_texticon_column(self, header, col_types=[str, str], sortid=1,
(-)deluge-1.3-stable/deluge/ui/gtkui/options_tab.py (+1 lines)
Lines 150-155 Link Here
150
                self.chk_move_completed.set_active(status["move_on_completed"])
150
                self.chk_move_completed.set_active(status["move_on_completed"])
151
            if status["move_on_completed_path"] != self.prev_status["move_on_completed_path"]:
151
            if status["move_on_completed_path"] != self.prev_status["move_on_completed_path"]:
152
                if client.is_localhost():
152
                if client.is_localhost():
153
                    self.filechooser_move_completed.unselect_all()
153
                    self.filechooser_move_completed.set_current_folder(status["move_on_completed_path"])
154
                    self.filechooser_move_completed.set_current_folder(status["move_on_completed_path"])
154
                else:
155
                else:
155
                    self.entry_move_completed.set_text(status["move_on_completed_path"])
156
                    self.entry_move_completed.set_text(status["move_on_completed_path"])
(-)deluge-1.3-stable/deluge/ui/gtkui/systemtray.py (-1 / +1 lines)
Lines 350-356 Link Here
350
            self.tray_glade.get_widget("menuitem_show_deluge").set_active(False)
350
            self.tray_glade.get_widget("menuitem_show_deluge").set_active(False)
351
351
352
        popup_function = gtk.status_icon_position_menu
352
        popup_function = gtk.status_icon_position_menu
353
        if deluge.common.windows_check():
353
        if deluge.common.windows_check() or deluge.common.osx_check():
354
            popup_function = None
354
            popup_function = None
355
            button = 0
355
            button = 0
356
        self.tray_menu.popup(None, None, popup_function,
356
        self.tray_menu.popup(None, None, popup_function,
(-)deluge-1.3-stable/deluge/ui/gtkui/torrentview.py (-4 / +16 lines)
Lines 210-215 Link Here
210
        return queue_peer_seed_sort_function(v2, v4)
210
        return queue_peer_seed_sort_function(v2, v4)
211
    return queue_peer_seed_sort_function(v1, v3)
211
    return queue_peer_seed_sort_function(v1, v3)
212
212
213
def progress_sort(model, iter1, iter2, sort_column_id):
214
    progress1 = model[iter1][sort_column_id]
215
    progress2 = model[iter2][sort_column_id]
216
    # Progress value is equal, so sort on state
217
    if progress1 == progress2:
218
        state1 = model[iter1][sort_column_id + 1]
219
        state2 = model[iter2][sort_column_id + 1]
220
        return cmp(state1, state2)
221
    return cmp(progress1, progress2)
222
223
213
class TorrentView(listview.ListView, component.Component):
224
class TorrentView(listview.ListView, component.Component):
214
    """TorrentView handles the listing of torrents."""
225
    """TorrentView handles the listing of torrents."""
215
    def __init__(self):
226
    def __init__(self):
Lines 256-262 Link Here
256
        self.add_progress_column(_("Progress"),
267
        self.add_progress_column(_("Progress"),
257
                                 status_field=["progress", "state"],
268
                                 status_field=["progress", "state"],
258
                                 col_types=[float, str],
269
                                 col_types=[float, str],
259
                                 function=cell_data_progress)
270
                                 function=cell_data_progress,
271
                                 sort_func=progress_sort)
260
        self.add_func_column(_("Seeders"), listview.cell_data_peer, [int, int],
272
        self.add_func_column(_("Seeders"), listview.cell_data_peer, [int, int],
261
                             status_field=["num_seeds", "total_seeds"],
273
                             status_field=["num_seeds", "total_seeds"],
262
                             sort_func=seed_peer_column_sort, default=False)
274
                             sort_func=seed_peer_column_sort, default=False)
Lines 265-273 Link Here
265
                             sort_func=seed_peer_column_sort, default=False)
277
                             sort_func=seed_peer_column_sort, default=False)
266
        self.add_func_column(_("Seeders") + "/" + _("Peers"), listview.cell_data_ratio, [float],
278
        self.add_func_column(_("Seeders") + "/" + _("Peers"), listview.cell_data_ratio, [float],
267
                             status_field=["seeds_peers_ratio"], default=False)
279
                             status_field=["seeds_peers_ratio"], default=False)
268
        self.add_func_column(_("Down Speed"), listview.cell_data_speed, [float],
280
        self.add_func_column(_("Down Speed"), listview.cell_data_speed, [int],
269
                             status_field=["download_payload_rate"])
281
                             status_field=["download_payload_rate"])
270
        self.add_func_column(_("Up Speed"), listview.cell_data_speed, [float],
282
        self.add_func_column(_("Up Speed"), listview.cell_data_speed, [int],
271
                             status_field=["upload_payload_rate"])
283
                             status_field=["upload_payload_rate"])
272
        self.add_func_column(_("Down Limit"), listview.cell_data_speed_limit, [float],
284
        self.add_func_column(_("Down Limit"), listview.cell_data_speed_limit, [float],
273
                             status_field=["max_download_speed"], default=False)
285
                             status_field=["max_download_speed"], default=False)
Lines 279-285 Link Here
279
                             status_field=["ratio"], default=False)
291
                             status_field=["ratio"], default=False)
280
        self.add_func_column(_("Avail"), listview.cell_data_ratio, [float],
292
        self.add_func_column(_("Avail"), listview.cell_data_ratio, [float],
281
                             status_field=["distributed_copies"], default=False)
293
                             status_field=["distributed_copies"], default=False)
282
        self.add_func_column(_("Added"), listview.cell_data_date, [float],
294
        self.add_func_column(_("Added"), listview.cell_data_date, [int],
283
                             status_field=["time_added"], default=False)
295
                             status_field=["time_added"], default=False)
284
        self.add_texticon_column(_("Tracker"),
296
        self.add_texticon_column(_("Tracker"),
285
                                 status_field=["tracker_host", "tracker_host"],
297
                                 status_field=["tracker_host", "tracker_host"],
(-)deluge-1.3-stable/deluge/ui/web/json_api.py (+2 lines)
Lines 428-433 Link Here
428
    def __init__(self):
428
    def __init__(self):
429
        super(WebApi, self).__init__("Web", depend=["SessionProxy"])
429
        super(WebApi, self).__init__("Web", depend=["SessionProxy"])
430
        self.host_list = ConfigManager("hostlist.conf.1.2", DEFAULT_HOSTS)
430
        self.host_list = ConfigManager("hostlist.conf.1.2", DEFAULT_HOSTS)
431
        if not os.path.isfile(self.host_list.config_file):
432
            self.host_list.save()
431
        self.core_config = CoreConfig()
433
        self.core_config = CoreConfig()
432
        self.event_queue = EventQueue()
434
        self.event_queue = EventQueue()
433
        try:
435
        try:
(-)deluge-1.3-stable/setup.py (-1 / +1 lines)
Lines 489-495 Link Here
489
489
490
# Data files to be installed to the system.
490
# Data files to be installed to the system.
491
_data_files = []
491
_data_files = []
492
if not windows_check():
492
if not windows_check() and not osx_check():
493
    _data_files = [
493
    _data_files = [
494
        ('share/icons/hicolor/scalable/apps', ['deluge/data/icons/scalable/apps/deluge.svg']),
494
        ('share/icons/hicolor/scalable/apps', ['deluge/data/icons/scalable/apps/deluge.svg']),
495
        ('share/icons/hicolor/128x128/apps', ['deluge/data/icons/hicolor/128x128/apps/deluge.png']),
495
        ('share/icons/hicolor/128x128/apps', ['deluge/data/icons/hicolor/128x128/apps/deluge.png']),

Return to bug 207558