|
|
@ -56,7 +56,7 @@ namespace fs = boost::filesystem; |
|
|
|
*****************************************************/ |
|
|
|
*****************************************************/ |
|
|
|
|
|
|
|
|
|
|
|
// Constructor
|
|
|
|
// Constructor
|
|
|
|
GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), force_exit(false) { |
|
|
|
GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), displaySpeedInTitle(false), force_exit(false) { |
|
|
|
setupUi(this); |
|
|
|
setupUi(this); |
|
|
|
setWindowTitle(tr("qBittorrent %1", "e.g: qBittorrent v0.x").arg(QString::fromUtf8(VERSION))); |
|
|
|
setWindowTitle(tr("qBittorrent %1", "e.g: qBittorrent v0.x").arg(QString::fromUtf8(VERSION))); |
|
|
|
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); |
|
|
|
QSettings settings(QString::fromUtf8("qBittorrent"), QString::fromUtf8("qBittorrent")); |
|
|
@ -788,8 +788,10 @@ void GUI::processDownloadedFiles(QString path, QString url) { |
|
|
|
// Set BT session configuration
|
|
|
|
// Set BT session configuration
|
|
|
|
void GUI::configureSession(bool deleteOptions) { |
|
|
|
void GUI::configureSession(bool deleteOptions) { |
|
|
|
qDebug("Configuring session"); |
|
|
|
qDebug("Configuring session"); |
|
|
|
|
|
|
|
// General
|
|
|
|
|
|
|
|
displaySpeedInTitle = options->speedInTitleBar(); |
|
|
|
// Downloads
|
|
|
|
// Downloads
|
|
|
|
// Save path
|
|
|
|
// * Save path
|
|
|
|
BTSession->setDefaultSavePath(options->getSavePath()); |
|
|
|
BTSession->setDefaultSavePath(options->getSavePath()); |
|
|
|
BTSession->preAllocateAllFiles(options->preAllocateAllFiles()); |
|
|
|
BTSession->preAllocateAllFiles(options->preAllocateAllFiles()); |
|
|
|
BTSession->startTorrentsInPause(options->addTorrentsInPause()); |
|
|
|
BTSession->startTorrentsInPause(options->addTorrentsInPause()); |
|
|
@ -1146,6 +1148,11 @@ void GUI::updateLists() { |
|
|
|
default: |
|
|
|
default: |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if(displaySpeedInTitle) { |
|
|
|
|
|
|
|
QString dl_rate = QByteArray::number(BTSession->getSessionStatus().payload_download_rate, 'f', 1); |
|
|
|
|
|
|
|
QString up_rate = QByteArray::number(BTSession->getSessionStatus().payload_upload_rate, 'f', 1); |
|
|
|
|
|
|
|
setWindowTitle(tr("qBittorrent %1 (DL: %2KiB/s, UP: %3KiB/s)", "%1 is qBittorrent version").arg(QString::fromUtf8(VERSION)).arg(dl_rate).arg(up_rate)); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Called when a tracker requires authentication
|
|
|
|
// Called when a tracker requires authentication
|
|
|
|