From 93b2f8921c70e2cf5f2f2c3cf79943de54b6709b Mon Sep 17 00:00:00 2001 From: rathnor Date: Sun, 8 Jun 2003 13:47:30 +0000 Subject: fix restart in menu to accept and use an argument --- ChangeLog | 2 ++ src/FbCommands.cc | 11 +++++++++-- src/FbCommands.hh | 6 +++++- src/Screen.cc | 6 +++--- 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index f6c51a8..fa38223 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ (Format: Year/Month/Day) Changes for 0.9.3: *03/06/08: + * Fix restart command to accept and use an argument again (Simon) + Screen.cc FbCommands.hh/cc * Fix bug that sometimes left window frames after window closed (Simon) fluxbox.cc *03/06/06: diff --git a/src/FbCommands.cc b/src/FbCommands.cc index 5ce933a..a118fb3 100644 --- a/src/FbCommands.cc +++ b/src/FbCommands.cc @@ -19,7 +19,7 @@ // 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() { diff --git a/src/FbCommands.hh b/src/FbCommands.hh index 1056b6f..4f87bf1 100644 --- a/src/FbCommands.hh +++ b/src/FbCommands.hh @@ -19,7 +19,7 @@ // 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 @@ public: /// 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 diff --git a/src/Screen.cc b/src/Screen.cc index 1182dba..3ecb077 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -22,7 +22,7 @@ // 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 @@ void BScreen::initMenu() { } if (defaultMenu) { - FbTk::RefCount restart_fb(new FbCommands::RestartFluxboxCmd()); + FbTk::RefCount restart_fb(new FbCommands::RestartFluxboxCmd("")); FbTk::RefCount exit_fb(new FbCommands::ExitFluxboxCmd()); FbTk::RefCount execute_xterm(new FbCommands::ExecuteCmd("xterm", screenNumber())); m_rootmenu->setInternalMenu(); @@ -2098,7 +2098,7 @@ bool BScreen::parseMenuFile(ifstream &file, FbTk::Menu &menu, int &row) { "no menu label defined\n")); cerr<<"Row: "< restart_fb(new FbCommands::RestartFluxboxCmd()); + FbTk::RefCount restart_fb(new FbCommands::RestartFluxboxCmd(str_cmd)); menu.insert(str_label.c_str(), restart_fb); } } // end of restart -- cgit v0.11.2