summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d4586df)
raw | patch | inline | side by side (parent: d4586df)
author | Jeffrey Middleton <jefromi@gmail.com> | |
Thu, 12 Mar 2009 14:43:14 +0000 (09:43 -0500) | ||
committer | Jeffrey Middleton <jefromi@gmail.com> | |
Thu, 12 Mar 2009 14:43:14 +0000 (09:43 -0500) |
Controls the length of time a status message displays; the previous
setting of 3 seconds from options.c is the default value.
setting of 3 seconds from options.c is the default value.
src/conf.c | patch | blob | history | |
src/options.c | patch | blob | history | |
src/options.h | patch | blob | history | |
src/screen.c | patch | blob | history |
diff --git a/src/conf.c b/src/conf.c
index 13dc5d50c5cdeb1c4ddd8891c49560cf902944f3..1dc1a4333c9d99b918643854ca9b6ee5af083756 100644 (file)
--- a/src/conf.c
+++ b/src/conf.c
#define CONF_AUDIBLE_BELL "audible-bell"
#define CONF_VISIBLE_BELL "visible-bell"
#define CONF_BELL_ON_WRAP "bell-on-wrap"
+#define CONF_STATUS_MESSAGE_TIME "status-message-time"
#define CONF_XTERM_TITLE "set-xterm-title"
#define CONF_ENABLE_MOUSE "enable-mouse"
#define CONF_CROSSFADE_TIME "crossfade-time"
options.visible_bell = str2bool(value);
else if (!strcasecmp(CONF_BELL_ON_WRAP, name))
options.bell_on_wrap = str2bool(value);
+ else if (!strcasecmp(CONF_STATUS_MESSAGE_TIME, name))
+ options.status_message_time = atoi(value);
else if (!strcasecmp(CONF_XTERM_TITLE, name))
options.enable_xterm_title = str2bool(value);
else if (!strcasecmp(CONF_ENABLE_MOUSE, name))
diff --git a/src/options.c b/src/options.c
index cc938c330334f709c340a5ce4dec306237d1acfe..dd7ba532c68aa1346141dc4f44bf9a944180fdf8 100644 (file)
--- a/src/options.c
+++ b/src/options.c
.wide_cursor = true,
.audible_bell = true,
.bell_on_wrap = true,
+ .status_message_time = 3,
#ifndef NCMPC_MINI
.scroll = DEFAULT_SCROLL,
.welcome_screen_list = true,
diff --git a/src/options.h b/src/options.h
index 48a12f2b81e3eba8b89085f8670e858b51322abe..dbd5a43ce93a1199be5765034b7eefa22f9c3150 100644 (file)
--- a/src/options.h
+++ b/src/options.h
#include "config.h"
#include <stdbool.h>
+#include <glib.h>
#define MPD_HOST_ENV "MPD_HOST"
#define MPD_PORT_ENV "MPD_PORT"
bool audible_bell;
bool visible_bell;
bool bell_on_wrap;
+ GTime status_message_time;
#ifndef NCMPC_MINI
bool enable_xterm_title;
#endif
diff --git a/src/screen.c b/src/screen.c
index ea6c02310424b26abc0aa5e5e7b9c5aee7fcccfa..5c9204237de4d3affb1fdfd3b54ad267fe91311f 100644 (file)
--- a/src/screen.c
+++ b/src/screen.c
static const GTime SCREEN_WELCOME_TIME = 10;
#endif
-/** status message time [s] */
-static const GTime SCREEN_STATUS_MESSAGE_TIME = 3;
-
/* minimum window size */
static const int SCREEN_MIN_COLS = 14;
static const int SCREEN_MIN_ROWS = 5;
const char *str = NULL;
int x = 0;
- if( time(NULL) - screen.status_timestamp <= SCREEN_STATUS_MESSAGE_TIME )
+ if( time(NULL) - screen.status_timestamp <= options.status_message_time )
return;
wmove(w, 0, 0);