Add option to turn off title and heartbeat on OldTime screen.
This commit is contained in:
@@ -14,6 +14,7 @@ v0.5dev (ongoing development)
|
|||||||
* Build system: Rename configure.in to configure.ac
|
* Build system: Rename configure.in to configure.ac
|
||||||
+ hd44780: Add support for FreeBSD's iic I2C framework
|
+ hd44780: Add support for FreeBSD's iic I2C framework
|
||||||
+ hd44780: New connection type 'piplate' (J. Brogdon)
|
+ hd44780: New connection type 'piplate' (J. Brogdon)
|
||||||
|
* lcdproc client: Add option to turn off title and heartbeat on OldTime screen
|
||||||
|
|
||||||
v0.5.6
|
v0.5.6
|
||||||
- Remove deprecated CFontz633 driver. Use CFontzPacket with Model=633 instead!
|
- Remove deprecated CFontz633 driver. Use CFontzPacket with Model=633 instead!
|
||||||
|
|||||||
@@ -174,6 +174,13 @@ time_screen(int rep, int display, int *flags_ptr)
|
|||||||
* | May 17, 2005 |
|
* | May 17, 2005 |
|
||||||
* +--------------------+
|
* +--------------------+
|
||||||
*
|
*
|
||||||
|
* Alternate 2-line version without the title bar:
|
||||||
|
*
|
||||||
|
* +----------------+
|
||||||
|
* | 2012-12-27 @|
|
||||||
|
* | 15:07:01 |
|
||||||
|
* +----------------+
|
||||||
|
*
|
||||||
*\endverbatim
|
*\endverbatim
|
||||||
*
|
*
|
||||||
* \param rep Time since last screen update
|
* \param rep Time since last screen update
|
||||||
@@ -188,6 +195,7 @@ clock_screen(int rep, int display, int *flags_ptr)
|
|||||||
char today[40];
|
char today[40];
|
||||||
int xoffs;
|
int xoffs;
|
||||||
static int heartbeat = 0;
|
static int heartbeat = 0;
|
||||||
|
static int showTitle = 1;
|
||||||
static const char *timeFormat = NULL;
|
static const char *timeFormat = NULL;
|
||||||
static const char *dateFormat = NULL;
|
static const char *dateFormat = NULL;
|
||||||
time_t thetime;
|
time_t thetime;
|
||||||
@@ -195,18 +203,23 @@ clock_screen(int rep, int display, int *flags_ptr)
|
|||||||
|
|
||||||
if ((*flags_ptr & INITIALIZED) == 0) {
|
if ((*flags_ptr & INITIALIZED) == 0) {
|
||||||
char tmp[257]; /* should be large enough for host name */
|
char tmp[257]; /* should be large enough for host name */
|
||||||
|
int disableHeart; /* Disables server heartbeat icon */
|
||||||
|
|
||||||
*flags_ptr |= INITIALIZED;
|
*flags_ptr |= INITIALIZED;
|
||||||
|
|
||||||
/* get config values */
|
/* get config values */
|
||||||
timeFormat = config_get_string("OldTime", "TimeFormat", 0, "%H:%M:%S");
|
timeFormat = config_get_string("OldTime", "TimeFormat", 0, "%H:%M:%S");
|
||||||
dateFormat = config_get_string("OldTime", "DateFormat", 0, "%b %d %Y");
|
dateFormat = config_get_string("OldTime", "DateFormat", 0, "%b %d %Y");
|
||||||
|
showTitle = config_get_bool("OldTime", "ShowTitle", 0, 1);
|
||||||
|
disableHeart = config_get_bool("OldTime", "DisableHeartbeat", 0, 0);
|
||||||
|
|
||||||
sock_send_string(sock, "screen_add O\n");
|
sock_send_string(sock, "screen_add O\n");
|
||||||
sock_printf(sock, "screen_set O -name {Old Clock Screen: %s}\n", get_hostname());
|
sock_printf(sock, "screen_set O -name {Old Clock Screen: %s}\n", get_hostname());
|
||||||
sock_send_string(sock, "widget_add O title title\n");
|
if (disableHeart)
|
||||||
|
sock_send_string(sock, "screen_set O -heartbeat off\n");
|
||||||
sock_send_string(sock, "widget_add O one string\n");
|
sock_send_string(sock, "widget_add O one string\n");
|
||||||
if (lcd_hgt >= 4) {
|
if (lcd_hgt >= 4) {
|
||||||
|
sock_send_string(sock, "widget_add O title title\n");
|
||||||
sock_send_string(sock, "widget_add O two string\n");
|
sock_send_string(sock, "widget_add O two string\n");
|
||||||
sock_send_string(sock, "widget_add O three string\n");
|
sock_send_string(sock, "widget_add O three string\n");
|
||||||
|
|
||||||
@@ -217,7 +230,13 @@ clock_screen(int rep, int display, int *flags_ptr)
|
|||||||
sock_printf(sock, "widget_set O one %i 2 {%s}\n", xoffs, tmp);
|
sock_printf(sock, "widget_set O one %i 2 {%s}\n", xoffs, tmp);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sock_printf(sock, "widget_set O title {TIME: %s}\n", get_hostname());
|
if (showTitle) {
|
||||||
|
sock_send_string(sock, "widget_add O title title\n");
|
||||||
|
sock_printf(sock, "widget_set O title {TIME: %s}\n", get_hostname());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
sock_send_string(sock, "widget_add O two string\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -243,10 +262,20 @@ clock_screen(int rep, int display, int *flags_ptr)
|
|||||||
sock_printf(sock, "widget_set O three %i 4 {%s}\n", xoffs, now);
|
sock_printf(sock, "widget_set O three %i 4 {%s}\n", xoffs, now);
|
||||||
}
|
}
|
||||||
else { /* 2-line version of the screen */
|
else { /* 2-line version of the screen */
|
||||||
xoffs = (lcd_wid > (strlen(today) + strlen(now) + 1))
|
if (showTitle) {
|
||||||
? ((lcd_wid - ((strlen(today) + strlen(now) + 1))) / 2) + 1 : 1;
|
xoffs = (lcd_wid > (strlen(today) + strlen(now) + 1))
|
||||||
if (display)
|
? ((lcd_wid - ((strlen(today) + strlen(now) + 1))) / 2) + 1 : 1;
|
||||||
sock_printf(sock, "widget_set O one %i 2 {%s %s}\n", xoffs, today, now);
|
if (display)
|
||||||
|
sock_printf(sock, "widget_set O one %i 2 {%s %s}\n", xoffs, today, now);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
xoffs = (lcd_wid > strlen(today)) ? ((lcd_wid - strlen(today)) / 2) + 1 : 1;
|
||||||
|
if (display)
|
||||||
|
sock_printf(sock, "widget_set O one %i 1 {%s}\n", xoffs, today);
|
||||||
|
xoffs = (lcd_wid > strlen(now)) ? ((lcd_wid - strlen(now)) / 2) + 1 : 1;
|
||||||
|
if (display)
|
||||||
|
sock_printf(sock, "widget_set O two %i 2 {%s}\n", xoffs, now);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -103,6 +103,12 @@ Active=false
|
|||||||
TimeFormat="%H:%M:%S"
|
TimeFormat="%H:%M:%S"
|
||||||
# date format [default: %x; legal: see strftime(3)]
|
# date format [default: %x; legal: see strftime(3)]
|
||||||
DateFormat="%x"
|
DateFormat="%x"
|
||||||
|
# Display the title bar in two-line mode. Note that with four lines or more
|
||||||
|
# the title is always shown. [default: true; legal: true, false]
|
||||||
|
#ShowTitle=false
|
||||||
|
# Disables the heartbeat icon in the top right corner. By default, the server
|
||||||
|
# setting for the heartbeat is used. [default: false; legal: true, false]
|
||||||
|
#DisableHeartbeat=true
|
||||||
|
|
||||||
|
|
||||||
[BigClock]
|
[BigClock]
|
||||||
|
|||||||
Reference in New Issue
Block a user