summaryrefslogtreecommitdiff
path: root/src/sel_items_adder.cpp
diff options
context:
space:
mode:
authorAndrzej Rybczak <electricityispower@gmail.com>2012-09-11 21:52:41 +0200
committerAndrzej Rybczak <electricityispower@gmail.com>2012-09-11 21:52:41 +0200
commitc90545b00809d69cfd640e31ac1582fad95fbeba (patch)
tree9ac2d0575d519f5642a029238a7c426c23e33961 /src/sel_items_adder.cpp
parent6ab2714e2f984624cb392bca37ad3357d2e85ef8 (diff)
move statusbar/progressbar related code to separate file
Diffstat (limited to 'src/sel_items_adder.cpp')
-rw-r--r--src/sel_items_adder.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/sel_items_adder.cpp b/src/sel_items_adder.cpp
index 490332a2..a7495e91 100644
--- a/src/sel_items_adder.cpp
+++ b/src/sel_items_adder.cpp
@@ -29,6 +29,7 @@
#include "sel_items_adder.h"
#include "settings.h"
#include "status.h"
+#include "statusbar.h"
#include "utility/comparators.h"
using Global::MainHeight;
@@ -77,7 +78,7 @@ void SelectedItemsAdder::SwitchTo()
if (MainHeight < 5)
{
- ShowMessage("Screen is too small to display this window");
+ Statusbar::msg("Screen is too small to display this window");
return;
}
@@ -95,7 +96,7 @@ void SelectedItemsAdder::SwitchTo()
bool playlists_not_active = myScreen == myBrowser && myBrowser->isLocal();
if (playlists_not_active)
- ShowMessage("Local items can't be added to stored playlists");
+ Statusbar::msg("Local items can't be added to stored playlists");
w->clear();
w->reset();
@@ -172,10 +173,10 @@ void SelectedItemsAdder::EnterPressed()
}
else if (pos == 1) // create new playlist
{
- LockStatusbar();
- Statusbar() << "Save playlist as: ";
+ Statusbar::lock();
+ Statusbar::put() << "Save playlist as: ";
std::string playlist = Global::wFooter->getString();
- UnlockStatusbar();
+ Statusbar::unlock();
if (!playlist.empty())
{
std::string utf_playlist = locale_to_utf_cpy(playlist);
@@ -183,7 +184,7 @@ void SelectedItemsAdder::EnterPressed()
for (auto it = list.begin(); it != list.end(); ++it)
Mpd.AddToPlaylist(utf_playlist, *it);
if (Mpd.CommitCommandsList())
- ShowMessage("Selected item(s) added to playlist \"%s\"", playlist.c_str());
+ Statusbar::msg("Selected item(s) added to playlist \"%s\"", playlist.c_str());
}
}
else if (pos > 1 && pos < w->size()-1) // add items to existing playlist
@@ -193,7 +194,7 @@ void SelectedItemsAdder::EnterPressed()
for (auto it = list.begin(); it != list.end(); ++it)
Mpd.AddToPlaylist(playlist, *it);
if (Mpd.CommitCommandsList())
- ShowMessage("Selected item(s) added to playlist \"%s\"", w->current().value().c_str());
+ Statusbar::msg("Selected item(s) added to playlist \"%s\"", w->current().value().c_str());
}
if (pos != w->size()-1)
{
@@ -209,7 +210,7 @@ void SelectedItemsAdder::EnterPressed()
// disable adding after current track/album when stopped
if (pos > 1 && pos < 4 && !Mpd.isPlaying())
{
- ShowMessage("Player is stopped");
+ Statusbar::msg("Player is stopped");
return;
}
@@ -246,7 +247,7 @@ void SelectedItemsAdder::EnterPressed()
}
if (successful_operation)
- ShowMessage("Selected item(s) added");
+ Statusbar::msg("Selected item(s) added");
}
SwitchTo();
}