| 91 | } |
| 92 | |
| 93 | void RedisConfigUI::DoFillData() |
| 94 | { |
| 95 | CEditUI exampleEditUI; |
| 96 | CComboUI exampleComboUI; |
| 97 | |
| 98 | RedisClient::TDicConfig::const_iterator it = m_dicConfig.begin(); |
| 99 | RedisClient::TDicConfig::const_iterator itend = m_dicConfig.end(); |
| 100 | |
| 101 | for ( ; it!=itend; ++it) |
| 102 | { |
| 103 | CDuiString name = _T("redisconfig_"); |
| 104 | CDuiString key = Base::CharacterSet::ANSIToUnicode(it->first).c_str(); |
| 105 | CDuiString val = Base::CharacterSet::ANSIToUnicode(it->second).c_str(); |
| 106 | name.Append(key); |
| 107 | CControlUI* pCtl = GetPaintMgr()->FindControl(name); |
| 108 | |
| 109 | /// xml中未配置该项 |
| 110 | if (pCtl == NULL) continue; |
| 111 | |
| 112 | if (pCtl->GetClass() == exampleEditUI.GetClass()) |
| 113 | { |
| 114 | CEditUI* pEdit = static_cast<CEditUI*> (pCtl); |
| 115 | pEdit->SetText(val); |
| 116 | } |
| 117 | else if (pCtl->GetClass() == exampleComboUI.GetClass()) |
| 118 | { |
| 119 | CComboUI* pCombo = static_cast<CComboUI*> (pCtl); |
| 120 | int idx = 0; |
| 121 | if (val == _T("yes")) idx = 0; |
| 122 | else if (val == _T("no")) idx = 1; |
| 123 | else if (it->first == "loglevel") |
| 124 | { |
| 125 | string loglevel = it->second; |
| 126 | if (loglevel == "debug") idx = 0; |
| 127 | else if (loglevel == "verbose") idx = 1; |
| 128 | else if (loglevel == "notice") idx = 2; |
| 129 | else if (loglevel == "warning") idx = 3; |
| 130 | } |
| 131 | pCombo->SetInternVisible(true); |
| 132 | pCombo->SelectItem(idx); |
| 133 | pCombo->SetFocus(); |
| 134 | } |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | void RedisConfigUI::DoApplyData() |
| 139 | { |
nothing calls this directly
no test coverage detected