menu: get rid of a few List functions
This commit is contained in:
@@ -514,10 +514,10 @@ void ScrollUpArtist::Run()
|
||||
while (pos > 0)
|
||||
{
|
||||
s = myScreen->GetSong(--pos);
|
||||
myScreen->Scroll(wUp);
|
||||
if (!s || s->getArtist() != artist)
|
||||
break;
|
||||
}
|
||||
mList->Highlight(pos);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -533,10 +533,10 @@ void ScrollUpAlbum::Run()
|
||||
while (pos > 0)
|
||||
{
|
||||
s = myScreen->GetSong(--pos);
|
||||
myScreen->Scroll(wUp);
|
||||
if (!s || s->getAlbum() != album)
|
||||
break;
|
||||
}
|
||||
mList->Highlight(pos);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -552,10 +552,10 @@ void ScrollDownArtist::Run()
|
||||
while (pos < mList->Size() - 1)
|
||||
{
|
||||
s = myScreen->GetSong(++pos);
|
||||
myScreen->Scroll(wDown);
|
||||
if (!s || s->getArtist() != artist)
|
||||
break;
|
||||
}
|
||||
mList->Highlight(pos);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -571,10 +571,10 @@ void ScrollDownAlbum::Run()
|
||||
while (pos < mList->Size() - 1)
|
||||
{
|
||||
s = myScreen->GetSong(++pos);
|
||||
myScreen->Scroll(wDown);
|
||||
if (!s || s->getAlbum() != album)
|
||||
break;
|
||||
}
|
||||
mList->Highlight(pos);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1806,8 +1806,6 @@ void DeselectItems::Run()
|
||||
{
|
||||
// FIXME
|
||||
/*List *mList = myScreen->GetList();
|
||||
if (!mList->hasSelected())
|
||||
return;
|
||||
for (size_t i = 0; i < mList->Size(); ++i)
|
||||
mList->Select(i, 0);
|
||||
ShowMessage("Items deselected");*/
|
||||
|
||||
17
src/menu.h
17
src/menu.h
@@ -37,19 +37,6 @@ namespace NCurses {
|
||||
///
|
||||
struct List
|
||||
{
|
||||
/// @see Menu::hasSelected()
|
||||
///
|
||||
virtual bool hasSelected() const = 0;
|
||||
|
||||
/// @see Menu::GetSelected()
|
||||
///
|
||||
virtual void GetSelected(std::vector<size_t> &v) const = 0;
|
||||
|
||||
/// Highlights given position
|
||||
/// @param pos position to be highlighted
|
||||
///
|
||||
virtual void Highlight(size_t pos) = 0;
|
||||
|
||||
/// @return currently highlighted position
|
||||
///
|
||||
virtual size_t Choice() const = 0;
|
||||
@@ -314,12 +301,12 @@ template <typename T> struct Menu : public Window, public List
|
||||
/// Checks whether list contains selected positions
|
||||
/// @return true if it contains them, false otherwise
|
||||
///
|
||||
virtual bool hasSelected() const;
|
||||
bool hasSelected() const;
|
||||
|
||||
/// Gets positions of items that are selected
|
||||
/// @param v vector to be filled with selected positions numbers
|
||||
///
|
||||
virtual void GetSelected(std::vector<size_t> &v) const;
|
||||
void GetSelected(std::vector<size_t> &v) const;
|
||||
|
||||
/// Reverses selection of all items in list
|
||||
/// @param beginning beginning of range that has to be reversed
|
||||
|
||||
Reference in New Issue
Block a user