the time displayed is now time that is read off the server...

This commit is contained in:
maroy 2004-12-14 13:03:10 +00:00
parent ae093e2cdc
commit ecb2a677f0
2 changed files with 30 additions and 13 deletions

View File

@ -22,7 +22,7 @@
Author : $Author: maroy $
Version : $Revision: 1.5 $
Version : $Revision: 1.6 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/GLiveSupport.h,v $
------------------------------------------------------------------------------*/
@ -85,7 +85,7 @@ using namespace LiveSupport::SchedulerClient;
* respective documentation.
*
* @author $Author: maroy $
* @version $Revision: 1.5 $
* @version $Revision: 1.6 $
* @see LocalizedObject#getBundle(const xmlpp::Element &)
* @see AuthenticationClientFactory
* @see StorageClientFactory
@ -217,6 +217,17 @@ class GLiveSupport : public Configurable,
void
logout(void) throw ();
/**
* Accessor function to the scheduler client held by this object.
*
* @return the scheduler client held by this object.
*/
Ptr<SchedulerClientInterface>::Ref
getScheduler(void) throw ()
{
return scheduler;
}
/**
* Accessor function to the storage client held by this object.
*

View File

@ -22,7 +22,7 @@
Author : $Author: maroy $
Version : $Revision: 1.7 $
Version : $Revision: 1.8 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/products/gLiveSupport/src/Attic/UiTestMainWindow.cxx,v $
------------------------------------------------------------------------------*/
@ -226,17 +226,23 @@ UiTestMainWindow :: onLoginButtonClicked (void) throw ()
bool
UiTestMainWindow :: onUpdateTime(int dummy) throw ()
{
// TODO: read current time from scheduler server, via the gLiveSupport
// object
Ptr<ptime>::Ref now = TimeConversion::now();
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);
Ptr<SessionId>::Ref sessionId = gLiveSupport->getSessionId();
timeLabel->set_text(to_simple_string(dayTimeSec));
if (sessionId.get()) {
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;
}