Add a timestamp to messages in the Status window (closes request #1509908)

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@473 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Nick Treleaven 2006-06-23 14:00:22 +00:00
parent b66243f1e1
commit a16fabec77
2 changed files with 27 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2006-06-23 Nick Treleaven <nick.treleaven@btinternet.com>
* src/msgwindow.c: Add a timestamp to messages in the Status window
(closes request #1509908).
2006-06-22 Enrico Troeger <enrico.troeger@uvena.de>
* src/utils.c: Reorganised C include file items, added C++ headers.

View File

@ -21,6 +21,8 @@
*/
#include <time.h>
#include "geany.h"
#include "support.h"
@ -181,7 +183,25 @@ void msgwin_status_add(gchar const *format, ...)
gtk_list_store_append(msgwindow.store_status, &iter);
//gtk_list_store_insert(msgwindow.store_status, &iter, 0);
//gtk_list_store_set(msgwindow.store_status, &iter, 0, (state > 0) ? &white : &dark, 1, string, -1);
gtk_list_store_set(msgwindow.store_status, &iter, 0, ((state++ % 2) == 0) ? &white : &dark, 1, string, -1);
{
GTimeVal cur_time;
gchar *date_str, *statusmsg;
gchar **strv;
g_get_current_time(&cur_time);
date_str = ctime(&cur_time.tv_sec); //uses internal string buffer
strv = g_strsplit(date_str, " ", 5);
if (strv[3] != NULL)
statusmsg = g_strconcat(strv[3], ": ", string, NULL);
else
statusmsg = g_strdup(string);
gtk_list_store_set(msgwindow.store_status, &iter, 0,
((state++ % 2) == 0) ? &white : &dark, 1, statusmsg, -1);
g_free(statusmsg);
g_strfreev(strv);
}
if (app->main_window_realized)
{