aboutsummaryrefslogtreecommitdiff
path: root/src/FbCommands.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-12-19 03:56:51 (GMT)
committerfluxgen <fluxgen>2003-12-19 03:56:51 (GMT)
commit63a5065d5e58e18e8f20fd53a6438413f1a5d42d (patch)
treec9309eedc2627fcdf2f9a31d09181bc908c5a3ee /src/FbCommands.cc
parentfbceff651a4e93638e7d44ab6a35ee3622793ff4 (diff)
downloadfluxbox_pavel-63a5065d5e58e18e8f20fd53a6438413f1a5d42d.zip
fluxbox_pavel-63a5065d5e58e18e8f20fd53a6438413f1a5d42d.tar.bz2
WorkspaceNameDialogCmd, CommandDialogCmd and changes in SetWorkspaceNameCmd
Diffstat (limited to 'src/FbCommands.cc')
-rw-r--r--src/FbCommands.cc50
1 files changed, 45 insertions, 5 deletions
diff --git a/src/FbCommands.cc b/src/FbCommands.cc
index 1bec59a..1a1c74d 100644
--- a/src/FbCommands.cc
+++ b/src/FbCommands.cc
@@ -19,14 +19,16 @@
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.19 2003/12/19 00:47:30 fluxgen Exp $ 22// $Id: FbCommands.cc,v 1.20 2003/12/19 03:56:51 fluxgen Exp $
23 23
24#include "FbCommands.hh" 24#include "FbCommands.hh"
25#include "fluxbox.hh" 25#include "fluxbox.hh"
26#include "FbTk/Theme.hh"
27#include "Screen.hh" 26#include "Screen.hh"
28#include "Menu.hh" 27#include "CommandDialog.hh"
29#include "SetWorkspaceName.hh" 28#include "Workspace.hh"
29
30#include "FbTk/Theme.hh"
31#include "FbTk/Menu.hh"
30 32
31#include <sys/types.h> 33#include <sys/types.h>
32#include <unistd.h> 34#include <unistd.h>
@@ -163,13 +165,51 @@ void ShowWorkspaceMenuCmd::execute() {
163 165
164} 166}
165 167
168
169
170SetWorkspaceNameCmd::SetWorkspaceNameCmd(const std::string &name, int spaceid):
171 m_name(name), m_workspace(spaceid) { }
172
166void SetWorkspaceNameCmd::execute() { 173void SetWorkspaceNameCmd::execute() {
174 BScreen *screen = Fluxbox::instance()->mouseScreen();
175 if (screen == 0) {
176 screen = Fluxbox::instance()->keyScreen();
177 if (screen == 0) {
178 cerr<<"Screen == 0!"<<endl;
179 return;
180 }
181 }
182
183 if (m_workspace < 0) {
184 screen->currentWorkspace()->setName(m_name);
185 } else {
186 Workspace *space = screen->getWorkspace(m_workspace);
187 if (space == 0)
188 return;
189 space->setName(m_name);
190 }
191
192 screen->updateWorkspaceNamesAtom();
193 Fluxbox::instance()->save_rc();
194}
195
196void WorkspaceNameDialogCmd::execute() {
197
198 BScreen *screen = Fluxbox::instance()->mouseScreen();
199 if (screen == 0)
200 return;
201
202 CommandDialog *win = new CommandDialog(*screen, "Set Workspace Name:", "SetWorkspaceName ");
203 win->setText(screen->currentWorkspace()->name());
204 win->show();
205}
167 206
207void CommandDialogCmd::execute() {
168 BScreen *screen = Fluxbox::instance()->mouseScreen(); 208 BScreen *screen = Fluxbox::instance()->mouseScreen();
169 if (screen == 0) 209 if (screen == 0)
170 return; 210 return;
171 211
172 SetWorkspaceName *win = new SetWorkspaceName(*screen); 212 FbTk::FbWindow *win = new CommandDialog(*screen, "Fluxbox Command");
173 win->show(); 213 win->show();
174} 214}
175 215