summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormarkt <markt>2007-03-16 20:44:47 (GMT)
committermarkt <markt>2007-03-16 20:44:47 (GMT)
commit74216903cc04b9b4492925fc4f90e9f5f378d8c1 (patch)
tree9c48de40fba08bde6a3792dd24f12ebc3a4db8b2 /src
parentd948abb81b104dd1562015c4dfa0d080480b6ce2 (diff)
downloadfluxbox_lack-74216903cc04b9b4492925fc4f90e9f5f378d8c1.zip
fluxbox_lack-74216903cc04b9b4492925fc4f90e9f5f378d8c1.tar.bz2
added custommenu command
Diffstat (limited to 'src')
-rw-r--r--src/FbCommandFactory.cc3
-rw-r--r--src/FbCommands.cc11
-rw-r--r--src/FbCommands.hh9
3 files changed, 23 insertions, 0 deletions
diff --git a/src/FbCommandFactory.cc b/src/FbCommandFactory.cc
index 2f05e5a..c02365a 100644
--- a/src/FbCommandFactory.cc
+++ b/src/FbCommandFactory.cc
@@ -65,6 +65,7 @@ FbCommandFactory::FbCommandFactory() {
65 "close", 65 "close",
66 "closeallwindows", 66 "closeallwindows",
67 "commanddialog", 67 "commanddialog",
68 "custommenu",
68 "deiconify", 69 "deiconify",
69 "detachclient", 70 "detachclient",
70 "export", 71 "export",
@@ -438,6 +439,8 @@ FbTk::Command *FbCommandFactory::stringToCommand(const std::string &command,
438 return new HideMenuCmd(); 439 return new HideMenuCmd();
439 else if (command == "rootmenu") 440 else if (command == "rootmenu")
440 return new ShowRootMenuCmd(); 441 return new ShowRootMenuCmd();
442 else if (command == "custommenu")
443 return new ShowCustomMenuCmd(arguments.c_str());
441 else if (command == "workspacemenu") 444 else if (command == "workspacemenu")
442 return new ShowWorkspaceMenuCmd(); 445 return new ShowWorkspaceMenuCmd();
443 else if (command == "setworkspacename") { 446 else if (command == "setworkspacename") {
diff --git a/src/FbCommands.cc b/src/FbCommands.cc
index 692e12f..bef6402 100644
--- a/src/FbCommands.cc
+++ b/src/FbCommands.cc
@@ -28,6 +28,7 @@
28#include "Workspace.hh" 28#include "Workspace.hh"
29#include "Window.hh" 29#include "Window.hh"
30#include "Keys.hh" 30#include "Keys.hh"
31#include "MenuCreator.hh"
31 32
32#include "FbTk/Theme.hh" 33#include "FbTk/Theme.hh"
33#include "FbTk/Menu.hh" 34#include "FbTk/Menu.hh"
@@ -269,6 +270,16 @@ void HideMenuCmd::execute() {
269 screen->workspaceMenu().hide(); 270 screen->workspaceMenu().hide();
270} 271}
271 272
273ShowCustomMenuCmd::ShowCustomMenuCmd(const string &arguments) : custom_menu_file(arguments) {}
274
275void ShowCustomMenuCmd::execute() {
276 BScreen *screen = Fluxbox::instance()->mouseScreen();
277 if (screen == 0)
278 return;
279 ::showMenu(*screen, *MenuCreator::createFromFile(custom_menu_file,
280 screen->screenNumber(), true));
281}
282
272void ShowRootMenuCmd::execute() { 283void ShowRootMenuCmd::execute() {
273 BScreen *screen = Fluxbox::instance()->mouseScreen(); 284 BScreen *screen = Fluxbox::instance()->mouseScreen();
274 if (screen == 0) 285 if (screen == 0)
diff --git a/src/FbCommands.hh b/src/FbCommands.hh
index 59200d2..3bc5074 100644
--- a/src/FbCommands.hh
+++ b/src/FbCommands.hh
@@ -118,6 +118,15 @@ public:
118 void execute(); 118 void execute();
119}; 119};
120 120
121class ShowCustomMenuCmd: public FbTk::Command {
122public:
123 explicit ShowCustomMenuCmd(const std::string &arguments);
124 void execute();
125private:
126 std::string custom_menu_file;
127
128};
129
121class ShowRootMenuCmd: public FbTk::Command { 130class ShowRootMenuCmd: public FbTk::Command {
122public: 131public:
123 void execute(); 132 void execute();