From e1c1e1d11dc6bbf096586a7605869a11d0229729 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Mon, 18 Jul 2011 12:44:01 +0200 Subject: Attach modifiedSig handlers to the session.screenX.windowMenu resource --- src/Screen.cc | 15 ++++----------- src/Screen.hh | 1 - 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/Screen.cc b/src/Screen.cc index 7e3913a..d898e69 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -826,9 +826,6 @@ void BScreen::reconfigure() { for(size_t i = 0; i < std::min(m_workspaces_list.size(), resource.workspace_names->size()); ++i) m_workspaces_list[i]->setName( resource.workspace_names.get()[i] ); - // update menu filenames - m_windowmenu->reloadHelper()->setMainFile(windowMenuFilename()); - // reconfigure workspaces for_each(m_workspaces_list.begin(), m_workspaces_list.end(), @@ -1347,7 +1344,9 @@ void BScreen::initMenus() { MemFun(*m_rootmenu->reloadHelper(), &FbTk::AutoReloadHelper::setMainFile)); m_rootmenu->reloadHelper()->setMainFile(*Fluxbox::instance()->getMenuResource()); - m_windowmenu->reloadHelper()->setMainFile(windowMenuFilename()); + m_tracker.join(resource.windowmenufile.modifiedSig(), + MemFun(*m_windowmenu->reloadHelper(), &FbTk::AutoReloadHelper::setMainFile)); + m_windowmenu->reloadHelper()->setMainFile(*resource.windowmenufile); } @@ -1390,12 +1389,6 @@ void BScreen::rereadMenu() { } -const std::string BScreen::windowMenuFilename() const { - if ((*resource.windowmenufile).empty()) - return Fluxbox::instance()->getDefaultDataFilename("windowmenu"); - return *resource.windowmenufile; -} - void BScreen::rereadWindowMenu() { lua::state &l = Fluxbox::instance()->lua(); l.checkstack(1); @@ -1403,7 +1396,7 @@ void BScreen::rereadWindowMenu() { m_windowmenu->removeAll(); try { - l.loadfile(FbTk::StringUtil::expandFilename(windowMenuFilename()).c_str()); + l.loadfile(FbTk::StringUtil::expandFilename(resource.windowmenufile).c_str()); l.call(0, 1); MenuCreator::createMenu(*m_windowmenu, l, m_windowmenu->reloadHelper()); } diff --git a/src/Screen.hh b/src/Screen.hh index 2ff87db..3b54815 100644 --- a/src/Screen.hh +++ b/src/Screen.hh @@ -109,7 +109,6 @@ public: bool getMaxDisableResize() const { return *resource.max_disable_resize; } bool doShowWindowPos() const { return *resource.show_window_pos; } FbTk::StringResource &defaultDecoResource() { return resource.default_deco; } - const std::string windowMenuFilename() const; FbTk::ImageControl &imageControl() { return *m_image_control.get(); } // menus const FbMenu &rootMenu() const { return *m_rootmenu.get(); } -- cgit v0.11.2