fix restart in menu to accept and use an argument
rathnor rathnor
4 files changed,
19 insertions(+),
6 deletions(-)
M
src/FbCommands.cc
→
src/FbCommands.cc
@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbCommands.cc,v 1.5 2003/04/28 01:17:39 fluxgen Exp $ +// $Id: FbCommands.cc,v 1.6 2003/06/08 13:47:30 rathnor Exp $ #include "FbCommands.hh" #include "fluxbox.hh"@@ -62,8 +62,15 @@ void ExitFluxboxCmd::execute() {
Fluxbox::instance()->shutdown(); } +RestartFluxboxCmd::RestartFluxboxCmd(const std::string &cmd):m_cmd(cmd){ +} + void RestartFluxboxCmd::execute() { - Fluxbox::instance()->restart(); + if (m_cmd.size() == 0) { + Fluxbox::instance()->restart(); + } else { + Fluxbox::instance()->restart(m_cmd.c_str()); + } } void ReconfigureFluxboxCmd::execute() {
M
src/FbCommands.hh
→
src/FbCommands.hh
@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbCommands.hh,v 1.4 2003/04/28 00:34:06 fluxgen Exp $ +// $Id: FbCommands.hh,v 1.5 2003/06/08 13:47:30 rathnor Exp $ // \file contains basic commands to restart, reconfigure, execute command and exit fluxbox@@ -51,7 +51,11 @@
/// restarts fluxbox class RestartFluxboxCmd: public FbTk::Command { public: + RestartFluxboxCmd(const std::string &cmd); void execute(); +private: + std::string m_cmd; + const int m_screen_num; }; /// reconfigures fluxbox
M
src/Screen.cc
→
src/Screen.cc
@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Screen.cc,v 1.178 2003/05/24 13:13:22 rathnor Exp $ +// $Id: Screen.cc,v 1.179 2003/06/08 13:47:30 rathnor Exp $ #include "Screen.hh"@@ -1891,7 +1891,7 @@ perror(fb->getMenuFilename());
} if (defaultMenu) { - FbTk::RefCount<FbTk::Command> restart_fb(new FbCommands::RestartFluxboxCmd()); + FbTk::RefCount<FbTk::Command> restart_fb(new FbCommands::RestartFluxboxCmd("")); FbTk::RefCount<FbTk::Command> exit_fb(new FbCommands::ExitFluxboxCmd()); FbTk::RefCount<FbTk::Command> execute_xterm(new FbCommands::ExecuteCmd("xterm", screenNumber())); m_rootmenu->setInternalMenu();@@ -2098,7 +2098,7 @@ "BScreen::parseMenuFile: [restart] error, "
"no menu label defined\n")); cerr<<"Row: "<<row<<endl; } else { - FbTk::RefCount<FbTk::Command> restart_fb(new FbCommands::RestartFluxboxCmd()); + FbTk::RefCount<FbTk::Command> restart_fb(new FbCommands::RestartFluxboxCmd(str_cmd)); menu.insert(str_label.c_str(), restart_fb); } } // end of restart