fix restart in menu to accept and use an argument
This commit is contained in:
parent
efe8bf4acd
commit
93b2f8921c
4 changed files with 19 additions and 6 deletions
|
@ -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:
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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<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 @@ bool BScreen::parseMenuFile(ifstream &file, FbTk::Menu &menu, int &row) {
|
|||
"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
|
||||
|
|
Loading…
Reference in a new issue