예제 #1
0
STDMETHODIMP ProgressWrap::COMGETTER(TimeRemaining)(LONG *aTimeRemaining)
{
    LogRelFlow(("{%p} %s: enter aTimeRemaining=%p\n", this, "Progress::getTimeRemaining", aTimeRemaining));

    VirtualBoxBase::clearError();

    HRESULT hrc;

    try
    {
        CheckComArgOutPointerValidThrow(aTimeRemaining);

        AutoCaller autoCaller(this);
        if (FAILED(autoCaller.rc()))
            throw autoCaller.rc();

        hrc = getTimeRemaining(aTimeRemaining);
    }
    catch (HRESULT hrc2)
    {
        hrc = hrc2;
    }
    catch (...)
    {
        hrc = VirtualBoxBase::handleUnexpectedExceptions(this, RT_SRC_POS);
    }

    LogRelFlow(("{%p} %s: leave *aTimeRemaining=%RI32 hrc=%Rhrc\n", this, "Progress::getTimeRemaining", *aTimeRemaining, hrc));
    return hrc;
}
예제 #2
0
void NeoBattery::updateSysStatus()
{
    charging = isCharging();
    qLog(PowerManagement) << __PRETTY_FUNCTION__ << charging;

    int capacity = getCapacity();

    battery->setCharging(charging);
    battery->setCharge(capacity);
    battery->setTimeRemaining(getTimeRemaining());
    // stop the charging animation when fully charged and plugged in
    // otherwise it looks like it never gets full
   if (capacity > 98 && charging)
       battery->setCharging(false);

}
예제 #3
0
void Town::update(float dt)
{
  string text;
  char time_remaining[10];

  counter += dt;

  TextLabel *label = (TextLabel*) game.getSceneManager()->getActive()->findEntity(string("time"));
  if(label != 0)
  {
    sprintf(time_remaining, "%d", (int) getTimeRemaining());
    text = "Time: ";
    text += time_remaining;
    label->setText(text); 
  }

  if(counter >= time)
    game.setGameOver(true);
}
예제 #4
0
		// Returns a friendly string for the current time remaining
		inline std::string getTextTimeRemaining()
		{
			return getTimeString(getTimeRemaining());
		}
예제 #5
0
std::string gt::Torrent::getTextTimeRemaining()
{
	return getTimeString(getTimeRemaining());
}