aboutsummaryrefslogtreecommitdiff
path: root/src/FbCommandFactory.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbCommandFactory.cc')
-rw-r--r--src/FbCommandFactory.cc21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/FbCommandFactory.cc b/src/FbCommandFactory.cc
index ece39b1..91348fa 100644
--- a/src/FbCommandFactory.cc
+++ b/src/FbCommandFactory.cc
@@ -20,7 +20,7 @@
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE. 21// DEALINGS IN THE SOFTWARE.
22 22
23// $Id: FbCommandFactory.cc,v 1.22 2003/12/19 03:55:10 fluxgen Exp $ 23// $Id: FbCommandFactory.cc,v 1.23 2003/12/19 18:17:08 fluxgen Exp $
24 24
25#include "FbCommandFactory.hh" 25#include "FbCommandFactory.hh"
26 26
@@ -110,6 +110,8 @@ FbCommandFactory::FbCommandFactory() {
110 "setstyle", 110 "setstyle",
111 "setworkspacename", 111 "setworkspacename",
112 "setworkspacenamedialog", 112 "setworkspacenamedialog",
113 "setresourcevalue",
114 "setresourcevaluedialog",
113 "shade", 115 "shade",
114 "shadewindow", 116 "shadewindow",
115 "showdesktop", 117 "showdesktop",
@@ -151,6 +153,23 @@ FbTk::Command *FbCommandFactory::stringToCommand(const std::string &command,
151 return new FbTk::SimpleCommand<Fluxbox>(*Fluxbox::instance(), &Fluxbox::shutdown); 153 return new FbTk::SimpleCommand<Fluxbox>(*Fluxbox::instance(), &Fluxbox::shutdown);
152 else if (command == "commanddialog") // run specified fluxbox command 154 else if (command == "commanddialog") // run specified fluxbox command
153 return new CommandDialogCmd(); 155 return new CommandDialogCmd();
156 else if (command == "setresourcevalue") {
157 // we need to parse arguments as:
158 // <remove whitespace here><resname><one whitespace><value>
159 string name = arguments;
160 FbTk::StringUtil::removeFirstWhitespace(name);
161 size_t pos = name.find_first_of(" \t");
162 // we need an argument to resource name
163 if (pos == std::string::npos || pos == name.size())
164 return 0;
165 // +1 so we only remove the first whitespace
166 // i.e so users can set space before workspace name and so on
167 string value = name.substr(pos + 1);
168 name = name.substr(0, pos);
169 cerr<<"Creating SetResourceValue "<<name<<" "<<value<<endl;
170 return new SetResourceValueCmd(name, value);
171 } else if (command == "setresourcevaluedialog")
172 return new SetResourceValueDialogCmd();
154 // 173 //
155 // Current focused window commands 174 // Current focused window commands
156 // 175 //