Changeset 8eb215


Ignore:
Timestamp:
01/16/2014 11:31:04 PM (12 years ago)
Author:
Calum Lind <calumlind+deluge@gmail.com>
Branches:
2.0.x, develop, master
Children:
b0c3c3
Parents:
0a41b86
git-author:
Calum Lind <calumlind+deluge@gmail.com> (01/16/2014 04:48:32 PM)
git-committer:
Calum Lind <calumlind+deluge@gmail.com> (01/16/2014 11:31:04 PM)
Message:

Remove torrent_status translations from Daemon and move to UI clients

Location:
deluge
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • deluge/core/filtermanager.py

    r0a41b86 r8eb215  
    112112        return filtered_torrent_ids
    113113
    114     error_str = _("Error") + ":"
    115114    # Check torrent's tracker_status for 'Error:' and return those torrent_ids
    116115    for torrent_id in torrent_ids:
    117         if error_str in tm[torrent_id].get_status(["tracker_status"])["tracker_status"]:
     116        if "Error:" in tm[torrent_id].get_status(["tracker_status"])["tracker_status"]:
    118117            filtered_torrent_ids.append(torrent_id)
    119118    return filtered_torrent_ids
  • deluge/core/torrentmanager.py

    r0a41b86 r8eb215  
    973973
    974974        # Set the tracker status for the torrent
    975         torrent.set_tracker_status(_("Announce OK"))
     975        torrent.set_tracker_status("Announce OK")
    976976
    977977        # Check to see if we got any peer information from the tracker
     
    991991
    992992        # Set the tracker status for the torrent
    993         torrent.set_tracker_status(_("Announce Sent"))
     993        torrent.set_tracker_status("Announce Sent")
    994994
    995995    def on_alert_tracker_warning(self, alert):
     
    10001000        except RuntimeError:
    10011001            return
    1002         tracker_status = '%s: %s' % (_("Warning"), decode_string(alert.message()))
     1002        tracker_status = 'Warning: %s' % decode_string(alert.message())
    10031003        # Set the tracker status for the torrent
    10041004        torrent.set_tracker_status(tracker_status)
     
    10111011        except RuntimeError:
    10121012            return
    1013         tracker_status = "%s: %s" % (_("Error"), decode_string(alert.msg))
     1013        tracker_status = "Error: %s" % decode_string(alert.msg)
    10141014        torrent.set_tracker_status(tracker_status)
    10151015
  • deluge/main.py

    r0a41b86 r8eb215  
    141141def start_daemon():
    142142    """Entry point for daemon script"""
    143     deluge.common.setup_translations()
    144143
    145144    if 'dev' not in deluge.common.get_version():
  • deluge/ui/gtkui/status_tab.py

    r0a41b86 r8eb215  
    148148            status["is_auto_managed"]=_("Off")
    149149
     150        translate_tracker_status = {
     151            "Error" : _("Error"),
     152            "Warning" : _("Warning"),
     153            "Announce OK" : _("Announce OK"),
     154            "Announce Sent" : _("Announce Sent")
     155        }
     156        for key, value in translate_tracker_status.iteritems():
     157            if key in status["tracker_status"]:
     158                status["tracker_status"] = status["tracker_status"].replace(key, value, 1)
     159                log.error(status["tracker_status"])
     160                break
     161
    150162        # Update all the label widgets
    151163        for widget in self.label_widgets:
  • deluge/ui/web/js/deluge-all/details/StatusTab.js

    r0a41b86 r8eb215  
    116116        data.auto_managed = _((status.is_auto_managed) ? 'True' : 'False');
    117117
     118        var translate_tracker_status = {
     119            'Error' : _('Error'),
     120            'Warning' : _('Warning'),
     121            'Announce OK' : _('Announce OK'),
     122            'Announce Sent' : _('Announce Sent')
     123        };
     124        for (var key in translate_tracker_status) {
     125            if (data.tracker_status.indexOf(key) != -1) {
     126                data.tracker_status = data.tracker_status.replace(key, translate_tracker_status[key]);
     127                break;
     128            }
     129        }
     130
    118131        data.downloaded += ' (' + ((status.total_payload_download) ? fsize(status.total_payload_download) : '0.0 KiB') + ')';
    119132        data.uploaded += ' (' + ((status.total_payload_upload) ? fsize(status.total_payload_upload): '0.0 KiB') + ')';
Note: See TracChangeset for help on using the changeset viewer.