From 6c647097c218cae3eabf2d380e603177b16ce8fc Mon Sep 17 00:00:00 2001 From: fluxgen Date: Fri, 19 Dec 2003 17:22:04 +0000 Subject: SetResourceValueCmd and SetResourceValueDialogCmd --- src/FbCommands.cc | 31 +++++++++++++++++++++++++++---- src/FbCommands.hh | 16 +++++++++++++++- 2 files changed, 42 insertions(+), 5 deletions(-) diff --git a/src/FbCommands.cc b/src/FbCommands.cc index 1a1c74d..91ec11c 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.20 2003/12/19 03:56:51 fluxgen Exp $ +// $Id: FbCommands.cc,v 1.21 2003/12/19 17:22:04 fluxgen Exp $ #include "FbCommands.hh" #include "fluxbox.hh" @@ -174,10 +174,8 @@ void SetWorkspaceNameCmd::execute() { BScreen *screen = Fluxbox::instance()->mouseScreen(); if (screen == 0) { screen = Fluxbox::instance()->keyScreen(); - if (screen == 0) { - cerr<<"Screen == 0!"<show(); } + +SetResourceValueCmd::SetResourceValueCmd(const std::string &resname, + const std::string &value): + m_resname(resname), + m_value(value) { + +} + +void SetResourceValueCmd::execute() { + BScreen *screen = Fluxbox::instance()->mouseScreen(); + if (screen == 0) + return; + screen->resourceManager().setResourceValue(m_resname, m_value); + Fluxbox::instance()->save_rc(); +} + +void SetResourceValueDialogCmd::execute() { + BScreen *screen = Fluxbox::instance()->mouseScreen(); + if (screen == 0) + return; + + FbTk::FbWindow *win = new CommandDialog(*screen, "Type resource name and the value", "SetResourceValue "); + win->show(); +}; + }; // end namespace FbCommands diff --git a/src/FbCommands.hh b/src/FbCommands.hh index 9c61259..0355e7e 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.15 2003/12/19 03:56:51 fluxgen Exp $ +// $Id: FbCommands.hh,v 1.16 2003/12/19 17:19:56 fluxgen Exp $ // \file contains basic commands to restart, reconfigure, execute command and exit fluxbox @@ -114,4 +114,18 @@ public: } // end namespace FbCommands +class SetResourceValueCmd: public FbTk::Command { +public: + SetResourceValueCmd(const std::string &resourcename, const std::string &value); + void execute(); +private: + const std::string m_resname; + const std::string m_value; +}; + +class SetResourceValueDialogCmd: public FbTk::Command { +public: + void execute(); +}; + #endif // FBCOMMANDS_HH -- cgit v0.11.2