new feature: shorten units' names displayed in statusbar while being in playlist

This commit is contained in:
Andrzej Rybczak
2010-05-14 15:53:50 +02:00
parent 20646600b8
commit 6eae6cd0f6
5 changed files with 13 additions and 2 deletions

View File

@@ -226,6 +226,8 @@
# #
#playlist_show_remaining_time = "no" #playlist_show_remaining_time = "no"
# #
#playlist_shorten_total_times = "no"
#
#playlist_separate_albums = "no" #playlist_separate_albums = "no"
# #
#playlist_display_mode = "classic" (classic/columns) #playlist_display_mode = "classic" (classic/columns)

View File

@@ -171,6 +171,9 @@ Number of default mode used in search engine.
.B playlist_show_remaining_time = yes/no .B playlist_show_remaining_time = yes/no
If enabled, time remaining to end of playlist will be shown after playlist's statistics. If enabled, time remaining to end of playlist will be shown after playlist's statistics.
.TP .TP
.B playlist_shorten_total_times = yes/no
If enabled, total/remaining playlist time displayed in statusbar will be shown using shortened units' names (d:h:m:s instead of days:hours:minutes:seconds).
.TP
.B playlist_separate_albums = yes/no .B playlist_separate_albums = yes/no
If enabled, separators will be placed between albums in playlist. If enabled, separators will be placed between albums in playlist.
.TP .TP

View File

@@ -387,12 +387,12 @@ std::string Playlist::TotalLength()
if (itsTotalLength) if (itsTotalLength)
{ {
result << ", length: "; result << ", length: ";
ShowTime(result, itsTotalLength, 0); ShowTime(result, itsTotalLength, Config.playlist_shorten_total_times);
} }
if (Config.playlist_show_remaining_time && itsRemainingTime && !Items->isFiltered() && Items->Size() > 1) if (Config.playlist_show_remaining_time && itsRemainingTime && !Items->isFiltered() && Items->Size() > 1)
{ {
result << " :: remaining: "; result << " :: remaining: ";
ShowTime(result, itsRemainingTime, 0); ShowTime(result, itsRemainingTime, Config.playlist_shorten_total_times);
} }
result << ')'; result << ')';
return result.str(); return result.str();

View File

@@ -356,6 +356,7 @@ void NcmpcppConfig::SetDefaults()
colors_enabled = true; colors_enabled = true;
fancy_scrolling = true; fancy_scrolling = true;
playlist_show_remaining_time = false; playlist_show_remaining_time = false;
playlist_shorten_total_times = false;
playlist_separate_albums = false; playlist_separate_albums = false;
columns_in_playlist = false; columns_in_playlist = false;
columns_in_browser = false; columns_in_browser = false;
@@ -833,6 +834,10 @@ void NcmpcppConfig::Read()
{ {
playlist_show_remaining_time = v == "yes"; playlist_show_remaining_time = v == "yes";
} }
else if (cl.find("playlist_shorten_total_times") != std::string::npos)
{
playlist_shorten_total_times = v == "yes";
}
else if (cl.find("playlist_separate_albums") != std::string::npos) else if (cl.find("playlist_separate_albums") != std::string::npos)
{ {
playlist_separate_albums = v == "yes"; playlist_separate_albums = v == "yes";

View File

@@ -196,6 +196,7 @@ struct NcmpcppConfig
bool colors_enabled; bool colors_enabled;
bool fancy_scrolling; bool fancy_scrolling;
bool playlist_show_remaining_time; bool playlist_show_remaining_time;
bool playlist_shorten_total_times;
bool playlist_separate_albums; bool playlist_separate_albums;
bool columns_in_playlist; bool columns_in_playlist;
bool columns_in_browser; bool columns_in_browser;