diff options
author | fluxgen <fluxgen> | 2003-12-20 17:42:04 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2003-12-20 17:42:04 (GMT) |
commit | 5a91d8747e4ab0bb25b85c82e49f6f74d8e14e05 (patch) | |
tree | 1f03ec76a386ccced9fab202c5eab0f738c98303 /src/FbCommands.cc | |
parent | d86f0e36bb6c09e2b3e097f26a6f2ddf0e751e55 (diff) | |
download | fluxbox_pavel-5a91d8747e4ab0bb25b85c82e49f6f74d8e14e05.zip fluxbox_pavel-5a91d8747e4ab0bb25b85c82e49f6f74d8e14e05.tar.bz2 |
bindkey command
Diffstat (limited to 'src/FbCommands.cc')
-rw-r--r-- | src/FbCommands.cc | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/FbCommands.cc b/src/FbCommands.cc index 91ec11c..d4ad87e 100644 --- a/src/FbCommands.cc +++ b/src/FbCommands.cc | |||
@@ -19,13 +19,14 @@ | |||
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.21 2003/12/19 17:22:04 fluxgen Exp $ | 22 | // $Id: FbCommands.cc,v 1.22 2003/12/20 17:41:32 fluxgen Exp $ |
23 | 23 | ||
24 | #include "FbCommands.hh" | 24 | #include "FbCommands.hh" |
25 | #include "fluxbox.hh" | 25 | #include "fluxbox.hh" |
26 | #include "Screen.hh" | 26 | #include "Screen.hh" |
27 | #include "CommandDialog.hh" | 27 | #include "CommandDialog.hh" |
28 | #include "Workspace.hh" | 28 | #include "Workspace.hh" |
29 | #include "Keys.hh" | ||
29 | 30 | ||
30 | #include "FbTk/Theme.hh" | 31 | #include "FbTk/Theme.hh" |
31 | #include "FbTk/Menu.hh" | 32 | #include "FbTk/Menu.hh" |
@@ -33,6 +34,7 @@ | |||
33 | #include <sys/types.h> | 34 | #include <sys/types.h> |
34 | #include <unistd.h> | 35 | #include <unistd.h> |
35 | 36 | ||
37 | #include <fstream> | ||
36 | #include <iostream> | 38 | #include <iostream> |
37 | using namespace std; | 39 | using namespace std; |
38 | 40 | ||
@@ -106,7 +108,6 @@ SetStyleCmd::SetStyleCmd(const std::string &filename):m_filename(filename) { | |||
106 | } | 108 | } |
107 | 109 | ||
108 | void SetStyleCmd::execute() { | 110 | void SetStyleCmd::execute() { |
109 | cerr<<"SetStyle: "<<m_filename<<endl; | ||
110 | Fluxbox::instance()->saveStyleFilename(m_filename.c_str()); | 111 | Fluxbox::instance()->saveStyleFilename(m_filename.c_str()); |
111 | Fluxbox::instance()->save_rc(); | 112 | Fluxbox::instance()->save_rc(); |
112 | FbTk::ThemeManager::instance().load(m_filename); | 113 | FbTk::ThemeManager::instance().load(m_filename); |
@@ -236,4 +237,17 @@ void SetResourceValueDialogCmd::execute() { | |||
236 | win->show(); | 237 | win->show(); |
237 | }; | 238 | }; |
238 | 239 | ||
240 | BindKeyCmd::BindKeyCmd(const std::string &keybind):m_keybind(keybind) { } | ||
241 | |||
242 | void BindKeyCmd::execute() { | ||
243 | if (Fluxbox::instance()->keys() != 0) { | ||
244 | if (Fluxbox::instance()->keys()->addBinding(m_keybind)) { | ||
245 | ofstream ofile(Fluxbox::instance()->keys()->filename().c_str(), ios::app); | ||
246 | if (!ofile) | ||
247 | return; | ||
248 | ofile<<m_keybind<<endl; | ||
249 | } | ||
250 | } | ||
251 | } | ||
252 | |||
239 | }; // end namespace FbCommands | 253 | }; // end namespace FbCommands |