all repos — fluxbox @ 6c647097c218cae3eabf2d380e603177b16ce8fc

custom fork of the fluxbox windowmanager

SetResourceValueCmd and SetResourceValueDialogCmd
fluxgen fluxgen
commit

6c647097c218cae3eabf2d380e603177b16ce8fc

parent

694c4489e8de6179273cd8770004d6fd74a15d1b

2 files changed, 42 insertions(+), 5 deletions(-)

jump to
M src/FbCommands.ccsrc/FbCommands.cc

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// 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!"<<endl; + if (screen == 0) return; - } } if (m_workspace < 0) {

@@ -212,5 +210,30 @@

FbTk::FbWindow *win = new CommandDialog(*screen, "Fluxbox Command"); win->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
M src/FbCommands.hhsrc/FbCommands.hh

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// 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

@@ -113,5 +113,19 @@ void execute();

}; } // 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