diff options
author | Mark Tiefenbruck <mark@fluxbox.org> | 2008-01-11 07:41:22 (GMT) |
---|---|---|
committer | Mark Tiefenbruck <mark@fluxbox.org> | 2008-01-11 07:41:22 (GMT) |
commit | 9f2f65a698c4cc71373a7fe9d73a0889e0d3487b (patch) | |
tree | 4ad67db771d73ea3c48f80a1244037fc9754edd2 /src/WorkspaceMenu.cc | |
parent | 1f01d84c080d607a91eb417efcaf5e500b5f1d7e (diff) | |
download | fluxbox-9f2f65a698c4cc71373a7fe9d73a0889e0d3487b.zip fluxbox-9f2f65a698c4cc71373a7fe9d73a0889e0d3487b.tar.bz2 |
make FbTk::Command a template class, split parsing information out of ObjectRegistry
Diffstat (limited to 'src/WorkspaceMenu.cc')
-rw-r--r-- | src/WorkspaceMenu.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/WorkspaceMenu.cc b/src/WorkspaceMenu.cc index 3f417ed..5a83170 100644 --- a/src/WorkspaceMenu.cc +++ b/src/WorkspaceMenu.cc | |||
@@ -25,7 +25,7 @@ | |||
25 | #include "Workspace.hh" | 25 | #include "Workspace.hh" |
26 | #include "WorkspaceCmd.hh" | 26 | #include "WorkspaceCmd.hh" |
27 | #include "MenuCreator.hh" | 27 | #include "MenuCreator.hh" |
28 | #include "FbTk/ObjectRegistry.hh" | 28 | #include "FbTk/CommandParser.hh" |
29 | #include "FbCommands.hh" | 29 | #include "FbCommands.hh" |
30 | #include "Layer.hh" | 30 | #include "Layer.hh" |
31 | 31 | ||
@@ -92,7 +92,7 @@ void WorkspaceMenu::update(FbTk::Subject *subj) { | |||
92 | FbTk::MultiButtonMenuItem* mb_menu = new FbTk::MultiButtonMenuItem(5, | 92 | FbTk::MultiButtonMenuItem* mb_menu = new FbTk::MultiButtonMenuItem(5, |
93 | wkspc->name().c_str(), | 93 | wkspc->name().c_str(), |
94 | &wkspc->menu()); | 94 | &wkspc->menu()); |
95 | FbTk::RefCount<FbTk::Command> jump_cmd(new JumpToWorkspaceCmd(wkspc->workspaceID())); | 95 | FbTk::RefCount<FbTk::Command<void> > jump_cmd(new JumpToWorkspaceCmd(wkspc->workspaceID())); |
96 | mb_menu->setCommand(3, jump_cmd); | 96 | mb_menu->setCommand(3, jump_cmd); |
97 | insert(mb_menu, workspace + IDX_AFTER_ICONS); | 97 | insert(mb_menu, workspace + IDX_AFTER_ICONS); |
98 | } | 98 | } |
@@ -124,28 +124,28 @@ void WorkspaceMenu::init(BScreen &screen) { | |||
124 | FbTk::MultiButtonMenuItem* mb_menu = new FbTk::MultiButtonMenuItem(5, | 124 | FbTk::MultiButtonMenuItem* mb_menu = new FbTk::MultiButtonMenuItem(5, |
125 | wkspc->name().c_str(), | 125 | wkspc->name().c_str(), |
126 | &wkspc->menu()); | 126 | &wkspc->menu()); |
127 | FbTk::RefCount<FbTk::Command> jump_cmd(new JumpToWorkspaceCmd(wkspc->workspaceID())); | 127 | FbTk::RefCount<FbTk::Command<void> > jump_cmd(new JumpToWorkspaceCmd(wkspc->workspaceID())); |
128 | mb_menu->setCommand(2, jump_cmd); | 128 | mb_menu->setCommand(2, jump_cmd); |
129 | insert(mb_menu, workspace + IDX_AFTER_ICONS); | 129 | insert(mb_menu, workspace + IDX_AFTER_ICONS); |
130 | } | 130 | } |
131 | setItemSelected(screen.currentWorkspace()->workspaceID() + IDX_AFTER_ICONS, true); | 131 | setItemSelected(screen.currentWorkspace()->workspaceID() + IDX_AFTER_ICONS, true); |
132 | 132 | ||
133 | 133 | ||
134 | RefCount<Command> saverc_cmd(new FbCommands::SaveResources()); | 134 | RefCount<Command<void> > saverc_cmd(new FbCommands::SaveResources()); |
135 | 135 | ||
136 | MacroCommand *new_workspace_macro = new MacroCommand(); | 136 | MacroCommand *new_workspace_macro = new MacroCommand(); |
137 | RefCount<Command> addworkspace(new SimpleCommand<BScreen, int>(screen, &BScreen::addWorkspace)); | 137 | RefCount<Command<void> > addworkspace(new SimpleCommand<BScreen>(screen, (SimpleCommand<BScreen>::Action)&BScreen::addWorkspace)); |
138 | new_workspace_macro->add(addworkspace); | 138 | new_workspace_macro->add(addworkspace); |
139 | new_workspace_macro->add(saverc_cmd); | 139 | new_workspace_macro->add(saverc_cmd); |
140 | RefCount<Command> new_workspace_cmd(new_workspace_macro); | 140 | RefCount<Command<void> > new_workspace_cmd(new_workspace_macro); |
141 | 141 | ||
142 | MacroCommand *remove_workspace_macro = new MacroCommand(); | 142 | MacroCommand *remove_workspace_macro = new MacroCommand(); |
143 | RefCount<Command> rmworkspace(new SimpleCommand<BScreen, int>(screen, &BScreen::removeLastWorkspace)); | 143 | RefCount<Command<void> > rmworkspace(new SimpleCommand<BScreen>(screen, (SimpleCommand<BScreen>::Action)&BScreen::removeLastWorkspace)); |
144 | remove_workspace_macro->add(rmworkspace); | 144 | remove_workspace_macro->add(rmworkspace); |
145 | remove_workspace_macro->add(saverc_cmd); | 145 | remove_workspace_macro->add(saverc_cmd); |
146 | RefCount<Command> remove_last_cmd(remove_workspace_macro); | 146 | RefCount<Command<void> > remove_last_cmd(remove_workspace_macro); |
147 | 147 | ||
148 | RefCount<Command> start_edit(FbTk::ObjectRegistry<Command>::instance().parse("setworkspacenamedialog")); | 148 | RefCount<Command<void> > start_edit(FbTk::CommandParser<void>::instance().parse("setworkspacenamedialog")); |
149 | 149 | ||
150 | insert(new FbTk::MenuSeparator()); | 150 | insert(new FbTk::MenuSeparator()); |
151 | insert(_FB_XTEXT(Workspace, NewWorkspace, "New Workspace", "Add a new workspace"), | 151 | insert(_FB_XTEXT(Workspace, NewWorkspace, "New Workspace", "Add a new workspace"), |