From a14b635343ebdcb711885d840687d181ebd2bfbb Mon Sep 17 00:00:00 2001 From: Kalle Wallin Date: Wed, 9 Jun 2004 17:27:05 +0000 Subject: [PATCH] Updated the get_title callback. git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1421 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/screen_clock.c | 4 ++-- src/screen_file.c | 11 ++++++----- src/screen_help.c | 8 +++++--- src/screen_keydef.c | 14 ++++++-------- src/screen_play.c | 9 +++++++-- 5 files changed, 26 insertions(+), 20 deletions(-) diff --git a/src/screen_clock.c b/src/screen_clock.c index 459d9e4..3fe2ec1 100644 --- a/src/screen_clock.c +++ b/src/screen_clock.c @@ -148,9 +148,9 @@ clock_close(void) } static char * -clock_title(void) +clock_title(char *str, size_t size) { - return _("Music Player Client - Clock"); + return _("Clock"); } static void diff --git a/src/screen_file.c b/src/screen_file.c index f86e8df..8b7577f 100644 --- a/src/screen_file.c +++ b/src/screen_file.c @@ -1,5 +1,7 @@ /* - * (c) 2004 by Kalle Wallin (kaw@linux.se) + * $Id$ + * + * (c) 2004 by Kalle Wallin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -360,16 +362,15 @@ file_close(void) } static char * -file_title(void) +file_title(char *str, size_t size) { - static char buf[TITLESIZE]; char *tmp; tmp = utf8_to_locale(basename(mpc->cwd)); - snprintf(buf, TITLESIZE, _("Browse: %s"), tmp); + snprintf(str, size, _("Browse: %s"), tmp); g_free(tmp); - return buf; + return str; } static void diff --git a/src/screen_help.c b/src/screen_help.c index 0299d6c..8584bb7 100644 --- a/src/screen_help.c +++ b/src/screen_help.c @@ -1,5 +1,7 @@ /* - * (c) 2004 by Kalle Wallin (kaw@linux.se) + * $Id$ + * + * (c) 2004 by Kalle Wallin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -204,9 +206,9 @@ help_exit(void) static char * -help_title(void) +help_title(char *str, size_t size) { - return _("Music Player Client - Help"); + return _("Help"); } static void diff --git a/src/screen_keydef.c b/src/screen_keydef.c index 16311af..2dda43d 100644 --- a/src/screen_keydef.c +++ b/src/screen_keydef.c @@ -1,5 +1,7 @@ /* - * (c) 2004 by Kalle Wallin (kaw@linux.se) + * $Id$ + * + * (c) 2004 by Kalle Wallin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -271,17 +273,13 @@ keydef_close(void) } static char * -keydef_title(void) +keydef_title(char *str, size_t size) { - static char buf[BUFSIZE]; - if( subcmd<0 ) return _("Edit key bindings"); - snprintf(buf, BUFSIZE, - _("Edit keys for %s"), - cmds[subcmd].name); - return buf; + snprintf(str, size, _("Edit keys for %s"), cmds[subcmd].name); + return str; } static void diff --git a/src/screen_play.c b/src/screen_play.c index 8d3fc6c..9dc2a96 100644 --- a/src/screen_play.c +++ b/src/screen_play.c @@ -151,9 +151,14 @@ play_exit(void) } static char * -play_title(void) +play_title(char *str, size_t size) { - return _("Music Player Client - Playlist"); + if( strcmp(options.host, "localhost") == 0 ) + return _("Playlist"); + + snprintf(str, size, _("Playlist on %s"), options.host); + + return str; } static void -- 2.30.2