aboutsummaryrefslogtreecommitdiff
path: root/src/RootCmdMenuItem.cc
diff options
context:
space:
mode:
authorakir <akir>2004-08-29 21:11:24 (GMT)
committerakir <akir>2004-08-29 21:11:24 (GMT)
commitdc836d2b7827c14e82f0250f197d632b30942097 (patch)
treec633c50ca4b6f395a02885544a9f98c4ca747829 /src/RootCmdMenuItem.cc
parent680128f286d990549ea99eadbb4a6094f65cc461 (diff)
downloadfluxbox-dc836d2b7827c14e82f0250f197d632b30942097.zip
fluxbox-dc836d2b7827c14e82f0250f197d632b30942097.tar.bz2
added [wallpapers|rootcommands] to menuitems
Diffstat (limited to 'src/RootCmdMenuItem.cc')
-rw-r--r--src/RootCmdMenuItem.cc47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/RootCmdMenuItem.cc b/src/RootCmdMenuItem.cc
new file mode 100644
index 0000000..d9e0e08
--- /dev/null
+++ b/src/RootCmdMenuItem.cc
@@ -0,0 +1,47 @@
1// RootCmdMenuItem.cc for Fluxbox Window Manager
2// Copyright (c) 2004 Mathias Gumz
3//
4// Permission is hereby granted, free of charge, to any person obtaining a
5// copy of this software and associated documentation files (the "Software"),
6// to deal in the Software without restriction, including without limitation
7// the rights to use, copy, modify, merge, publish, distribute, sublicense,
8// and/or sell copies of the Software, and to permit persons to whom the
9// Software is furnished to do so, subject to the following conditions:
10//
11// The above copyright notice and this permission notice shall be included in
12// all copies or substantial portions of the Software.
13//
14// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE.
21
22// $Id: RootCmdMenuItem.cc,v 1.1 2004/08/29 21:11:24 akir Exp $
23
24#include "RootCmdMenuItem.hh"
25
26#include "FbCommands.hh"
27#include "fluxbox.hh"
28
29#include "FbTk/StringUtil.hh"
30
31RootCmdMenuItem::RootCmdMenuItem(const std::string &label,
32 const std::string &filename,
33 const std::string &cmd):
34 FbTk::MenuItem(label.c_str()),
35 m_filename(filename) {
36
37 FbTk::RefCount<FbTk::Command>
38 setwp_cmd(new FbCommands::ExecuteCmd(cmd + " \"" + m_filename + "\""));
39 setCommand(setwp_cmd);
40 setToggleItem(true);
41}
42
43
44bool RootCmdMenuItem::isSelected() const {
45 return Fluxbox::instance()->getStyleFilename() == m_filename;
46}
47