void ChatView::showEvent(QShowEvent *event) { evaluateJavaScript(LS("alignChat();")); QWebView::showEvent(event); }
QString ChannelsView::toUrl(const QString &id, const QString &name) const { return LS("chat://channel/") + id + LS("/open?name=") + ChatId::toBase32(name.toUtf8()) + LS("&gender=0"); }
void slowpathLock(Node::Ptr oldTail) { // makes sure that init of me.next is prior to tail_link in // other thread VEDGE(node_init, enqueue); // init of me needs to be done before publishing it to // previous thread also VEDGE(node_init, tail_link); // Can't write self into previous node until previous node inited XEDGE(enqueue, tail_link); LS(node_init, Node me); Node::Ptr curTail; bool newThreads; // Step one, put ourselves at the back of the queue for (;;) { Node::Ptr newTail = Node::Ptr(&me, oldTail.tag()); // Enqueue ourselves... if (L(enqueue, tail_.compare_exchange_strong(oldTail, newTail))) break; // OK, maybe the whole thing is just unlocked now? if (oldTail == Node::Ptr(nullptr, 0)) { // If so, try the top level lock if (tail_.compare_exchange_strong(oldTail, Node::Ptr(nullptr, 1))) goto out; } delay(); } // Need to make sure not to compete for the lock before the // right time. This makes sure the ordering doesn't get messed // up. XEDGE(ready_wait, lock); // Step two: OK, there is an actual queue, so link up with the old // tail and wait until we are at the head of the queue if (oldTail.ptr()) { // * Writing into the oldTail is safe because threads can't // leave unless there is no thread after them or they have // marked the next ready L(tail_link, oldTail->next = &me); while (!L(ready_wait, me.ready)) delay(); } // Step three: wait until the lock is freed // We don't need a a constraint from this load; "lock" serves // to handle this just fine: lock can't succeed until we've // read an unlocked tail_. while ((curTail = tail_).tag()) { delay(); } // Our lock acquisition needs to be finished before we give the // next thread a chance to try to acquire the lock or it could // compete with us for it, causing trouble. VEDGE(lock, signal_next); // Step four: take the lock for (;;) { assert_eq(curTail.tag(), 0); assert_ne(curTail.ptr(), nullptr); newThreads = curTail.ptr() != &me; // If there aren't any waiters after us, the queue is // empty. Otherwise, keep the old tail. Node *newTailP = newThreads ? curTail : nullptr; Node::Ptr newTail = Node::Ptr(newTailP, 1); if (L(lock, tail_.compare_exchange_strong(curTail, newTail))) break; } // Step five: now that we have the lock, if any threads came // in after us, indicate to the next one that it is at the // head of the queue if (newThreads) { // Next thread might not have written itself in, yet, // so we have to wait. Node *next; XEDGE(load_next, signal_next); while (!L(load_next, next = me.next)) delay(); L(signal_next, next->ready = true); } //printf("full slowpath out\n"); out: //printf("made it out of slowpath!\n"); return; }
void CIwResultPropertyPage::InitManagerResult(int nManagerIndex, bool bChecked, const CString & sSupplierName, const TImportResult& tImportResult) { ASSERT(nManagerIndex >= 0 && nManagerIndex <= sizeof(g_arrIwManagerControls)/sizeof(TIwManagerControls) - 1); const TIwManagerControls& tIwManagerControls = g_arrIwManagerControls[nManagerIndex]; CWnd* pwndMgr = GetDlgItem(tIwManagerControls.nResPageMgrId); CWnd* pwndSuccessful = GetDlgItem(tIwManagerControls.nResPageSucessfulId); CWnd* pwndFailed = GetDlgItem(tIwManagerControls.nResPageFailedId); CWnd* pwndUnprocessed = GetDlgItem(tIwManagerControls.nResPageUnprocessedId); CWnd* pwndTotal = GetDlgItem(tIwManagerControls.nResPageTotalId); ASSERT(pwndMgr != 0); ASSERT(pwndSuccessful != 0); ASSERT(pwndFailed != 0); ASSERT(pwndUnprocessed != 0); ASSERT(pwndTotal != 0); pwndMgr->SetWindowText(sSupplierName); if (!bChecked) { pwndMgr->EnableWindow(0); pwndSuccessful->EnableWindow(0); pwndFailed->EnableWindow(0); pwndUnprocessed->EnableWindow(0); pwndTotal->EnableWindow(0); } else { CString sStatistics; CString sTmp; pwndSuccessful->GetWindowText(sStatistics); sStatistics += _T(" "); if (tImportResult.nSuccess == -1) { sStatistics += LS (L_UNDEFINED_IMPORT_RESULT); } else { sTmp.Format(_T("%d"), tImportResult.nSuccess); sStatistics += sTmp; } pwndSuccessful->SetWindowText(sStatistics); pwndFailed->GetWindowText(sStatistics); sStatistics += _T(" "); if (tImportResult.nFailure == -1) { sStatistics += LS (L_UNDEFINED_IMPORT_RESULT); } else { sTmp.Format(_T("%d"), tImportResult.nFailure); sStatistics += sTmp; } pwndFailed->SetWindowText(sStatistics); pwndUnprocessed->GetWindowText(sStatistics); sStatistics += _T(" "); if (tImportResult.nUnprocessed == -1) { sStatistics += LS (L_UNDEFINED_IMPORT_RESULT); } else { sTmp.Format(_T("%d"), tImportResult.nUnprocessed); sStatistics += sTmp; } pwndUnprocessed->SetWindowText(sStatistics); pwndTotal->GetWindowText(sStatistics); sStatistics += _T(" "); if (tImportResult.nTotal == -1) { sStatistics += LS (L_UNDEFINED_IMPORT_RESULT); } else { sTmp.Format(_T("%d"), tImportResult.nTotal); sStatistics += sTmp; } pwndTotal->SetWindowText(sStatistics); } }
CString COrbitSupplier::GetSupplierName() const { CString sSupplier = LS (L_FILE_IMPORT_OTHER_CLIENTS_ORBIT_DOWNLOADER); return sSupplier; }
void CSiteManager_PasswordsPage::OnDelall() { if (IDYES == MessageBox (LS (L_AREYOUSURE), LS (L_CONFIRMATION), MB_OK|MB_YESNO)) _SitesMgr.DeleteAllPasswords (); }
BOOL CDlgExportHistory::ExportHistory(LPCSTR pszFile, fs::list <fsDLHistoryRecord*> &vpHist, BOOL bAppend) { HANDLE hFile = CreateFile (pszFile, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if (hFile == INVALID_HANDLE_VALUE) return FALSE; CString str; if (bAppend && GetLastError () == ERROR_ALREADY_EXISTS) { DWORD dwSize = GetFileSize (hFile, NULL); if (dwSize > 10000) { SetFilePointer (hFile, dwSize - 10000, NULL, FILE_BEGIN); dwSize = 10000; } DWORD dw; LPSTR psz = new char [dwSize+1]; ReadFile (hFile, psz, dwSize, &dw, NULL); psz [dwSize] = 0; int nLen = lstrlen (psz); if (nLen != (int) dwSize) { CloseHandle (hFile); return FALSE; } LPSTR psz2 = psz + nLen - 7; while (psz2 != psz) { if (_memicmp (psz2, "</body>", 7) == 0) { *psz2 = 0; break; } *psz2--; } if (psz2 == psz) { CloseHandle (hFile); return FALSE; } SetFilePointer (hFile, (psz2 - psz) - nLen, NULL, FILE_END); SetEndOfFile (hFile); delete [] psz; } else { SetEndOfFile (hFile); str = "<html>\n"; str += "<style type=\"text/css\">\n"; str += "<!--\n"; str += "H3 { font-size: 19px; font-family: Tahoma; color: #cc0000;}\n"; str += "TR { font-size: 12px; font-family: Tahoma; color: #000033}\n"; str += "TD { font-size: 12px; font-family: Tahoma; color: #000033}\n"; str += "A,A:visited,A:active { text-decoration: none; }\n"; str += "A:hover { text-decoration: underline; }\n"; str += "-->\n"; str += "</style>\n"; str += "<body>\n"; str += "<h3>"; str += LS (L_FDMHIST); str += "</h3>\n"; } for (int i = 0; i < vpHist.size (); i++) { fsDLHistoryRecord* rec = vpHist [i]; str += "<table width=\"75%\" border=\"1\">\n"; str += "<tr><td width=\"180\">"; str += LS (L_URLOFDOWNLOAD); str += ":</td>"; str += "<td><a href=\""; str += rec->strURL; str += "\"> "; str += rec->strURL; str += "</a></td></tr>\n"; if (rec->dateDownloaded.dwHighDateTime) { str += "<tr><td>"; str += LS (L_DLDEDTOFILE); str += ":</td><td>"; str += rec->strSavedTo; str += "</td></tr>\n"; str += "<tr><td>"; str += LS (L_SIZEOFFILE); str += ":</td><td>"; str += BytesToString (rec->uFileSize); str += "</td></tr>\n"; str += "<tr><td>"; str += LS (L_DLDWASCOMPLETED); str += ":</td><td>"; str += TimeToStr (rec->dateDownloaded); str += "</td></tr>\n"; } else { str += "<tr><td>"; str += LS (L_DLDWASDELETED); str += ":</td><td>"; str += TimeToStr (rec->dateRecordAdded); str += "</td></tr>\n"; } if (rec->strComment != "") { CString str2 = rec->strComment; str2.Replace ("\n", "<br>"); str += "<tr><td>"; str += LS (L_DESC); str += ":</td><td>"; str += str2; str += "</td></tr>\n"; } str += "</table><br>\n"; } str += "</body></html>"; DWORD dw; WriteFile (hFile, str, str.GetLength (), &dw, NULL); CloseHandle (hFile); return TRUE; }
void CSpiderWnd::Plugin_GetPluginNames(LPCTSTR *ppszLong, LPCTSTR *ppszShort) { *ppszLong = *ppszShort = LS (L_HTMLSPIDER); }
CString CDlg_Options_Downloads_Flv::get_PageShortTitle() { return LS (L_FLASH_VIDEO); }
BOOL vmsMediaConverter::ConvertMedia(LPCSTR pszSrcFile, LPCSTR pszDstFile, LPCSTR pszDstFormat, LPCSTR pszAudioCodec, int nAudioChannels, int nAudioBitrate, int nAudioRate, LPCSTR pszVideoCodec, int nVideoBitrate, int nVideoFrameRate, int nVideoFrameWidth, int nVideoFrameHeight, int* pnProgress, BOOL *pbCancel) { enum ConvertResult { CR_OK = 0, CR_INVALID_ARGS = 1, CR_DLL_RELOAD_IS_REQUIRED = 2, CR_FAILED = 3, }; static vmsCriticalSectionEx _cs; if (pbCancel) { while (_cs.isLocked () && *pbCancel == FALSE) Sleep (200); if (*pbCancel) return FALSE; } _cs.Lock (); Initialize (); BOOL bRes = FALSE; typedef BOOL (*FNCM)(LPCSTR pszSrcFile, LPCSTR pszDstFile, LPCSTR pszDstFormat, LPCSTR pszAudioCodec, int nAudioChannels, int nAudioBitrate, int nAudioRate, LPCSTR pszVideoCodec, int nVideoBitrate, int nVideoFrameRate, int nVideoFrameWidth, int nVideoFrameHeight, int* pnProgress, BOOL *pbCancel); typedef int (*FNC)(LPCSTR pszSrcFile, LPCSTR pszDstFile, LPCSTR pszDstFormat, LPCSTR pszAudioCodec, int nAudioChannels, int nAudioBitrate, int nAudioRate, LPCSTR pszVideoCodec, int nVideoBitrate, int nVideoFrameRate, int nVideoFrameWidth, int nVideoFrameHeight, int nThreads, int* pnProgress, BOOL *pbCancel, int *pnFfmpegResult); FNC pfn = (FNC) m_dll.GetProcAddress ("Convert"); if (pfn) { int nRes = pfn (pszSrcFile, pszDstFile, pszDstFormat, pszAudioCodec, nAudioChannels, nAudioBitrate, nAudioRate, pszVideoCodec, nVideoBitrate, nVideoFrameRate, nVideoFrameWidth, nVideoFrameHeight, 1, pnProgress, pbCancel, NULL); if (nRes == CR_DLL_RELOAD_IS_REQUIRED) MessageBox (*AfxGetApp ()->m_pMainWnd, "Failed to convert media file. Please try restart FDM.\nError: -2.\nPlease report us about this error.", LS (L_ERROR), MB_ICONERROR); bRes = nRes == CR_OK; if (pbCancel && *pbCancel) bRes = FALSE; } else { FNCM pfn = (FNCM) m_dll.GetProcAddress ("ConvertMediaFile"); if (pfn) { bRes = pfn (pszSrcFile, pszDstFile, pszDstFormat, pszAudioCodec, nAudioChannels, nAudioBitrate, nAudioRate, pszVideoCodec, nVideoBitrate, nVideoFrameRate, nVideoFrameWidth, nVideoFrameHeight, pnProgress, pbCancel); } } Shutdown (); if (!bRes) DeleteFile (pszDstFile); _cs.Unlock (); return bRes; }
void ExternalAuthTask::start() { QVariantMap data = m_cache.value(m_data.id + m_data.cookie); if (!data.isEmpty()) return done(data); m_manager = new QNetworkAccessManager(this); QNetworkRequest request(QUrl(Ch::server()->feed(FEED_NAME_SERVER)->data().value(SERVER_FEED_OAUTH_KEY).toString() + LS("/state/") + SimpleID::encode(m_data.id))); request.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::AlwaysNetwork); request.setRawHeader("X-SChat-Cookie", SimpleID::encode(m_data.cookie)); m_reply = m_manager->get(request); connect(m_reply, SIGNAL(finished()), SLOT(ready())); connect(m_reply, SIGNAL(sslErrors(QList<QSslError>)), SLOT(sslErrors())); }
void CDlg_CheckFileIntegrity_Progress::ApplyLanguage() { SetWindowText (LS (L_PLEASEWAIT)); GetDlgItem (IDCANCEL)->SetWindowText (LS (L_CANCEL)); GetDlgItem (IDC_MESSAGE)->SetWindowText (LS (L_CALCULATINGCHECKSUM)); }
CString CDlg_Options_General_Misc_Advanced::get_PageShortTitle() { return LS (L_ADVANCED); }
void ChatView::alignChat() { page()->mainFrame()->evaluateJavaScript(LS("Settings.scroll = true; alignChat();")); }
void CWaitForConfirmationDlg::SetTimerText() { CString str; str.Format ("%s (%d)", m_bNoIsDefault ? LS (L_NO) : LS (L_YES), m_wait); SetDlgItemText (m_bNoIsDefault ? IDCANCEL : IDOK, str); }
CString CDlg_Options_Downloads_Flv::get_PageTitle() { return LS (L_FVDOWNLOADS); }
CSiteManager_PasswordsPage::CSiteManager_PasswordsPage() : CPropertyPage(CSiteManager_PasswordsPage::IDD) { m_psp.dwFlags |= PSP_USETITLE; m_psp.pszTitle = LS (L_PASSWORDS); }
void LanguageField::indexChanged() { if (save()) ChatCore::settings()->setValue(LS("Translation"), m_translation->name()); }
CDownloadProperties_MirrorsPage::CDownloadProperties_MirrorsPage() : CPropertyPage(CDownloadProperties_MirrorsPage::IDD) { m_psp.dwFlags |= PSP_USETITLE; m_psp.pszTitle = LS (L_MIRRORS); }
CUpload_GeneralPage::CUpload_GeneralPage() : CPropertyPage(CUpload_GeneralPage::IDD) { m_psp.dwFlags |= PSP_USETITLE; m_psp.pszTitle = LS (L_GENERAL); }
void CDlgExportHistory::ExportHistory(int iWhich, BOOL bCompletedOnly, BOOL bAppend) { fs::list <fsDLHistoryRecord*> vpHist; switch (iWhich) { case 0: { _DldsMgr.m_histmgr.Lock (); for (int i = 0; i < _DldsMgr.m_histmgr.GetRecordCount (); i++) { fsDLHistoryRecord* rec = _DldsMgr.m_histmgr.GetRecord (i); if (bCompletedOnly && rec->dateDownloaded.dwHighDateTime == 0) continue; vpHist.add (rec); } _DldsMgr.m_histmgr.Unlock (); } break; case 1: { CDownloads_History* list = &_pwndDownloads->m_wndHistory; int cItems = list->GetItemCount (); for (int i = cItems-1; i >= 0; i--) { fsDLHistoryRecord* rec = (fsDLHistoryRecord*) list->GetItemData (i); if (bCompletedOnly && rec->dateDownloaded.dwHighDateTime == 0) continue; vpHist.add (rec); } } break; case 2: CDownloads_History* list = &_pwndDownloads->m_wndHistory; POSITION pos = list->GetFirstSelectedItemPosition (); while (pos) { int nItem = list->GetNextSelectedItem (pos); fsDLHistoryRecord* rec = (fsDLHistoryRecord*) list->GetItemData (nItem); if (bCompletedOnly && rec->dateDownloaded.dwHighDateTime == 0) continue; vpHist.add (rec); } } if (vpHist.size () == 0) { AfxGetApp ()->m_pMainWnd->MessageBox (LS (L_NOTHINGTOEXPORT), NULL, MB_ICONEXCLAMATION); return; } CString strFilter; strFilter.Format ("%s (*.html)|*.html||", LS (L_HTMLFILES)); UINT flags = OFN_NOCHANGEDIR; if (bAppend == FALSE) flags |= OFN_OVERWRITEPROMPT; CFileDialog dlg (FALSE, "html", NULL, flags, strFilter, NULL); if (_DlgMgr.DoModal (&dlg) == IDCANCEL) return; ExportHistory (dlg.GetPathName (), vpHist, bAppend); }
BOOL CUpload_GeneralPage::OnInitDialog() { CPropertyPage::OnInitDialog(); SetDlgItemText (IDC_PKGNAME, m_upl->pMgr->get_PackageName ()); vmsUploadPackageImpl *pkg = m_upl->pMgr->get_Package (); m_wndNumberOfDlds.AddString ("less than 10"); m_wndNumberOfDlds.AddString ("from 10 to 100"); m_wndNumberOfDlds.AddString ("more than 100"); switch (pkg->m_nSupposedNumberOfDlds) { case 9: m_wndNumberOfDlds.SetCurSel (0); break; case 100: m_wndNumberOfDlds.SetCurSel (1); break; case 0: m_wndNumberOfDlds.SetCurSel (2); break; } m_wndDaysToKeep.AddString ("2 days"); m_wndDaysToKeep.AddString ("7 days"); m_wndDaysToKeep.AddString ("1 month"); switch (pkg->m_nNumberOfDaysToKeepThisUpload) { case 2: m_wndDaysToKeep.SetCurSel (0); break; case 7: m_wndDaysToKeep.SetCurSel (1); break; case 31: m_wndDaysToKeep.SetCurSel (2); break; } m_wndCompress.AddString (LS (L_NONE)); m_wndCompress.AddString (LS (L_FAST)); m_wndCompress.AddString (LS (L_AVERAGE2)); m_wndCompress.AddString (LS (L_BEST)); m_wndCompress.SetItemData (0, 0); m_wndCompress.SetItemData (1, 2); m_wndCompress.SetItemData (2, 6); m_wndCompress.SetItemData (3, 9); size_t i = 0; for (i = 0; i < (size_t) m_wndCompress.GetCount (); i++) { if (m_wndCompress.GetItemData (i) == (DWORD)pkg->m_iZipCompressMethod) m_wndCompress.SetCurSel (i); } m_wndFiles.InsertColumn (0, ""); for (i = 0; i < pkg->m_vPathes.size (); i++) m_wndFiles.InsertItem (i, pkg->m_vPathes [i]); m_wndFiles.SetColumnWidth (0, LVSCW_AUTOSIZE); if (pkg->m_strPassword.IsEmpty () == FALSE) { CheckDlgButton (IDC_SETPWD, BST_CHECKED); SetDlgItemText (IDC_PWD, pkg->m_strPassword); } if (pkg->m_bAddLinkToUploadInCatalogue) CheckDlgButton (IDC_PLACETOCAT, BST_CHECKED); BOOL bAdvInfo = FALSE; SetDlgItemText (IDC_DESC, pkg->m_strDescription); bAdvInfo = bAdvInfo || pkg->m_strDescription.IsEmpty () == FALSE; SetDlgItemText (IDC_TAGS, pkg->m_strTags); bAdvInfo = bAdvInfo || pkg->m_strTags.IsEmpty () == FALSE; SetDlgItemText (IDC_SNDRNAME, pkg->m_strOwnerName); bAdvInfo = bAdvInfo || pkg->m_strOwnerName.IsEmpty () == FALSE; SetDlgItemText (IDC_SNDREMAIL, pkg->m_strOwnerEmail); bAdvInfo = bAdvInfo || pkg->m_strOwnerEmail.IsEmpty () == FALSE; SetDlgItemText (IDC_RCVREMAIL, pkg->m_strRecipientEmail); bAdvInfo = bAdvInfo || pkg->m_strRecipientEmail.IsEmpty () == FALSE; if (bAdvInfo) CheckDlgButton (IDC_ADVANCEDINFO, BST_CHECKED); UpdateEnabled (); ApplyLanguage (); return TRUE; }
ECallbackResult CLoadAgent::OnCheckLoad(SLoadInfo* pLoadInfo) { CEditDoc* pcDoc = GetListeningDoc(); // リロード要求の場合は、継続。 if(pLoadInfo->bRequestReload)goto next; //フォルダが指定された場合は「ファイルを開く」ダイアログを表示し、実際のファイル入力を促す if( IsDirectory(pLoadInfo->cFilePath) ){ std::vector<std::tstring> files; SLoadInfo sLoadInfo(_T(""), CODE_AUTODETECT, false); bool bDlgResult = pcDoc->m_cDocFileOperation.OpenFileDialog( CEditWnd::getInstance()->GetHwnd(), pLoadInfo->cFilePath, //指定されたフォルダ &sLoadInfo, files ); if( !bDlgResult ){ return CALLBACK_INTERRUPT; //キャンセルされた場合は中断 } size_t nSize = files.size(); if( 0 < nSize ){ sLoadInfo.cFilePath = files[0].c_str(); // 他のファイルは新規ウィンドウ for( size_t i = 1; i < nSize; i++ ){ SLoadInfo sFilesLoadInfo = sLoadInfo; sFilesLoadInfo.cFilePath = files[i].c_str(); CControlTray::OpenNewEditor( G_AppInstance(), CEditWnd::getInstance()->GetHwnd(), sFilesLoadInfo, NULL, true ); } } *pLoadInfo = sLoadInfo; } // 他のウィンドウで既に開かれている場合は、それをアクティブにする HWND hWndOwner; if( CShareData::getInstance()->ActiveAlreadyOpenedWindow(pLoadInfo->cFilePath, &hWndOwner, pLoadInfo->eCharCode) ){ pLoadInfo->bOpened = true; return CALLBACK_INTERRUPT; } // 現在のウィンドウに対してファイルを読み込めない場合は、新たなウィンドウを開き、そこにファイルを読み込ませる if(!pcDoc->IsAcceptLoad()){ CControlTray::OpenNewEditor( G_AppInstance(), CEditWnd::getInstance()->GetHwnd(), *pLoadInfo ); return CALLBACK_INTERRUPT; } next: // オプション:開こうとしたファイルが存在しないとき警告する if( GetDllShareData().m_Common.m_sFile.GetAlertIfFileNotExist() ){ if(!fexist(pLoadInfo->cFilePath)){ InfoBeep(); // Feb. 15, 2003 genta Popupウィンドウを表示しないように. // ここでステータスメッセージを使っても画面に表示されない. TopInfoMessage( CEditWnd::getInstance()->GetHwnd(), LS(STR_NOT_EXSIST_SAVE), //Mar. 24, 2001 jepro 若干修正 pLoadInfo->cFilePath.GetBufferPointer() ); } } // 読み取り可能チェック do{ CFile cFile(pLoadInfo->cFilePath.c_str()); //ファイルが存在しない場合はチェック省略 if(!cFile.IsFileExist())break; // ロックは一時的に解除してチェックする(チェックせずに後戻りできないところまで進めるより安全) // ※ ロックしていてもアクセス許可の変更によって読み取れなくなっていることもある bool bLock = (pLoadInfo->IsSamePath(pcDoc->m_cDocFile.GetFilePath()) && pcDoc->m_cDocFile.IsFileLocking()); if( bLock ) pcDoc->m_cDocFileOperation.DoFileUnlock(); //チェック if(!cFile.IsFileReadable()){ if( bLock ) pcDoc->m_cDocFileOperation.DoFileLock(false); ErrorMessage( CEditWnd::getInstance()->GetHwnd(), LS(STR_LOADAGENT_ERR_OPEN), pLoadInfo->cFilePath.c_str() ); return CALLBACK_INTERRUPT; //ファイルが存在しているのに読み取れない場合は中断 } if( bLock ) pcDoc->m_cDocFileOperation.DoFileLock(false); } while(false); // 1回しか通らない. breakでここまで飛ぶ // ファイルサイズチェック if( GetDllShareData().m_Common.m_sFile.m_bAlertIfLargeFile ){ WIN32_FIND_DATA wfd; HANDLE nFind = ::FindFirstFile( pLoadInfo->cFilePath.c_str(), &wfd ); if( nFind != INVALID_HANDLE_VALUE ){ ::FindClose( nFind ); LARGE_INTEGER nFileSize; nFileSize.HighPart = wfd.nFileSizeHigh; nFileSize.LowPart = wfd.nFileSizeLow; // GetDllShareData().m_Common.m_sFile.m_nAlertFileSize はMB単位 if( (nFileSize.QuadPart>>20) >= (GetDllShareData().m_Common.m_sFile.m_nAlertFileSize) ){ int nRet = MYMESSAGEBOX( CEditWnd::getInstance()->GetHwnd(), MB_ICONQUESTION | MB_YESNO | MB_TOPMOST, GSTR_APPNAME, LS(STR_LOADAGENT_BIG_FILE), GetDllShareData().m_Common.m_sFile.m_nAlertFileSize ); if( nRet != IDYES ){ return CALLBACK_INTERRUPT; } } }
void parseOrbitDownloadsList(const CString& sDldList, OrbitDownloadsArray& arrDownloads) { CString sMsg; if (sDldList.IsEmpty()) return; CCsvParser cpParser; cpParser.Init(sDldList, "\"", ","); CString sContent; while (cpParser.ParseNextRecord()) { int nFieldNumber = -1; CString sValue; TOrbitDownload tOrbitDownload; while (cpParser.GetNextField(sValue)) { ++nFieldNumber; if (nFieldNumber == 0) { tOrbitDownload.sPath = sValue; } if (nFieldNumber == 1) { tOrbitDownload.sFile = sValue; } if (nFieldNumber == 2) { sValue.Trim(); UINT64 uFileSize; if (sscanf_s((const char*)sValue, "%I64u", &uFileSize) != 1) { sMsg = LS (L_CANT_PARSE_ORBIT_DOWNLOAD_LIST); throw std::runtime_error((LPCTSTR)sMsg); } char szCompletedSize[16] = {0,}; sprintf_s(szCompletedSize, 16, "%I64u", uFileSize); if (sValue.CompareNoCase(szCompletedSize) != 0) { sMsg = LS (L_CANT_PARSE_ORBIT_DOWNLOAD_LIST); throw std::runtime_error((LPCTSTR)sMsg); } tOrbitDownload.uFileSize = uFileSize; } if (nFieldNumber == 4) { tOrbitDownload.sUrl = sValue; } if (nFieldNumber == 10) { sValue.Trim(); if (!sValue.IsEmpty()) tOrbitDownload.bIsComplete = true; } } if (nFieldNumber < 10) { sMsg = LS (L_CANT_PARSE_ORBIT_DOWNLOAD_LIST); throw std::runtime_error((LPCTSTR)sMsg); } if (tOrbitDownload.bIsComplete) arrDownloads.Add(tOrbitDownload); } int nFieldNumber = -1; CString sValue; TOrbitDownload tOrbitDownload; while (cpParser.GetNextField(sValue)) { ++nFieldNumber; if (nFieldNumber == 0) { tOrbitDownload.sPath = sValue; } if (nFieldNumber == 1) { tOrbitDownload.sFile = sValue; } if (nFieldNumber == 2) { sValue.Trim(); UINT64 uFileSize; if (sscanf_s((const char*)sValue, "%I64u", &uFileSize) != 1) { sMsg = LS (L_CANT_PARSE_ORBIT_DOWNLOAD_LIST); throw std::runtime_error((LPCTSTR)sMsg); } char szCompletedSize[16] = {0,}; sprintf_s(szCompletedSize, 16, "%I64u", uFileSize); if (sValue.CompareNoCase(szCompletedSize) != 0) { sMsg = LS (L_CANT_PARSE_ORBIT_DOWNLOAD_LIST); throw std::runtime_error((LPCTSTR)sMsg); } tOrbitDownload.uFileSize = uFileSize; } if (nFieldNumber == 4) { tOrbitDownload.sUrl = sValue; } if (nFieldNumber == 10) { sValue.Trim(); if (!sValue.IsEmpty()) tOrbitDownload.bIsComplete = true; } } if (nFieldNumber < 10) { sMsg = LS (L_CANT_PARSE_ORBIT_DOWNLOAD_LIST); throw std::runtime_error((LPCTSTR)sMsg); } if (tOrbitDownload.bIsComplete) arrDownloads.Add(tOrbitDownload); }
void ChannelsView::populateJavaScriptWindowObject() { page()->mainFrame()->addToJavaScriptWindowObject(LS("SimpleChat"), WebBridge::i()); page()->mainFrame()->addToJavaScriptWindowObject(LS("ChannelsView"), this); }
/* ツールバー作成 @date @@@ 2002.01.03 YAZAKI m_tbMyButtonなどをCShareDataからCMenuDrawerへ移動したことによる修正。 @date 2005.08.29 aroka ツールバーの折り返し @date 2006.06.17 ryoji ビジュアルスタイルが有効の場合はツールバーを Rebar に入れてサイズ変更時のちらつきを無くす */ void CMainToolBar::CreateToolBar( void ) { if( m_hwndToolBar )return; REBARINFO rbi; REBARBANDINFO rbBand; int nFlag; TBBUTTON tbb; int i; int nIdx; LONG_PTR lToolType; nFlag = 0; // 2006.06.17 ryoji // Rebar ウィンドウの作成 if( IsVisualStyle() ){ // ビジュアルスタイル有効 m_hwndReBar = ::CreateWindowEx( WS_EX_TOOLWINDOW, REBARCLASSNAME, //レバーコントロール NULL, WS_CHILD/* | WS_VISIBLE*/ | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | // 2007.03.08 ryoji WS_VISIBLE 除去 RBS_BANDBORDERS | CCS_NODIVIDER, 0, 0, 0, 0, m_pOwner->GetHwnd(), NULL, CEditApp::getInstance()->GetAppInstance(), NULL ); if( NULL == m_hwndReBar ){ TopWarningMessage( m_pOwner->GetHwnd(), LS(STR_ERR_DLGEDITWND04) ); return; } if( GetDllShareData().m_Common.m_sToolBar.m_bToolBarIsFlat ){ /* フラットツールバーにする/しない */ PreventVisualStyle( m_hwndReBar ); // ビジュアルスタイル非適用のフラットな Rebar にする } ::ZeroMemory(&rbi, sizeof(rbi)); rbi.cbSize = sizeof(rbi); Rebar_SetbarInfo(m_hwndReBar, &rbi); nFlag = CCS_NORESIZE | CCS_NODIVIDER | CCS_NOPARENTALIGN | TBSTYLE_FLAT; // ツールバーへの追加スタイル } /* ツールバーウィンドウの作成 */ m_hwndToolBar = ::CreateWindowEx( 0, TOOLBARCLASSNAME, NULL, WS_CHILD/* | WS_VISIBLE*/ | WS_CLIPCHILDREN | /*WS_BORDER | */ // 2006.06.17 ryoji WS_CLIPCHILDREN 追加 // 2007.03.08 ryoji WS_VISIBLE 除去 /* WS_EX_WINDOWEDGE| */ TBSTYLE_TOOLTIPS | // TBSTYLE_WRAPABLE | // TBSTYLE_ALTDRAG | // CCS_ADJUSTABLE | nFlag, 0, 0, 0, 0, m_pOwner->GetHwnd(), (HMENU)ID_TOOLBAR, CEditApp::getInstance()->GetAppInstance(), NULL ); if( NULL == m_hwndToolBar ){ if( GetDllShareData().m_Common.m_sToolBar.m_bToolBarIsFlat ){ /* フラットツールバーにする/しない */ GetDllShareData().m_Common.m_sToolBar.m_bToolBarIsFlat = FALSE; } TopWarningMessage( m_pOwner->GetHwnd(), LS(STR_ERR_DLGEDITWND05) ); DestroyToolBar(); // 2006.06.17 ryoji } else{ // 2006.09.06 ryoji ツールバーをサブクラス化する g_pOldToolBarWndProc = (WNDPROC)::SetWindowLongPtr( m_hwndToolBar, GWLP_WNDPROC, (LONG_PTR)ToolBarWndProc ); Toolbar_SetButtonSize( m_hwndToolBar, DpiScaleX(22), DpiScaleY(22) ); // 2009.10.01 ryoji 高DPI対応スケーリング Toolbar_ButtonStructSize( m_hwndToolBar, sizeof(TBBUTTON) ); // Oct. 12, 2000 genta // 既に用意されているImage Listをアイコンとして登録 m_pcIcons->SetToolBarImages( m_hwndToolBar ); /* ツールバーにボタンを追加 */ int count = 0; //@@@ 2002.06.15 MIK int nToolBarButtonNum = 0;// 2005/8/29 aroka // From Here 2005.08.29 aroka // はじめにツールバー構造体の配列を作っておく TBBUTTON *pTbbArr = new TBBUTTON[GetDllShareData().m_Common.m_sToolBar.m_nToolBarButtonNum]; for( i = 0; i < GetDllShareData().m_Common.m_sToolBar.m_nToolBarButtonNum; ++i ){ nIdx = GetDllShareData().m_Common.m_sToolBar.m_nToolBarButtonIdxArr[i]; pTbbArr[nToolBarButtonNum] = m_pOwner->GetMenuDrawer().getButton(nIdx); // セパレータが続くときはひとつにまとめる // 折り返しボタンもTBSTYLE_SEP属性を持っているので // 折り返しの前のセパレータは全て削除される. if( (pTbbArr[nToolBarButtonNum].fsStyle & TBSTYLE_SEP) && (nToolBarButtonNum!=0)){ if( (pTbbArr[nToolBarButtonNum-1].fsStyle & TBSTYLE_SEP) ){ pTbbArr[nToolBarButtonNum-1] = pTbbArr[nToolBarButtonNum]; nToolBarButtonNum--; } } // 仮想折返しボタンがきたら直前のボタンに折返し属性を付ける if( pTbbArr[nToolBarButtonNum].fsState & TBSTATE_WRAP ){ if( nToolBarButtonNum!=0 ){ pTbbArr[nToolBarButtonNum-1].fsState |= TBSTATE_WRAP; } continue; } nToolBarButtonNum++; } // To Here 2005.08.29 aroka for( i = 0; i < nToolBarButtonNum; ++i ){ tbb = pTbbArr[i]; //@@@ 2002.06.15 MIK start switch( tbb.fsStyle ) { case TBSTYLE_DROPDOWN: //ドロップダウン //拡張スタイルに設定 Toolbar_SetExtendedStyle( m_hwndToolBar, TBSTYLE_EX_DRAWDDARROWS ); Toolbar_AddButtons( m_hwndToolBar, 1, &tbb ); count++; break; case TBSTYLE_COMBOBOX: //コンボボックス { RECT rc; TBBUTTONINFO tbi; TBBUTTON my_tbb; LOGFONT lf; switch( tbb.idCommand ) { case F_SEARCH_BOX: if( m_hwndSearchBox ) { break; } //セパレータ作る memset_raw( &my_tbb, 0, sizeof(my_tbb) ); my_tbb.fsStyle = TBSTYLE_BUTTON; //ボタンにしないと描画が乱れる 2005/8/29 aroka my_tbb.idCommand = tbb.idCommand; //同じIDにしておく if( tbb.fsState & TBSTATE_WRAP ){ //折り返し 2005/8/29 aroka my_tbb.fsState |= TBSTATE_WRAP; } Toolbar_AddButtons( m_hwndToolBar, 1, &my_tbb ); count++; //サイズを設定する tbi.cbSize = sizeof(tbi); tbi.dwMask = TBIF_SIZE; tbi.cx = (WORD)DpiScaleX(160); //ボックスの幅 // 2009.10.01 ryoji 高DPI対応スケーリング Toolbar_SetButtonInfo( m_hwndToolBar, tbb.idCommand, &tbi ); //位置とサイズを取得する rc.right = rc.left = rc.top = rc.bottom = 0; Toolbar_GetItemRect( m_hwndToolBar, count-1, &rc ); //コンボボックスを作る // Mar. 8, 2003 genta 検索ボックスを1ドット下にずらした m_hwndSearchBox = CreateWindow( _T("COMBOBOX"), _T("Combo"), WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWN /*| CBS_SORT*/ | CBS_AUTOHSCROLL /*| CBS_DISABLENOSCROLL*/, rc.left, rc.top + 1, rc.right - rc.left, (rc.bottom - rc.top) * 10, m_hwndToolBar, (HMENU)(INT_PTR)tbb.idCommand, CEditApp::getInstance()->GetAppInstance(), NULL ); if( m_hwndSearchBox ) { m_pOwner->SetCurrentFocus(0); lf = m_pOwner->GetLogfont(); //memset_raw( &lf, 0, sizeof(lf) ); lf.lfHeight = DpiPointsToPixels(-9); // Jan. 14, 2003 genta ダイアログにあわせてちょっと小さく // 2009.10.01 ryoji 高DPI対応(ポイント数から算出) lf.lfWidth = 0; lf.lfEscapement = 0; lf.lfOrientation = 0; lf.lfWeight = FW_NORMAL; lf.lfItalic = FALSE; lf.lfUnderline = FALSE; lf.lfStrikeOut = FALSE; //lf.lfCharSet = GetDllShareData().m_Common.m_sView.m_lf.lfCharSet; lf.lfOutPrecision = OUT_TT_ONLY_PRECIS; // Raster Font を使わないように //lf.lfClipPrecision = GetDllShareData().m_Common.m_sView.m_lf.lfClipPrecision; //lf.lfQuality = GetDllShareData().m_Common.m_sView.m_lf.lfQuality; //lf.lfPitchAndFamily = GetDllShareData().m_Common.m_sView.m_lf.lfPitchAndFamily; //_tcsncpy( lf.lfFaceName, GetDllShareData().m_Common.m_sView.m_lf.lfFaceName, _countof(lf.lfFaceName)); // 画面のフォントに設定 2012/11/27 Uchi m_hFontSearchBox = ::CreateFontIndirect( &lf ); if( m_hFontSearchBox ) { ::SendMessage( m_hwndSearchBox, WM_SETFONT, (WPARAM)m_hFontSearchBox, MAKELONG (TRUE, 0) ); } // //入力長制限 // Combo_LimitText( m_hwndSearchBox, (WPARAM)_MAX_PATH - 1 ); //検索ボックスを更新 // 関数化 2010/6/6 Uchi AcceptSharedSearchKey(); m_comboDel = SComboBoxItemDeleter(); // 再表示用の初期化 m_comboDel.pRecent = &m_cRecentSearch; CDialog::SetComboBoxDeleter(m_hwndSearchBox, &m_comboDel); } break; default: break; } } break; case TBSTYLE_BUTTON: //ボタン case TBSTYLE_SEP: //セパレータ default: Toolbar_AddButtons( m_hwndToolBar, 1, &tbb ); count++; break; } //@@@ 2002.06.15 MIK end } if( GetDllShareData().m_Common.m_sToolBar.m_bToolBarIsFlat ){ /* フラットツールバーにする/しない */ lToolType = ::GetWindowLongPtr(m_hwndToolBar, GWL_STYLE); lToolType |= (TBSTYLE_FLAT); ::SetWindowLongPtr(m_hwndToolBar, GWL_STYLE, lToolType); ::InvalidateRect(m_hwndToolBar, NULL, TRUE); } delete []pTbbArr;// 2005/8/29 aroka } // 2006.06.17 ryoji // ツールバーを Rebar に入れる if( m_hwndReBar && m_hwndToolBar ){ // ツールバーの高さを取得する DWORD dwBtnSize = Toolbar_GetButtonSize( m_hwndToolBar ); DWORD dwRows = Toolbar_GetRows( m_hwndToolBar ); // バンド情報を設定する // 以前のプラットフォームに _WIN32_WINNT >= 0x0600 で定義される構造体のフルサイズを渡すと失敗する // 2007.12.21 ryoji rbBand.cbSize = CCSIZEOF_STRUCT( REBARBANDINFO, wID ); rbBand.fMask = RBBIM_STYLE | RBBIM_CHILD | RBBIM_CHILDSIZE | RBBIM_SIZE; rbBand.fStyle = RBBS_CHILDEDGE; rbBand.hwndChild = m_hwndToolBar; // ツールバー rbBand.cxMinChild = 0; rbBand.cyMinChild = HIWORD(dwBtnSize) * dwRows; rbBand.cx = 250; // バンドを追加する Rebar_InsertBand( m_hwndReBar, -1, &rbBand ); ::ShowWindow( m_hwndToolBar, SW_SHOW ); } return; }
void unlock() { VEDGE(pre, unlock); LS(unlock, clearTag(tail_)); }
void lcd_basic_screen() { lcd_lib_clear(); lcd_lib_draw_hline(3, 124, LS(53, 50, 50)); }
CDownloaderProperties_ListPage::CDownloaderProperties_ListPage() : CPropertyPage(CDownloaderProperties_ListPage::IDD) { m_psp.dwFlags |= PSP_USETITLE; m_psp.pszTitle = LS (L_ALLDLDS); }
void ChatView::setId(const QByteArray &id) { m_id = id; evaluateJavaScript(LS("Settings.id = \"") + SimpleID::encode(m_id) + LS("\";")); }