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