void UninstallInfoPage::onButtonClicked( wxCommandEvent& event ) { if (event.GetId() == m_butCancel->GetId()) { GetParent()->Close(); } else if (event.GetId() == m_butUninstall->GetId()) { ItemForm* itemForm = dynamic_cast<ItemForm*>(GetParent()); if (!itemForm) { GetParent()->Close(); return; } bool res = itemForm->startUninstall(m_cbComplete->GetValue(), m_cbAccount->GetValue()); if (res) { m_cbComplete->Enable(false); m_cbAccount->Enable(false); m_butCancel->Enable(false); m_butUninstall->Enable(false); } else { GetParent()->Close(); } } }
void InstallVerifyInfoPage::onButtonClicked( wxCommandEvent& event ) { if (event.GetId() == m_butCancel->GetId()) { GetParent()->Close(); } else if (event.GetId() == m_butVerify->GetId()) { ItemForm* itemForm = dynamic_cast<ItemForm*>(GetParent()); if (!itemForm) { GetParent()->Close(); return; } bool res = itemForm->startVerify(m_cbFiles->GetValue(), m_cbTools->GetValue(), m_cbInstallHook->GetValue()); if (res) { m_cbFiles->Enable(false); m_cbTools->Enable(false); m_cbInstallHook->Enable(false); m_butVerify->Enable(false); m_butCancel->Enable(false); } else { GetParent()->Close(); } } }
bool DrStrangecodeRssReader::OnAppInitializing(AppRegistry& appRegistry) { // Create a form MainForm *pMainForm = new MainForm(); pMainForm->Initialize(); pMainForm->SetName(kMainFormNameString); ItemForm * pItemForm = new ItemForm(); pItemForm->Initialize(); pItemForm->SetName(kItemFormNameString); // Add the form to the frame Frame *pFrame = GetAppFrame()->GetFrame(); pFrame->AddControl(*pMainForm); pFrame->AddControl(*pItemForm); // Set the current form pFrame->SetCurrentForm(*pMainForm); // Draw and Show the form pMainForm->Draw(); pMainForm->Show(); return true; }
void UninstallInfoPage::onButtonClicked( wxCommandEvent& event ) { ItemForm* itemForm = dynamic_cast<ItemForm*>(GetParent()); if (!itemForm) { GetParent()->Close(); return; } if (event.GetId() == m_butCancel->GetId()) { if (!itemForm->restorePage()) itemForm->Close(); } else if (event.GetId() == m_butUninstall->GetId()) { auto closeWatcher = m_pCloseWatcher; bool res = itemForm->startUninstall(m_cbComplete->GetValue(), m_cbAccount->GetValue()); { std::lock_guard<std::mutex> guard(closeWatcher->m_Lock); if (closeWatcher->m_bIsClosed) return; if (res) { m_cbComplete->Enable(false); m_cbAccount->Enable(false); m_butCancel->Enable(false); m_butUninstall->Enable(false); return; } } //Cant hold lock above as we will recurse onto it GetParent()->Close(); } }