diff --git a/Changelog b/Changelog index 6ac40feae..8a522af82 100644 --- a/Changelog +++ b/Changelog @@ -3,6 +3,7 @@ - FEATURE: Display total amount of uploaded data in finished list - FEATURE: Resizing a column in a search results tab affects all tabs - FEATURE: Search results tab columns are now remembered upon startup + - BUGFIX: Provide more helpful explanation when an I/O error occured - COSMETIC: Redesigned program preferences - COSMETIC: Updated icons set diff --git a/src/GUI.cpp b/src/GUI.cpp index 33e45fdb4..59e068dc0 100644 --- a/src/GUI.cpp +++ b/src/GUI.cpp @@ -132,7 +132,7 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis options = new options_imp(this); connect(options, SIGNAL(status_changed(bool)), this, SLOT(OptionsSaved(bool))); BTSession = new bittorrent(); - connect(BTSession, SIGNAL(fullDiskError(QTorrentHandle&)), this, SLOT(fullDiskError(QTorrentHandle&))); + connect(BTSession, SIGNAL(fullDiskError(QTorrentHandle&, QString)), this, SLOT(fullDiskError(QTorrentHandle&, QString))); connect(BTSession, SIGNAL(finishedTorrent(QTorrentHandle&)), this, SLOT(finishedTorrent(QTorrentHandle&))); connect(BTSession, SIGNAL(addedTorrent(QTorrentHandle&)), this, SLOT(addedTorrent(QTorrentHandle&))); connect(BTSession, SIGNAL(pausedTorrent(QTorrentHandle&)), this, SLOT(pausedTorrent(QTorrentHandle&))); @@ -418,11 +418,11 @@ void GUI::checkedTorrent(QTorrentHandle& h) const { } // Notification when disk is full -void GUI::fullDiskError(QTorrentHandle& h) const { +void GUI::fullDiskError(QTorrentHandle& h, QString msg) const { QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); bool useNotificationBalloons = settings.value(QString::fromUtf8("Preferences/General/NotificationBaloons"), true).toBool(); if(systrayIntegration && useNotificationBalloons) { - myTrayIcon->showMessage(tr("I/O Error", "i.e: Input/Output Error"), tr("An error occured when trying to read or write %1. The disk is probably full, download has been paused", "e.g: An error occured when trying to read or write xxx.avi. The disk is probably full, download has been paused").arg(h.name()), QSystemTrayIcon::Critical, TIME_TRAY_BALLOON); + myTrayIcon->showMessage(tr("I/O Error", "i.e: Input/Output Error"), tr("An I/O error occured for torrent %1.\n Reason: %2", "e.g: An error occured for torrent xxx.avi.\n Reason: disk is full.").arg(h.name()).arg(msg), QSystemTrayIcon::Critical, TIME_TRAY_BALLOON); } // Download will be paused by libtorrent. Updating GUI information accordingly QString hash = h.hash(); diff --git a/src/GUI.h b/src/GUI.h index 71c01d170..42955cce6 100644 --- a/src/GUI.h +++ b/src/GUI.h @@ -139,7 +139,7 @@ class GUI : public QMainWindow, private Ui::MainWindow{ void createTrayIcon(); void updateUnfinishedTorrentNumber(unsigned int nb); void updateFinishedTorrentNumber(unsigned int nb); - void fullDiskError(QTorrentHandle& h) const; + void fullDiskError(QTorrentHandle& h, QString msg) const; void handleDownloadFromUrlFailure(QString, QString) const; void createSystrayDelayed(); // Keyboard shortcuts diff --git a/src/bittorrent.cpp b/src/bittorrent.cpp index bc66c5efc..fd43d8489 100644 --- a/src/bittorrent.cpp +++ b/src/bittorrent.cpp @@ -1182,7 +1182,7 @@ void bittorrent::readAlerts() { h.auto_managed(false); std::cerr << "File Error: " << p->message().c_str() << std::endl; if(h.is_valid()) - emit fullDiskError(h); + emit fullDiskError(h, misc::toQString(p->message())); } else if (dynamic_cast(a.get())) { // Level: fatal diff --git a/src/bittorrent.h b/src/bittorrent.h index 1a0d43261..b8ce1fef3 100644 --- a/src/bittorrent.h +++ b/src/bittorrent.h @@ -178,7 +178,7 @@ class bittorrent : public QObject { void pausedTorrent(QTorrentHandle& h); void resumedTorrent(QTorrentHandle& h); void finishedTorrent(QTorrentHandle& h); - void fullDiskError(QTorrentHandle& h); + void fullDiskError(QTorrentHandle& h, QString msg); void trackerError(QString hash, QString time, QString msg); void trackerAuthenticationRequired(QTorrentHandle& h); void newDownloadedTorrent(QString path, QString url);