Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 232855 | Differences between
and this patch

Collapse All | Expand All

(-)./src/EventWin.cc.old (-17 / +13 lines)
Lines 10-15 Link Here
10
10
11
#  include <gdkmm.h>
11
#  include <gdkmm.h>
12
#include <string.h>
12
#include <string.h>
13
#include <time.h>
14
#include <locale.h>
15
#include <langinfo.h>
13
16
14
#include "EventWin.hh"
17
#include "EventWin.hh"
15
// FIXME: a supprimer??
18
// FIXME: a supprimer??
Lines 74-96 Link Here
74
77
75
void EventWin::addEvent(Glib::ustring eventName, int evtSeverity)
78
void EventWin::addEvent(Glib::ustring eventName, int evtSeverity)
76
{
79
{
77
  time_t		currentTime = time(NULL);
78
  Glib::ustring	newEvent;
80
  Glib::ustring	newEvent;
79
  char			i18nTime[32];
81
  struct tm *gmt;
80
  char			*tmp;
82
  char timebuf[64];
81
83
  time_t AnnoDomini;
82
  // FIXME: ?buggy? Glib::Date *timeStamp = new class Glib::Date ();
84
83
  // seems not to manage H:M:S (limitation to be bugged upstream!)
85
  setlocale(LC_ALL,"");
84
  //   Glib::Date *i18nTimeNew = new class Glib::Date ();
86
  time(&AnnoDomini);
85
  //   i18nTimeNew->set_time(time(NULL));
87
  gmt=localtime(&AnnoDomini);
86
  //   std::cout << "TEST TIME = " << i18nTimeNew->format_string ("%c").c_str() << std::endl;
88
  strftime(timebuf, sizeof(timebuf), nl_langinfo (D_T_FMT), gmt);
87
  
89
  timebuf[sizeof(timebuf)-1] = '\0';
88
  // Create the timestamp
89
  strftime (&i18nTime[0], 32, "%c", localtime(&currentTime));
90
  if ((tmp=strstr(i18nTime, "CEST")) != NULL)
91
	*(tmp--) = '\0';
92
93
  std::cout << "Event: " << Glib::locale_to_utf8(i18nTime) << std::endl;
94
90
95
  // FIXME: make a table for event transition
91
  // FIXME: make a table for event transition
96
  // No status change
92
  // No status change
Lines 125-131 Link Here
125
  // Create the new row
121
  // Create the new row
126
  Gtk::TreeModel::Row row = *(refListModel->append());
122
  Gtk::TreeModel::Row row = *(refListModel->append());
127
  row[eventColumns.eventText] = newEvent.c_str();
123
  row[eventColumns.eventText] = newEvent.c_str();
128
  row[eventColumns.eventDate] = Glib::ustring(Glib::locale_to_utf8(i18nTime));
124
  row[eventColumns.eventDate] = Glib::ustring(timebuf);
129
  row[eventColumns.eventIcon] = Gtk::Image(getSeverityIcon(evtSeverity)).get_pixbuf();
125
  row[eventColumns.eventIcon] = Gtk::Image(getSeverityIcon(evtSeverity)).get_pixbuf();
130
126
131
  // Set focus on the last event
127
  // Set focus on the last event

Return to bug 232855