Merge pull request #2415 from Trial97/configure_timeout
Add config for transfer timeout
This commit is contained in:
commit
fc445078cd
@ -559,6 +559,7 @@ Application::Application(int& argc, char** argv) : QApplication(argc, argv)
|
|||||||
|
|
||||||
m_settings->registerSetting("NumberOfConcurrentTasks", 10);
|
m_settings->registerSetting("NumberOfConcurrentTasks", 10);
|
||||||
m_settings->registerSetting("NumberOfConcurrentDownloads", 6);
|
m_settings->registerSetting("NumberOfConcurrentDownloads", 6);
|
||||||
|
m_settings->registerSetting("RequestTimeout", 60);
|
||||||
|
|
||||||
QString defaultMonospace;
|
QString defaultMonospace;
|
||||||
int defaultSize = 11;
|
int defaultSize = 11;
|
||||||
|
@ -107,7 +107,11 @@ void NetRequest::executeTask()
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
|
||||||
|
#if defined(LAUNCHER_APPLICATION)
|
||||||
|
request.setTransferTimeout(APPLICATION->settings()->get("RequestTimeout").toInt() * 1000);
|
||||||
|
#else
|
||||||
request.setTransferTimeout();
|
request.setTransferTimeout();
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
m_last_progress_time = m_clock.now();
|
m_last_progress_time = m_clock.now();
|
||||||
|
@ -203,6 +203,7 @@ void LauncherPage::applySettings()
|
|||||||
|
|
||||||
s->set("NumberOfConcurrentTasks", ui->numberOfConcurrentTasksSpinBox->value());
|
s->set("NumberOfConcurrentTasks", ui->numberOfConcurrentTasksSpinBox->value());
|
||||||
s->set("NumberOfConcurrentDownloads", ui->numberOfConcurrentDownloadsSpinBox->value());
|
s->set("NumberOfConcurrentDownloads", ui->numberOfConcurrentDownloadsSpinBox->value());
|
||||||
|
s->set("RequestTimeout", ui->timeoutSecondsSpinBox->value());
|
||||||
|
|
||||||
// Console settings
|
// Console settings
|
||||||
s->set("ShowConsole", ui->showConsoleCheck->isChecked());
|
s->set("ShowConsole", ui->showConsoleCheck->isChecked());
|
||||||
@ -259,6 +260,7 @@ void LauncherPage::loadSettings()
|
|||||||
|
|
||||||
ui->numberOfConcurrentTasksSpinBox->setValue(s->get("NumberOfConcurrentTasks").toInt());
|
ui->numberOfConcurrentTasksSpinBox->setValue(s->get("NumberOfConcurrentTasks").toInt());
|
||||||
ui->numberOfConcurrentDownloadsSpinBox->setValue(s->get("NumberOfConcurrentDownloads").toInt());
|
ui->numberOfConcurrentDownloadsSpinBox->setValue(s->get("NumberOfConcurrentDownloads").toInt());
|
||||||
|
ui->timeoutSecondsSpinBox->setValue(s->get("RequestTimeout").toInt());
|
||||||
|
|
||||||
// Console settings
|
// Console settings
|
||||||
ui->showConsoleCheck->setChecked(s->get("ShowConsole").toBool());
|
ui->showConsoleCheck->setChecked(s->get("ShowConsole").toBool());
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>511</width>
|
<width>511</width>
|
||||||
<height>629</height>
|
<height>691</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@ -252,6 +252,13 @@
|
|||||||
<string>Miscellaneous</string>
|
<string>Miscellaneous</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<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">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="numberOfConcurrentTasksLabel">
|
<widget class="QLabel" name="numberOfConcurrentTasksLabel">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -273,10 +280,20 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="2" column="0">
|
||||||
<widget class="QSpinBox" name="numberOfConcurrentDownloadsSpinBox">
|
<widget class="QLabel" name="timeoutSecondsLabel">
|
||||||
<property name="minimum">
|
<property name="toolTip">
|
||||||
<number>1</number>
|
<string>Seconds to wait until the requests are terminated</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Timeout for HTTP requests</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QSpinBox" name="timeoutSecondsSpinBox">
|
||||||
|
<property name="suffix">
|
||||||
|
<string>s</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
Loading…
Reference in New Issue
Block a user