summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--res/skins/Deere/style.qss29
-rw-r--r--res/skins/LateNight/style.qss38
-rw-r--r--res/skins/Shade/style.qss8
-rw-r--r--res/skins/Tango/style.qss12
-rw-r--r--src/library/autodj/dlgautodj.cpp8
-rw-r--r--src/library/dlganalysis.cpp14
-rw-r--r--src/library/dlganalysis.ui3
-rw-r--r--src/library/recording/dlgrecording.cpp66
-rw-r--r--src/library/recording/dlgrecording.h6
-rw-r--r--src/library/recording/dlgrecording.ui12
-rw-r--r--src/recording/recordingmanager.cpp29
-rw-r--r--src/recording/recordingmanager.h4
12 files changed, 140 insertions, 89 deletions
diff --git a/res/skins/Deere/style.qss b/res/skins/Deere/style.qss
index d4dff089bf..7aff59fca0 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 12eae2b8da..617f18e731 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,
@@ -2342,7 +2330,8 @@ WLibrary QRadioButton {
}
/* Additional space for QLabels */
-WLibrary QLabel {
+#DlgAnalysis QLabel,
+#DlgAutoDJ QLabel {
margin: 2px 5px 5px 1px;
}
@@ -2363,7 +2352,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;
}
@@ -2373,12 +2362,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;
}
@@ -2391,7 +2378,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 623624f6b9..eff839f55d 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 fd41769564..0dd35b5418 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 f3227031f0..c0f32ea068 100644
--- a/src/library/autodj/dlgautodj.cpp
+++ b/src/library/autodj/dlgautodj.cpp
@@ -82,7 +82,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"));
@@ -173,7 +176,7 @@ DlgAutoDJ::DlgAutoDJ(
&DlgAutoDJ::slotTransitionModeChanged);
connect(pushButtonRepeatPlaylist,
- &QPushButton::toggled,
+ &QPushButton::clicked,
this,
&DlgAutoDJ::slotRepeatPlaylistChanged);
if (m_bShowButtonText) {
@@ -192,6 +195,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 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);
diff --git a/src/library/dlganalysis.ui b/src/library/dlganalysis.ui
index e07bc1c92a..395800c14f 100644
--- a/src/library/dlganalysis.ui
+++ b/src/library/dlganalysis.ui
@@ -84,6 +84,9 @@
<property name="text">
<string>Analyze</string>
</property>
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
</widget>
</item>
<item>
diff --git a/src/library/recording/dlgrecording.cpp b/src/library/recording/dlgrecording.cpp
index 763528dfcd..8a6e698eeb 100644
--- a/src/library/recording/dlgrecording.cpp
+++ b/src/library/recording/dlgrecording.cpp
@@ -57,7 +57,8 @@ DlgRecording::DlgRecording(
connect(m_pRecordingManager,
&RecordingManager::isRecording,
this,
- &DlgRecording::slotRecordingEnabled);
+ &DlgRecording::slotRecordingStateChanged);
+
connect(m_pRecordingManager,
&RecordingManager::bytesRecorded,
this,
@@ -84,11 +85,17 @@ DlgRecording::DlgRecording(
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() {
@@ -139,28 +146,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);
@@ -170,20 +173,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 3cb73a86e9..1e00224064 100644
--- a/src/library/recording/dlgrecording.h
+++ b/src/library/recording/dlgrecording.h
@@ -37,8 +37,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();
@@ -56,7 +55,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 c0b0fd90e5..efdf9e7fd8 100644
--- a/src/library/recording/dlgrecording.ui
+++ b/src/library/recording/dlgrecording.ui
@@ -57,11 +57,13 @@
</widget>
</item>
<item>
- <widget class="QLabel" name="label">
- <property name="text">
- <string>Status:</string>
- </property>
- </widget>
+ <widget class="QLabel" name="labelRecPrefix"/>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelRecFilename"/>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelRecStatistics"/>
</item>
<item>
<spacer name="horizontalSpacer">
diff --git a/src/recording/recordingmanager.cpp b/src/recording/recordingmanager.cpp
index af57a43696..54d635de11 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<bool>(value);
+ if (toggle) {
if (isRecordingActive()) {
stopRecording();
} else {
diff --git a/src/recording/recordingmanager.h b/src/recording/recordingmanager.h
index 3f9ac6b34b..acf17805c7 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;