本文整理汇总了C++中UserInfo::getUser方法的典型用法代码示例。如果您正苦于以下问题:C++ UserInfo::getUser方法的具体用法?C++ UserInfo::getUser怎么用?C++ UserInfo::getUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserInfo
的用法示例。
在下文中一共展示了UserInfo::getUser方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onIgnorePrivate
// !SMT!-S
LRESULT UsersFrame::onIgnorePrivate(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
int i = -1;
while ((i = ctrlUsers.GetNextItem(i, LVNI_SELECTED)) != -1)
{
UserInfo *ui = ctrlUsers.getItemData(i);
FavoriteManager::getInstance()->setNormalPM(ui->getUser());
ui->columns[COLUMN_IGNORE].clear();
switch (wID)
{
case IDC_PM_IGNORED:
ui->columns[COLUMN_IGNORE] = TSTRING(IGNORE_S);
FavoriteManager::getInstance()->setIgnorePM(ui->getUser(), true);
break;
case IDC_PM_FREE:
ui->columns[COLUMN_IGNORE] = TSTRING(FREE_PM_ACCESS);
FavoriteManager::getInstance()->setFreePM(ui->getUser(), true);
break;
};
updateUser(ui->getUser());
ctrlUsers.updateItem(i);
}
return 0;
}
示例2: matches
bool UsersFrame::matches(const UserInfo &ui) {
if(!filter.empty() && !filter.match(filter.prepare(), [this, &ui](int column) { return Text::fromT(ui.getText(column)); })) {
return false;
}
return show(ui.getUser(), false);
}
示例3: onSetUserLimit
// !SMT!-S
LRESULT UsersFrame::onSetUserLimit(WORD /* wNotifyCode */, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
MENUINFO menuInfo = {0};
menuInfo.cbSize = sizeof(MENUINFO);
menuInfo.fMask = MIM_MENUDATA;
speedMenu.GetMenuInfo(&menuInfo);
const int iLimit = menuInfo.dwMenuData;
const int lim = getSpeedLimitByCtrlId(wID, iLimit);
int i = -1;
while ((i = ctrlUsers.GetNextItem(i, LVNI_SELECTED)) != -1)
{
UserInfo *ui = ctrlUsers.getItemData(i);
FavoriteManager::getInstance()->setUploadLimit(ui->getUser(), lim);
ui->columns[COLUMN_SPEED_LIMIT] = Text::toT(FavoriteUser::getSpeedLimitText(lim));
updateUser(ui->getUser());
ctrlUsers.updateItem(i);
}
return 0;
}
示例4: handleDescription
void UsersFrame::handleDescription() {
if(users->countSelected() == 1) {
int i = users->getSelected();
UserInfo* ui = users->getData(i);
ParamDlg dlg(this, ui->columns[COLUMN_NICK], T_("Description"), ui->columns[COLUMN_DESCRIPTION]);
if(dlg.run() == IDOK) {
FavoriteManager::getInstance()->setUserDescription(ui->getUser(), Text::fromT(dlg.getValue()));
ui->columns[COLUMN_DESCRIPTION] = dlg.getValue();
}
}
}
示例5: onConnect
LRESULT UsersFrame::onConnect(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
const int l_cnt = ctrlUsers.GetItemCount();
for (int i = 0; i < l_cnt; ++i)
{
dcassert(l_cnt == ctrlUsers.GetItemCount());
UserInfo *ui = ctrlUsers.getItemData(i);
const string& l_url = FavoriteManager::getUserUrl(ui->getUser());
if (!l_url.empty())
{
HubFrame::openWindow(false, l_url);
}
}
return 0;
}
示例6: onOpenUserLog
LRESULT UsersFrame::onOpenUserLog(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
if (ctrlUsers.GetSelectedCount() == 1)
{
int i = ctrlUsers.GetNextItem(-1, LVNI_SELECTED);
UserInfo* ui = ctrlUsers.getItemData(i);
dcassert(i != -1);
const auto& l_user = ui->getUser(); // [!] PVS V807 Decreased performance. Consider creating a pointer to avoid using the 'ui->getUser()' expression repeatedly. usersframe.cpp 445
StringMap params;
params["hubNI"] = Util::toString(ClientManager::getHubNames(l_user->getCID(), Util::emptyString));
params["hubURL"] = Util::toString(ClientManager::getHubs(l_user->getCID(), Util::emptyString));
params["userCID"] = l_user->getCID().toBase32();
params["userNI"] = l_user->getLastNick();
params["myCID"] = ClientManager::getMyCID().toBase32();
WinUtil::openLog(SETTING(LOG_FILE_PRIVATE_CHAT), params, TSTRING(NO_LOG_FOR_USER));
}
return 0;
}
示例7: removeUser
void UsersFrame::removeUser(const FavoriteUser& aUser)
{
dcassert(!ClientManager::isShutdown());
if (!ClientManager::isShutdown())
{
const int l_cnt = ctrlUsers.GetItemCount();
for (int i = 0; i < l_cnt; ++i)
{
dcassert(l_cnt == ctrlUsers.GetItemCount());
UserInfo *ui = ctrlUsers.getItemData(i);
if (ui->getUser() == aUser.getUser())
{
ctrlUsers.DeleteItem(i);
delete ui;
setCountMessages(ctrlUsers.GetItemCount());
return;
}
}
}
}
示例8: onEdit
LRESULT UsersFrame::onEdit(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
if (ctrlUsers.GetSelectedCount() == 1)
{
int i = ctrlUsers.GetNextItem(-1, LVNI_SELECTED);
UserInfo* ui = ctrlUsers.getItemData(i);
dcassert(i != -1);
LineDlg dlg;
dlg.description = TSTRING(DESCRIPTION);
dlg.title = ui->getText(COLUMN_NICK);
dlg.line = ui->getText(COLUMN_DESCRIPTION);
if (dlg.DoModal(m_hWnd))
{
FavoriteManager::getInstance()->setUserDescription(ui->getUser(), Text::fromT(dlg.line));
ui->columns[COLUMN_DESCRIPTION] = dlg.line;
ctrlUsers.updateItem(i);
}
}
return 0;
}
示例9: updateUser
void UsersFrame::updateUser(const UserPtr& user)
{
dcassert(!ClientManager::isShutdown());
if (!ClientManager::isShutdown())
{
const int l_cnt = ctrlUsers.GetItemCount();
for (int i = 0; i < l_cnt; ++i)
{
dcassert(l_cnt == ctrlUsers.GetItemCount());
UserInfo *ui = ctrlUsers.getItemData(i);
if (ui->getUser() == user)
{
FavoriteUser currentFavUser;
if (FavoriteManager::getFavoriteUser(user, currentFavUser))
{
updateUser(i, ui, currentFavUser);
}
}
}
}
}