diff --git a/res/skins/Deere/style.qss b/res/skins/Deere/style.qss index d4dff089bf0..7aff59fca04 100644 --- a/res/skins/Deere/style.qss +++ b/res/skins/Deere/style.qss @@ -583,15 +583,6 @@ WLibrary QRadioButton::indicator:unchecked { #DlgAnalysis > QPushButton:focus, #fadeModeCombobox:focus, #DlgAutoDJ QSpinBox:focus { - border: 1px solid #bbb; - outline: none; -} -#DlgMissing > QPushButton:checked:focus, -#DlgHidden > QPushButton:checked:focus, -#DlgAutoDJ > QPushButton:checked:focus, -#DlgRecording > QPushButton:checked:focus, -#DlgAnalysis > QPushButton:checked:focus { - border: 1px solid #d2d2d2; outline: none; } @@ -656,6 +647,25 @@ QPushButton#pushButtonRepeatPlaylist { } /* AutoDJ button icons */ +/* Recording info */ +#labelRecPrefix, +#labelRecFilename, +#labelRecStatistics { + text-transform: none; + padding: 3px 0px 0px 0px; + margin: 0px; +} +#labelRecPrefix { + margin-left: 3px; +} +#labelRecFilename { + font-weight: bold; +} +#labelRecPrefix, +#labelRecStatistics { + font-weight: normal; +} + /* Scroll bars */ #LibraryContainer QScrollBar:horizontal, WEffectSelector QAbstractScrollArea QScrollBar:horizontal, @@ -811,6 +821,7 @@ WLibrary QLabel, WLibrary QPushButton { font-family: "Open Sans"; font-size: 12px; + font-weight: bold; text-transform: uppercase; } diff --git a/res/skins/LateNight/style.qss b/res/skins/LateNight/style.qss index 97c0a547b37..cf6848a6201 100644 --- a/res/skins/LateNight/style.qss +++ b/res/skins/LateNight/style.qss @@ -506,18 +506,6 @@ QHeaderView::down-arrow { #DlgAutoDJ > QPushButton:focus, #DlgRecording > QPushButton:focus, #DlgAnalysis > QPushButton:focus { - border-width: 2px 2px 2px 2px; - border-image: url(skin:buttons_classic/btn_embedded_library.svg) 2 2 2 2; - outline: none; - } - #DlgAnalysis > QPushButton:checked:focus, - #DlgMissing > QPushButton:checked:focus, - #DlgHidden > QPushButton:checked:focus, - #DlgAutoDJ > QPushButton:checked:focus, - #DlgRecording > QPushButton:checked:focus, - #DlgAnalysis > QPushButton:checked:focus { - border-width: 2px 2px 2px 2px; - border-image: url(skin:buttons_classic/btn_embedded_library_active.svg) 2 2 2 2; outline: none; } #DlgMissing > QPushButton:pressed, @@ -525,7 +513,7 @@ QHeaderView::down-arrow { #DlgAutoDJ > QPushButton:pressed, #DlgRecording > QPushButton:pressed, #DlgAnalysis > QPushButton:pressed { - border-image: url(skin:buttons_classic/btn_embedded_library_pressed.svg) 2 2 2 2; + border-image: url(skin:buttons_classic/btn_embedded_library_active.svg) 2 2 2 2; color: #d2d2d2; } #DlgMissing > QPushButton:!enabled, @@ -2340,7 +2328,8 @@ WLibrary QRadioButton { } /* Additional space for QLabels */ -WLibrary QLabel { +#DlgAnalysis QLabel, +#DlgAutoDJ QLabel { margin: 2px 5px 5px 1px; } @@ -2361,7 +2350,7 @@ WLibrary QRadioButton::indicator:unchecked { #DlgAutoDJ > QPushButton, #DlgRecording > QPushButton, #DlgAnalysis > QPushButton { - margin: 0px 4px 3px 2px; + margin: 0px 6px 3px 0px; padding: 0px; height: 20px; } @@ -2371,12 +2360,10 @@ WLibrary QRadioButton::indicator:unchecked { #DlgAnalysis > QPushButton { padding: 0px 5px; } - /* Focus highlight is set via border-image at the top */ - /* Space in between 'Enable AutoDJ' and transition time spinbox */ QPushButton#pushButtonAutoDJ { - margin-left: 0px; min-width: 40px; } + /* Space in between 'Enable AutoDJ' and transition time spinbox */ #DlgAutoDJ > #horizontalSpacer { width: 100px; } @@ -2389,7 +2376,20 @@ WLibrary QRadioButton::indicator:unchecked { margin-left: 12px; } - +#labelRecPrefix, +#labelRecFilename, +#labelRecStatistics { + text-transform: none; + font-size: 13px; + padding: 0px 0px 3px 0px; + } + #labelRecFilename { + font-weight: bold; + } + #labelRecPrefix, + #labelRecStatistics { + font-weight: normal; + } #LibraryContainer QTreeView { show-decoration-selected: 0; diff --git a/res/skins/Shade/style.qss b/res/skins/Shade/style.qss index 623624f6b90..eff839f55df 100644 --- a/res/skins/Shade/style.qss +++ b/res/skins/Shade/style.qss @@ -810,6 +810,14 @@ QPushButton#pushButtonRepeatPlaylist { } /* AutoDJ button icons */ +#labelRecFilename { + font-weight: bold; +} +#labelRecPrefix, +#labelRecStatistics { + font-weight: normal; +} + #HotcueButton { background-color: #aab2b7; } diff --git a/res/skins/Tango/style.qss b/res/skins/Tango/style.qss index fd41769564f..0dd35b54182 100644 --- a/res/skins/Tango/style.qss +++ b/res/skins/Tango/style.qss @@ -2766,13 +2766,21 @@ QPushButton#pushButtonRepeatPlaylist:!checked { /* Push labels away from buttons at the right */ /* AutoDJ selection info */ QLabel#labelSelectionInfo, - /* Recording info */ - #DlgRecording QLabel, /* Analysis progress info */ QLabel#labelProgress { margin: 0px 4px 5px 2px; } + /* Recording info */ + #labelRecFilename { + font-weight: bold; + margin: 0px 1px; + } + #labelRecPrefix, + #labelRecStatistics { + font-weight: normal; + } + /* Entire BPM cell */ /* Lock icon at the left */ #LibraryBPMButton::indicator:checked { diff --git a/src/library/autodj/dlgautodj.cpp b/src/library/autodj/dlgautodj.cpp index 97305e08acb..e5d28578817 100644 --- a/src/library/autodj/dlgautodj.cpp +++ b/src/library/autodj/dlgautodj.cpp @@ -80,7 +80,10 @@ DlgAutoDJ::DlgAutoDJ( // Do not set this because it disables auto-scrolling //m_pTrackTableView->setDragDropMode(QAbstractItemView::InternalMove); - connect(pushButtonAutoDJ, &QPushButton::toggled, this, &DlgAutoDJ::toggleAutoDJButton); + connect(pushButtonAutoDJ, + &QPushButton::clicked, + this, + &DlgAutoDJ::toggleAutoDJButton); setupActionButton(pushButtonFadeNow, &DlgAutoDJ::fadeNowButton, tr("Fade")); setupActionButton(pushButtonSkipNext, &DlgAutoDJ::skipNextButton, tr("Skip")); @@ -171,7 +174,7 @@ DlgAutoDJ::DlgAutoDJ( &DlgAutoDJ::slotTransitionModeChanged); connect(pushButtonRepeatPlaylist, - &QPushButton::toggled, + &QPushButton::clicked, this, &DlgAutoDJ::slotRepeatPlaylistChanged); if (m_bShowButtonText) { @@ -190,6 +193,7 @@ DlgAutoDJ::DlgAutoDJ( &AutoDJProcessor::transitionTimeChanged, this, &DlgAutoDJ::transitionTimeChanged); + connect(m_pAutoDJProcessor, &AutoDJProcessor::autoDJStateChanged, this, diff --git a/src/library/dlganalysis.cpp b/src/library/dlganalysis.cpp index 1a9796d4e1a..d43f382edf1 100644 --- a/src/library/dlganalysis.cpp +++ b/src/library/dlganalysis.cpp @@ -54,15 +54,14 @@ DlgAnalysis::DlgAnalysis(QWidget* 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, @@ -91,6 +90,10 @@ DlgAnalysis::DlgAnalysis(QWidget* 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(); @@ -165,10 +168,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); diff --git a/src/library/dlganalysis.ui b/src/library/dlganalysis.ui index e07bc1c92a5..395800c14f2 100644 --- a/src/library/dlganalysis.ui +++ b/src/library/dlganalysis.ui @@ -84,6 +84,9 @@ Analyze + + true + diff --git a/src/library/recording/dlgrecording.cpp b/src/library/recording/dlgrecording.cpp index 1b833d3c752..5f16ee98b91 100644 --- a/src/library/recording/dlgrecording.cpp +++ b/src/library/recording/dlgrecording.cpp @@ -47,7 +47,8 @@ DlgRecording::DlgRecording(QWidget* parent, UserSettingsPointer pConfig, connect(m_pRecordingManager, &RecordingManager::isRecording, this, - &DlgRecording::slotRecordingEnabled); + &DlgRecording::slotRecordingStateChanged); + connect(m_pRecordingManager, &RecordingManager::bytesRecorded, this, @@ -74,11 +75,17 @@ DlgRecording::DlgRecording(QWidget* parent, UserSettingsPointer pConfig, m_pTrackTableView->loadTrackModel(&m_proxyModel); connect(pushButtonRecording, - &QPushButton::toggled, + &QPushButton::clicked, this, - &DlgRecording::toggleRecording); - label->setText(""); - label->setEnabled(false); + &DlgRecording::slotRecButtonClicked); + + labelRecPrefix->hide(); + labelRecFilename->hide(); + labelRecStatistics->hide(); + labelRecPrefix->setText(tr("Recording to file:")); + + // Sync GUI with recording state, also refreshes labels + slotRecordingStateChanged(m_pRecordingManager->isRecordingActive()); } DlgRecording::~DlgRecording() { @@ -129,28 +136,24 @@ void DlgRecording::moveSelection(int delta) { m_pTrackTableView->moveSelection(delta); } -void DlgRecording::toggleRecording(bool toggle) { +void DlgRecording::slotRecButtonClicked(bool toggle) { Q_UNUSED(toggle); - if (!m_pRecordingManager->isRecordingActive()) //If recording is enabled - { - //pushButtonRecording->setText(tr("Stop Recording")); - m_pRecordingManager->startRecording(); - } - else if(m_pRecordingManager->isRecordingActive()) //If we disable recording - { - //pushButtonRecording->setText(tr("Start Recording")); - m_pRecordingManager->stopRecording(); - } + m_pRecordingManager->slotToggleRecording(1); } -void DlgRecording::slotRecordingEnabled(bool isRecording) { +void DlgRecording::slotRecordingStateChanged(bool isRecording) { if (isRecording) { - pushButtonRecording->setText((tr("Stop Recording"))); - label->setEnabled(true); + pushButtonRecording->setChecked(true); + pushButtonRecording->setText(tr("Stop Recording")); + labelRecPrefix->show(); + labelRecFilename->show(); + labelRecStatistics->show(); } else { - pushButtonRecording->setText((tr("Start Recording"))); - label->setText(""); - label->setEnabled(false); + pushButtonRecording->setChecked(false); + pushButtonRecording->setText(tr("Start Recording")); + labelRecPrefix->hide(); + labelRecFilename->hide(); + labelRecStatistics->hide(); } //This will update the recorded track table view m_browseModel.setPath(m_recordingDir); @@ -160,20 +163,21 @@ void DlgRecording::slotRecordingEnabled(bool isRecording) { void DlgRecording::slotBytesRecorded(int bytes) { double megabytes = bytes / 1048576.0; m_bytesRecordedStr = QString::number(megabytes,'f',2); - refreshLabel(); + refreshLabels(); } // gets recorded duration and update label void DlgRecording::slotDurationRecorded(QString durationRecorded) { m_durationRecordedStr = durationRecorded; - refreshLabel(); + refreshLabels(); } // update label besides start/stop button -void DlgRecording::refreshLabel() { - QString text = tr("Recording to file: %1 (%2 MiB written in %3)") - .arg(m_pRecordingManager->getRecordingFile()) - .arg(m_bytesRecordedStr) - .arg(m_durationRecordedStr); - label->setText(text); - } +void DlgRecording::refreshLabels() { + QString recFile = m_pRecordingManager->getRecordingFile(); + QString recData = QString(QStringLiteral("(") + tr("%1 MiB written in %2") + QStringLiteral(")")) + .arg(m_bytesRecordedStr) + .arg(m_durationRecordedStr); + labelRecFilename->setText(recFile); + labelRecStatistics->setText(recData); +} diff --git a/src/library/recording/dlgrecording.h b/src/library/recording/dlgrecording.h index fc9045e8e4a..d41ceb6b2fd 100644 --- a/src/library/recording/dlgrecording.h +++ b/src/library/recording/dlgrecording.h @@ -36,8 +36,7 @@ class DlgRecording : public QWidget, public Ui::DlgRecording, public virtual Lib inline const QString currentSearch() { return m_proxyModel.currentSearch(); } public slots: - void toggleRecording(bool toggle); - void slotRecordingEnabled(bool); + void slotRecordingStateChanged(bool); void slotBytesRecorded(int); void refreshBrowseModel(); void slotRestoreSearch(); @@ -55,7 +54,8 @@ class DlgRecording : public QWidget, public Ui::DlgRecording, public virtual Lib ProxyTrackModel m_proxyModel; QString m_recordingDir; - void refreshLabel(); + void refreshLabels(); + void slotRecButtonClicked(bool checked); QString m_bytesRecordedStr; QString m_durationRecordedStr; diff --git a/src/library/recording/dlgrecording.ui b/src/library/recording/dlgrecording.ui index c0b0fd90e51..efdf9e7fd83 100644 --- a/src/library/recording/dlgrecording.ui +++ b/src/library/recording/dlgrecording.ui @@ -57,11 +57,13 @@ - - - Status: - - + + + + + + + diff --git a/src/recording/recordingmanager.cpp b/src/recording/recordingmanager.cpp index af57a436960..54d635de114 100644 --- a/src/recording/recordingmanager.cpp +++ b/src/recording/recordingmanager.cpp @@ -36,8 +36,10 @@ RecordingManager::RecordingManager(UserSettingsPointer pConfig, EngineMaster* pE m_secondsRecorded(0), m_secondsRecordedSplit(0) { m_pToggleRecording = new ControlPushButton(ConfigKey(RECORDING_PREF_KEY, "toggle_recording")); - connect(m_pToggleRecording, SIGNAL(valueChanged(double)), - this, SLOT(slotToggleRecording(double))); + connect(m_pToggleRecording, + &ControlPushButton::valueChanged, + this, + &RecordingManager::slotToggleRecording); m_recReadyCO = new ControlObject(ConfigKey(RECORDING_PREF_KEY, "status")); m_recReady = new ControlProxy(m_recReadyCO->getKey(), this); @@ -49,12 +51,18 @@ RecordingManager::RecordingManager(UserSettingsPointer pConfig, EngineMaster* pE EngineSideChain* pSidechain = pEngine->getSideChain(); if (pSidechain) { EngineRecord* pEngineRecord = new EngineRecord(m_pConfig); - connect(pEngineRecord, SIGNAL(isRecording(bool, bool)), - this, SLOT(slotIsRecording(bool, bool))); - connect(pEngineRecord, SIGNAL(bytesRecorded(int)), - this, SLOT(slotBytesRecorded(int))); - connect(pEngineRecord, SIGNAL(durationRecorded(quint64)), - this, SLOT(slotDurationRecorded(quint64))); + connect(pEngineRecord, + &EngineRecord::isRecording, + this, + &RecordingManager::slotIsRecording); + connect(pEngineRecord, + &EngineRecord::bytesRecorded, + this, + &RecordingManager::slotBytesRecorded); + connect(pEngineRecord, + &EngineRecord::durationRecorded, + this, + &RecordingManager::slotDurationRecorded); pSidechain->addSideChainWorker(pEngineRecord); } } @@ -81,8 +89,9 @@ void RecordingManager::slotSetRecording(bool recording) { } } -void RecordingManager::slotToggleRecording(double v) { - if (v > 0) { +void RecordingManager::slotToggleRecording(double value) { + bool toggle = static_cast(value); + if (toggle) { if (isRecordingActive()) { stopRecording(); } else { diff --git a/src/recording/recordingmanager.h b/src/recording/recordingmanager.h index 3f9ac6b34bc..acf17805c76 100644 --- a/src/recording/recordingmanager.h +++ b/src/recording/recordingmanager.h @@ -56,9 +56,7 @@ class RecordingManager : public QObject void slotBytesRecorded(int); void slotDurationRecorded(quint64); void slotSetRecording(bool recording); - - private slots: - void slotToggleRecording(double v); + void slotToggleRecording(double value); private: QString formatDateTimeForFilename(QDateTime dateTime) const;