From 6fad392312cf634020354fd66afe95ca530d18e7 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 a667406..956cebf 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -805,8 +805,6 @@ BScreen::addExtraWindowMenu(const FbTk::FbString &label, const FbTk::RefCountsetAlpha(*resource.focused_alpha); unfocusedWinFrameTheme()->setAlpha(*resource.unfocused_alpha); m_menutheme->setAlpha(*resource.menu_alpha); @@ -825,7 +823,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 @@ -1342,7 +1339,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()); } @@ -1356,7 +1356,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 7d479ae..dc3b0b3 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