diff options
author | rathnor <rathnor> | 2003-07-20 02:45:57 (GMT) |
---|---|---|
committer | rathnor <rathnor> | 2003-07-20 02:45:57 (GMT) |
commit | ace3e2e6293fa0ae5a2b9d971f24fa45b317ba2e (patch) | |
tree | 1943fde6b3bced84b1b6634b1f36bfa877ef6f29 | |
parent | 1631ed814cb8665516673706637084dfa1485f87 (diff) | |
download | fluxbox-ace3e2e6293fa0ae5a2b9d971f24fa45b317ba2e.zip fluxbox-ace3e2e6293fa0ae5a2b9d971f24fa45b317ba2e.tar.bz2 |
fix toolbarmode = OFF bug, plus add toolbar menu back to screen's config menu
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | src/Screen.cc | 26 | ||||
-rw-r--r-- | src/Screen.hh | 11 | ||||
-rw-r--r-- | src/ToolbarHandler.cc | 19 |
4 files changed, 51 insertions, 9 deletions
@@ -1,5 +1,9 @@ | |||
1 | (Format: Year/Month/Day) | 1 | (Format: Year/Month/Day) |
2 | Changes for 0.9.5: | 2 | Changes for 0.9.5: |
3 | *03/07/20: | ||
4 | * Fix crash with toolbarmode = OFF, and put toolbar menu back into | ||
5 | screen's configure menu (Simon) | ||
6 | Screen.hh/cc ToolbarHandler.cc | ||
3 | *03/07/19: | 7 | *03/07/19: |
4 | * Make most Commands execute on mouse screen rather than screen | 8 | * Make most Commands execute on mouse screen rather than screen |
5 | of focused window (Simon) | 9 | of focused window (Simon) |
diff --git a/src/Screen.cc b/src/Screen.cc index 2e05b9c..b3ba39a 100644 --- a/src/Screen.cc +++ b/src/Screen.cc | |||
@@ -22,7 +22,7 @@ | |||
22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
23 | // DEALINGS IN THE SOFTWARE. | 23 | // DEALINGS IN THE SOFTWARE. |
24 | 24 | ||
25 | // $Id: Screen.cc,v 1.204 2003/07/19 03:59:55 rathnor Exp $ | 25 | // $Id: Screen.cc,v 1.205 2003/07/20 02:45:57 rathnor Exp $ |
26 | 26 | ||
27 | 27 | ||
28 | #include "Screen.hh" | 28 | #include "Screen.hh" |
@@ -1940,10 +1940,29 @@ bool BScreen::parseMenuFile(ifstream &file, FbTk::Menu &menu, int &row) { | |||
1940 | return ((menu.numberOfItems() == 0) ? true : false); | 1940 | return ((menu.numberOfItems() == 0) ? true : false); |
1941 | } | 1941 | } |
1942 | 1942 | ||
1943 | void BScreen::addConfigMenu(const char *label, FbTk::Menu &menu) { | ||
1944 | m_configmenu_list.push_back(std::make_pair(label, &menu)); | ||
1945 | setupConfigmenu(*m_configmenu.get()); | ||
1946 | } | ||
1947 | |||
1948 | void BScreen::removeConfigMenu(FbTk::Menu &menu) { | ||
1949 | Configmenus::iterator it = m_configmenu_list.begin(); | ||
1950 | Configmenus::iterator it_end = m_configmenu_list.end(); | ||
1951 | for (; it != it_end; ++it) { | ||
1952 | if (it->second == &menu) { | ||
1953 | m_configmenu_list.erase(it); | ||
1954 | break; | ||
1955 | } | ||
1956 | } | ||
1957 | setupConfigmenu(*m_configmenu.get()); | ||
1958 | } | ||
1959 | |||
1943 | void BScreen::setupConfigmenu(FbTk::Menu &menu) { | 1960 | void BScreen::setupConfigmenu(FbTk::Menu &menu) { |
1944 | I18n *i18n = I18n::instance(); | 1961 | I18n *i18n = I18n::instance(); |
1945 | using namespace FBNLS; | 1962 | using namespace FBNLS; |
1946 | 1963 | ||
1964 | menu.removeAll(); | ||
1965 | |||
1947 | FbTk::MacroCommand *s_a_reconf_macro = new FbTk::MacroCommand(); | 1966 | FbTk::MacroCommand *s_a_reconf_macro = new FbTk::MacroCommand(); |
1948 | FbTk::RefCount<FbTk::Command> saverc_cmd(new FbTk::SimpleCommand<Fluxbox>(*Fluxbox::instance(), | 1967 | FbTk::RefCount<FbTk::Command> saverc_cmd(new FbTk::SimpleCommand<Fluxbox>(*Fluxbox::instance(), |
1949 | &Fluxbox::save_rc)); | 1968 | &Fluxbox::save_rc)); |
@@ -1997,6 +2016,11 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) { | |||
1997 | } | 2016 | } |
1998 | #endif // SLIT | 2017 | #endif // SLIT |
1999 | 2018 | ||
2019 | Configmenus::iterator it = m_configmenu_list.begin(); | ||
2020 | Configmenus::iterator it_end = m_configmenu_list.end(); | ||
2021 | for (; it != it_end; ++it) | ||
2022 | menu.insert(it->first, it->second); | ||
2023 | |||
2000 | menu.insert(new | 2024 | menu.insert(new |
2001 | BoolMenuItem(i18n->getMessage(ConfigmenuSet, ConfigmenuImageDithering, | 2025 | BoolMenuItem(i18n->getMessage(ConfigmenuSet, ConfigmenuImageDithering, |
2002 | "Image Dithering"), | 2026 | "Image Dithering"), |
diff --git a/src/Screen.hh b/src/Screen.hh index c4976b5..3718d92 100644 --- a/src/Screen.hh +++ b/src/Screen.hh | |||
@@ -22,7 +22,7 @@ | |||
22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
23 | // DEALINGS IN THE SOFTWARE. | 23 | // DEALINGS IN THE SOFTWARE. |
24 | 24 | ||
25 | // $Id: Screen.hh,v 1.114 2003/07/10 11:28:24 fluxgen Exp $ | 25 | // $Id: Screen.hh,v 1.115 2003/07/20 02:45:57 rathnor Exp $ |
26 | 26 | ||
27 | #ifndef SCREEN_HH | 27 | #ifndef SCREEN_HH |
28 | #define SCREEN_HH | 28 | #define SCREEN_HH |
@@ -310,6 +310,12 @@ public: | |||
310 | /// updates max avaible area for the workspace | 310 | /// updates max avaible area for the workspace |
311 | void updateAvailableWorkspaceArea(); | 311 | void updateAvailableWorkspaceArea(); |
312 | 312 | ||
313 | // for extras to add menus. These menus must be marked | ||
314 | // internal for their safety, and the extension must | ||
315 | // delete and remove the menu itself | ||
316 | void addConfigMenu(const char *label, FbTk::Menu &menu); | ||
317 | void removeConfigMenu(FbTk::Menu &menu); | ||
318 | |||
313 | enum { ROWSMARTPLACEMENT = 1, COLSMARTPLACEMENT, CASCADEPLACEMENT, | 319 | enum { ROWSMARTPLACEMENT = 1, COLSMARTPLACEMENT, CASCADEPLACEMENT, |
314 | UNDERMOUSEPLACEMENT, LEFTRIGHT, RIGHTLEFT, TOPBOTTOM, BOTTOMTOP }; | 320 | UNDERMOUSEPLACEMENT, LEFTRIGHT, RIGHTLEFT, TOPBOTTOM, BOTTOMTOP }; |
315 | 321 | ||
@@ -360,9 +366,12 @@ private: | |||
360 | 366 | ||
361 | typedef std::list<FbTk::Menu *> Rootmenus; | 367 | typedef std::list<FbTk::Menu *> Rootmenus; |
362 | typedef std::list<Netizen *> Netizens; | 368 | typedef std::list<Netizen *> Netizens; |
369 | typedef std::list<std::pair<const char *, FbTk::Menu *> > Configmenus; | ||
370 | |||
363 | 371 | ||
364 | Rootmenus m_rootmenu_list; | 372 | Rootmenus m_rootmenu_list; |
365 | Netizens m_netizen_list; | 373 | Netizens m_netizen_list; |
374 | Configmenus m_configmenu_list; | ||
366 | Icons m_icon_list; | 375 | Icons m_icon_list; |
367 | 376 | ||
368 | // This list keeps the order of window focusing for this screen | 377 | // This list keeps the order of window focusing for this screen |
diff --git a/src/ToolbarHandler.cc b/src/ToolbarHandler.cc index f5e9255..5db8f44 100644 --- a/src/ToolbarHandler.cc +++ b/src/ToolbarHandler.cc | |||
@@ -20,7 +20,7 @@ | |||
20 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 20 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
21 | // DEALINGS IN THE SOFTWARE. | 21 | // DEALINGS IN THE SOFTWARE. |
22 | 22 | ||
23 | // $Id: ToolbarHandler.cc,v 1.23 2003/07/18 15:40:55 rathnor Exp $ | 23 | // $Id: ToolbarHandler.cc,v 1.24 2003/07/20 02:45:57 rathnor Exp $ |
24 | 24 | ||
25 | /** | 25 | /** |
26 | * The ToolbarHandler class acts as a rough interface to the toolbar. | 26 | * The ToolbarHandler class acts as a rough interface to the toolbar. |
@@ -155,6 +155,10 @@ ToolbarHandler::ToolbarHandler(BScreen &screen) | |||
155 | m_toolbarmenu.setInternalMenu(); | 155 | m_toolbarmenu.setInternalMenu(); |
156 | setupModeMenu(m_modemenu, *this); | 156 | setupModeMenu(m_modemenu, *this); |
157 | setMode(*m_rc_mode, false); // the atomhandler part will initialise it shortly | 157 | setMode(*m_rc_mode, false); // the atomhandler part will initialise it shortly |
158 | // now add this to the config menus for the screen | ||
159 | // (we only want it done once, so it can't go in initforscreen) | ||
160 | |||
161 | screen.addConfigMenu("Toolbar", m_toolbarmenu); | ||
158 | } | 162 | } |
159 | 163 | ||
160 | void ToolbarHandler::setMode(ToolbarMode newmode, bool initialise) { | 164 | void ToolbarHandler::setMode(ToolbarMode newmode, bool initialise) { |
@@ -175,7 +179,6 @@ void ToolbarHandler::setMode(ToolbarMode newmode, bool initialise) { | |||
175 | m_toolbarmenu.removeAll(); | 179 | m_toolbarmenu.removeAll(); |
176 | m_toolbar.reset(new Toolbar(m_screen, | 180 | m_toolbar.reset(new Toolbar(m_screen, |
177 | *m_screen.layerManager().getLayer(Fluxbox::instance()->getNormalLayer()), m_toolbarmenu)); | 181 | *m_screen.layerManager().getLayer(Fluxbox::instance()->getNormalLayer()), m_toolbarmenu)); |
178 | Fluxbox::instance()->load_rc(m_screen); | ||
179 | m_toolbar->reconfigure(); | 182 | m_toolbar->reconfigure(); |
180 | 183 | ||
181 | m_toolbarmenu.insert("Mode...", &m_modemenu); | 184 | m_toolbarmenu.insert("Mode...", &m_modemenu); |
@@ -384,14 +387,16 @@ void ToolbarHandler::updateWorkspace(FluxboxWindow &win) { | |||
384 | } | 387 | } |
385 | 388 | ||
386 | void ToolbarHandler::updateCurrentWorkspace(BScreen &screen) { | 389 | void ToolbarHandler::updateCurrentWorkspace(BScreen &screen) { |
387 | if (&screen != &m_screen) | 390 | if (&screen != &m_screen || mode() == OFF) |
388 | return; | 391 | return; |
389 | 392 | ||
390 | m_toolbar->redrawWorkspaceLabel(true); | 393 | m_toolbar->redrawWorkspaceLabel(true); |
391 | m_toolbar->disableUpdates(); | 394 | if (mode() != NONE) { |
392 | m_toolbar->delAllIcons(true); | 395 | m_toolbar->disableUpdates(); |
393 | initForScreen(m_screen); | 396 | m_toolbar->delAllIcons(true); |
394 | m_toolbar->enableUpdates(); | 397 | initForScreen(m_screen); |
398 | m_toolbar->enableUpdates(); | ||
399 | } | ||
395 | 400 | ||
396 | } | 401 | } |
397 | 402 | ||