From 7238e21fc58e8e8ec27b42a0907f98144ba4413e Mon Sep 17 00:00:00 2001 From: fluxgen Date: Wed, 3 Dec 2003 22:13:21 +0000 Subject: reload style command --- src/FbCommandFactory.cc | 5 ++++- src/FbCommands.cc | 9 ++++++++- src/FbCommands.hh | 7 ++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/FbCommandFactory.cc b/src/FbCommandFactory.cc index b62a9ce..50dda7e 100644 --- a/src/FbCommandFactory.cc +++ b/src/FbCommandFactory.cc @@ -20,7 +20,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbCommandFactory.cc,v 1.20 2003/11/17 00:33:16 fluxgen Exp $ +// $Id: FbCommandFactory.cc,v 1.21 2003/12/03 22:13:21 fluxgen Exp $ #include "FbCommandFactory.hh" @@ -96,6 +96,7 @@ FbCommandFactory::FbCommandFactory() { "quit", "raise", "reconfigure", + "reloadstyle", "resizeto", "resize", "resizehorizontal", @@ -138,6 +139,8 @@ FbTk::Command *FbCommandFactory::stringToCommand(const std::string &command, return new ReconfigureFluxboxCmd(); else if (command == "setstyle") return new SetStyleCmd(arguments); + else if (command == "reloadstyle") + return new ReloadStyleCmd(); else if (command == "saverc") return new SaveResources(); else if (command == "execcommand" || command == "execute" || command == "exec") diff --git a/src/FbCommands.cc b/src/FbCommands.cc index 11d4f78..7372b6a 100644 --- a/src/FbCommands.cc +++ b/src/FbCommands.cc @@ -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.17 2003/09/06 15:02:41 fluxgen Exp $ +// $Id: FbCommands.cc,v 1.18 2003/12/03 22:13:21 fluxgen Exp $ #include "FbCommands.hh" #include "fluxbox.hh" @@ -93,11 +93,18 @@ void ReconfigureFluxboxCmd::execute() { Fluxbox::instance()->reconfigure(); } + +void ReloadStyleCmd::execute() { + SetStyleCmd cmd(Fluxbox::instance()->getStyleFilename()); + cmd.execute(); +} + SetStyleCmd::SetStyleCmd(const std::string &filename):m_filename(filename) { } void SetStyleCmd::execute() { + cerr<<"SetStyle: "<saveStyleFilename(m_filename.c_str()); Fluxbox::instance()->save_rc(); FbTk::ThemeManager::instance().load(m_filename); diff --git a/src/FbCommands.hh b/src/FbCommands.hh index 749d689..d77bbf7 100644 --- a/src/FbCommands.hh +++ b/src/FbCommands.hh @@ -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.12 2003/09/06 15:02:41 fluxgen Exp $ +// $Id: FbCommands.hh,v 1.13 2003/12/03 22:13:21 fluxgen Exp $ // \file contains basic commands to restart, reconfigure, execute command and exit fluxbox @@ -70,6 +70,11 @@ public: void execute(); }; +class ReloadStyleCmd: public FbTk::Command { +public: + void execute(); +}; + class SetStyleCmd: public FbTk::Command { public: explicit SetStyleCmd(const std::string &filename); -- cgit v0.11.2