From 17dde49100067d2b59be068c227a10071a48a448 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Thu, 14 Jul 2011 13:02:29 +0200 Subject: Attach a modifiedSig handler to the session.menuFile resource --- src/Screen.cc | 10 +++++----- src/fluxbox.hh | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Screen.cc b/src/Screen.cc index 97ebffa..6e74d88 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -828,8 +828,6 @@ BScreen::addExtraWindowMenu(const FbTk::FbString &label, const FbTk::RefCountsetAlpha(*resource.focused_alpha); unfocusedWinFrameTheme()->setAlpha(*resource.unfocused_alpha); m_menutheme->setAlpha(*resource.menu_alpha); @@ -848,7 +846,6 @@ void BScreen::reconfigure() { m_workspaces_list[i]->setName( resource.workspace_names.get()[i] ); // update menu filenames - m_rootmenu->reloadHelper()->setMainFile(fluxbox->getMenuFilename()); m_windowmenu->reloadHelper()->setMainFile(windowMenuFilename()); // reconfigure workspaces @@ -1361,7 +1358,10 @@ void BScreen::reassociateWindow(FluxboxWindow *w, unsigned int wkspc_id, void BScreen::initMenus() { m_workspacemenu = MenuCreator::createMenuType("workspacemenu", screenNumber()); - m_rootmenu->reloadHelper()->setMainFile(Fluxbox::instance()->getMenuFilename()); + m_tracker.join(Fluxbox::instance()->getMenuResource().modifiedSig(), + MemFun(*m_rootmenu->reloadHelper(), &FbTk::AutoReloadHelper::setMainFile)); + m_rootmenu->reloadHelper()->setMainFile(*Fluxbox::instance()->getMenuResource()); + m_windowmenu->reloadHelper()->setMainFile(windowMenuFilename()); } @@ -1375,7 +1375,7 @@ void BScreen::rereadMenu() { m_rootmenu->removeAll(); try { - l.loadfile(FbTk::StringUtil::expandFilename(fb->getMenuFilename()).c_str()); + l.loadfile(FbTk::StringUtil::expandFilename(*fb->getMenuResource()).c_str()); l.call(0, 1); MenuCreator::createMenu(*m_rootmenu, l, m_rootmenu->reloadHelper()); } diff --git a/src/fluxbox.hh b/src/fluxbox.hh index 78ce093..c245d43 100644 --- a/src/fluxbox.hh +++ b/src/fluxbox.hh @@ -120,7 +120,7 @@ public: FbTk::StringResource &getStyleResource() { return m_rc_stylefile; } const std::string &getStyleOverlayFilename() const { return *m_rc_styleoverlayfile; } - const std::string &getMenuFilename() const { return *m_rc_menufile; } + FbTk::StringResource &getMenuResource() { return m_rc_menufile; } FbTk::StringResource &getAppsResource() { return m_rc_appsfile; } FbTk::StringResource &getKeysResource() { return m_rc_keyfile; } int colorsPerChannel() const { return *m_rc_colors_per_channel; } -- cgit v0.11.2