summaryrefslogtreecommitdiff
path: root/src/FbCommands.cc
diff options
context:
space:
mode:
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