Use double click settings as default behaviour for new files added as command line arguments.
This commit is contained in:
parent
96aabc3ac5
commit
2ab8ab8077
@ -66,7 +66,7 @@ const char* CommandlineOptions::kVersionText = "Clementine %1";
|
|||||||
CommandlineOptions::CommandlineOptions(int argc, char** argv)
|
CommandlineOptions::CommandlineOptions(int argc, char** argv)
|
||||||
: argc_(argc),
|
: argc_(argc),
|
||||||
argv_(argv),
|
argv_(argv),
|
||||||
url_list_action_(UrlList_Append),
|
url_list_action_(UrlList_None),
|
||||||
player_action_(Player_None),
|
player_action_(Player_None),
|
||||||
set_volume_(-1),
|
set_volume_(-1),
|
||||||
volume_modifier_(0),
|
volume_modifier_(0),
|
||||||
|
@ -34,7 +34,11 @@ class CommandlineOptions {
|
|||||||
|
|
||||||
// Don't change the values or order, these get serialised and sent to
|
// Don't change the values or order, these get serialised and sent to
|
||||||
// possibly a different version of Clementine
|
// possibly a different version of Clementine
|
||||||
enum UrlListAction { UrlList_Append = 0, UrlList_Load = 1, };
|
enum UrlListAction {
|
||||||
|
UrlList_Append = 0,
|
||||||
|
UrlList_Load = 1,
|
||||||
|
UrlList_None = 2,
|
||||||
|
};
|
||||||
enum PlayerAction {
|
enum PlayerAction {
|
||||||
Player_None = 0,
|
Player_None = 0,
|
||||||
Player_Play = 1,
|
Player_Play = 1,
|
||||||
|
@ -1929,7 +1929,9 @@ void MainWindow::CommandlineOptionsReceived(
|
|||||||
void MainWindow::CommandlineOptionsReceived(const CommandlineOptions& options) {
|
void MainWindow::CommandlineOptionsReceived(const CommandlineOptions& options) {
|
||||||
switch (options.player_action()) {
|
switch (options.player_action()) {
|
||||||
case CommandlineOptions::Player_Play:
|
case CommandlineOptions::Player_Play:
|
||||||
app_->player()->Play();
|
if (options.urls().empty()) {
|
||||||
|
app_->player()->Play();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case CommandlineOptions::Player_PlayPause:
|
case CommandlineOptions::Player_PlayPause:
|
||||||
app_->player()->PlayPause();
|
app_->player()->PlayPause();
|
||||||
@ -1954,17 +1956,30 @@ void MainWindow::CommandlineOptionsReceived(const CommandlineOptions& options) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (options.url_list_action()) {
|
if (!options.urls().empty()) {
|
||||||
case CommandlineOptions::UrlList_Load:
|
MimeData* data = new MimeData;
|
||||||
app_->playlist_manager()->ClearCurrent();
|
data->setUrls(options.urls());
|
||||||
|
// Behaviour depends on command line options, so set it here
|
||||||
|
data->override_user_settings_ = true;
|
||||||
|
|
||||||
// fallthrough
|
if (options.player_action() == CommandlineOptions::Player_Play)
|
||||||
case CommandlineOptions::UrlList_Append: {
|
data->play_now_ = true;
|
||||||
MimeData* data = new MimeData;
|
else
|
||||||
data->setUrls(options.urls());
|
ApplyPlayBehaviour(doubleclick_playmode_, data);
|
||||||
AddToPlaylist(data);
|
|
||||||
break;
|
switch (options.url_list_action()) {
|
||||||
|
case CommandlineOptions::UrlList_Load:
|
||||||
|
data->clear_first_ = true;
|
||||||
|
break;
|
||||||
|
case CommandlineOptions::UrlList_Append:
|
||||||
|
// Nothing to do
|
||||||
|
break;
|
||||||
|
case CommandlineOptions::UrlList_None:
|
||||||
|
ApplyAddBehaviour(doubleclick_addmode_, data);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AddToPlaylist(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.set_volume() != -1)
|
if (options.set_volume() != -1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user