add config for transfer timeout
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
5cf7466e4c
commit
6078a771c1
@ -559,6 +559,7 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv)
|
||||
|
||||
m_settings->registerSetting("NumberOfConcurrentTasks", 10);
|
||||
m_settings->registerSetting("NumberOfConcurrentDownloads", 6);
|
||||
m_settings->registerSetting("DownlodTransferTimeout", 60);
|
||||
|
||||
QString defaultMonospace;
|
||||
int defaultSize = 11;
|
||||
@ -949,8 +950,7 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv)
|
||||
[[fallthrough]];
|
||||
default: {
|
||||
qDebug() << "Exiting because update lockfile is present";
|
||||
QMetaObject::invokeMethod(
|
||||
this, []() { exit(1); }, Qt::QueuedConnection);
|
||||
QMetaObject::invokeMethod(this, []() { exit(1); }, Qt::QueuedConnection);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -982,8 +982,7 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv)
|
||||
[[fallthrough]];
|
||||
default: {
|
||||
qDebug() << "Exiting because update lockfile is present";
|
||||
QMetaObject::invokeMethod(
|
||||
this, []() { exit(1); }, Qt::QueuedConnection);
|
||||
QMetaObject::invokeMethod(this, []() { exit(1); }, Qt::QueuedConnection);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -1671,8 +1670,7 @@ QString Application::getJarPath(QString jarFile)
|
||||
#if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) || defined(Q_OS_OPENBSD)
|
||||
FS::PathCombine(m_rootPath, "share", BuildConfig.LAUNCHER_NAME),
|
||||
#endif
|
||||
FS::PathCombine(m_rootPath, "jars"),
|
||||
FS::PathCombine(applicationDirPath(), "jars"),
|
||||
FS::PathCombine(m_rootPath, "jars"), FS::PathCombine(applicationDirPath(), "jars"),
|
||||
FS::PathCombine(applicationDirPath(), "..", "jars") // from inside build dir, for debuging
|
||||
};
|
||||
for (QString p : potentialPaths) {
|
||||
|
@ -106,7 +106,11 @@ void NetRequest::executeTask()
|
||||
}
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
|
||||
#if defined(LAUNCHER_APPLICATION)
|
||||
request.setTransferTimeout(APPLICATION->settings()->get("DownlodTransferTimeout").toInt() * 1000);
|
||||
#else
|
||||
request.setTransferTimeout();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
m_last_progress_time = m_clock.now();
|
||||
|
@ -191,6 +191,7 @@ void LauncherPage::applySettings()
|
||||
|
||||
s->set("NumberOfConcurrentTasks", ui->numberOfConcurrentTasksSpinBox->value());
|
||||
s->set("NumberOfConcurrentDownloads", ui->numberOfConcurrentDownloadsSpinBox->value());
|
||||
s->set("DownlodTransferTimeout", ui->timeoutSecondsSpinBox->value());
|
||||
|
||||
// Console settings
|
||||
s->set("ShowConsole", ui->showConsoleCheck->isChecked());
|
||||
@ -245,6 +246,7 @@ void LauncherPage::loadSettings()
|
||||
|
||||
ui->numberOfConcurrentTasksSpinBox->setValue(s->get("NumberOfConcurrentTasks").toInt());
|
||||
ui->numberOfConcurrentDownloadsSpinBox->setValue(s->get("NumberOfConcurrentDownloads").toInt());
|
||||
ui->timeoutSecondsSpinBox->setValue(s->get("DownlodTransferTimeout").toInt());
|
||||
|
||||
// Console settings
|
||||
ui->showConsoleCheck->setChecked(s->get("ShowConsole").toBool());
|
||||
|
@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>511</width>
|
||||
<height>629</height>
|
||||
<height>691</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@ -205,6 +205,13 @@
|
||||
<string>Miscellaneous</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="1">
|
||||
<widget class="QSpinBox" name="numberOfConcurrentDownloadsSpinBox">
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="numberOfConcurrentTasksLabel">
|
||||
<property name="text">
|
||||
@ -226,10 +233,20 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QSpinBox" name="numberOfConcurrentDownloadsSpinBox">
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="timeoutSecondsLabel">
|
||||
<property name="toolTip">
|
||||
<string>Seconds to wait until the requests are terminated</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Transfer timeout</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QSpinBox" name="timeoutSecondsSpinBox">
|
||||
<property name="suffix">
|
||||
<string>s</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
Loading…
Reference in New Issue
Block a user