summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ab87e55)
raw | patch | inline | side by side (parent: ab87e55)
author | Matt Portas <m.r.portas@warwick.ac.uk> | |
Mon, 23 Nov 2009 21:09:49 +0000 (21:09 +0000) | ||
committer | Max Kellermann <max@duempel.org> | |
Mon, 23 Nov 2009 21:10:30 +0000 (22:10 +0100) |
This allows the second column displaying the song length to be
disabled using the config file. By default it is set to on, so it
shouldn't affect anyone unless they specify it.
disabled using the config file. By default it is set to on, so it
shouldn't affect anyone unless they specify it.
doc/config.sample | patch | blob | history | |
doc/ncmpc.1 | patch | blob | history | |
src/conf.c | patch | blob | history | |
src/options.c | patch | blob | history | |
src/options.h | patch | blob | history | |
src/song_paint.c | patch | blob | history |
diff --git a/doc/config.sample b/doc/config.sample
index 9bd61c75d3322370acd2f224b53faeb7253b8173..7dcfaead68f4da03427642ee1e6faa7897a91e7b 100644 (file)
--- a/doc/config.sample
+++ b/doc/config.sample
## Automatically save the lyrics after receiving them.
#lyrics-autosave = no
+## Display song length in second column
+#second-column = yes
+
############## Colors #######################
##
## base colors: black, red, green, yellow, blue, magenta, cyan, white
diff --git a/doc/ncmpc.1 b/doc/ncmpc.1
index 13f2eb268118a92d6df9d3e728f4cd78c5286266..e09a65c512499ba2c4a8eecb902ed2d18d1728ea 100644 (file)
--- a/doc/ncmpc.1
+++ b/doc/ncmpc.1
@@ -123,6 +123,9 @@ When using the jump command, search for the prefix of an entry. That means typin
.TP
.B lyrics\-autosave = yes|no
Automatically save lyrics after receiving them.
+.TP
+.B second-column = yes|no
+Display song length in a second column.
.SS Display
.TP
.B welcome\-screen\-list = yes|no
diff --git a/src/conf.c b/src/conf.c
index 9ff0b55c5e99f00d81644aefc781a5eff2d18b2b..527306b8fe16bc3c04a7dcee831786bd69b7141f 100644 (file)
--- a/src/conf.c
+++ b/src/conf.c
#define CONF_DISPLAY_TIME "display-time"
#define CONF_JUMP_PREFIX_ONLY "jump-prefix-only"
#define CONF_LYRICS_AUTOSAVE "lyrics-autosave"
+#define CONF_SECOND_COLUMN "second-column"
static bool
str2bool(char *str)
options.lyrics_autosave = str2bool(value);
#else
{}
+#endif
+ else if (!strcasecmp(CONF_SECOND_COLUMN, name))
+#ifdef NCMPC_MINI
+ {}
+#else
+ options.second_column = str2bool(value);
#endif
else
match_found = false;
diff --git a/src/options.c b/src/options.c
index 9746d3ab78c08b67052ba11076887499f0b138fa..f50f18c795b4fb5ce342ee5e858d7a61c9aec0d7 100644 (file)
--- a/src/options.c
+++ b/src/options.c
.scroll = DEFAULT_SCROLL,
.welcome_screen_list = true,
.jump_prefix_only = true,
+ .second_column = true,
#endif
};
diff --git a/src/options.h b/src/options.h
index 8a0a9d353d0b4a56ba3170d9603907c6e72fff19..ef78e5b82de5fce24369c69381f2b29c848d2d5e 100644 (file)
--- a/src/options.h
+++ b/src/options.h
bool welcome_screen_list;
bool display_time;
bool jump_prefix_only;
+ bool second_column;
#endif
} options_t;
diff --git a/src/song_paint.c b/src/song_paint.c
index 0e2e74194383f3fb25f19ce3cf1c8377f3cddb04..5c0eee462d70fd77abf23438b7b049e6ed59888a 100644 (file)
--- a/src/song_paint.c
+++ b/src/song_paint.c
selected, buffer);
#ifndef NCMPC_MINI
- if (mpd_song_get_duration(song) > 0) {
+ if (options.second_column && mpd_song_get_duration(song) > 0) {
char duration[32];
format_duration_short(duration, sizeof(duration),
mpd_song_get_duration(song));