MessageBoxRaised::critical(0,tr("I/O Error"),tr("The torrent file '%1' does not exist.").arg(Utils::Fs::toNativePath(m_filePath)));
MessageBoxRaised::critical(this,tr("I/O Error"),tr("The torrent file '%1' does not exist.").arg(Utils::Fs::toNativePath(m_filePath)));
returnfalse;
returnfalse;
}
}
QFileInfofileinfo(m_filePath);
QFileInfofileinfo(m_filePath);
if(!fileinfo.isReadable()){
if(!fileinfo.isReadable()){
MessageBoxRaised::critical(0,tr("I/O Error"),tr("The torrent file '%1' cannot be read from the disk. Probably you don't have enough permissions.").arg(Utils::Fs::toNativePath(m_filePath)));
MessageBoxRaised::critical(this,tr("I/O Error"),tr("The torrent file '%1' cannot be read from the disk. Probably you don't have enough permissions.").arg(Utils::Fs::toNativePath(m_filePath)));
MessageBoxRaised::critical(0,tr("Invalid torrent"),tr("Failed to load the torrent: %1.\nError: %2","Don't remove the '\n' characters. They insert a newline.").arg(Utils::Fs::toNativePath(m_filePath)).arg(error));
MessageBoxRaised::critical(this,tr("Invalid torrent"),tr("Failed to load the torrent: %1.\nError: %2","Don't remove the '\n' characters. They insert a newline.").arg(Utils::Fs::toNativePath(m_filePath)).arg(error));
MessageBoxRaised::critical(0,tr("Already in download list"),tr("Torrent is already in download list. Trackers weren't merged because it is a private torrent."),QMessageBox::Ok);
MessageBoxRaised::critical(this,tr("Already in download list"),tr("Torrent is already in download list. Trackers weren't merged because it is a private torrent."),QMessageBox::Ok);
}
}
else{
else{
torrent->addTrackers(m_torrentInfo.trackers());
torrent->addTrackers(m_torrentInfo.trackers());
torrent->addUrlSeeds(m_torrentInfo.urlSeeds());
torrent->addUrlSeeds(m_torrentInfo.urlSeeds());
MessageBoxRaised::information(0,tr("Already in download list"),tr("Torrent is already in download list. Trackers were merged."),QMessageBox::Ok);
MessageBoxRaised::information(this,tr("Already in download list"),tr("Torrent is already in download list. Trackers were merged."),QMessageBox::Ok);
}
}
}
}
else{
else{
MessageBoxRaised::critical(0,tr("Cannot add torrent"),tr("Cannot add this torrent. Perhaps it is already in adding state."),QMessageBox::Ok);
MessageBoxRaised::critical(this,tr("Cannot add torrent"),tr("Cannot add this torrent. Perhaps it is already in adding state."),QMessageBox::Ok);
MessageBoxRaised::critical(0,tr("Already in download list"),tr("Torrent is already in download list. Trackers weren't merged because it is a private torrent."),QMessageBox::Ok);
MessageBoxRaised::critical(this,tr("Already in download list"),tr("Torrent is already in download list. Trackers weren't merged because it is a private torrent."),QMessageBox::Ok);
}
}
else{
else{
torrent->addTrackers(magnetUri.trackers());
torrent->addTrackers(magnetUri.trackers());
torrent->addUrlSeeds(magnetUri.urlSeeds());
torrent->addUrlSeeds(magnetUri.urlSeeds());
MessageBoxRaised::information(0,tr("Already in download list"),tr("Magnet link is already in download list. Trackers were merged."),QMessageBox::Ok);
MessageBoxRaised::information(this,tr("Already in download list"),tr("Magnet link is already in download list. Trackers were merged."),QMessageBox::Ok);
}
}
}
}
else{
else{
MessageBoxRaised::critical(0,tr("Cannot add torrent"),tr("Cannot add this torrent. Perhaps it is already in adding."),QMessageBox::Ok);
MessageBoxRaised::critical(this,tr("Cannot add torrent"),tr("Cannot add this torrent. Perhaps it is already in adding."),QMessageBox::Ok);