aboutsummaryrefslogtreecommitdiff
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
parentd948abb81b104dd1562015c4dfa0d080480b6ce2 (diff)
downloadfluxbox_paul-74216903cc04b9b4492925fc4f90e9f5f378d8c1.zip
fluxbox_paul-74216903cc04b9b4492925fc4f90e9f5f378d8c1.tar.bz2
added custommenu command
-rw-r--r--ChangeLog4
-rw-r--r--src/FbCommandFactory.cc3
-rw-r--r--src/FbCommands.cc11
-rw-r--r--src/FbCommands.hh9
4 files changed, 27 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 720d148..61b94cf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
1 (Format: Year/Month/Day) 1 (Format: Year/Month/Day)
2Changes for 1.0rc3: 2Changes for 1.0rc3:
3*07/03/16:
4 * Added key command to open a custom menu file (thanks Matteo Galiazzo)
5 - :CustomMenu /path/to/file
6 FbCommands.cc/hh FbCommandFactory.cc
3*07/03/11: 7*07/03/11:
4 * Fixed display bug with ParentRelative menu highlight (thanks Julien Trolet) 8 * Fixed display bug with ParentRelative menu highlight (thanks Julien Trolet)
5 FbTk/Menu.cc 9 FbTk/Menu.cc
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();