2
ITmages upload client for Windows
3
Copyright (C) 2011 Dmitriy Simbiriatin <slpiv@itmages.ru>
5
This program is free software; you can redistribute it and/or
6
modify it under the terms of the GNU General Public License
7
as published by the Free Software Foundation; either version 2
8
of the License, or (at your option) any later version.
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
GNU General Public License for more details.
15
You should have received a copy of the GNU General Public License
16
along with this program; if not, write to the Free Software
17
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23
#include "errorshandler.h"
25
void ErrorsHandler(ItmagesErrorIds error_number)
27
switch (error_number) {
31
gettext("Failed to open the file for writing. Possibly another program already use it."),
32
gettext("ITmages - Error"),
33
MB_OK | MB_ICONERROR);
34
MessageBeep(MB_ICONERROR);
39
gettext("Failed to read from the file. Possibly another program already use it."),
40
gettext("ITmages - Error"),
41
MB_OK | MB_ICONERROR);
42
MessageBeep(MB_ICONERROR);
47
gettext("Upload error. Please check your internet connection."),
48
gettext("ITmages - Error"),
49
MB_OK | MB_ICONERROR);
50
MessageBeep(MB_ICONERROR);
55
gettext("Failed to allocate the memory."),
56
gettext("ITmages - Error"),
57
MB_OK | MB_ICONERROR);
58
MessageBeep(MB_ICONERROR);
60
case ERROR_PARSERESPONSE:
63
gettext("Failed to parse the response from the server."),
64
gettext("ITmages - Error"),
65
MB_OK | MB_ICONERROR);
66
MessageBeep(MB_ICONERROR);
68
case ERROR_GETIMGPATH:
71
gettext("Failed to get the image path."),
72
gettext("ITmages - Error"),
73
MB_OK | MB_ICONERROR);
74
MessageBeep(MB_ICONERROR);
76
case ERROR_SUPPORTEDIMG:
79
gettext("Unsupported image type. ITmages supports only jpg/jpeg, png and gif images."),
80
gettext("ITmages - Error"),
81
MB_OK | MB_ICONERROR);
82
MessageBeep(MB_ICONERROR);
84
case ERROR_GETIMGSIZE:
87
gettext("Failed to get the image's size."),
88
gettext("ITmages - Error"),
89
MB_OK | MB_ICONERROR);
90
MessageBeep(MB_ICONERROR);
92
case ERROR_MAXIMGSIZE:
95
gettext("Unsupported image size. Image's size have to be less than 6 Mb."),
96
gettext("ITmages - Error"),
97
MB_OK | MB_ICONERROR);
98
MessageBeep(MB_ICONERROR);
100
case ERROR_OPENCLIPBOARD:
103
gettext("Failed to open the clipboard."),
104
gettext("ITmages - Error"),
105
MB_OK | MB_ICONERROR);
106
MessageBeep(MB_ICONERROR);
108
case ERROR_REGISTERWNDCLS:
111
gettext("Failed to register window's class."),
112
gettext("ITmages - Error"),
113
MB_OK | MB_ICONERROR);
114
MessageBeep(MB_ICONERROR);
116
case ERROR_GETSETTINGSDIR:
119
gettext("Failed to get the default settings directory."),
120
gettext("ITmages - Error"),
121
MB_OK | MB_ICONERROR);
122
MessageBeep(MB_ICONERROR);
124
case ERROR_GETCOOKIESDIR:
127
gettext("Failed to get the default cookies directory."),
128
gettext("ITmages - Error"),
129
MB_OK | MB_ICONERROR);
130
MessageBeep(MB_ICONERROR);
132
case ERROR_READCONFFILE:
135
gettext("Failed to read the configuration file."),
136
gettext("ITmages - Error"),
137
MB_OK | MB_ICONERROR);
138
MessageBeep(MB_ICONERROR);
140
case ERROR_WRITECONFFILE:
143
gettext("Failed to write the settings into the configuration file."),
144
gettext("ITmages - Error"),
145
MB_OK | MB_ICONERROR);
146
MessageBeep(MB_ICONERROR);
148
case ERROR_CREATETHREAD:
151
gettext("Failed to create a new thread."),
152
gettext("ITmages - Error"),
153
MB_OK | MB_ICONERROR);
154
MessageBeep(MB_ICONERROR);
156
case ERROR_CONNECTION:
159
gettext("Failed to connect to the server."),
160
gettext("ITmages - Error"),
161
MB_OK | MB_ICONERROR);
162
MessageBeep(MB_ICONERROR);
167
gettext("Failed to login. Check your login and password."),
168
gettext("ITmages - Error"),
169
MB_OK | MB_ICONERROR);
170
MessageBeep(MB_ICONERROR);
175
gettext("Failed to logout."),
176
gettext("ITmages - Error"),
177
MB_OK | MB_ICONERROR);
178
MessageBeep(MB_ICONERROR);
183
gettext("The reduce value have to be less than actual width of the image."),
184
gettext("ITmages - Warning"),
185
MB_OK | MB_ICONWARNING);
186
MessageBeep(MB_ICONWARNING);
188
case ERROR_BADIMGSIZE:
191
gettext("Wrong image size. Possible, image is corrupted."),
192
gettext("ITmages - Error"),
193
MB_OK | MB_ICONERROR);
194
MessageBeep(MB_ICONERROR);
196
case ERROR_GETIMGWIDTH:
199
gettext("Failed to get the image's width."),
200
gettext("ITmages - Error"),
201
MB_OK | MB_ICONERROR);
202
MessageBeep(MB_ICONERROR);
204
case ERROR_GETIMGINFO:
207
gettext("Failed to get the information about the image."),
208
gettext("ITmages - Error"),
209
MB_OK | MB_ICONERROR);
210
MessageBeep(MB_ICONERROR);
215
gettext("Wrong error's id."),
216
gettext("ITmages - Error"),
217
MB_OK | MB_ICONERROR);
218
MessageBeep(MB_ICONERROR);