simplify Clear() in Window and its derivatives
it removes argument responsible for immediate refreshing. since after all calls that were refreshing screen there was call to Refresh() anyway, this switch doesn't make much sense.
This commit is contained in:
@@ -331,7 +331,7 @@ void Browser::GetDirectory(std::string dir, std::string subdir)
|
|||||||
if (w->at(i).type == itSong)
|
if (w->at(i).type == itSong)
|
||||||
delete w->at(i).song;
|
delete w->at(i).song;
|
||||||
|
|
||||||
w->Clear(0);
|
w->Clear();
|
||||||
|
|
||||||
if (dir != "/")
|
if (dir != "/")
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ void Info::GetSong()
|
|||||||
myScreen = this;
|
myScreen = this;
|
||||||
RedrawHeader = 1;
|
RedrawHeader = 1;
|
||||||
itsTitle = "Song info";
|
itsTitle = "Song info";
|
||||||
w->Clear(0);
|
w->Clear();
|
||||||
PrepareSong(*s);
|
PrepareSong(*s);
|
||||||
w->Window::Clear();
|
w->Window::Clear();
|
||||||
w->Flush();
|
w->Flush();
|
||||||
|
|||||||
@@ -123,10 +123,10 @@ void MediaLibrary::SwitchTo()
|
|||||||
{
|
{
|
||||||
hasTwoColumns = !hasTwoColumns;
|
hasTwoColumns = !hasTwoColumns;
|
||||||
hasToBeResized = 1;
|
hasToBeResized = 1;
|
||||||
Artists->Clear(0);
|
Artists->Clear();
|
||||||
Albums->Clear(0);
|
Albums->Clear();
|
||||||
Albums->Reset();
|
Albums->Reset();
|
||||||
Songs->Clear(0);
|
Songs->Clear();
|
||||||
if (hasTwoColumns)
|
if (hasTwoColumns)
|
||||||
{
|
{
|
||||||
if (w == Artists)
|
if (w == Artists)
|
||||||
@@ -161,8 +161,8 @@ void MediaLibrary::Update()
|
|||||||
if (!hasTwoColumns && Artists->Empty())
|
if (!hasTwoColumns && Artists->Empty())
|
||||||
{
|
{
|
||||||
TagList list;
|
TagList list;
|
||||||
Albums->Clear(0);
|
Albums->Clear();
|
||||||
Songs->Clear(0);
|
Songs->Clear();
|
||||||
Mpd.GetList(list, Config.media_lib_primary_tag);
|
Mpd.GetList(list, Config.media_lib_primary_tag);
|
||||||
sort(list.begin(), list.end(), CaseInsensitiveSorting());
|
sort(list.begin(), list.end(), CaseInsensitiveSorting());
|
||||||
for (TagList::iterator it = list.begin(); it != list.end(); ++it)
|
for (TagList::iterator it = list.begin(); it != list.end(); ++it)
|
||||||
@@ -280,7 +280,7 @@ void MediaLibrary::Update()
|
|||||||
Songs->Reset();
|
Songs->Reset();
|
||||||
SongList list;
|
SongList list;
|
||||||
|
|
||||||
Songs->Clear(0);
|
Songs->Clear();
|
||||||
Mpd.StartSearch(1);
|
Mpd.StartSearch(1);
|
||||||
Mpd.AddSearch(Config.media_lib_primary_tag, hasTwoColumns ? Albums->Current().second.Artist : locale_to_utf_cpy(Artists->Current()));
|
Mpd.AddSearch(Config.media_lib_primary_tag, hasTwoColumns ? Albums->Current().second.Artist : locale_to_utf_cpy(Artists->Current()));
|
||||||
if (Albums->Empty()) // left for compatibility with <mpd-0.14
|
if (Albums->Empty()) // left for compatibility with <mpd-0.14
|
||||||
@@ -351,8 +351,8 @@ void MediaLibrary::MouseButtonPressed(MEVENT me)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
Screen<Window>::MouseButtonPressed(me);
|
Screen<Window>::MouseButtonPressed(me);
|
||||||
Albums->Clear(0);
|
Albums->Clear();
|
||||||
Songs->Clear(0);
|
Songs->Clear();
|
||||||
}
|
}
|
||||||
else if (!Albums->Empty() && Albums->hasCoords(me.x, me.y))
|
else if (!Albums->Empty() && Albums->hasCoords(me.x, me.y))
|
||||||
{
|
{
|
||||||
@@ -371,7 +371,7 @@ void MediaLibrary::MouseButtonPressed(MEVENT me)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
Screen<Window>::MouseButtonPressed(me);
|
Screen<Window>::MouseButtonPressed(me);
|
||||||
Songs->Clear(0);
|
Songs->Clear();
|
||||||
}
|
}
|
||||||
else if (!Songs->Empty() && Songs->hasCoords(me.x, me.y))
|
else if (!Songs->Empty() && Songs->hasCoords(me.x, me.y))
|
||||||
{
|
{
|
||||||
@@ -507,11 +507,11 @@ void MediaLibrary::AddToPlaylist(bool add_n_play)
|
|||||||
w->Scroll(wDown);
|
w->Scroll(wDown);
|
||||||
if (w == Artists)
|
if (w == Artists)
|
||||||
{
|
{
|
||||||
Albums->Clear(0);
|
Albums->Clear();
|
||||||
Songs->Clear(0);
|
Songs->Clear();
|
||||||
}
|
}
|
||||||
else if (w == Albums)
|
else if (w == Albums)
|
||||||
Songs->Clear(0);
|
Songs->Clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -390,11 +390,9 @@ namespace NCurses
|
|||||||
virtual void Scroll(Where where);
|
virtual void Scroll(Where where);
|
||||||
|
|
||||||
/// Cleares all options, used filters etc. It doesn't reset highlighted position though.
|
/// Cleares all options, used filters etc. It doesn't reset highlighted position though.
|
||||||
/// @param clear_screen indicates whether window has to be cleared imediately or not
|
|
||||||
/// @see Window::Clear()
|
|
||||||
/// @see Reset()
|
/// @see Reset()
|
||||||
///
|
///
|
||||||
virtual void Clear(bool clear_screen = 1);
|
virtual void Clear();
|
||||||
|
|
||||||
/// Sets the highlighted position to 0
|
/// Sets the highlighted position to 0
|
||||||
///
|
///
|
||||||
@@ -888,7 +886,7 @@ template <typename T> void NCurses::Menu<T>::ClearFiltered()
|
|||||||
itsOptionsPtr = &itsOptions;
|
itsOptionsPtr = &itsOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T> void NCurses::Menu<T>::Clear(bool clear_screen)
|
template <typename T> void NCurses::Menu<T>::Clear()
|
||||||
{
|
{
|
||||||
for (option_iterator it = itsOptions.begin(); it != itsOptions.end(); ++it)
|
for (option_iterator it = itsOptions.begin(); it != itsOptions.end(); ++it)
|
||||||
delete *it;
|
delete *it;
|
||||||
@@ -897,8 +895,7 @@ template <typename T> void NCurses::Menu<T>::Clear(bool clear_screen)
|
|||||||
itsFilter.clear();
|
itsFilter.clear();
|
||||||
ClearFiltered();
|
ClearFiltered();
|
||||||
itsOptionsPtr = &itsOptions;
|
itsOptionsPtr = &itsOptions;
|
||||||
if (clear_screen)
|
Window::Clear();
|
||||||
Window::Clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T> bool NCurses::Menu<T>::isBold(int pos)
|
template <typename T> bool NCurses::Menu<T>::isBold(int pos)
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ void SelectedItemsAdder::EnterPressed()
|
|||||||
if (myBrowser->Main() && !myBrowser->isLocal() && myBrowser->CurrentDir() == "/")
|
if (myBrowser->Main() && !myBrowser->isLocal() && myBrowser->CurrentDir() == "/")
|
||||||
myBrowser->GetDirectory("/");
|
myBrowser->GetDirectory("/");
|
||||||
if (myPlaylistEditor->Main())
|
if (myPlaylistEditor->Main())
|
||||||
myPlaylistEditor->Playlists->Clear(0); // make playlist editor update itself
|
myPlaylistEditor->Playlists->Clear(); // make playlist editor update itself
|
||||||
}
|
}
|
||||||
MPD::FreeSongList(list);
|
MPD::FreeSongList(list);
|
||||||
SwitchTo();
|
SwitchTo();
|
||||||
|
|||||||
@@ -437,21 +437,21 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
if (myScreen->ActiveWindow() == myLibrary->Artists)
|
if (myScreen->ActiveWindow() == myLibrary->Artists)
|
||||||
{
|
{
|
||||||
myLibrary->Albums->Clear(0);
|
myLibrary->Albums->Clear();
|
||||||
myLibrary->Songs->Clear(0);
|
myLibrary->Songs->Clear();
|
||||||
}
|
}
|
||||||
else if (myScreen->ActiveWindow() == myLibrary->Albums)
|
else if (myScreen->ActiveWindow() == myLibrary->Albums)
|
||||||
{
|
{
|
||||||
myLibrary->Songs->Clear(0);
|
myLibrary->Songs->Clear();
|
||||||
}
|
}
|
||||||
else if (myScreen->ActiveWindow() == myPlaylistEditor->Playlists)
|
else if (myScreen->ActiveWindow() == myPlaylistEditor->Playlists)
|
||||||
{
|
{
|
||||||
myPlaylistEditor->Content->Clear(0);
|
myPlaylistEditor->Content->Clear();
|
||||||
}
|
}
|
||||||
# ifdef HAVE_TAGLIB_H
|
# ifdef HAVE_TAGLIB_H
|
||||||
else if (myScreen->ActiveWindow() == myTagEditor->LeftColumn)
|
else if (myScreen->ActiveWindow() == myTagEditor->LeftColumn)
|
||||||
{
|
{
|
||||||
myTagEditor->Tags->Clear(0);
|
myTagEditor->Tags->Clear();
|
||||||
myTagEditor->TagTypes->Refresh();
|
myTagEditor->TagTypes->Refresh();
|
||||||
}
|
}
|
||||||
# endif // HAVE_TAGLIB_H
|
# endif // HAVE_TAGLIB_H
|
||||||
@@ -660,7 +660,7 @@ int main(int argc, char *argv[])
|
|||||||
else
|
else
|
||||||
ShowMessage("Aborted!");
|
ShowMessage("Aborted!");
|
||||||
if (myPlaylistEditor->Main()) // check if initialized
|
if (myPlaylistEditor->Main()) // check if initialized
|
||||||
myPlaylistEditor->Playlists->Clear(0); // make playlists list update itself
|
myPlaylistEditor->Playlists->Clear(); // make playlists list update itself
|
||||||
}
|
}
|
||||||
# ifndef WIN32
|
# ifndef WIN32
|
||||||
else if (myScreen == myBrowser && !myBrowser->Main()->Empty() && myBrowser->Main()->Current().type != itPlaylist)
|
else if (myScreen == myBrowser && !myBrowser->Main()->Empty() && myBrowser->Main()->Current().type != itPlaylist)
|
||||||
@@ -802,7 +802,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
ShowMessage("Playlist saved as: %s", playlist_name.c_str());
|
ShowMessage("Playlist saved as: %s", playlist_name.c_str());
|
||||||
if (myPlaylistEditor->Main()) // check if initialized
|
if (myPlaylistEditor->Main()) // check if initialized
|
||||||
myPlaylistEditor->Playlists->Clear(0); // make playlist's list update itself
|
myPlaylistEditor->Playlists->Clear(); // make playlist's list update itself
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -826,7 +826,7 @@ int main(int argc, char *argv[])
|
|||||||
else
|
else
|
||||||
ShowMessage("Aborted!");
|
ShowMessage("Aborted!");
|
||||||
if (myPlaylistEditor->Main()) // check if initialized
|
if (myPlaylistEditor->Main()) // check if initialized
|
||||||
myPlaylistEditor->Playlists->Clear(0); // make playlist's list update itself
|
myPlaylistEditor->Playlists->Clear(); // make playlist's list update itself
|
||||||
if (myScreen == myPlaylist)
|
if (myScreen == myPlaylist)
|
||||||
myPlaylist->EnableHighlighting();
|
myPlaylist->EnableHighlighting();
|
||||||
}
|
}
|
||||||
@@ -1156,7 +1156,7 @@ int main(int argc, char *argv[])
|
|||||||
if (myScreen == myPlaylistEditor)
|
if (myScreen == myPlaylistEditor)
|
||||||
{
|
{
|
||||||
Mpd.AddToPlaylist(myPlaylistEditor->Playlists->Current(), path);
|
Mpd.AddToPlaylist(myPlaylistEditor->Playlists->Current(), path);
|
||||||
myPlaylistEditor->Content->Clear(0); // make it refetch content of playlist
|
myPlaylistEditor->Content->Clear(); // make it refetch content of playlist
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Mpd.Add(path);
|
Mpd.Add(path);
|
||||||
@@ -1561,7 +1561,7 @@ int main(int argc, char *argv[])
|
|||||||
if (myBrowser->Main() && !myBrowser->isLocal())
|
if (myBrowser->Main() && !myBrowser->isLocal())
|
||||||
myBrowser->GetDirectory("/");
|
myBrowser->GetDirectory("/");
|
||||||
if (myPlaylistEditor->Main())
|
if (myPlaylistEditor->Main())
|
||||||
myPlaylistEditor->Playlists->Clear(0);
|
myPlaylistEditor->Playlists->Clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1722,7 +1722,7 @@ int main(int argc, char *argv[])
|
|||||||
if (myScreen->ActiveWindow() == myPlaylistEditor->Content)
|
if (myScreen->ActiveWindow() == myPlaylistEditor->Content)
|
||||||
{
|
{
|
||||||
Mpd.ClearPlaylist(locale_to_utf_cpy(myPlaylistEditor->Playlists->Current()));
|
Mpd.ClearPlaylist(locale_to_utf_cpy(myPlaylistEditor->Playlists->Current()));
|
||||||
myPlaylistEditor->Content->Clear(0);
|
myPlaylistEditor->Content->Clear();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1901,7 +1901,7 @@ int main(int argc, char *argv[])
|
|||||||
ToLower(item_type);
|
ToLower(item_type);
|
||||||
if (myLibrary->Columns() == 2)
|
if (myLibrary->Columns() == 2)
|
||||||
{
|
{
|
||||||
myLibrary->Songs->Clear(0);
|
myLibrary->Songs->Clear();
|
||||||
myLibrary->Albums->Reset();
|
myLibrary->Albums->Reset();
|
||||||
myLibrary->Albums->Clear();
|
myLibrary->Albums->Clear();
|
||||||
myLibrary->Albums->SetTitle("Albums (sorted by " + item_type + ")");
|
myLibrary->Albums->SetTitle("Albums (sorted by " + item_type + ")");
|
||||||
@@ -1909,7 +1909,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
myLibrary->Artists->Clear(0);
|
myLibrary->Artists->Clear();
|
||||||
myLibrary->Artists->Display();
|
myLibrary->Artists->Display();
|
||||||
}
|
}
|
||||||
ShowMessage("Switched to list of %s tag", item_type.c_str());
|
ShowMessage("Switched to list of %s tag", item_type.c_str());
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ void Outputs::FetchList()
|
|||||||
return;
|
return;
|
||||||
MPD::OutputList ol;
|
MPD::OutputList ol;
|
||||||
Mpd.GetOutputs(ol);
|
Mpd.GetOutputs(ol);
|
||||||
w->Clear(0);
|
w->Clear();
|
||||||
for (MPD::OutputList::const_iterator it = ol.begin(); it != ol.end(); ++it)
|
for (MPD::OutputList::const_iterator it = ol.begin(); it != ol.end(); ++it)
|
||||||
w->AddOption(*it, it->second);
|
w->AddOption(*it, it->second);
|
||||||
if (myScreen == this)
|
if (myScreen == this)
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ void PlaylistEditor::Update()
|
|||||||
{
|
{
|
||||||
if (Playlists->Empty())
|
if (Playlists->Empty())
|
||||||
{
|
{
|
||||||
Content->Clear(0);
|
Content->Clear();
|
||||||
TagList list;
|
TagList list;
|
||||||
Mpd.GetPlaylists(list);
|
Mpd.GetPlaylists(list);
|
||||||
sort(list.begin(), list.end(), CaseInsensitiveSorting());
|
sort(list.begin(), list.end(), CaseInsensitiveSorting());
|
||||||
@@ -237,7 +237,7 @@ void PlaylistEditor::MouseButtonPressed(MEVENT me)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
Screen<Window>::MouseButtonPressed(me);
|
Screen<Window>::MouseButtonPressed(me);
|
||||||
Content->Clear(0);
|
Content->Clear();
|
||||||
}
|
}
|
||||||
else if (!Content->Empty() && Content->hasCoords(me.x, me.y))
|
else if (!Content->Empty() && Content->hasCoords(me.x, me.y))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ void Scrollpad::Scroll(Where where)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scrollpad::Clear(bool clear_screen)
|
void Scrollpad::Clear()
|
||||||
{
|
{
|
||||||
itsRealHeight = itsHeight;
|
itsRealHeight = itsHeight;
|
||||||
itsBuffer.Clear();
|
itsBuffer.Clear();
|
||||||
@@ -192,8 +192,6 @@ void Scrollpad::Clear(bool clear_screen)
|
|||||||
SetColor(itsColor, itsBgColor);
|
SetColor(itsColor, itsBgColor);
|
||||||
ForgetFormatting();
|
ForgetFormatting();
|
||||||
keypad(itsWindow, 1);
|
keypad(itsWindow, 1);
|
||||||
if (clear_screen)
|
|
||||||
Refresh();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scrollpad::Reset()
|
void Scrollpad::Reset()
|
||||||
|
|||||||
@@ -102,10 +102,9 @@ namespace NCurses
|
|||||||
virtual void Resize(size_t new_width, size_t new_height);
|
virtual void Resize(size_t new_width, size_t new_height);
|
||||||
|
|
||||||
/// Cleares the content of scrollpad
|
/// Cleares the content of scrollpad
|
||||||
/// @param clear_screen indicates whether window has to be cleared imediately or not
|
|
||||||
/// @see Window::Clear()
|
/// @see Window::Clear()
|
||||||
///
|
///
|
||||||
virtual void Clear(bool clear_screen = 1);
|
virtual void Clear();
|
||||||
|
|
||||||
/// Sets starting position to the beginning
|
/// Sets starting position to the beginning
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -268,7 +268,7 @@ void SearchEngine::Prepare()
|
|||||||
}
|
}
|
||||||
|
|
||||||
w->SetTitle("");
|
w->SetTitle("");
|
||||||
w->Clear(0);
|
w->Clear();
|
||||||
w->ResizeList(17);
|
w->ResizeList(17);
|
||||||
|
|
||||||
w->IntoSeparator(10);
|
w->IntoSeparator(10);
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ void ServerInfo::Update()
|
|||||||
time(&now);
|
time(&now);
|
||||||
|
|
||||||
Mpd.UpdateStats();
|
Mpd.UpdateStats();
|
||||||
w->Clear(0);
|
w->Clear();
|
||||||
|
|
||||||
*w << fmtBold << U("Version: ") << fmtBoldEnd << U("0.") << std::fixed << std::setprecision(1) << Mpd.Version() << '\n';
|
*w << fmtBold << U("Version: ") << fmtBoldEnd << U("0.") << std::fixed << std::setprecision(1) << Mpd.Version() << '\n';
|
||||||
*w << fmtBold << U("Uptime: ") << fmtBoldEnd;
|
*w << fmtBold << U("Uptime: ") << fmtBoldEnd;
|
||||||
|
|||||||
@@ -249,7 +249,7 @@ void NcmpcppStatusChanged(Connection *, StatusChanges changed, void *)
|
|||||||
if (myPlaylist->Items->Empty())
|
if (myPlaylist->Items->Empty())
|
||||||
{
|
{
|
||||||
myPlaylist->Items->Reset();
|
myPlaylist->Items->Reset();
|
||||||
myPlaylist->Items->Window::Clear(0);
|
myPlaylist->Items->Window::Clear();
|
||||||
ShowMessage("Cleared playlist!");
|
ShowMessage("Cleared playlist!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -280,13 +280,13 @@ void NcmpcppStatusChanged(Connection *, StatusChanges changed, void *)
|
|||||||
if (myScreen == myBrowser)
|
if (myScreen == myBrowser)
|
||||||
myBrowser->GetDirectory(myBrowser->CurrentDir());
|
myBrowser->GetDirectory(myBrowser->CurrentDir());
|
||||||
else
|
else
|
||||||
myBrowser->Main()->Clear(0);
|
myBrowser->Main()->Clear();
|
||||||
}
|
}
|
||||||
# ifdef HAVE_TAGLIB_H
|
# ifdef HAVE_TAGLIB_H
|
||||||
if (myTagEditor->Main())
|
if (myTagEditor->Main())
|
||||||
{
|
{
|
||||||
myTagEditor->Albums->Clear(0);
|
myTagEditor->Albums->Clear();
|
||||||
myTagEditor->Dirs->Clear(0);
|
myTagEditor->Dirs->Clear();
|
||||||
}
|
}
|
||||||
# endif // HAVE_TAGLIB_H
|
# endif // HAVE_TAGLIB_H
|
||||||
if (myLibrary->Main())
|
if (myLibrary->Main())
|
||||||
@@ -294,13 +294,13 @@ void NcmpcppStatusChanged(Connection *, StatusChanges changed, void *)
|
|||||||
if (myLibrary->Columns() == 2)
|
if (myLibrary->Columns() == 2)
|
||||||
{
|
{
|
||||||
myLibrary->Albums->Clear();
|
myLibrary->Albums->Clear();
|
||||||
myLibrary->Songs->Clear(0);
|
myLibrary->Songs->Clear();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
myLibrary->Artists->Clear(0);
|
myLibrary->Artists->Clear();
|
||||||
}
|
}
|
||||||
if (myPlaylistEditor->Main())
|
if (myPlaylistEditor->Main())
|
||||||
myPlaylistEditor->Content->Clear(0);
|
myPlaylistEditor->Content->Clear();
|
||||||
}
|
}
|
||||||
if (changed.PlayerState)
|
if (changed.PlayerState)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -323,7 +323,7 @@ void TagEditor::EnterPressed()
|
|||||||
{
|
{
|
||||||
itsHighlightedDir = itsBrowsedDir;
|
itsHighlightedDir = itsBrowsedDir;
|
||||||
itsBrowsedDir = LeftColumn->Current().second;
|
itsBrowsedDir = LeftColumn->Current().second;
|
||||||
LeftColumn->Clear(0);
|
LeftColumn->Clear();
|
||||||
LeftColumn->Reset();
|
LeftColumn->Reset();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -600,7 +600,7 @@ void TagEditor::EnterPressed()
|
|||||||
}
|
}
|
||||||
case 11: // reset
|
case 11: // reset
|
||||||
{
|
{
|
||||||
Tags->Clear(0);
|
Tags->Clear();
|
||||||
ShowMessage("Changes reset");
|
ShowMessage("Changes reset");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -630,7 +630,7 @@ void TagEditor::EnterPressed()
|
|||||||
Mpd.UpdateDirectory(locale_to_utf_cpy(FindSharedDir(Tags)));
|
Mpd.UpdateDirectory(locale_to_utf_cpy(FindSharedDir(Tags)));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Tags->Clear(0);
|
Tags->Clear();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
case 13: // capitalize first letters
|
case 13: // capitalize first letters
|
||||||
@@ -689,7 +689,7 @@ void TagEditor::SpacePressed()
|
|||||||
w = LeftColumn = Config.albums_in_tag_editor ? Albums : Dirs;
|
w = LeftColumn = Config.albums_in_tag_editor ? Albums : Dirs;
|
||||||
ShowMessage("Switched to %s view", Config.albums_in_tag_editor ? "albums" : "directories");
|
ShowMessage("Switched to %s view", Config.albums_in_tag_editor ? "albums" : "directories");
|
||||||
LeftColumn->Display();
|
LeftColumn->Display();
|
||||||
Tags->Clear(0);
|
Tags->Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TagEditor::MouseButtonPressed(MEVENT me)
|
void TagEditor::MouseButtonPressed(MEVENT me)
|
||||||
@@ -747,7 +747,7 @@ void TagEditor::MouseButtonPressed(MEVENT me)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
Screen<Window>::MouseButtonPressed(me);
|
Screen<Window>::MouseButtonPressed(me);
|
||||||
Tags->Clear(0);
|
Tags->Clear();
|
||||||
}
|
}
|
||||||
else if (!TagTypes->Empty() && TagTypes->hasCoords(me.x, me.y))
|
else if (!TagTypes->Empty() && TagTypes->hasCoords(me.x, me.y))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ void Visualizer::Update()
|
|||||||
if (data < 0) // no data available in fifo
|
if (data < 0) // no data available in fifo
|
||||||
return;
|
return;
|
||||||
|
|
||||||
w->Clear(0);
|
w->Clear();
|
||||||
# ifdef HAVE_FFTW3_H
|
# ifdef HAVE_FFTW3_H
|
||||||
Config.visualizer_use_wave ? DrawSoundWave(buf, data) : DrawFrequencySpectrum(buf, data);
|
Config.visualizer_use_wave ? DrawSoundWave(buf, data) : DrawFrequencySpectrum(buf, data);
|
||||||
# else
|
# else
|
||||||
|
|||||||
@@ -318,11 +318,9 @@ void Window::Refresh()
|
|||||||
prefresh(itsWindow, 0, 0, itsStartY, itsStartX, itsStartY+itsHeight-1, itsStartX+itsWidth-1);
|
prefresh(itsWindow, 0, 0, itsStartY, itsStartX, itsStartY+itsHeight-1, itsStartX+itsWidth-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window::Clear(bool refresh)
|
void Window::Clear()
|
||||||
{
|
{
|
||||||
werase(itsWindow);
|
werase(itsWindow);
|
||||||
if (refresh)
|
|
||||||
Window::Refresh();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window::Hide(char ch) const
|
void Window::Hide(char ch) const
|
||||||
|
|||||||
@@ -343,9 +343,8 @@ namespace NCurses
|
|||||||
virtual void Resize(size_t new_width, size_t new_height);
|
virtual void Resize(size_t new_width, size_t new_height);
|
||||||
|
|
||||||
/// Cleares the window
|
/// Cleares the window
|
||||||
/// @param refresh indicates whether window has to be refreshed immediately or not
|
|
||||||
///
|
///
|
||||||
virtual void Clear(bool refresh = 1);
|
virtual void Clear();
|
||||||
|
|
||||||
/// Adds given file descriptor to the list that will be polled in
|
/// Adds given file descriptor to the list that will be polled in
|
||||||
/// ReadKey() along with stdin and callback that will be invoked
|
/// ReadKey() along with stdin and callback that will be invoked
|
||||||
|
|||||||
Reference in New Issue
Block a user