aboutsummaryrefslogtreecommitdiff
path: root/src/Screen.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Screen.cc')
-rw-r--r--src/Screen.cc27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index 9aab3f7..5e7ca8b 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -1362,22 +1362,25 @@ void BScreen::rereadWindowMenu() {
1362} 1362}
1363 1363
1364void BScreen::addConfigMenu(const FbTk::FbString &label, FbTk::Menu &menu) { 1364void BScreen::addConfigMenu(const FbTk::FbString &label, FbTk::Menu &menu) {
1365 m_configmenu_list.push_back(make_pair(label, &menu)); 1365
1366 if (m_configmenu.get()) 1366 FbTk::Menu* cm = m_configmenu.get();
1367 setupConfigmenu(*m_configmenu.get()); 1367 if (cm) {
1368 int pos = cm->findSubmenuIndex(&menu);
1369 if (pos == -1) { // not found? add
1370 cm->insertSubmenu(label, &menu, pos);
1371 }
1372 }
1368} 1373}
1369 1374
1370void BScreen::removeConfigMenu(FbTk::Menu &menu) { 1375void BScreen::removeConfigMenu(FbTk::Menu &menu) {
1371 Configmenus::iterator erase_it = find_if(m_configmenu_list.begin(),
1372 m_configmenu_list.end(),
1373 FbTk::Compose(bind2nd(equal_to<FbTk::Menu *>(), &menu),
1374 FbTk::Select2nd<Configmenus::value_type>()));
1375 if (erase_it != m_configmenu_list.end())
1376 m_configmenu_list.erase(erase_it);
1377
1378 if (!isShuttingdown() && m_configmenu.get())
1379 setupConfigmenu(*m_configmenu.get());
1380 1376
1377 FbTk::Menu* cm = m_configmenu.get();
1378 if (cm) {
1379 int pos = cm->findSubmenuIndex(&menu);
1380 if (pos > -1) {
1381 cm->remove(pos);
1382 }
1383 }
1381} 1384}
1382 1385
1383 1386