mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-31 11:35:24 +01:00
Add a quick change menu to the playlist container.
This commit is contained in:
parent
c026b599b4
commit
1cddc696ae
@ -48,7 +48,8 @@ PlaylistContainer::PlaylistContainer(QWidget* parent)
|
|||||||
tab_bar_visible_(false),
|
tab_bar_visible_(false),
|
||||||
tab_bar_animation_(new QTimeLine(500, this)),
|
tab_bar_animation_(new QTimeLine(500, this)),
|
||||||
no_matches_label_(nullptr),
|
no_matches_label_(nullptr),
|
||||||
filter_timer_(new QTimer(this)) {
|
filter_timer_(new QTimer(this)),
|
||||||
|
path_(Playlist::Path_Automatic) {
|
||||||
ui_->setupUi(this);
|
ui_->setupUi(this);
|
||||||
|
|
||||||
no_matches_label_ = new QLabel(ui_->playlist);
|
no_matches_label_ = new QLabel(ui_->playlist);
|
||||||
|
@ -21,6 +21,8 @@
|
|||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
|
||||||
|
#include "playlist.h"
|
||||||
|
|
||||||
class Ui_PlaylistContainer;
|
class Ui_PlaylistContainer;
|
||||||
|
|
||||||
class LineEditInterface;
|
class LineEditInterface;
|
||||||
@ -114,6 +116,8 @@ signals:
|
|||||||
QLabel* no_matches_label_;
|
QLabel* no_matches_label_;
|
||||||
|
|
||||||
QTimer* filter_timer_;
|
QTimer* filter_timer_;
|
||||||
|
|
||||||
|
Playlist::Path path_;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // PLAYLISTCONTAINER_H
|
#endif // PLAYLISTCONTAINER_H
|
||||||
|
@ -24,7 +24,16 @@
|
|||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="margin">
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
@ -36,7 +45,16 @@
|
|||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="margin">
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
@ -104,6 +122,36 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="Line" name="line">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="file_path_label">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>File Paths:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="file_path_box">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="Line" name="line_2">
|
<widget class="Line" name="line_2">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
@ -50,8 +50,6 @@ PlaylistManager::PlaylistManager(Application* app, QObject* parent)
|
|||||||
connect(app_->player(), SIGNAL(Paused()), SLOT(SetActivePaused()));
|
connect(app_->player(), SIGNAL(Paused()), SLOT(SetActivePaused()));
|
||||||
connect(app_->player(), SIGNAL(Playing()), SLOT(SetActivePlaying()));
|
connect(app_->player(), SIGNAL(Playing()), SLOT(SetActivePlaying()));
|
||||||
connect(app_->player(), SIGNAL(Stopped()), SLOT(SetActiveStopped()));
|
connect(app_->player(), SIGNAL(Stopped()), SLOT(SetActiveStopped()));
|
||||||
|
|
||||||
settings_.beginGroup(Playlist::kSettingsGroup);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PlaylistManager::~PlaylistManager() {
|
PlaylistManager::~PlaylistManager() {
|
||||||
@ -198,7 +196,10 @@ void PlaylistManager::ItemsLoadedForSavePlaylist(QFutureWatcher<Song>* watcher,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PlaylistManager::SaveWithUI(int id, const QString& suggested_filename) {
|
void PlaylistManager::SaveWithUI(int id, const QString& suggested_filename) {
|
||||||
QString filename = settings_.value("last_save_playlist").toString();
|
QSettings settings;
|
||||||
|
settings.beginGroup(Playlist::kSettingsGroup);
|
||||||
|
QString filename = settings.value("last_save_playlist").toString();
|
||||||
|
settings.endGroup();
|
||||||
|
|
||||||
// We want to use the playlist tab name as a default filename, but in the
|
// We want to use the playlist tab name as a default filename, but in the
|
||||||
// same directory as the last saved file.
|
// same directory as the last saved file.
|
||||||
@ -223,9 +224,13 @@ void PlaylistManager::SaveWithUI(int id, const QString& suggested_filename) {
|
|||||||
nullptr, tr("Save playlist", "Title of the playlist save dialog."),
|
nullptr, tr("Save playlist", "Title of the playlist save dialog."),
|
||||||
filename, parser()->filters(), &default_filter);
|
filename, parser()->filters(), &default_filter);
|
||||||
|
|
||||||
if (filename.isNull()) return;
|
if (filename.isNull()) {
|
||||||
|
settings.endGroup();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
settings_.setValue("last_save_playlist", filename);
|
settings.setValue("last_save_playlist", filename);
|
||||||
|
settings.endGroup();
|
||||||
|
|
||||||
Save(id == -1 ? current_id() : id, filename);
|
Save(id == -1 ? current_id() : id, filename);
|
||||||
}
|
}
|
||||||
|
@ -253,8 +253,6 @@ class PlaylistManager : public PlaylistManagerInterface {
|
|||||||
PlaylistParser* parser_;
|
PlaylistParser* parser_;
|
||||||
PlaylistContainer* playlist_container_;
|
PlaylistContainer* playlist_container_;
|
||||||
|
|
||||||
QSettings settings_;
|
|
||||||
|
|
||||||
// key = id
|
// key = id
|
||||||
QMap<int, Data> playlists_;
|
QMap<int, Data> playlists_;
|
||||||
|
|
||||||
|
@ -281,6 +281,13 @@
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="b_quickchange_menu">
|
||||||
|
<property name="text">
|
||||||
|
<string>Show Quick Change Menu</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="b_write_metadata">
|
<widget class="QCheckBox" name="b_write_metadata">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user