void PageUpgrade::OnEnter(int leavePageId) {
  for (int i = 0; i < taskListView_.GetCount(); i++) {
    taskListView_.SetState(i, -1);
  }
  
  progressBar_.SetPos(0);

  SetHeaderInfo(HEADER_STYLE_INFO, IDS_PROMPT_UPGRADE, 0);
  SetHeaderButtonText(IDC_BUTTON_START, IDS_BUTTON_START);
}
void PageUpgrade::OnBnClickedButtonStart() {
  if (upgradeThread_.IsAlive()) {
    return;
  }

  EnableConnectionCheck(false);

  SetHeaderInfo(HEADER_STYLE_INFO, IDS_PROMPT_UPGADE_PROCESSING, 0);

  upgradeThread_.Start(new MethodRunnable<PageUpgrade>(this, &PageUpgrade::UpgradeAsync));
}
LRESULT PageUpgrade::OnUpgradeCompleted(WPARAM wParam, LPARAM lParam) {
  upgradeThread_.WaitForExit(INFINITE);

  if (!(BOOL)wParam) {
    int error = (int)lParam;
    
    SetHeaderInfo(HEADER_STYLE_ERROR, IDS_PROMPT_UPGADE_FAILED, 0);
    SetHeaderButtonText(IDC_BUTTON_START, IDS_BUTTON_RETRY);
  } else {
    //GotoStep(STEP_IR_CALIBRATION);
  }

  EnableConnectionCheck(true);

  return 0;
}
Exemplo n.º 4
0
void CSaveLoadInfoBase::Save(PCLibInfoBase pSrc)
{
	PCInfoBase pInfo;

	pInfo = NULL;
	if (pSrc == NULL) {
		goto Exit;
	}

	m_pLibInfoBase = pSrc;
	pInfo = m_pLibInfoBase->GetNew ();

	SetHeaderInfo (pInfo);
	MakeWriteData ();
	WriteData ();

Exit:
	SAFE_DELETE (pInfo);
}
Exemplo n.º 5
0
void CSaveLoadInfoBase::Load(PCLibInfoBase pDst)
{
	BOOL bResult;
	PCInfoBase pInfo;

	pInfo = NULL;
	if (pDst == NULL) {
		goto Exit;
	}

	m_pLibInfoBase = pDst;
	pInfo = m_pLibInfoBase->GetNew ();

	SetHeaderInfo (pInfo);
	bResult = ReadData ();
	if (bResult == FALSE) {
		goto Exit;
	}
	ReadHeader ();

Exit:
	SAFE_DELETE (pInfo);
}