added SetStyleCmd

This commit is contained in:
fluxgen 2003-02-15 01:58:06 +00:00
parent 96c49e2d0d
commit 2031f46de3
2 changed files with 24 additions and 2 deletions

View file

@ -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.1 2003/01/09 17:46:10 fluxgen Exp $
// $Id: FbCommands.cc,v 1.2 2003/02/15 01:58:06 fluxgen Exp $
#include "FbCommands.hh"
#include "fluxbox.hh"
@ -61,4 +61,18 @@ void ReconfigureFluxboxCmd::execute() {
Fluxbox::instance()->reconfigure();
}
SetStyleCmd::SetStyleCmd(const std::string &filename):m_filename(filename) {
}
void SetStyleCmd::execute() {
#ifdef DEBUG
cerr<<__FILE__<<":Loading style: "<<m_filename<<endl;
#endif // DEBUG
Fluxbox::instance()->saveStyleFilename(m_filename.c_str());
Fluxbox::instance()->save_rc();
FbTk::ThemeManager::instance().load(m_filename.c_str());
}
}; // end namespace FbCommands

View file

@ -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.1 2003/01/09 17:46:10 fluxgen Exp $
// $Id: FbCommands.hh,v 1.2 2003/02/15 01:56:57 fluxgen Exp $
// \file contains basic commands to restart, reconfigure, execute command and exit fluxbox
@ -59,6 +59,14 @@ public:
void execute();
};
class SetStyleCmd: public FbTk::Command {
public:
SetStyleCmd(const std::string &filename);
void execute();
private:
std::string m_filename;
};
}; // end namespace FbCommands
#endif // FBCOMMANDS_HH