all repos — fluxbox @ 93b2f8921c70e2cf5f2f2c3cf79943de54b6709b

custom fork of the fluxbox windowmanager

fix restart in menu to accept and use an argument
rathnor rathnor
commit

93b2f8921c70e2cf5f2f2c3cf79943de54b6709b

parent

efe8bf4acd913a48ba08c4fa390297da27d17590

4 files changed, 19 insertions(+), 6 deletions(-)

jump to
M ChangeLogChangeLog

@@ -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:
M src/FbCommands.ccsrc/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.hhsrc/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.ccsrc/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