void MainWindow::model_executionStateChanged(bool running) { bool hasSelection = _ui->testsTree->selectionModel()->selectedIndexes().count() > 0; _ui->actionNew->setEnabled(!running); _ui->actionOpen->setEnabled(!running); _ui->actionSave->setEnabled(!running); _ui->actionSave_As->setEnabled(!running); _ui->actionAdd_test_executable->setEnabled(!running); _ui->actionRemove_test_executable->setEnabled(!running && hasSelection); _ui->actionRun_selected->setEnabled(!running); _ui->actionRefresh_tests->setEnabled(!running && hasSelection); _ui->actionTerminate->setEnabled(running); if (!running) { _ui->progressBar->setValue(0); _ui->statusBar->clearMessage(); if (hasSelection) { updateOutput(static_cast<TestItemBase*>( _ui->testsTree->selectionModel()->selectedIndexes().first().internalPointer() )); } emit SetErrorCount(this, _model.rootItem()->getErrorCount()); emit ClearProgress(this); } else { _ui->outputEdit->setText(QString()); } }
// // TextDisplayClose // void TextDisplayClose(void) { if (curr_disp == DIS_INVALID || disable_progress) return; ClearProgress(); }
// // TextDisplaySetBar // void TextDisplaySetBar(int barnum, int count) { int perc; if (curr_disp == DIS_INVALID || disable_progress || progress_target <= 0) { return; } // select the correct bar if ((curr_disp == DIS_FILEPROGRESS && barnum != 1) || (curr_disp == DIS_BUILDPROGRESS && barnum != 1)) { return; } if (count > progress_target) TextFatalError("\nINTERNAL ERROR: Progress went past target !\n\n"); perc = count * 100 / progress_target; if (perc == progress_shown) return; if (perc == 0) ClearProgress(); else fprintf(stderr, "--%3d%%--\b\b\b\b\b\b\b\b", perc); progress_shown = perc; }
BOOL CDLUpdateDlg::OnInitDialog() { HRESULT hr = S_OK; CDialog::OnInitDialog(); FC_DEBUGPRINT1(_T("CEDL> CDLUpdateDlg::OnInitDialog(): thread id=0x%x\n"),::GetCurrentThreadId()); assert(m_pStation != NULL); //set the help id for context sensitive help SetWindowContextHelpId(IDD); // init the controls m_ImageList.Create(IDB_DOMIMAGELIST, DLG_BITMAP_WIDTH, 0, RGB(255, 0, 255)); m_ImageList.SetBkColor(GetSysColor(COLOR_WINDOW)); m_DomainListCtrl.SetImageList(&m_ImageList, LVSIL_SMALL); m_DomainListCtrl.SetExtendedStyle(LVS_EX_GRIDLINES | LVS_EX_HEADERDRAGDROP | LVS_EX_FULLROWSELECT); DisplayColumnHeadings(IDS_COL_DOMAINLIST); m_DownloadBtn.EnableWindow(FALSE); m_strControlName.Format(_T("%s [%s]"), m_pStation->GetConfigName(), m_pStation->GetAddress()); ClearProgress(); // start the preparation for DL assert(m_pDLEvents != NULL); m_pDLEvents->SetListClient(this->GetSafeHwnd()); if (m_pStation->IsRequestPending()) { FC_DEBUGPRINT(_T("CEDL> OnInitDialog: Download Pending\n")); m_pStation->FireErrorMessage(E_CE_DL_PENDING); m_pStation->FireError(E_CE_DL_PENDING); m_strDomainName.LoadString(IDS_CONN_INTR); UpdateData(FALSE); return TRUE; } m_strDomainName.LoadString(IDS_CONN); UpdateData(FALSE); m_hSaveCursor = ::SetCursor(::LoadCursor(NULL, IDC_APPSTARTING)); m_hwndCapture = GetSafeHwnd(); if (m_hwndCapture) { ::SetCapture(m_hwndCapture); } m_pStation->SetSignal(BUILD_DL_LIST); m_pStation->ResetSignal(DOWN_LD); m_pStation->ResetSignal(DOWN_LD_ALL); m_pStation->ResetSignal(PRJ_NEW); m_pStation->ResetSignal(PRJ_CHANGED); m_pStation->SetState(CEDL_STAT_WAIT_CONNECT); m_pStation->DoStateMachine(); if(FAILED(hr)) { FC_DEBUGPRINT1(_T("CEDL> OnInitDialog: failed hr= 0x%x\n"),hr); m_pStation->FireErrorMessage(hr); m_pStation->FireError(hr); } return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
void MainWindow::Clean() { if (_model.isRunning()) return; _actualFile.clear(); _model.clear(); updateTitle(); emit SetErrorCount(this, 0); emit ClearProgress(this); }
int InstallerWindow::ExecOnThread() { try { auto_any<htmlayout::dom::element *, html_disabled> btn_install(& button_install); htmlayout::queue::push(new html_set_attribute_task(& button_install, "disabled", L"disabled"), HtmlWindow::s_hwnd); auto_any<htmlayout::dom::element *, html_disabled> btn_skip(& button_skip); htmlayout::queue::push(new html_set_attribute_task(& button_skip, "disabled", L"disabled"), HtmlWindow::s_hwnd); ClearError(); ClearProgress(); InstallConfiguration * p_configuration = reinterpret_cast<InstallConfiguration *>(get(m_configuration)); CHECK_BOOL(p_configuration != NULL, L"Invalid configuration"); if (RestartElevated()) { OnCancel(); return 0; } Components components = p_configuration->GetSupportedComponents( InstallerSession::Instance->lcidtype, InstallerSession::Instance->sequence); SetProgressTotal(components.size() * 2); int rc = components.Exec(this); InstallerUI::AfterInstall(rc); return 0; } catch(std::exception& ex) { LOG(L"*** Failed to install one or more components: " << DVLib::string2wstring(ex.what())); ShowError(DVLib::string2wstring(ex.what())); RecordError(); } catch(...) { LOG(L"*** Failed to install one or more components"); ShowError(TEXT("Failed to install one or more components")); RecordError(); } return 0; }
void CDLUpdateDlg::OnUpdateSelectall() { int nMaxItems = m_DomainListCtrl.GetItemCount(); if(nMaxItems == LB_ERR) return; for(int iItem = 0; iItem < nMaxItems; iItem++) { LV_ITEM Item; Item.iItem = iItem; Item.iSubItem = 0; Item.mask = LVIF_STATE; Item.state = LVIS_SELECTED; Item.stateMask = (UINT)-1; m_DomainListCtrl.SetItem(&Item); } m_DomainListCtrl.Invalidate(); ClearProgress(); return; }
void CDLUpdateDlg::OnUpdateDownload() { HRESULT hr = S_OK; assert(m_pStation != NULL); ClearProgress(); m_DownloadBtn.EnableWindow(FALSE); if (m_pStation->IsRequestPending()) { m_pStation->FireError(E_CE_DL_PENDING); return; } m_pStation->ResetSignal(DOWN_LD_ALL); m_pStation->ResetSignal(BUILD_DL_LIST); m_pStation->SetSignal(DOWN_LD); m_pStation->ResetSignal(CHANGED); m_pStation->FireStartDownload(); hr = m_pStation->DoStateMachine(); if(FAILED(hr)) { m_pStation->FireError(hr); } return; }
void InstallerWindow::OnShow() { htmlayout::dom::element r = GetRoot(); components = r.get_element_by_id("components"); // os label htmlayout::dom::element os = r.get_element_by_id("os"); if (os.is_valid()) { os.set_text((DVLib::GetOperatingSystemVersionString() + L" (" + DVLib::pa2wstring(DVLib::GetProcessorArchitecture()) + L")").c_str()); } // status status = r.get_element_by_id("status"); // error error = r.get_element_by_id("error"); ClearError(); // progress progress = r.get_element_by_id("progress"); ClearProgress(); // load components LoadComponents(); InstallConfiguration * p_configuration = reinterpret_cast<InstallConfiguration *>(get(m_configuration)); CHECK_BOOL(p_configuration != NULL, L"Invalid configuration"); // labels and info htmlayout::dom::element dialog_message = r.get_element_by_id("dialog_message"); if (dialog_message.is_valid()) { dialog_message.set_text(InstallerSession::Instance->sequence == SequenceInstall ? p_configuration->dialog_message.GetValue().c_str() : p_configuration->dialog_message_uninstall.GetValue().c_str()); } button_install = r.get_element_by_id("button_install"); if (button_install.is_valid()) { button_install.set_text(p_configuration->install_caption.GetValue().c_str()); if (InstallerSession::Instance->sequence != SequenceInstall) button_install.destroy(); } button_uninstall = r.get_element_by_id("button_uninstall"); if (button_uninstall.is_valid()) { button_uninstall.set_text(p_configuration->uninstall_caption.GetValue().c_str()); if (InstallerSession::Instance->sequence != SequenceUninstall) button_uninstall.destroy(); } button_skip = r.get_element_by_id("button_skip"); if (button_skip.is_valid()) { button_skip.set_text(p_configuration->skip_caption.GetValue().c_str()); if (! m_additional_config) { button_skip.destroy(); } } button_cancel = r.get_element_by_id("button_cancel"); if (button_cancel.is_valid()) { button_cancel.set_text(p_configuration->cancel_caption.GetValue().c_str()); } AddUserControls(); AddElevatedControls(); Start(); }