From 567502189572868987faaa0884fe3b6de2179728 Mon Sep 17 00:00:00 2001 From: thalieht Date: Thu, 26 Jan 2017 21:01:19 +0200 Subject: [PATCH] enable RSS, Search and Execution Log widgets before switching to them via hotkeys --- src/gui/mainwindow.cpp | 30 +++++++++++++++++++++--------- src/gui/mainwindow.h | 6 +++--- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index de9e2abb6..0b873443d 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -795,22 +795,34 @@ void MainWindow::displayTransferTab() const m_tabs->setCurrentWidget(m_transferListWidget); } -void MainWindow::displaySearchTab() const +void MainWindow::displaySearchTab() { - if (m_searchWidget) - m_tabs->setCurrentWidget(m_searchWidget); + if (!m_searchWidget) { + m_ui->actionSearchWidget->setChecked(true); + displaySearchTab(true); + } + + m_tabs->setCurrentWidget(m_searchWidget); } -void MainWindow::displayRSSTab() const +void MainWindow::displayRSSTab() { - if (m_rssWidget) - m_tabs->setCurrentWidget(m_rssWidget); + if (!m_rssWidget) { + m_ui->actionRSSReader->setChecked(true); + displayRSSTab(true); + } + + m_tabs->setCurrentWidget(m_rssWidget); } -void MainWindow::displayExecutionLogTab() const +void MainWindow::displayExecutionLogTab() { - if (m_executionLog) - m_tabs->setCurrentWidget(m_executionLog); + if (!m_executionLog) { + m_ui->actionExecutionLogs->setChecked(true); + on_actionExecutionLogs_triggered(true); + } + + m_tabs->setCurrentWidget(m_executionLog); } // End of keyboard shortcuts slots diff --git a/src/gui/mainwindow.h b/src/gui/mainwindow.h index 84955911c..954e494b3 100644 --- a/src/gui/mainwindow.h +++ b/src/gui/mainwindow.h @@ -124,9 +124,9 @@ private slots: // Keyboard shortcuts void createKeyboardShortcuts(); void displayTransferTab() const; - void displaySearchTab() const; - void displayRSSTab() const; - void displayExecutionLogTab() const; + void displaySearchTab(); + void displayRSSTab(); + void displayExecutionLogTab(); void focusSearchFilter(); void updateGUI(); void loadPreferences(bool configureSession = true);