fixed menu bug
This commit is contained in:
parent
5856d7af0d
commit
a26d408964
1 changed files with 14 additions and 20 deletions
|
@ -22,7 +22,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// $Id: Screen.cc,v 1.136 2003/04/26 05:42:35 rathnor Exp $
|
// $Id: Screen.cc,v 1.137 2003/04/26 15:00:25 fluxgen Exp $
|
||||||
|
|
||||||
|
|
||||||
#include "Screen.hh"
|
#include "Screen.hh"
|
||||||
|
@ -1731,22 +1731,11 @@ void BScreen::initMenu() {
|
||||||
I18n *i18n = I18n::instance();
|
I18n *i18n = I18n::instance();
|
||||||
|
|
||||||
if (m_rootmenu.get()) {
|
if (m_rootmenu.get()) {
|
||||||
/* Rootmenus::iterator it = rootmenuList.begin();
|
// since all menus in root is submenus in m_rootmenu
|
||||||
Rootmenus::iterator it_end = rootmenuList.end();
|
// just remove every item in m_rootmenu and then clear rootmenuList
|
||||||
for (; it != it_end; ++it) {
|
|
||||||
if (*it != m_configmenu.get()) {
|
|
||||||
delete *it;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
rootmenuList.clear();
|
|
||||||
*/
|
|
||||||
while (!rootmenuList.empty()) {
|
|
||||||
delete rootmenuList.back();
|
|
||||||
rootmenuList.pop_back();
|
|
||||||
}
|
|
||||||
|
|
||||||
while (m_rootmenu->numberOfItems())
|
while (m_rootmenu->numberOfItems())
|
||||||
m_rootmenu->remove(0);
|
m_rootmenu->remove(0);
|
||||||
|
rootmenuList.clear();
|
||||||
|
|
||||||
} else
|
} else
|
||||||
m_rootmenu.reset(createMenuFromScreen(*this));
|
m_rootmenu.reset(createMenuFromScreen(*this));
|
||||||
|
@ -1906,7 +1895,10 @@ bool BScreen::parseMenuFile(ifstream &file, FbTk::Menu &menu, int &row) {
|
||||||
"no label defined"));
|
"no label defined"));
|
||||||
cerr<<"Row: "<<row<<endl;
|
cerr<<"Row: "<<row<<endl;
|
||||||
} else {
|
} else {
|
||||||
cerr<<"inserts configmenu: "<<m_configmenu.get()<<endl;
|
#ifdef DEBUG
|
||||||
|
cerr<<__FILE__<<"("<<__FUNCTION__<<
|
||||||
|
"): inserts configmenu: "<<m_configmenu.get()<<endl;
|
||||||
|
#endif // DEBUG
|
||||||
menu.insert(str_label.c_str(), m_configmenu.get());
|
menu.insert(str_label.c_str(), m_configmenu.get());
|
||||||
}
|
}
|
||||||
} // end of config
|
} // end of config
|
||||||
|
@ -2057,6 +2049,8 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) {
|
||||||
s_a_reconf_macro->add(reconf_cmd);
|
s_a_reconf_macro->add(reconf_cmd);
|
||||||
FbTk::RefCount<FbTk::Command> save_and_reconfigure(s_a_reconf_macro);
|
FbTk::RefCount<FbTk::Command> save_and_reconfigure(s_a_reconf_macro);
|
||||||
// create focus menu
|
// create focus menu
|
||||||
|
// we don't set this to internal menu so will
|
||||||
|
// be deleted toghether with the parent
|
||||||
FbTk::Menu *focus_menu = createMenuFromScreen(*this);
|
FbTk::Menu *focus_menu = createMenuFromScreen(*this);
|
||||||
|
|
||||||
focus_menu->insert(new FocusModelMenuItem(i18n->getMessage(
|
focus_menu->insert(new FocusModelMenuItem(i18n->getMessage(
|
||||||
|
@ -2088,16 +2082,16 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) {
|
||||||
save_and_reconfigure));
|
save_and_reconfigure));
|
||||||
|
|
||||||
focus_menu->update();
|
focus_menu->update();
|
||||||
rootmenuList.push_back(focus_menu);
|
|
||||||
|
|
||||||
|
|
||||||
menu.insert(i18n->getMessage(
|
menu.insert(i18n->getMessage(
|
||||||
ConfigmenuSet, ConfigmenuFocusModel,
|
ConfigmenuSet, ConfigmenuFocusModel,
|
||||||
"Focus Model"),
|
"Focus Model"),
|
||||||
focus_menu);
|
focus_menu);
|
||||||
#ifdef SLIT
|
#ifdef SLIT
|
||||||
if (getSlit() != 0)
|
if (getSlit() != 0) {
|
||||||
|
getSlit()->menu().setInternalMenu();
|
||||||
menu.insert("Slit", &getSlit()->menu());
|
menu.insert("Slit", &getSlit()->menu());
|
||||||
|
}
|
||||||
#endif // SLIT
|
#endif // SLIT
|
||||||
menu.insert(i18n->getMessage(
|
menu.insert(i18n->getMessage(
|
||||||
ToolbarSet, ToolbarToolbarTitle,
|
ToolbarSet, ToolbarToolbarTitle,
|
||||||
|
|
Loading…
Reference in a new issue