aboutsummaryrefslogtreecommitdiff
path: root/src/FbCommands.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbCommands.cc')
-rw-r--r--src/FbCommands.cc18
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>
37using namespace std; 39using namespace std;
38 40
@@ -106,7 +108,6 @@ SetStyleCmd::SetStyleCmd(const std::string &filename):m_filename(filename) {
106} 108}
107 109
108void SetStyleCmd::execute() { 110void 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
240BindKeyCmd::BindKeyCmd(const std::string &keybind):m_keybind(keybind) { }
241
242void 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