Browse Source

- BUGFIX: Provide more helpful explanation when an I/O error occured

adaptive-webui-19844
Christophe Dumez 16 years ago
parent
commit
65c4da6f0e
  1. 1
      Changelog
  2. 6
      src/GUI.cpp
  3. 2
      src/GUI.h
  4. 2
      src/bittorrent.cpp
  5. 2
      src/bittorrent.h

1
Changelog

@ -3,6 +3,7 @@ @@ -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

6
src/GUI.cpp

@ -132,7 +132,7 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis @@ -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 { @@ -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();

2
src/GUI.h

@ -139,7 +139,7 @@ class GUI : public QMainWindow, private Ui::MainWindow{ @@ -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

2
src/bittorrent.cpp

@ -1182,7 +1182,7 @@ void bittorrent::readAlerts() { @@ -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<listen_failed_alert*>(a.get())) {
// Level: fatal

2
src/bittorrent.h

@ -178,7 +178,7 @@ class bittorrent : public QObject { @@ -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);

Loading…
Cancel
Save