Fix to work with saner new behaviour

develop
kaetemi 4 years ago
parent 7812ccafc1
commit 39fc4895d2

@ -1093,10 +1093,7 @@ CChatWindow *CChatWindowManager::createChatWindow(const CChatWindowDesc &desc)
if (desc.Id.empty()) if (desc.Id.empty())
_WindowID++; _WindowID++;
if (desc.Localize) _ChatWindowMap[desc.Title] = w;
_ChatWindowMap[CI18N::get(desc.Title.toString())] = w;
else
_ChatWindowMap[desc.Title] = w;
w->setAHOnActive(desc.AHOnActive); w->setAHOnActive(desc.AHOnActive);
w->setAHOnActiveParams(desc.AHOnActiveParams); w->setAHOnActiveParams(desc.AHOnActiveParams);
@ -1135,10 +1132,7 @@ CChatWindow *CChatWindowManager::createChatGroupWindow(const CChatWindowDesc &de
if (desc.Id.empty()) if (desc.Id.empty())
_WindowID++; _WindowID++;
if (desc.Localize) _ChatWindowMap[desc.Title] = w;
_ChatWindowMap[CI18N::get(desc.Title.toString())] = w;
else
_ChatWindowMap[desc.Title] = w;
w->setAHOnActive(desc.AHOnActive); w->setAHOnActive(desc.AHOnActive);
w->setAHOnActiveParams(desc.AHOnActiveParams); w->setAHOnActiveParams(desc.AHOnActiveParams);
@ -1185,7 +1179,7 @@ void CChatWindowManager::removeChatWindow(const ucstring &title)
TChatWindowMap::iterator it = _ChatWindowMap.find(title); TChatWindowMap::iterator it = _ChatWindowMap.find(title);
if (it == _ChatWindowMap.end()) if (it == _ChatWindowMap.end())
{ {
nlwarning("unknwown window %s", title.toString().c_str()); nlwarning("Unknown chat window '%s'", title.toUtf8().c_str());
return; return;
} }
it->second->deleteContainer(); it->second->deleteContainer();
@ -1225,18 +1219,9 @@ bool CChatWindowManager::rename(const ucstring &oldName, const ucstring &newName
if (newWin != NULL) return false; // target window exists if (newWin != NULL) return false; // target window exists
TChatWindowMap::iterator it = _ChatWindowMap.find(oldName); TChatWindowMap::iterator it = _ChatWindowMap.find(oldName);
if (it == _ChatWindowMap.end()) return false; if (it == _ChatWindowMap.end()) return false;
if (newNameLocalize) _ChatWindowMap[newName] = it->second;
{ it->second->getContainer()->setLocalize(false);
_ChatWindowMap[CI18N::get(newName.toString())] = it->second; it->second->getContainer()->setTitle(newName.toUtf8());
it->second->getContainer()->setLocalize(true);
it->second->getContainer()->setTitle(newName.toString());
}
else
{
_ChatWindowMap[newName] = it->second;
it->second->getContainer()->setLocalize(false);
it->second->getContainer()->setUCTitle(newName);
}
_ChatWindowMap.erase(it); _ChatWindowMap.erase(it);
return true; return true;
} }

Loading…
Cancel
Save