playlist: remove enterPressed
This commit is contained in:
@@ -957,6 +957,17 @@ void Add::run()
|
||||
}
|
||||
}
|
||||
|
||||
bool Play::canBeRun()
|
||||
{
|
||||
return myScreen == myPlaylist
|
||||
&& !myPlaylist->main().empty();
|
||||
}
|
||||
|
||||
void Play::run()
|
||||
{
|
||||
Mpd.PlayID(myPlaylist->main().current()->value().getID());
|
||||
}
|
||||
|
||||
bool SeekForward::canBeRun()
|
||||
{
|
||||
return Status::State::player() != MPD::psStop && Status::State::totalTime() > 0;
|
||||
@@ -2618,6 +2629,7 @@ void populateActions()
|
||||
insert_action(new Actions::MoveSelectedItemsDown());
|
||||
insert_action(new Actions::MoveSelectedItemsTo());
|
||||
insert_action(new Actions::Add());
|
||||
insert_action(new Actions::Play());
|
||||
insert_action(new Actions::SeekForward());
|
||||
insert_action(new Actions::SeekBackward());
|
||||
insert_action(new Actions::ToggleDisplayMode());
|
||||
|
||||
@@ -41,7 +41,7 @@ enum class Type
|
||||
NextColumn, MasterScreen, SlaveScreen, VolumeUp, VolumeDown, AddItemToPlaylist,
|
||||
DeletePlaylistItems, DeleteStoredPlaylist, DeleteBrowserItems, ReplaySong, Previous,
|
||||
Next, Pause, Stop, ExecuteCommand, SavePlaylist, MoveSortOrderUp, MoveSortOrderDown,
|
||||
MoveSelectedItemsUp, MoveSelectedItemsDown, MoveSelectedItemsTo, Add,
|
||||
MoveSelectedItemsUp, MoveSelectedItemsDown, MoveSelectedItemsTo, Add, Play,
|
||||
SeekForward, SeekBackward, ToggleDisplayMode, ToggleSeparatorsBetweenAlbums,
|
||||
ToggleLyricsUpdateOnSongChange, ToggleLyricsFetcher, ToggleFetchingLyricsInBackground,
|
||||
TogglePlayingSongCentering, UpdateDatabase, JumpToPlayingSong, ToggleRepeat, Shuffle,
|
||||
@@ -474,6 +474,15 @@ private:
|
||||
virtual void run() OVERRIDE;
|
||||
};
|
||||
|
||||
struct Play: BaseAction
|
||||
{
|
||||
Play(): BaseAction(Type::Play, "play") { }
|
||||
|
||||
private:
|
||||
virtual bool canBeRun() OVERRIDE;
|
||||
virtual void run() OVERRIDE;
|
||||
};
|
||||
|
||||
struct SeekForward: BaseAction
|
||||
{
|
||||
SeekForward(): BaseAction(Type::SeekForward, "seek_forward") { }
|
||||
|
||||
@@ -497,6 +497,7 @@ void BindingsConfiguration::generateDefaults()
|
||||
bind(k, Actions::Type::SelectItem);
|
||||
if (notBound(k = stringToKey("enter")))
|
||||
{
|
||||
bind(k, Actions::Type::Play);
|
||||
bind(k, Actions::Type::ToggleOutput);
|
||||
bind(k, Actions::Type::PressEnter);
|
||||
}
|
||||
|
||||
@@ -238,7 +238,7 @@ void write_bindings(NC::Scrollpad &w)
|
||||
key(w, Type::Quit, "Quit");
|
||||
|
||||
key_section(w, "Playlist");
|
||||
key(w, Type::PressEnter, "Play selected item");
|
||||
key(w, Type::Play, "Play selected item");
|
||||
key(w, Type::DeletePlaylistItems, "Delete selected item(s) from playlist");
|
||||
key(w, Type::ClearMainPlaylist, "Clear playlist");
|
||||
key(w, Type::CropMainPlaylist, "Clear playlist except selected item(s)");
|
||||
|
||||
@@ -131,12 +131,6 @@ void Playlist::update()
|
||||
}
|
||||
}
|
||||
|
||||
void Playlist::enterPressed()
|
||||
{
|
||||
if (!w.empty())
|
||||
Mpd.PlayID(w.current()->value().getID());
|
||||
}
|
||||
|
||||
void Playlist::mouseButtonPressed(MEVENT me)
|
||||
{
|
||||
if (!w.empty() && w.hasCoords(me.x, me.y))
|
||||
|
||||
@@ -43,7 +43,7 @@ struct Playlist: Screen<SongMenu>, HasSongs, Searchable, Tabbable
|
||||
|
||||
virtual void update() OVERRIDE;
|
||||
|
||||
virtual void enterPressed() OVERRIDE;
|
||||
virtual void enterPressed() OVERRIDE { }
|
||||
virtual void mouseButtonPressed(MEVENT me) OVERRIDE;
|
||||
|
||||
virtual bool isLockable() OVERRIDE { return true; }
|
||||
|
||||
Reference in New Issue
Block a user