-
Notifications
You must be signed in to change notification settings - Fork 220
/
Copy pathDataToText.cpp
155 lines (140 loc) · 4.67 KB
/
DataToText.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
//
// This file is part of the aMule Project.
//
// Copyright (c) 2003-2011 aMule Team ( [email protected] / http://www.amule.org )
//
// Any parts of this program derived from the xMule, lMule or eMule project,
// or contributed by third-party developers are copyrighted by their
// respective authors.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
//
#include <wx/intl.h>
#include "DataToText.h"
#include "Constants.h"
#include <protocol/ed2k/ClientSoftware.h>
wxString PriorityToStr( int priority, bool isAuto )
{
if ( isAuto ) {
switch ( priority ) {
case PR_LOW: return _("Auto [Lo]");
case PR_NORMAL: return _("Auto [No]");
case PR_HIGH: return _("Auto [Hi]");
}
} else {
switch ( priority ) {
case PR_VERYLOW: return _("Very low");
case PR_LOW: return _("Low");
case PR_NORMAL: return _("Normal");
case PR_HIGH: return _("High");
case PR_VERYHIGH: return _("Very High");
case PR_POWERSHARE: return _("Release");
}
}
wxFAIL;
return _("Unknown");
}
wxString DownloadStateToStr( int state, bool queueFull )
{
switch ( state ) {
case DS_CONNECTING: return _("Connecting");
case DS_CONNECTED: return _("Asking");
case DS_WAITCALLBACK: return _("Connecting via server");
case DS_ONQUEUE: return ( queueFull ? _("Queue Full") : _("On Queue") );
case DS_DOWNLOADING: return _("Downloading");
case DS_REQHASHSET: return _("Receiving hashset");
case DS_NONEEDEDPARTS: return _("No needed parts");
case DS_LOWTOLOWIP: return _("Cannot connect LowID to LowID");
case DS_TOOMANYCONNS: return _("Too many connections");
case DS_NONE: return _("Unknown");
case DS_WAITCALLBACKKAD: return _("Connecting via Kad");
case DS_TOOMANYCONNSKAD: return _("Too many Kad connections");
case DS_BANNED: return _("Banned");
case DS_ERROR: return _("Connection Error");
case DS_REMOTEQUEUEFULL: return _("Remote Queue Full");
}
wxFAIL;
return _("Unknown");
}
const wxString GetSoftName(unsigned int software_ident)
{
switch (software_ident) {
case SO_OLDEMULE:
case SO_EMULE:
return wxT("eMule");
case SO_CDONKEY:
return wxT("cDonkey");
case SO_LXMULE:
return wxT("(l/x)Mule");
case SO_AMULE:
return wxT("aMule");
case SO_SHAREAZA:
case SO_NEW_SHAREAZA:
case SO_NEW2_SHAREAZA:
return wxT("Shareaza");
case SO_EMULEPLUS:
return wxT("eMule+");
case SO_HYDRANODE:
return wxT("HydraNode");
case SO_MLDONKEY:
return wxTRANSLATE("Old MLDonkey");
case SO_NEW_MLDONKEY:
case SO_NEW2_MLDONKEY:
return wxTRANSLATE("New MLDonkey");
case SO_LPHANT:
return wxT("lphant");
case SO_EDONKEYHYBRID:
return wxT("eDonkeyHybrid");
case SO_EDONKEY:
return wxT("eDonkey");
case SO_UNKNOWN:
return wxTRANSLATE("Unknown");
case SO_COMPAT_UNK:
return wxTRANSLATE("eMule Compatible");
default:
return wxEmptyString;
}
}
wxString OriginToText(unsigned int source_from)
{
switch ((ESourceFrom)source_from) {
case SF_LOCAL_SERVER: return wxTRANSLATE("Local Server");
case SF_REMOTE_SERVER: return wxTRANSLATE("Remote Server");
case SF_KADEMLIA: return wxTRANSLATE("Kad");
case SF_SOURCE_EXCHANGE: return wxTRANSLATE("Source Exchange");
case SF_PASSIVE: return wxTRANSLATE("Passive");
case SF_LINK: return wxTRANSLATE("Link");
case SF_SOURCE_SEEDS: return wxTRANSLATE("Source Seeds");
case SF_SEARCH_RESULT: return wxTRANSLATE("Search Result");
case SF_NONE:
default: return wxTRANSLATE("Unknown");
}
}
wxString GetConversionState(unsigned int state)
{
switch (state) {
case CONV_OK : return _("Completed");
case CONV_INPROGRESS : return _("In progress");
case CONV_OUTOFDISKSPACE : return _("ERROR: Out of diskspace");
case CONV_PARTMETNOTFOUND : return _("ERROR: Partmet not found");
case CONV_IOERROR : return _("ERROR: IO error!");
case CONV_FAILED : return _("ERROR: Failed!");
case CONV_QUEUE : return _("Queued");
case CONV_ALREADYEXISTS : return _("Already downloading");
case CONV_BADFORMAT : return _("Unknown or bad tempfile format.");
default: return wxT("?");
}
}
// File_checked_for_headers