equal
deleted
inserted
replaced
30 #include <QNetworkRequest> |
30 #include <QNetworkRequest> |
31 #include <QNetworkReply> |
31 #include <QNetworkReply> |
32 #include <QMessageBox> |
32 #include <QMessageBox> |
33 #include <QRegExp> |
33 #include <QRegExp> |
34 #include <QRegExpValidator> |
34 #include <QRegExpValidator> |
35 #include <QMessageBox> |
|
36 |
35 |
37 #include "upload_video.h" |
36 #include "upload_video.h" |
38 #include "hwconsts.h" |
37 #include "hwconsts.h" |
39 |
38 |
40 // User-agent string used in http requests. |
39 // User-agent string used in http requests. |
231 QString errorStr = QMessageBox::tr("Error while authenticating at google.com:\n"); |
230 QString errorStr = QMessageBox::tr("Error while authenticating at google.com:\n"); |
232 if (HttpCode == 403) |
231 if (HttpCode == 403) |
233 errorStr += QMessageBox::tr("Login or password is incorrect"); |
232 errorStr += QMessageBox::tr("Login or password is incorrect"); |
234 else |
233 else |
235 errorStr += reply->errorString(); |
234 errorStr += reply->errorString(); |
236 QMessageBox::warning(this, QMessageBox::tr("Error"), errorStr); |
235 |
|
236 QMessageBox deniedMsg(this); |
|
237 deniedMsg.setIcon(QMessageBox::Warning); |
|
238 deniedMsg.setWindowTitle(QMessageBox::tr("Video upload - Error")); |
|
239 deniedMsg.setText(errorStr); |
|
240 deniedMsg.setWindowModality(Qt::WindowModal); |
|
241 deniedMsg.exec(); |
|
242 |
237 setEditable(true); |
243 setEditable(true); |
238 return; |
244 return; |
239 } |
245 } |
240 |
246 |
241 QByteArray auth = ("GoogleLogin auth=" + authToken).toAscii(); |
247 QByteArray auth = ("GoogleLogin auth=" + authToken).toAscii(); |
286 location = QString::fromAscii(reply->rawHeader("Location")); |
292 location = QString::fromAscii(reply->rawHeader("Location")); |
287 if (location.isEmpty()) |
293 if (location.isEmpty()) |
288 { |
294 { |
289 QString errorStr = QMessageBox::tr("Error while sending metadata to youtube.com:\n"); |
295 QString errorStr = QMessageBox::tr("Error while sending metadata to youtube.com:\n"); |
290 errorStr += reply->errorString(); |
296 errorStr += reply->errorString(); |
291 QMessageBox::warning(this, QMessageBox::tr("Error"), errorStr); |
297 |
|
298 QMessageBox deniedMsg(this); |
|
299 deniedMsg.setIcon(QMessageBox::Warning); |
|
300 deniedMsg.setWindowTitle(QMessageBox::tr("Video upload - Error")); |
|
301 deniedMsg.setText(errorStr); |
|
302 deniedMsg.setWindowModality(Qt::WindowModal); |
|
303 deniedMsg.exec(); |
|
304 |
292 setEditable(true); |
305 setEditable(true); |
293 return; |
306 return; |
294 } |
307 } |
295 |
308 |
296 accept(); |
309 accept(); |