Add option to automatically select current playing track
This commit is contained in:
@@ -161,6 +161,7 @@ PlaylistView::PlaylistView(QWidget *parent)
|
|||||||
previous_background_image_x_(0),
|
previous_background_image_x_(0),
|
||||||
previous_background_image_y_(0),
|
previous_background_image_y_(0),
|
||||||
glow_enabled_(true),
|
glow_enabled_(true),
|
||||||
|
select_track_(false),
|
||||||
currently_glowing_(false),
|
currently_glowing_(false),
|
||||||
glow_intensity_step_(0),
|
glow_intensity_step_(0),
|
||||||
inhibit_autoscroll_timer_(new QTimer(this)),
|
inhibit_autoscroll_timer_(new QTimer(this)),
|
||||||
@@ -1004,6 +1005,7 @@ void PlaylistView::ReloadSettings() {
|
|||||||
#endif
|
#endif
|
||||||
glow_enabled_ = s.value("glow_effect", glow_effect).toBool();
|
glow_enabled_ = s.value("glow_effect", glow_effect).toBool();
|
||||||
bool editmetadatainline = s.value("editmetadatainline", false).toBool();
|
bool editmetadatainline = s.value("editmetadatainline", false).toBool();
|
||||||
|
select_track_ = s.value("select_track", false).toBool();
|
||||||
s.endGroup();
|
s.endGroup();
|
||||||
|
|
||||||
s.beginGroup(Playlist::kSettingsGroup);
|
s.beginGroup(Playlist::kSettingsGroup);
|
||||||
@@ -1228,7 +1230,15 @@ void PlaylistView::CopyCurrentSongToClipboard() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PlaylistView::SongChanged(const Song &song) {
|
void PlaylistView::SongChanged(const Song &song) {
|
||||||
|
|
||||||
song_playing_ = song;
|
song_playing_ = song;
|
||||||
|
|
||||||
|
if (select_track_ && playlist_) {
|
||||||
|
clearSelection();
|
||||||
|
QItemSelection selection(playlist_->index(playlist_->current_row(), 0), playlist_->index(playlist_->current_row(), playlist_->ColumnCount - 1));
|
||||||
|
selectionModel()->select(selection, QItemSelectionModel::Select);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlaylistView::Playing() {}
|
void PlaylistView::Playing() {}
|
||||||
|
|||||||
@@ -240,6 +240,8 @@ class PlaylistView : public QTreeView {
|
|||||||
int previous_background_image_y_;
|
int previous_background_image_y_;
|
||||||
|
|
||||||
bool glow_enabled_;
|
bool glow_enabled_;
|
||||||
|
bool select_track_;
|
||||||
|
|
||||||
bool currently_glowing_;
|
bool currently_glowing_;
|
||||||
QBasicTimer glow_timer_;
|
QBasicTimer glow_timer_;
|
||||||
int glow_intensity_step_;
|
int glow_intensity_step_;
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ void PlaylistSettingsPage::Load() {
|
|||||||
ui_->checkbox_continueonerror->setChecked(s.value("continue_on_error", false).toBool());
|
ui_->checkbox_continueonerror->setChecked(s.value("continue_on_error", false).toBool());
|
||||||
ui_->checkbox_greyout_songs_startup->setChecked(s.value("greyout_songs_startup", true).toBool());
|
ui_->checkbox_greyout_songs_startup->setChecked(s.value("greyout_songs_startup", true).toBool());
|
||||||
ui_->checkbox_greyout_songs_play->setChecked(s.value("greyout_songs_play", true).toBool());
|
ui_->checkbox_greyout_songs_play->setChecked(s.value("greyout_songs_play", true).toBool());
|
||||||
|
ui_->checkbox_select_track->setChecked(s.value("select_track", false).toBool());
|
||||||
|
|
||||||
Playlist::Path path = Playlist::Path(s.value(Playlist::kPathType, Playlist::Path_Automatic).toInt());
|
Playlist::Path path = Playlist::Path(s.value(Playlist::kPathType, Playlist::Path_Automatic).toInt());
|
||||||
switch (path) {
|
switch (path) {
|
||||||
@@ -113,6 +114,7 @@ void PlaylistSettingsPage::Save() {
|
|||||||
s.setValue("continue_on_error", ui_->checkbox_continueonerror->isChecked());
|
s.setValue("continue_on_error", ui_->checkbox_continueonerror->isChecked());
|
||||||
s.setValue("greyout_songs_startup", ui_->checkbox_greyout_songs_startup->isChecked());
|
s.setValue("greyout_songs_startup", ui_->checkbox_greyout_songs_startup->isChecked());
|
||||||
s.setValue("greyout_songs_play", ui_->checkbox_greyout_songs_play->isChecked());
|
s.setValue("greyout_songs_play", ui_->checkbox_greyout_songs_play->isChecked());
|
||||||
|
s.setValue("select_track", ui_->checkbox_select_track->isChecked());
|
||||||
s.setValue(Playlist::kPathType, static_cast<int>(path));
|
s.setValue(Playlist::kPathType, static_cast<int>(path));
|
||||||
s.setValue("editmetadatainline", ui_->checkbox_editmetadatainline->isChecked());
|
s.setValue("editmetadatainline", ui_->checkbox_editmetadatainline->isChecked());
|
||||||
s.setValue(Playlist::kWriteMetadata, ui_->checkbox_writemetadata->isChecked());
|
s.setValue(Playlist::kWriteMetadata, ui_->checkbox_writemetadata->isChecked());
|
||||||
|
|||||||
@@ -19,9 +19,6 @@
|
|||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Show a glowing animation on the current track</string>
|
<string>Show a glowing animation on the current track</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="checked">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
@@ -52,6 +49,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="checkbox_select_track">
|
||||||
|
<property name="text">
|
||||||
|
<string>Automatically select current playing track</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupbox_paths">
|
<widget class="QGroupBox" name="groupbox_paths">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
|
|||||||
Reference in New Issue
Block a user