void CGUIDialogKeyboardGeneric::UpdateLabel() // FIXME seems to be called twice for one USB SDL keyboard action/character { CGUILabelControl* pEdit = ((CGUILabelControl*)GetControl(CTL_LABEL_EDIT)); if (pEdit) { CStdStringW edit = m_strEdit; if (m_hiddenInput) { // convert to *'s edit.Empty(); if (m_lastRemoteClickTime + REMOTE_SMS_DELAY > CTimeUtils::GetFrameTime() && m_strEdit.size()) { // using the remove to input, so display the last key input edit.append(m_strEdit.size() - 1, L'*'); edit.append(1, m_strEdit[m_strEdit.size() - 1]); } else edit.append(m_strEdit.size(), L'*'); } // convert back to utf8 CStdString utf8Edit; g_charsetConverter.wToUTF8(edit, utf8Edit); pEdit->SetLabel(utf8Edit); // Send off a search message unsigned int now = CTimeUtils::GetFrameTime(); // don't send until the REMOTE_SMS_DELAY has passed if (m_lastRemoteClickTime && m_lastRemoteClickTime + REMOTE_SMS_DELAY >= now) return; if (m_pCharCallback) m_pCharCallback(this, utf8Edit); } }
void CGUIDialogKeyboard::UpdateLabel() // FIXME seems to be called twice for one USB SDL keyboard action/character { CGUILabelControl* pEdit = ((CGUILabelControl*)GetControl(CTL_LABEL_EDIT)); if (pEdit) { CStdStringW edit = m_strEdit; if (m_hiddenInput) { // convert to *'s edit.Empty(); if (m_lastRemoteClickTime + REMOTE_SMS_DELAY > timeGetTime() && m_strEdit.size()) { // using the remove to input, so display the last key input edit.append(m_strEdit.size() - 1, L'*'); edit.append(1, m_strEdit[m_strEdit.size() - 1]); } else edit.append(m_strEdit.size(), L'*'); } // convert back to utf8 CStdString utf8Edit; g_charsetConverter.wToUTF8(edit, utf8Edit); pEdit->SetLabel(utf8Edit); // Send off a search message if it's been SEARCH_DELAY since last search. DWORD now = timeGetTime(); if (!m_lastSearchUpdate || m_lastSearchUpdate + SEARCH_DELAY >= now) m_lastSearchUpdate = now; // update is called when we haven't passed our search delay, so reset it if (m_lastSearchUpdate + SEARCH_DELAY < now) { // don't send until the REMOTE_SMS_DELAY has passed if (m_lastRemoteClickTime && m_lastRemoteClickTime + REMOTE_SMS_DELAY >= now) return; m_lastSearchUpdate = 0; if (m_filtering == FILTERING_CURRENT) { // send our filter message CGUIMessage message(GUI_MSG_NOTIFY_ALL, GetID(), 0, GUI_MSG_FILTER_ITEMS); message.SetStringParam(utf8Edit); g_graphicsContext.SendMessage(message); } if (m_filtering == FILTERING_SEARCH) { // send our search message CGUIMessage message(GUI_MSG_NOTIFY_ALL, GetID(), 0, GUI_MSG_SEARCH_UPDATE); message.SetStringParam(utf8Edit); g_graphicsContext.SendMessage(message); } } } }
void CGUIDialogKeyboardGeneric::UpdateLabel() // FIXME seems to be called twice for one USB SDL keyboard action/character { CGUILabelControl* pEdit = ((CGUILabelControl*)GetControl(CTL_LABEL_EDIT)); if (pEdit) { CStdStringW edit = m_strEdit; pEdit->SetHighlight(0, 0); pEdit->SetSelection(0, 0); if (m_hiddenInput) { // convert to *'s edit.clear(); if (m_lastRemoteClickTime + REMOTE_SMS_DELAY > CTimeUtils::GetFrameTime() && m_iCursorPos > 0) { // using the remove to input, so display the last key input edit.append(m_iCursorPos - 1, L'*'); edit.append(1, m_strEdit[m_iCursorPos - 1]); } else edit.append(m_strEdit.size(), L'*'); } else if (!m_strEditing.empty()) { edit.insert(m_iCursorPos, m_strEditing); pEdit->SetHighlight(m_iCursorPos, m_iCursorPos + m_strEditing.size()); if (m_iEditingLength > 0) pEdit->SetSelection(m_iCursorPos + m_iEditingOffset, m_iCursorPos + m_iEditingOffset + m_iEditingLength); } // convert back to utf8 CStdString utf8Edit; g_charsetConverter.wToUTF8(edit, utf8Edit); pEdit->SetLabel(utf8Edit); // Send off a search message unsigned int now = CTimeUtils::GetFrameTime(); // don't send until the REMOTE_SMS_DELAY has passed if (m_lastRemoteClickTime && m_lastRemoteClickTime + REMOTE_SMS_DELAY >= now) return; if (m_pCharCallback) { // do not send editing text comes from system input method if (!m_hiddenInput && !m_strEditing.empty()) g_charsetConverter.wToUTF8(m_strEdit, utf8Edit); m_pCharCallback(this, utf8Edit); } } }
CStdStringW CGUIEditControl::GetDisplayedText() const { if (m_inputType == INPUT_TYPE_PASSWORD || m_inputType == INPUT_TYPE_PASSWORD_MD5 || m_inputType == INPUT_TYPE_PASSWORD_NUMBER_VERIFY_NEW) { CStdStringW text; text.append(m_text2.size(), L'*'); return text; } return m_text2; }
CStdStringW CGUIEditControl::GetDisplayedText() { if (m_inputType == INPUT_TYPE_PASSWORD) { CStdStringW text; if (!m_text2.empty() > 0 && m_addToText2Counter >= 0 && (m_addToText2Counter*50 < EXPOSE_PASSWORD_LETTER_IN_MS)) { m_addToText2Counter++; text.append(m_text2.size()-1, L'\u2022'); text += m_text2[m_text2.size()-1]; } else { m_addToText2Counter = -1; text.append(m_text2.size(), L'\u2022'); } return text; } return m_text2; }
void CGUIDialogKeyboard::UpdateLabel() // FIXME seems to be called twice for one USB SDL keyboard action/character { CGUILabelControl* pEdit = ((CGUILabelControl*)GetControl(CTL_LABEL_EDIT)); if (pEdit) { CStdStringW edit = m_strEdit; if (m_hiddenInput) { // convert to *'s edit.Empty(); if (m_lastRemoteClickTime + REMOTE_SMS_DELAY > CTimeUtils::GetFrameTime() && m_strEdit.size()) { // using the remove to input, so display the last key input edit.append(m_strEdit.size() - 1, L'*'); edit.append(1, m_strEdit[m_strEdit.size() - 1]); } else edit.append(m_strEdit.size(), L'*'); } // convert back to utf8 CStdString utf8Edit; g_charsetConverter.wToUTF8(edit, utf8Edit); pEdit->SetLabel(utf8Edit); // Send off a search message unsigned int now = CTimeUtils::GetFrameTime(); // don't send until the REMOTE_SMS_DELAY has passed if (m_lastRemoteClickTime && m_lastRemoteClickTime + REMOTE_SMS_DELAY >= now) return; if (m_filtering == FILTERING_CURRENT) { // send our filter message CGUIMessage message(GUI_MSG_NOTIFY_ALL, GetID(), 0, GUI_MSG_FILTER_ITEMS); message.SetStringParam(utf8Edit); g_windowManager.SendMessage(message); } if (m_filtering == FILTERING_SEARCH) SendSearchMessage(); } }
void CWIN32Util::ExtendDllPath() { CStdStringW strEnvW; CStdStringArray vecEnv; WCHAR wctemp[32768]; if(GetEnvironmentVariableW(L"PATH",wctemp,32767) != 0) strEnvW = wctemp; StringUtils::SplitString(DLL_ENV_PATH, ";", vecEnv); for (int i=0; i<(int)vecEnv.size(); ++i) { CStdStringW strFileW; g_charsetConverter.utf8ToW(CSpecialProtocol::TranslatePath(vecEnv[i]), strFileW, false); strEnvW.append(L";" + strFileW); } if(SetEnvironmentVariableW(L"PATH",strEnvW.c_str())!=0) CLog::Log(LOGDEBUG,"Setting system env PATH to %S",strEnvW.c_str()); else CLog::Log(LOGDEBUG,"Can't set system env PATH to %S",strEnvW.c_str()); }