diff options
author | Jan Holthuis <jan.holthuis@ruhr-uni-bochum.de> | 2020-04-15 11:09:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-15 11:09:22 +0200 |
commit | 1acfda2e1ab3f5fea51036b67a58e0928716b544 (patch) | |
tree | a09ab5558c1ff53b23a0050e636b120a801d77de /src/library/dlganalysis.cpp | |
parent | 84f73984ab786cc5b13133e035e36662eb6418b6 (diff) | |
parent | 5599cd348bb73c12d08eeb5b9635c83d5e3a972d (diff) |
Merge pull request #2628 from ronso0/lib-button-states
fix GUI states of Library feature buttons
Diffstat (limited to 'src/library/dlganalysis.cpp')
-rw-r--r-- | src/library/dlganalysis.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/library/dlganalysis.cpp b/src/library/dlganalysis.cpp index 01007b8ccc..bd1b064112 100644 --- a/src/library/dlganalysis.cpp +++ b/src/library/dlganalysis.cpp @@ -59,15 +59,14 @@ DlgAnalysis::DlgAnalysis(WLibrary* parent, &QRadioButton::clicked, this, &DlgAnalysis::showAllSongs); - - // TODO(rryan): This triggers a library search before the UI has even - // started up. Accounts for 0.2% of skin creation time. Get rid of this! - radioButtonRecentlyAdded->click(); + // Don't click those radio buttons now reduce skin loading time. + // 'RecentlyAdded' is clicked in onShow() connect(pushButtonAnalyze, &QPushButton::clicked, this, &DlgAnalysis::analyze); + pushButtonAnalyze->setEnabled(false); connect(pushButtonSelectAll, &QPushButton::clicked, @@ -96,6 +95,10 @@ DlgAnalysis::DlgAnalysis(WLibrary* parent, } void DlgAnalysis::onShow() { + if (!radioButtonRecentlyAdded->isChecked() && + !radioButtonAllSongs->isChecked()) { + radioButtonRecentlyAdded->click(); + } // Refresh table // There might be new tracks dropped to other views m_pAnalysisLibraryTableModel->select(); @@ -170,10 +173,11 @@ void DlgAnalysis::slotAnalysisActive(bool bActive) { //qDebug() << this << "slotAnalysisActive" << bActive; m_bAnalysisActive = bActive; if (bActive) { - pushButtonAnalyze->setEnabled(true); + pushButtonAnalyze->setChecked(true); pushButtonAnalyze->setText(tr("Stop Analysis")); labelProgress->setEnabled(true); } else { + pushButtonAnalyze->setChecked(false); pushButtonAnalyze->setText(tr("Analyze")); labelProgress->setText(""); labelProgress->setEnabled(false); |