aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-12-19 17:22:04 (GMT)
committerfluxgen <fluxgen>2003-12-19 17:22:04 (GMT)
commit6c647097c218cae3eabf2d380e603177b16ce8fc (patch)
tree921e931831cf65d5223ef6e40f0ca7fa9266bf84
parent694c4489e8de6179273cd8770004d6fd74a15d1b (diff)
downloadfluxbox_pavel-6c647097c218cae3eabf2d380e603177b16ce8fc.zip
fluxbox_pavel-6c647097c218cae3eabf2d380e603177b16ce8fc.tar.bz2
SetResourceValueCmd and SetResourceValueDialogCmd
-rw-r--r--src/FbCommands.cc31
-rw-r--r--src/FbCommands.hh16
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 @@
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.20 2003/12/19 03:56:51 fluxgen Exp $ 22// $Id: FbCommands.cc,v 1.21 2003/12/19 17:22:04 fluxgen Exp $
23 23
24#include "FbCommands.hh" 24#include "FbCommands.hh"
25#include "fluxbox.hh" 25#include "fluxbox.hh"
@@ -174,10 +174,8 @@ void SetWorkspaceNameCmd::execute() {
174 BScreen *screen = Fluxbox::instance()->mouseScreen(); 174 BScreen *screen = Fluxbox::instance()->mouseScreen();
175 if (screen == 0) { 175 if (screen == 0) {
176 screen = Fluxbox::instance()->keyScreen(); 176 screen = Fluxbox::instance()->keyScreen();
177 if (screen == 0) { 177 if (screen == 0)
178 cerr<<"Screen == 0!"<<endl;
179 return; 178 return;
180 }
181 } 179 }
182 180
183 if (m_workspace < 0) { 181 if (m_workspace < 0) {
@@ -213,4 +211,29 @@ void CommandDialogCmd::execute() {
213 win->show(); 211 win->show();
214} 212}
215 213
214
215SetResourceValueCmd::SetResourceValueCmd(const std::string &resname,
216 const std::string &value):
217 m_resname(resname),
218 m_value(value) {
219
220}
221
222void SetResourceValueCmd::execute() {
223 BScreen *screen = Fluxbox::instance()->mouseScreen();
224 if (screen == 0)
225 return;
226 screen->resourceManager().setResourceValue(m_resname, m_value);
227 Fluxbox::instance()->save_rc();
228}
229
230void SetResourceValueDialogCmd::execute() {
231 BScreen *screen = Fluxbox::instance()->mouseScreen();
232 if (screen == 0)
233 return;
234
235 FbTk::FbWindow *win = new CommandDialog(*screen, "Type resource name and the value", "SetResourceValue ");
236 win->show();
237};
238
216}; // end namespace FbCommands 239}; // 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 @@
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.hh,v 1.15 2003/12/19 03:56:51 fluxgen Exp $ 22// $Id: FbCommands.hh,v 1.16 2003/12/19 17:19:56 fluxgen Exp $
23 23
24// \file contains basic commands to restart, reconfigure, execute command and exit fluxbox 24// \file contains basic commands to restart, reconfigure, execute command and exit fluxbox
25 25
@@ -114,4 +114,18 @@ public:
114 114
115} // end namespace FbCommands 115} // end namespace FbCommands
116 116
117class SetResourceValueCmd: public FbTk::Command {
118public:
119 SetResourceValueCmd(const std::string &resourcename, const std::string &value);
120 void execute();
121private:
122 const std::string m_resname;
123 const std::string m_value;
124};
125
126class SetResourceValueDialogCmd: public FbTk::Command {
127public:
128 void execute();
129};
130
117#endif // FBCOMMANDS_HH 131#endif // FBCOMMANDS_HH