MCPcopy Create free account
hub / github.com/cinience/RedisStudio / DoFillData

Method DoFillData

RedisStudio/RedisConfigUI.cpp:93–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93void 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
138void RedisConfigUI::DoApplyData()
139{

Callers

nothing calls this directly

Calls 7

AppendMethod · 0.80
FindControlMethod · 0.45
GetClassMethod · 0.45
SetTextMethod · 0.45
SetInternVisibleMethod · 0.45
SelectItemMethod · 0.45
SetFocusMethod · 0.45

Tested by

no test coverage detected