From ecb2a677f0d162df272eff626f73351e55a13214 Mon Sep 17 00:00:00 2001 From: maroy Date: Tue, 14 Dec 2004 13:03:10 +0000 Subject: [PATCH] the time displayed is now time that is read off the server... --- .../products/gLiveSupport/src/GLiveSupport.h | 15 ++++++++-- .../gLiveSupport/src/UiTestMainWindow.cxx | 28 +++++++++++-------- 2 files changed, 30 insertions(+), 13 deletions(-) diff --git a/livesupport/products/gLiveSupport/src/GLiveSupport.h b/livesupport/products/gLiveSupport/src/GLiveSupport.h index 294db8223..4bd98ffd3 100644 --- a/livesupport/products/gLiveSupport/src/GLiveSupport.h +++ b/livesupport/products/gLiveSupport/src/GLiveSupport.h @@ -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::Ref + getScheduler(void) throw () + { + return scheduler; + } + /** * Accessor function to the storage client held by this object. * diff --git a/livesupport/products/gLiveSupport/src/UiTestMainWindow.cxx b/livesupport/products/gLiveSupport/src/UiTestMainWindow.cxx index 49768b234..2034b935a 100644 --- a/livesupport/products/gLiveSupport/src/UiTestMainWindow.cxx +++ b/livesupport/products/gLiveSupport/src/UiTestMainWindow.cxx @@ -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::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::Ref sessionId = gLiveSupport->getSessionId(); - timeLabel->set_text(to_simple_string(dayTimeSec)); + if (sessionId.get()) { + Ptr::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; }