mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-12-28 02:38:17 +03:00
Merge pull request #19334 from glassez/v4.6
Backport changes in v4.6.x branch
This commit is contained in:
commit
938adca47d
3 changed files with 29 additions and 24 deletions
|
@ -455,8 +455,6 @@ MainWindow::MainWindow(IGUIApplication *app, WindowState initialState)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
m_propertiesWidget->readSettings();
|
|
||||||
|
|
||||||
const bool isFiltersSidebarVisible = pref->isFiltersSidebarVisible();
|
const bool isFiltersSidebarVisible = pref->isFiltersSidebarVisible();
|
||||||
m_ui->actionShowFiltersSidebar->setChecked(isFiltersSidebarVisible);
|
m_ui->actionShowFiltersSidebar->setChecked(isFiltersSidebarVisible);
|
||||||
if (isFiltersSidebarVisible)
|
if (isFiltersSidebarVisible)
|
||||||
|
@ -1092,6 +1090,12 @@ void MainWindow::showEvent(QShowEvent *e)
|
||||||
{
|
{
|
||||||
// preparations before showing the window
|
// preparations before showing the window
|
||||||
|
|
||||||
|
if (m_neverShown)
|
||||||
|
{
|
||||||
|
m_propertiesWidget->readSettings();
|
||||||
|
m_neverShown = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (currentTabWidget() == m_transferListWidget)
|
if (currentTabWidget() == m_transferListWidget)
|
||||||
m_propertiesWidget->loadDynamicData();
|
m_propertiesWidget->loadDynamicData();
|
||||||
|
|
||||||
|
|
|
@ -202,6 +202,7 @@ private:
|
||||||
QFileSystemWatcher *m_executableWatcher = nullptr;
|
QFileSystemWatcher *m_executableWatcher = nullptr;
|
||||||
// GUI related
|
// GUI related
|
||||||
bool m_posInitialized = false;
|
bool m_posInitialized = false;
|
||||||
|
bool m_neverShown = true;
|
||||||
QPointer<QTabWidget> m_tabs;
|
QPointer<QTabWidget> m_tabs;
|
||||||
QPointer<StatusBar> m_statusBar;
|
QPointer<StatusBar> m_statusBar;
|
||||||
QPointer<OptionsDialog> m_options;
|
QPointer<OptionsDialog> m_options;
|
||||||
|
|
|
@ -577,41 +577,41 @@ Supports the formats: S01E01, 1x1, 2017.12.31 and 31.12.2017 (Date formats also
|
||||||
rulesList[rule].mustNotContain = $('mustNotContainText').value;
|
rulesList[rule].mustNotContain = $('mustNotContainText').value;
|
||||||
rulesList[rule].episodeFilter = $('episodeFilterText').value;
|
rulesList[rule].episodeFilter = $('episodeFilterText').value;
|
||||||
rulesList[rule].smartFilter = $('useSmartFilter').checked;
|
rulesList[rule].smartFilter = $('useSmartFilter').checked;
|
||||||
rulesList[rule].assignedCategory = $('assignCategoryCombobox').value;
|
|
||||||
rulesList[rule].savePath = $('savetoDifferentDir').checked ? $('saveToText').value : '';
|
|
||||||
rulesList[rule].ignoreDays = parseInt($('ignoreDaysValue').value);
|
rulesList[rule].ignoreDays = parseInt($('ignoreDaysValue').value);
|
||||||
|
rulesList[rule].affectedFeeds = rssDownloaderFeedSelectionTable.rows.filter((row) => row.full_data.checked)
|
||||||
|
.map((row) => row.full_data.url)
|
||||||
|
.getValues();
|
||||||
|
|
||||||
|
rulesList[rule].torrentParams.category = $('assignCategoryCombobox').value;
|
||||||
|
rulesList[rule].torrentParams.save_path = $('savetoDifferentDir').checked ? $('saveToText').value : '';
|
||||||
|
|
||||||
switch ($('addPausedCombobox').value) {
|
switch ($('addPausedCombobox').value) {
|
||||||
case 'default':
|
case 'default':
|
||||||
rulesList[rule].addPaused = null;
|
rulesList[rule].torrentParams.stopped = null;
|
||||||
break;
|
break;
|
||||||
case 'always':
|
case 'always':
|
||||||
rulesList[rule].addPaused = true;
|
rulesList[rule].torrentParams.stopped = true;
|
||||||
break;
|
break;
|
||||||
case 'never':
|
case 'never':
|
||||||
rulesList[rule].addPaused = false;
|
rulesList[rule].torrentParams.stopped = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($('contentLayoutCombobox').value) {
|
switch ($('contentLayoutCombobox').value) {
|
||||||
case 'Default':
|
case 'Default':
|
||||||
rulesList[rule].torrentContentLayout = null;
|
rulesList[rule].torrentParams.content_layout = null;
|
||||||
break;
|
break;
|
||||||
case 'Original':
|
case 'Original':
|
||||||
rulesList[rule].torrentContentLayout = 'Original';
|
rulesList[rule].torrentParams.content_layout = 'Original';
|
||||||
break;
|
break;
|
||||||
case 'Subfolder':
|
case 'Subfolder':
|
||||||
rulesList[rule].torrentContentLayout = 'Subfolder';
|
rulesList[rule].torrentParams.content_layout = 'Subfolder';
|
||||||
break;
|
break;
|
||||||
case 'NoSubfolder':
|
case 'NoSubfolder':
|
||||||
rulesList[rule].torrentContentLayout = 'NoSubfolder';
|
rulesList[rule].torrentParams.content_layout = 'NoSubfolder';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
rulesList[rule].affectedFeeds = rssDownloaderFeedSelectionTable.rows.filter((row) => row.full_data.checked)
|
|
||||||
.map((row) => row.full_data.url)
|
|
||||||
.getValues();
|
|
||||||
|
|
||||||
new Request({
|
new Request({
|
||||||
url: 'api/v2/rss/setRule',
|
url: 'api/v2/rss/setRule',
|
||||||
noCache: true,
|
noCache: true,
|
||||||
|
@ -702,8 +702,8 @@ Supports the formats: S01E01, 1x1, 2017.12.31 and 31.12.2017 (Date formats also
|
||||||
$('useSmartFilter').disabled = false;
|
$('useSmartFilter').disabled = false;
|
||||||
$('assignCategoryCombobox').disabled = false;
|
$('assignCategoryCombobox').disabled = false;
|
||||||
$('savetoDifferentDir').disabled = false;
|
$('savetoDifferentDir').disabled = false;
|
||||||
$('savetoDifferentDir').checked = rulesList[ruleName].savePath ? false : true;
|
$('savetoDifferentDir').checked = rulesList[ruleName].torrentParams.save_path ? false : true;
|
||||||
$('saveToText').disabled = rulesList[ruleName].savePath ? false : true;
|
$('saveToText').disabled = rulesList[ruleName].torrentParams.save_path ? false : true;
|
||||||
$('ignoreDaysValue').disabled = false;
|
$('ignoreDaysValue').disabled = false;
|
||||||
$('addPausedCombobox').disabled = false;
|
$('addPausedCombobox').disabled = false;
|
||||||
$('contentLayoutCombobox').disabled = false;
|
$('contentLayoutCombobox').disabled = false;
|
||||||
|
@ -715,9 +715,9 @@ Supports the formats: S01E01, 1x1, 2017.12.31 and 31.12.2017 (Date formats also
|
||||||
$('episodeFilterText').value = rulesList[ruleName].episodeFilter;
|
$('episodeFilterText').value = rulesList[ruleName].episodeFilter;
|
||||||
$('useSmartFilter').checked = rulesList[ruleName].smartFilter;
|
$('useSmartFilter').checked = rulesList[ruleName].smartFilter;
|
||||||
|
|
||||||
$('assignCategoryCombobox').value = rulesList[ruleName].assignedCategory ? rulesList[ruleName].assignedCategory : 'default';
|
$('assignCategoryCombobox').value = rulesList[ruleName].torrentParams.category ? rulesList[ruleName].torrentParams.category : 'default';
|
||||||
$('savetoDifferentDir').checked = rulesList[ruleName].savePath !== '';
|
$('savetoDifferentDir').checked = rulesList[ruleName].torrentParams.save_path !== '';
|
||||||
$('saveToText').value = rulesList[ruleName].savePath;
|
$('saveToText').value = rulesList[ruleName].torrentParams.save_path;
|
||||||
$('ignoreDaysValue').value = rulesList[ruleName].ignoreDays;
|
$('ignoreDaysValue').value = rulesList[ruleName].ignoreDays;
|
||||||
|
|
||||||
// calculate days since last match
|
// calculate days since last match
|
||||||
|
@ -730,15 +730,15 @@ Supports the formats: S01E01, 1x1, 2017.12.31 and 31.12.2017 (Date formats also
|
||||||
$('lastMatchText').textContent = 'QBT_TR(Last Match: Unknown)QBT_TR[CONTEXT=AutomatedRssDownloader]';
|
$('lastMatchText').textContent = 'QBT_TR(Last Match: Unknown)QBT_TR[CONTEXT=AutomatedRssDownloader]';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rulesList[ruleName].addPaused === null)
|
if (rulesList[ruleName].torrentParams.stopped === null)
|
||||||
$('addPausedCombobox').value = 'default';
|
$('addPausedCombobox').value = 'default';
|
||||||
else
|
else
|
||||||
$('addPausedCombobox').value = rulesList[ruleName].addPaused ? 'always' : 'never';
|
$('addPausedCombobox').value = rulesList[ruleName].torrentParams.stopped ? 'always' : 'never';
|
||||||
|
|
||||||
if (rulesList[ruleName].torrentContentLayout === null)
|
if (rulesList[ruleName].torrentParams.content_layout === null)
|
||||||
$('contentLayoutCombobox').value = 'Default';
|
$('contentLayoutCombobox').value = 'Default';
|
||||||
else
|
else
|
||||||
$('contentLayoutCombobox').value = rulesList[ruleName].torrentContentLayout;
|
$('contentLayoutCombobox').value = rulesList[ruleName].torrentParams.content_layout;
|
||||||
|
|
||||||
setElementTitles();
|
setElementTitles();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue