Revision 1788 trunk/client/gui_qt/WidgetRepairAndUnpack.cpp
| WidgetRepairAndUnpack.cpp (revision 1788) | ||
|---|---|---|
| 301 | 301 |
|
| 302 | 302 |
collection_item->setText(FIELD_PROGRESS, "75"); |
| 303 | 303 |
file_item->setText(FIELD_PROGRESS, QString("%1").arg((int) (progress * 100)));
|
| 304 |
|
|
| 305 |
if (progress == 1.0) {
|
|
| 306 |
collection_item->setText(FIELD_PROGRESS, "100"); |
|
| 307 |
collection_item->setText(FIELD_PROGRESS_STR, tr("Unpack completed"));
|
|
| 308 |
file_item->setText(FIELD_PROGRESS, "100"); |
|
| 309 |
file_item->setText(FIELD_PROGRESS_STR, tr("Unpack completed"));
|
|
| 310 |
} |
|
| 311 | 304 |
} |
| 312 | 305 |
|
| 313 | 306 |
void WidgetRepairAndUnpack::unpackMessageReceived(QString collection_name, QString filename, QString message) |
| ... | ... | |
| 332 | 325 |
ui->treeWidget->scrollToBottom(); |
| 333 | 326 |
} |
| 334 | 327 |
|
| 328 |
void WidgetRepairAndUnpack::unpackSuccess(QString collection_name, QString filename) |
|
| 329 |
{
|
|
| 330 |
QTreeWidgetItem *collection_item = NULL; |
|
| 331 |
QTreeWidgetItem *file_item = NULL; |
|
| 332 |
|
|
| 333 |
lookupCollectionAndFilename(collection_name, filename, &collection_item, &file_item); |
|
| 334 |
|
|
| 335 |
collection_item->setText(FIELD_PROGRESS, "100"); |
|
| 336 |
collection_item->setText(FIELD_PROGRESS_STR, tr("Unpack completed"));
|
|
| 337 |
file_item->setText(FIELD_PROGRESS, "100"); |
|
| 338 |
file_item->setText(FIELD_PROGRESS_STR, tr("Unpack completed"));
|
|
| 339 |
} |
|
| 340 |
|
|
| 341 |
void WidgetRepairAndUnpack::unpackFailure(QString collection_name, QString filename, QString reason) |
|
| 342 |
{
|
|
| 343 |
QTreeWidgetItem *collection_item = NULL; |
|
| 344 |
QTreeWidgetItem *file_item = NULL; |
|
| 345 |
|
|
| 346 |
lookupCollectionAndFilename(collection_name, filename, &collection_item, &file_item); |
|
| 347 |
|
|
| 348 |
collection_item->setText(FIELD_PROGRESS, "100"); |
|
| 349 |
collection_item->setText(FIELD_PROGRESS_STR, tr("Unpack failed due to an error"));
|
|
| 350 |
file_item->setText(FIELD_PROGRESS, "100"); |
|
| 351 |
file_item->setText(FIELD_PROGRESS_STR, tr("Unpack failed due to an error: ") + reason);
|
|
| 352 |
} |
|
| 353 |
|
|
| 335 | 354 |
void WidgetRepairAndUnpack::configChanged() |
| 336 | 355 |
{
|
| 337 | 356 |
this->opts = glue->configGetOpts(); |
| ... | ... | |
| 366 | 385 |
unpackMessageReceived(values[0], values[1], values[2]); |
| 367 | 386 |
} else if (event_name == "unpack_working_archive_changed") {
|
| 368 | 387 |
unpackWorkingArchiveChanged(values[0], values[1], values[2]); |
| 388 |
} else if (event_name == "unpack_success") {
|
|
| 389 |
unpackSuccess(values[0], values[1]); |
|
| 390 |
} else if (event_name == "unpack_failure") {
|
|
| 391 |
unpackFailure(values[0], values[1], values[2]); |
|
| 369 | 392 |
} else {
|
| 370 | 393 |
qWarning(QString("Unknown plugin event received from plugin '%1': %2").arg(plugin_name, event_name).toUtf8());
|
| 371 | 394 |
} |
Also available in: Unified diff
NNTPGrab

