Commit 09dbe780 authored by Bob Obara's avatar Bob Obara

BUG:Fix Group View's Current Tab being reset

When changing either the category filter or advance level setting, nested group view would reset their current tab to the first one.
This can be very annoying.  This change now stores the view name associated with the current tab and stores it in the UI Manager in a map.
The key is the name of the group view and the value is the name of the currently selected child view.  When the group view is reconstructed,
this information is used to determine which tabs are current.
parent e5877935
......@@ -27,6 +27,7 @@ The following is an example of a Analysis View:
#Changes to Group View
* View no longer displays empty tabs
* Current tabs are now remembered when the group rebuilds its widget - previously this was only true for the top-level tabbed group views
# Changes to BaseView
* Added the concept of top level categories that represents a set of categories (that can be a subset of those defined in the attribute resource) that can be used to display or filter attribute information.
......
This diff is collapsed.
......@@ -33,7 +33,6 @@ public:
qtGroupView(const ViewInfo& info);
virtual ~qtGroupView();
void getChildView(const std::string& viewType, QList<qtBaseView*>& views);
qtBaseView* getChildView(int pageIndex);
virtual void addChildView(qtBaseView*);
......
......@@ -1023,3 +1023,19 @@ void qtUIManager::setToLevelCategories(const std::set<std::string>& categories)
m_topView->setTopLevelCategories(categories);
}
}
void qtUIManager::setActiveTabInfo(
const std::string& groupViewName, const std::string& activeTabName)
{
m_activeTabInfo[groupViewName] = activeTabName;
}
std::string qtUIManager::activeTabInfo(const std::string& groupViewName) const
{
auto it = m_activeTabInfo.find(groupViewName);
if (it == m_activeTabInfo.end())
{
return "";
}
return it->second;
}
......@@ -193,6 +193,10 @@ public:
// See if we are dealing with a subset of categories
bool topLevelCategoriesSet() const { return m_topLevelCategoriesSet; }
//methods for saving/retrieving the active tab in a group view
void setActiveTabInfo(const std::string& groupViewName, const std::string& activeTabName);
std::string activeTabInfo(const std::string& groupViewName) const;
static qtItem* defaultItemConstructor(const AttributeItemInfo& info);
#ifdef _WIN32
......@@ -262,6 +266,7 @@ private:
bool m_categoryChecks;
bool m_topLevelCategoriesSet;
std::set<std::string> m_topLevelCategories;
std::map<std::string, std::string> m_activeTabInfo;
}; // class
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment