aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvektor <devnull@localhost>2005-03-30 02:02:50 (GMT)
committervektor <devnull@localhost>2005-03-30 02:02:50 (GMT)
commita5e7f3c529ab2a797e704cf0c0e202c128749d68 (patch)
tree669b555ed4517109e3367782a9419e5d059e5676
parent82df6a92692e7cef089f051e8cecd1ad8dcc89eb (diff)
* tvtime/src/tvtimeconf.c: Add a new config file option ShowTaglines
to disable showing the taglines in the window title bar. * tvtime/src/tvtimeconf.h: Accessor for the config option. * tvtime/src/tvtime.c: Don't show the taglines if the user hates us.
-rw-r--r--src/tvtime.c21
-rw-r--r--src/tvtimeconf.c11
-rw-r--r--src/tvtimeconf.h1
3 files changed, 27 insertions, 6 deletions
diff --git a/src/tvtime.c b/src/tvtime.c
index 299def0..8e8b4b1 100644
--- a/src/tvtime.c
+++ b/src/tvtime.c
@@ -1962,15 +1962,24 @@ int tvtime_main( rtctimer_t *rtctimer, int read_stdin, int realtime,
if( current_id != last_current_id || commands_xmltv_updated( commands ) ) {
const char *curline = commands_get_xmltv_title( commands );
char caption[ 256 ];
- if( !curline ) {
+ if( !curline && config_get_show_taglines( ct ) ) {
curline = tagline;
}
- if( current_id ) {
- snprintf( caption, sizeof( caption ), "tvtime [%d]: %s",
- current_id, curline );
+ if( curline ) {
+ if( current_id ) {
+ snprintf( caption, sizeof( caption ), "tvtime [%d]: %s",
+ current_id, curline );
+ } else {
+ snprintf( caption, sizeof( caption ), "tvtime: %s",
+ curline );
+ }
} else {
- snprintf( caption, sizeof( caption ), "tvtime: %s",
- curline );
+ if( current_id ) {
+ snprintf( caption, sizeof( caption ), "tvtime [%d]",
+ current_id );
+ } else {
+ snprintf( caption, sizeof( caption ), "tvtime" );
+ }
}
output->set_window_caption( caption );
last_current_id = current_id;
diff --git a/src/tvtimeconf.c b/src/tvtimeconf.c
index 686c0d2..fcadd68 100644
--- a/src/tvtimeconf.c
+++ b/src/tvtimeconf.c
@@ -76,6 +76,7 @@ struct config_s
int unmute_volume;
int muted;
int mute_on_exit;
+ int show_taglines;
int keymap[ 8 * MAX_KEYSYMS ];
char *keymap_arg[ 8 * MAX_KEYSYMS ];
@@ -243,6 +244,10 @@ static void parse_option( config_t *ct, xmlNodePtr node )
ct->mute_on_exit = atoi( curval );
}
+ if( !xmlStrcasecmp( name, BAD_CAST "ShowTaglines" ) ) {
+ ct->show_taglines = atoi( curval );
+ }
+
if( !xmlStrcasecmp( name, BAD_CAST "ShowCC" ) ) {
ct->cc = atoi( curval );
}
@@ -718,6 +723,7 @@ config_t *config_new( void )
ct->unmute_volume = -1;
ct->muted = 0;
ct->mute_on_exit = 1;
+ ct->show_taglines = 1;
memset( ct->keymap, 0, sizeof( ct->keymap ) );
memset( ct->keymap_arg, 0, sizeof( ct->keymap_arg ) );
@@ -1630,3 +1636,8 @@ int config_get_mute_on_exit( config_t *ct )
return ct->mute_on_exit;
}
+int config_get_show_taglines( config_t *ct )
+{
+ return ct->show_taglines;
+}
+
diff --git a/src/tvtimeconf.h b/src/tvtimeconf.h
index ca28501..6c9b4bb 100644
--- a/src/tvtimeconf.h
+++ b/src/tvtimeconf.h
@@ -190,6 +190,7 @@ int config_get_quiet_screenshots( config_t *ct );
int config_get_unmute_volume( config_t *ct );
int config_get_muted( config_t *ct );
int config_get_mute_on_exit( config_t *ct );
+int config_get_show_taglines( config_t *ct );
#ifdef __cplusplus
};

Privacy Policy