aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrathnor <rathnor>2003-06-08 13:47:30 (GMT)
committerrathnor <rathnor>2003-06-08 13:47:30 (GMT)
commit93b2f8921c70e2cf5f2f2c3cf79943de54b6709b (patch)
tree9291b92cf9feb4f7647cdc8a88fd9af44c050450 /src
parentefe8bf4acd913a48ba08c4fa390297da27d17590 (diff)
downloadfluxbox_paul-93b2f8921c70e2cf5f2f2c3cf79943de54b6709b.zip
fluxbox_paul-93b2f8921c70e2cf5f2f2c3cf79943de54b6709b.tar.bz2
fix restart in menu to accept and use an argument
Diffstat (limited to 'src')
-rw-r--r--src/FbCommands.cc11
-rw-r--r--src/FbCommands.hh6
-rw-r--r--src/Screen.cc6
3 files changed, 17 insertions, 6 deletions
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 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: FbCommands.cc,v 1.5 2003/04/28 01:17:39 fluxgen Exp $ 22// $Id: FbCommands.cc,v 1.6 2003/06/08 13:47:30 rathnor Exp $
23 23
24#include "FbCommands.hh" 24#include "FbCommands.hh"
25#include "fluxbox.hh" 25#include "fluxbox.hh"
@@ -62,8 +62,15 @@ void ExitFluxboxCmd::execute() {
62 Fluxbox::instance()->shutdown(); 62 Fluxbox::instance()->shutdown();
63} 63}
64 64
65RestartFluxboxCmd::RestartFluxboxCmd(const std::string &cmd):m_cmd(cmd){
66}
67
65void RestartFluxboxCmd::execute() { 68void RestartFluxboxCmd::execute() {
66 Fluxbox::instance()->restart(); 69 if (m_cmd.size() == 0) {
70 Fluxbox::instance()->restart();
71 } else {
72 Fluxbox::instance()->restart(m_cmd.c_str());
73 }
67} 74}
68 75
69void ReconfigureFluxboxCmd::execute() { 76void 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 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: FbCommands.hh,v 1.4 2003/04/28 00:34:06 fluxgen Exp $ 22// $Id: FbCommands.hh,v 1.5 2003/06/08 13:47:30 rathnor Exp $
23 23
24// \file contains basic commands to restart, reconfigure, execute command and exit fluxbox 24// \file contains basic commands to restart, reconfigure, execute command and exit fluxbox
25 25
@@ -51,7 +51,11 @@ public:
51/// restarts fluxbox 51/// restarts fluxbox
52class RestartFluxboxCmd: public FbTk::Command { 52class RestartFluxboxCmd: public FbTk::Command {
53public: 53public:
54 RestartFluxboxCmd(const std::string &cmd);
54 void execute(); 55 void execute();
56private:
57 std::string m_cmd;
58 const int m_screen_num;
55}; 59};
56 60
57/// reconfigures fluxbox 61/// 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 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Screen.cc,v 1.178 2003/05/24 13:13:22 rathnor Exp $ 25// $Id: Screen.cc,v 1.179 2003/06/08 13:47:30 rathnor Exp $
26 26
27 27
28#include "Screen.hh" 28#include "Screen.hh"
@@ -1891,7 +1891,7 @@ void BScreen::initMenu() {
1891 } 1891 }
1892 1892
1893 if (defaultMenu) { 1893 if (defaultMenu) {
1894 FbTk::RefCount<FbTk::Command> restart_fb(new FbCommands::RestartFluxboxCmd()); 1894 FbTk::RefCount<FbTk::Command> restart_fb(new FbCommands::RestartFluxboxCmd(""));
1895 FbTk::RefCount<FbTk::Command> exit_fb(new FbCommands::ExitFluxboxCmd()); 1895 FbTk::RefCount<FbTk::Command> exit_fb(new FbCommands::ExitFluxboxCmd());
1896 FbTk::RefCount<FbTk::Command> execute_xterm(new FbCommands::ExecuteCmd("xterm", screenNumber())); 1896 FbTk::RefCount<FbTk::Command> execute_xterm(new FbCommands::ExecuteCmd("xterm", screenNumber()));
1897 m_rootmenu->setInternalMenu(); 1897 m_rootmenu->setInternalMenu();
@@ -2098,7 +2098,7 @@ bool BScreen::parseMenuFile(ifstream &file, FbTk::Menu &menu, int &row) {
2098 "no menu label defined\n")); 2098 "no menu label defined\n"));
2099 cerr<<"Row: "<<row<<endl; 2099 cerr<<"Row: "<<row<<endl;
2100 } else { 2100 } else {
2101 FbTk::RefCount<FbTk::Command> restart_fb(new FbCommands::RestartFluxboxCmd()); 2101 FbTk::RefCount<FbTk::Command> restart_fb(new FbCommands::RestartFluxboxCmd(str_cmd));
2102 menu.insert(str_label.c_str(), restart_fb); 2102 menu.insert(str_label.c_str(), restart_fb);
2103 } 2103 }
2104 } // end of restart 2104 } // end of restart