updated time display, as it no longer needs a valid session id
This commit is contained in:
parent
d554a793d1
commit
c687ab5a52
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
|
|
||||||
Author : $Author: maroy $
|
Author : $Author: maroy $
|
||||||
Version : $Revision: 1.2 $
|
Version : $Revision: 1.3 $
|
||||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/MasterPanelWindow.cxx,v $
|
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/MasterPanelWindow.cxx,v $
|
||||||
|
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
@ -163,24 +163,18 @@ MasterPanelWindow :: resetTimer(void) throw ()
|
||||||
bool
|
bool
|
||||||
MasterPanelWindow :: onUpdateTime(int dummy) throw ()
|
MasterPanelWindow :: onUpdateTime(int dummy) throw ()
|
||||||
{
|
{
|
||||||
Ptr<SessionId>::Ref sessionId = gLiveSupport->getSessionId();
|
Ptr<const ptime>::Ref now = gLiveSupport->getScheduler()
|
||||||
|
->getSchedulerTime();
|
||||||
|
|
||||||
|
if (now.get()) {
|
||||||
|
time_duration dayTime = now->time_of_day();
|
||||||
|
// get the time of day, only up to a second precision
|
||||||
|
time_duration dayTimeSec(dayTime.hours(),
|
||||||
|
dayTime.minutes(),
|
||||||
|
dayTime.seconds(),
|
||||||
|
0);
|
||||||
|
|
||||||
if (sessionId.get()) {
|
timeWidget->set_text(to_simple_string(dayTimeSec));
|
||||||
Ptr<const ptime>::Ref now = gLiveSupport->getScheduler()
|
|
||||||
->getSchedulerTime(sessionId);
|
|
||||||
|
|
||||||
if (now.get()) {
|
|
||||||
time_duration dayTime = now->time_of_day();
|
|
||||||
// get the time of day, only up to a second precision
|
|
||||||
time_duration dayTimeSec(dayTime.hours(),
|
|
||||||
dayTime.minutes(),
|
|
||||||
dayTime.seconds(),
|
|
||||||
0);
|
|
||||||
|
|
||||||
timeWidget->set_text(to_simple_string(dayTimeSec));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
timeWidget->set_text("time");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
|
|
||||||
Author : $Author: maroy $
|
Author : $Author: maroy $
|
||||||
Version : $Revision: 1.9 $
|
Version : $Revision: 1.10 $
|
||||||
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/Attic/UiTestMainWindow.cxx,v $
|
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/Attic/UiTestMainWindow.cxx,v $
|
||||||
|
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
@ -227,22 +227,18 @@ UiTestMainWindow :: onLoginButtonClicked (void) throw ()
|
||||||
bool
|
bool
|
||||||
UiTestMainWindow :: onUpdateTime(int dummy) throw ()
|
UiTestMainWindow :: onUpdateTime(int dummy) throw ()
|
||||||
{
|
{
|
||||||
Ptr<SessionId>::Ref sessionId = gLiveSupport->getSessionId();
|
Ptr<const ptime>::Ref now = gLiveSupport->getScheduler()
|
||||||
|
->getSchedulerTime();
|
||||||
|
|
||||||
|
if (now.get()) {
|
||||||
|
time_duration dayTime = now->time_of_day();
|
||||||
|
// get the time of day, only up to a second precision
|
||||||
|
time_duration dayTimeSec(dayTime.hours(),
|
||||||
|
dayTime.minutes(),
|
||||||
|
dayTime.seconds(),
|
||||||
|
0);
|
||||||
|
|
||||||
if (sessionId.get()) {
|
timeLabel->set_text(to_simple_string(dayTimeSec));
|
||||||
Ptr<const ptime>::Ref now = gLiveSupport->getScheduler()
|
|
||||||
->getSchedulerTime(sessionId);
|
|
||||||
|
|
||||||
if (now.get()) {
|
|
||||||
time_duration dayTime = now->time_of_day();
|
|
||||||
// get the time of day, only up to a second precision
|
|
||||||
time_duration dayTimeSec(dayTime.hours(),
|
|
||||||
dayTime.minutes(),
|
|
||||||
dayTime.seconds(),
|
|
||||||
0);
|
|
||||||
|
|
||||||
timeLabel->set_text(to_simple_string(dayTimeSec));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue