From 63a5065d5e58e18e8f20fd53a6438413f1a5d42d Mon Sep 17 00:00:00 2001 From: fluxgen Date: Fri, 19 Dec 2003 03:56:51 +0000 Subject: WorkspaceNameDialogCmd, CommandDialogCmd and changes in SetWorkspaceNameCmd --- src/FbCommands.cc | 50 +++++++++++++++++++++++++++++++++++++++++++++----- src/FbCommands.hh | 16 +++++++++++++++- 2 files changed, 60 insertions(+), 6 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 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbCommands.cc,v 1.19 2003/12/19 00:47:30 fluxgen Exp $ +// $Id: FbCommands.cc,v 1.20 2003/12/19 03:56:51 fluxgen Exp $ #include "FbCommands.hh" #include "fluxbox.hh" -#include "FbTk/Theme.hh" #include "Screen.hh" -#include "Menu.hh" -#include "SetWorkspaceName.hh" +#include "CommandDialog.hh" +#include "Workspace.hh" + +#include "FbTk/Theme.hh" +#include "FbTk/Menu.hh" #include #include @@ -163,13 +165,51 @@ void ShowWorkspaceMenuCmd::execute() { } + + +SetWorkspaceNameCmd::SetWorkspaceNameCmd(const std::string &name, int spaceid): + m_name(name), m_workspace(spaceid) { } + void SetWorkspaceNameCmd::execute() { + BScreen *screen = Fluxbox::instance()->mouseScreen(); + if (screen == 0) { + screen = Fluxbox::instance()->keyScreen(); + if (screen == 0) { + cerr<<"Screen == 0!"<currentWorkspace()->setName(m_name); + } else { + Workspace *space = screen->getWorkspace(m_workspace); + if (space == 0) + return; + space->setName(m_name); + } + + screen->updateWorkspaceNamesAtom(); + Fluxbox::instance()->save_rc(); +} + +void WorkspaceNameDialogCmd::execute() { + + BScreen *screen = Fluxbox::instance()->mouseScreen(); + if (screen == 0) + return; + + CommandDialog *win = new CommandDialog(*screen, "Set Workspace Name:", "SetWorkspaceName "); + win->setText(screen->currentWorkspace()->name()); + win->show(); +} +void CommandDialogCmd::execute() { BScreen *screen = Fluxbox::instance()->mouseScreen(); if (screen == 0) return; - SetWorkspaceName *win = new SetWorkspaceName(*screen); + FbTk::FbWindow *win = new CommandDialog(*screen, "Fluxbox Command"); win->show(); } diff --git a/src/FbCommands.hh b/src/FbCommands.hh index fc97791..9c61259 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.14 2003/12/16 23:35:00 fluxgen Exp $ +// $Id: FbCommands.hh,v 1.15 2003/12/19 03:56:51 fluxgen Exp $ // \file contains basic commands to restart, reconfigure, execute command and exit fluxbox @@ -95,6 +95,20 @@ public: class SetWorkspaceNameCmd: public FbTk::Command { public: + SetWorkspaceNameCmd(const std::string &name, int spaceid = -1); + void execute(); +private: + std::string m_name; + int m_workspace; +}; + +class WorkspaceNameDialogCmd: public FbTk::Command { +public: + void execute(); +}; + +class CommandDialogCmd: public FbTk::Command { +public: void execute(); }; -- cgit v0.11.2