/* Callback for the Audit property sheet */ INT_PTR CALLBACK GameAuditDialogProc(HWND hDlg,UINT Msg,WPARAM wParam,LPARAM lParam) { switch (Msg) { case WM_INITDIALOG: FlushFileCaches(); hAudit = hDlg; Static_SetText(GetDlgItem(hDlg, IDC_PROP_TITLE), GameInfoTitle(rom_index)); SetTimer(hDlg, 0, 1, NULL); return 1; case WM_TIMER: KillTimer(hDlg, 0); { int iStatus; LPCSTR lpStatus; iStatus = Mame32VerifyRomSet(rom_index); lpStatus = DriverUsesRoms(rom_index) ? StatusString(iStatus) : "None required"; SetWindowText(GetDlgItem(hDlg, IDC_PROP_ROMS), lpStatus); iStatus = Mame32VerifySampleSet(rom_index); lpStatus = DriverUsesSamples(rom_index) ? StatusString(iStatus) : "None required"; SetWindowText(GetDlgItem(hDlg, IDC_PROP_SAMPLES), lpStatus); } ShowWindow(hDlg, SW_SHOW); break; } return 0; }
HttpHeader HttpHeader::Builder::build() const { std::string headerStr; switch (m_requestType) { case eRequestType::HTTP_REQUEST_GET: { headerStr += "GET "; headerStr += m_requestPath; headerStr += " HTTP/1.1\r\n"; break; } case eRequestType::HTTP_REQUEST_POST: { headerStr += "POST "; headerStr += m_requestPath; headerStr += " HTTP/1.1\r\n"; break; } case eRequestType::HTTP_RESPONSE: { headerStr += "HTTP/1.1 "; headerStr += StatusString(m_statusCode); headerStr += "\r\n"; break; } case eRequestType::UNKNOWN: { return HttpHeader(); } } headerStr += Joiner().on("\r\n").join(m_headers.begin(), m_headers.end()); headerStr += "\r\n\r\n"; HttpHeader rVal; rVal.parsePartial(core::memory::ConstBlob((u8 *) headerStr.c_str(), headerStr.length())); return rVal; }
void DownloadUI::UpdateDownloadList(void) { if (!m_List || !isVisible) return; gtk_clist_freeze(GTK_CLIST(m_List)); gtk_clist_clear(GTK_CLIST(m_List)); uint32 iLoop = downloadList.size(); if (iLoop == 0) { gtk_clist_thaw(GTK_CLIST(m_List)); return; } for (uint32 i = 0; i < iLoop; i++) { DownloadItem *dli = downloadList[i]; char *iText[2]; string displayString = dli->GetMetaData().Title(); iText[0] = (char *)displayString.c_str(); iText[1] = (char *)StatusString(dli).c_str(); int row = gtk_clist_append(GTK_CLIST(m_List), iText); gtk_clist_set_row_data(GTK_CLIST(m_List), row, (gpointer)dli); } gtk_clist_select_row(GTK_CLIST(m_List), m_currentindex, 0); SelChangeEvent(m_currentindex); gtk_clist_thaw(GTK_CLIST(m_List)); }
void DownloadUI::AddItem(DownloadItem *dli) { if (!dli || !m_List || !isVisible) return; char *iText[2]; string displayString = dli->GetMetaData().Title(); iText[0] = (char *)displayString.c_str(); iText[1] = (char *)StatusString(dli).c_str(); int row = gtk_clist_append(GTK_CLIST(m_List), iText); gtk_clist_set_row_data(GTK_CLIST(m_List), row, (gpointer)dli); }
void DownloadUI::UpdateItem(DownloadItem *dli) { if (!dli || !m_List || !isVisible) return; int row = gtk_clist_find_row_from_data(GTK_CLIST(m_List), (gpointer)dli); if (row < 0) return; char *iText[2]; iText[0] = (char *)StatusString(dli).c_str(); if (gtk_clist_get_text(GTK_CLIST(m_List), row, 1, &iText[1])) { if (!strcmp(iText[0], iText[1])) return; } gtk_clist_set_text(GTK_CLIST(m_List), row, 1, iText[0]); if (row == (int)m_currentindex) SelChangeEvent(m_currentindex); }