--- a/utils/confgui.cpp
+++ b/utils/confgui.cpp
@@ -84,37 +84,41 @@
connect(buttonBox, SIGNAL(rejected()), this, SLOT(rejectChanges()));
}
+void ConfTabsW::hideButtons()
+{
+ if (buttonBox)
+ buttonBox->hide();
+}
+
void ConfTabsW::acceptChanges()
{
cerr << "ConfTabsW::acceptChanges()\n";
- for (vector<ConfPanelW *>::iterator it = m_panels.begin();
- it != m_panels.end(); it++) {
- (*it)->storeValues();
- }
- for (vector<ConfPanelWIF *>::iterator it = m_widgets.begin();
- it != m_widgets.end(); it++) {
- (*it)->storeValues();
+ for (auto& entry : m_panels) {
+ entry->storeValues();
+ }
+ for (auto& entry : m_widgets) {
+ entry->storeValues();
}
emit sig_prefsChanged();
- close();
+ if (!buttonBox->isHidden())
+ close();
}
void ConfTabsW::rejectChanges()
{
cerr << "ConfTabsW::rejectChanges()\n";
reloadPanels();
- close();
+ if (!buttonBox->isHidden())
+ close();
}
void ConfTabsW::reloadPanels()
{
- for (vector<ConfPanelW *>::iterator it = m_panels.begin();
- it != m_panels.end(); it++) {
- (*it)->loadValues();
- }
- for (vector<ConfPanelWIF *>::iterator it = m_widgets.begin();
- it != m_widgets.end(); it++) {
- (*it)->loadValues();
+ for (auto& entry : m_panels) {
+ entry->loadValues();
+ }
+ for (auto& entry : m_widgets) {
+ entry->loadValues();
}
}
@@ -863,7 +867,7 @@
throw std::runtime_error("Bad type " + m_curvartp +
" for " + m_curvar);
}
-
+ rtrimstring(m_brief, " .");
switch (paramtype) {
case ConfTabsW::CFPT_BOOL: {
int def = atoi(m_curvarvals.c_str());
@@ -913,6 +917,13 @@
m_w = new ConfTabsW(m_parent, "Teh title", m_lnkfact);
m_hadTitle = true;
}
+ // Get rid of "parameters" in the title, it's not interesting
+ // and this makes our tab headers smaller.
+ string ps{"parameters"};
+ string::size_type pos = m_other.find(ps);
+ if (pos != string::npos) {
+ m_other = m_other.replace(pos, ps.size(), "");
+ }
m_idx = m_w->addPanel(u8s2qs(m_other));
m_hadGroup = true;
m_other.clear();