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