aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-04-26 15:00:25 (GMT)
committerfluxgen <fluxgen>2003-04-26 15:00:25 (GMT)
commita26d408964032adec3d4153dc642c5fdf28fb89d (patch)
treeb05c3d4ce17596d33386364f1f53190cf07429f5 /src
parent5856d7af0d04bf48d4659331b464e171e10343fd (diff)
downloadfluxbox-a26d408964032adec3d4153dc642c5fdf28fb89d.zip
fluxbox-a26d408964032adec3d4153dc642c5fdf28fb89d.tar.bz2
fixed menu bug
Diffstat (limited to 'src')
-rw-r--r--src/Screen.cc34
1 files changed, 14 insertions, 20 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index 226c352..76d343c 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.136 2003/04/26 05:42:35 rathnor Exp $ 25// $Id: Screen.cc,v 1.137 2003/04/26 15:00:25 fluxgen Exp $
26 26
27 27
28#include "Screen.hh" 28#include "Screen.hh"
@@ -1731,23 +1731,12 @@ void BScreen::initMenu() {
1731 I18n *i18n = I18n::instance(); 1731 I18n *i18n = I18n::instance();
1732 1732
1733 if (m_rootmenu.get()) { 1733 if (m_rootmenu.get()) {
1734 /* Rootmenus::iterator it = rootmenuList.begin(); 1734 // since all menus in root is submenus in m_rootmenu
1735 Rootmenus::iterator it_end = rootmenuList.end(); 1735 // just remove every item in m_rootmenu and then clear rootmenuList
1736 for (; it != it_end; ++it) {
1737 if (*it != m_configmenu.get()) {
1738 delete *it;
1739 }
1740 }
1741 rootmenuList.clear();
1742 */
1743 while (!rootmenuList.empty()) {
1744 delete rootmenuList.back();
1745 rootmenuList.pop_back();
1746 }
1747
1748 while (m_rootmenu->numberOfItems()) 1736 while (m_rootmenu->numberOfItems())
1749 m_rootmenu->remove(0); 1737 m_rootmenu->remove(0);
1750 1738 rootmenuList.clear();
1739
1751 } else 1740 } else
1752 m_rootmenu.reset(createMenuFromScreen(*this)); 1741 m_rootmenu.reset(createMenuFromScreen(*this));
1753 1742
@@ -1906,7 +1895,10 @@ bool BScreen::parseMenuFile(ifstream &file, FbTk::Menu &menu, int &row) {
1906 "no label defined")); 1895 "no label defined"));
1907 cerr<<"Row: "<<row<<endl; 1896 cerr<<"Row: "<<row<<endl;
1908 } else { 1897 } else {
1909 cerr<<"inserts configmenu: "<<m_configmenu.get()<<endl; 1898#ifdef DEBUG
1899 cerr<<__FILE__<<"("<<__FUNCTION__<<
1900 "): inserts configmenu: "<<m_configmenu.get()<<endl;
1901#endif // DEBUG
1910 menu.insert(str_label.c_str(), m_configmenu.get()); 1902 menu.insert(str_label.c_str(), m_configmenu.get());
1911 } 1903 }
1912 } // end of config 1904 } // end of config
@@ -2057,6 +2049,8 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) {
2057 s_a_reconf_macro->add(reconf_cmd); 2049 s_a_reconf_macro->add(reconf_cmd);
2058 FbTk::RefCount<FbTk::Command> save_and_reconfigure(s_a_reconf_macro); 2050 FbTk::RefCount<FbTk::Command> save_and_reconfigure(s_a_reconf_macro);
2059 // create focus menu 2051 // create focus menu
2052 // we don't set this to internal menu so will
2053 // be deleted toghether with the parent
2060 FbTk::Menu *focus_menu = createMenuFromScreen(*this); 2054 FbTk::Menu *focus_menu = createMenuFromScreen(*this);
2061 2055
2062 focus_menu->insert(new FocusModelMenuItem(i18n->getMessage( 2056 focus_menu->insert(new FocusModelMenuItem(i18n->getMessage(
@@ -2088,16 +2082,16 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) {
2088 save_and_reconfigure)); 2082 save_and_reconfigure));
2089 2083
2090 focus_menu->update(); 2084 focus_menu->update();
2091 rootmenuList.push_back(focus_menu);
2092
2093 2085
2094 menu.insert(i18n->getMessage( 2086 menu.insert(i18n->getMessage(
2095 ConfigmenuSet, ConfigmenuFocusModel, 2087 ConfigmenuSet, ConfigmenuFocusModel,
2096 "Focus Model"), 2088 "Focus Model"),
2097 focus_menu); 2089 focus_menu);
2098#ifdef SLIT 2090#ifdef SLIT
2099 if (getSlit() != 0) 2091 if (getSlit() != 0) {
2092 getSlit()->menu().setInternalMenu();
2100 menu.insert("Slit", &getSlit()->menu()); 2093 menu.insert("Slit", &getSlit()->menu());
2094 }
2101#endif // SLIT 2095#endif // SLIT
2102 menu.insert(i18n->getMessage( 2096 menu.insert(i18n->getMessage(
2103 ToolbarSet, ToolbarToolbarTitle, 2097 ToolbarSet, ToolbarToolbarTitle,