aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--util/fluxbox-update_configs.cc23
1 files changed, 17 insertions, 6 deletions
diff --git a/util/fluxbox-update_configs.cc b/util/fluxbox-update_configs.cc
index 2b24f66..f97463b 100644
--- a/util/fluxbox-update_configs.cc
+++ b/util/fluxbox-update_configs.cc
@@ -742,15 +742,25 @@ void update_keys_for_lua(std::auto_ptr<FbTk::ResourceManager_base>& rm, FbTk::Lu
742 write_file(FbTk::StringUtil::expandFilename(*rc_keyfile), l.tostring(-1)); 742 write_file(FbTk::StringUtil::expandFilename(*rc_keyfile), l.tostring(-1));
743} 743}
744 744
745void update_menu_for_lua(std::auto_ptr<FbTk::ResourceManager_base>& rm, FbTk::Lua &l) { 745void do_update_menu_for_lua(FbTk::StringResource &resource) {
746 FbTk::StringResource rc_menufile(*rm, "~/.fluxbox/menu", "menuFile", "MenuFile");
747 Menu menu; 746 Menu menu;
748 std::ostringstream stream; 747 std::ostringstream stream;
749 748
750 MenuConvertor::createFromFile(*rc_menufile, menu); 749 MenuConvertor::createFromFile(*resource, menu);
751 menu.write(stream); 750 menu.write(stream);
752 *rc_menufile = string(*rc_menufile) + ".lua"; 751 *resource = string(*resource) + ".lua";
753 write_file(FbTk::StringUtil::expandFilename(*rc_menufile), stream.str()); 752 write_file(FbTk::StringUtil::expandFilename(*resource), stream.str());
753}
754
755void update_menu_for_lua(std::auto_ptr<FbTk::ResourceManager_base>& rm, FbTk::Lua &l) {
756 FbTk::StringResource rc_menufile(*rm, "~/.fluxbox/menu", "menuFile", "MenuFile");
757 do_update_menu_for_lua(rc_menufile);
758}
759
760void update_windowmenu_for_lua(std::auto_ptr<FbTk::ResourceManager_base>& rm, FbTk::Lua &l) {
761 FbTk::StringResource rc_windowmenufile(*rm, "~/.fluxbox/windowmenu",
762 "screen0.windowMenu", "Screen0.WindowMenu");
763 do_update_menu_for_lua(rc_windowmenufile);
754} 764}
755 765
756/*------------------------------------------------------------------*\ 766/*------------------------------------------------------------------*\
@@ -778,7 +788,8 @@ const Update UPDATES[] = {
778 { 14, update_lua_resource_manager }, 788 { 14, update_lua_resource_manager },
779 { 15, update_move_slitlist_to_init_file }, 789 { 15, update_move_slitlist_to_init_file },
780 { 16, update_keys_for_lua }, 790 { 16, update_keys_for_lua },
781 { 17, update_menu_for_lua } 791 { 17, update_menu_for_lua },
792 { 18, update_windowmenu_for_lua }
782}; 793};
783 794
784/*------------------------------------------------------------------*\ 795/*------------------------------------------------------------------*\