From 47bf9ecbc8e2eeb8cc4ce5787cfa3ec8c103f044 Mon Sep 17 00:00:00 2001 From: Sit Melai Date: Thu, 3 Sep 2020 21:12:10 +0200 Subject: [PATCH] Always create General group, so at first launch groups show directly when changed --- .../client/src/interface_v3/people_list.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/code/ryzom/client/src/interface_v3/people_list.cpp b/code/ryzom/client/src/interface_v3/people_list.cpp index 47806bf5f..c3f2cf4d7 100644 --- a/code/ryzom/client/src/interface_v3/people_list.cpp +++ b/code/ryzom/client/src/interface_v3/people_list.cpp @@ -528,6 +528,23 @@ void CPeopleList::changeGroup(uint index, const ucstring &groupName) void CPeopleList::readContactGroups() { _GroupContainers.clear(); + + // Create default group even if no groups defined + vector > properties; + properties.push_back(make_pair(string("posparent"), string("parent"))); + properties.push_back(make_pair(string("id"), _ContainerID + "_group_0")); + properties.push_back(make_pair(string("title"), "General")); + CInterfaceGroup *group = CWidgetManager::getInstance()->getParser()->createGroupInstance("people_list_group_header", "ui:interface", properties, false); + CGroupContainer *gc = dynamic_cast(group); + gc->setUCTitle(ucstring("General")); + gc->setSavable(false); + + CInterfaceGroup *pRoot = dynamic_cast(CWidgetManager::getInstance()->getElementFromId("ui:interface")); + pRoot->addGroup (gc); + _BaseContainer->attachContainer(gc); + + _GroupContainers.push_back(make_pair("", gc)); + const std::string filename = CInterfaceManager::getInstance()->getSaveFileName("contactgroups", "xml"); try {