WSL/SLF GitLab Repository

Commit 3cbc6fb6 authored by Michael Reisecker's avatar Michael Reisecker
Browse files

Much better way of finding panels to highlight

There was some messed up code left from when it was only frames we could
highlight. Much better now.
parent 5163e460
......@@ -20,7 +20,7 @@ Releases of the INIshell project will be documented in this file.
(handling all help topics)
- Settings are now a separate window:
Standard "reset", "save" and "clear" buttons (in addition to cmd line)
- Display sections for missing mandatory INI keys
- Display sections for missing mandatory INI keys in "unsaved" warning message
- Jump to 1st missing input value if saving is cancelled
- Workflow panel is now toggled instead of separate show/hide menus
......@@ -56,7 +56,7 @@ This version adds current features to the XMLs and fixes some bugs.
### Added
- New XML features
- Archive manifest file.
- Archive manifest file
### Fixed
......@@ -101,7 +101,7 @@ This version provides an Alpine3d Inishell file.
### Fixed
- Minor cosmetic fixes.
- Minor cosmetic fixes
## [2.0.2beta] - 2020-05-04
......
......@@ -130,6 +130,8 @@ ScrollPanel * SectionTab::getSectionScrollArea(const int &index)
* (e. g. needing to check if a second panel manipulates the same key before deleting it in a
* Selector) convoluted the program so heavily that this solution is much cleaner and more robust.
* @param[in] ini The INIParser for which to set the values (the one that will be output).
* @param[in] insert_missing Set to true if the populated INIParser should contain empty values also.
* In this case they are set to "#N/A".
* @return A comma-separated list of missing mandatory INI keys.
*/
QString SectionTab::setIniValuesFromGui(INIParser *ini, const bool &insert_missing)
......@@ -393,33 +395,23 @@ bool SectionTab::showTab(const QString &tab_name)
*/
bool SectionTab::showPanel(const QString &section, const QString &element_key)
{
#ifdef DEBUG
const bool success = showTab(section);
if (!success)
qDebug() << "Help section does not exist:" << section;
qDebug() << "Panel " << section << "::" << element_key << " does not exist";
#else
(void) showTab(section);
#endif //def DEBUG
bool found = false;
const auto parent = this->getSectionScrollArea(section);
const QList<Atomic *> panel_list( parent->findChildren<Atomic *>() );
const QList<Atomic *> panel_list( parent->findChildren<Atomic *>(
Atomic::getQtKey(section + Cst::sep + element_key)) );
for (auto &panel : panel_list) { //run through elements in section and highlight all matching ones
QString section, key;
(void) panel->getIniValue(section, key);
if (QString::compare(key, element_key, Qt::CaseInsensitive) == 0) {
const QString id( section + Cst::sep + key ); //a frame can also have an (arbitrary) key
this->findChild<Atomic *>(Atomic::getQtKey(id));
if (!panel)
continue;
parent->ensureWidgetVisible(panel->getEmphasisWidget()); //scroll the ScrollBar until visible
panel->setHighlightedStyle(); //TODO: make it work for Selectors (their keys can not match)
found = true; //at least one was highlighted
}
parent->ensureWidgetVisible(panel->getEmphasisWidget()); //scroll the ScrollBar until visible
panel->setHighlightedStyle(); //TODO: make it work for Selectors (their keys can not match)
} //endfor panel_list
this->raise();
return found;
return !panel_list.isEmpty();
}
/**
......
Supports Markdown
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