aboutsummaryrefslogtreecommitdiff
path: root/src/Workspacemenu.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-01-12 18:19:45 (GMT)
committerfluxgen <fluxgen>2003-01-12 18:19:45 (GMT)
commit55b9d5ffb0c2fd52ff4bf3805840ca3ebf9083fa (patch)
tree22389e0772fd84852ef994bbf5b597a67f3ab44a /src/Workspacemenu.cc
parent6c7f8c4d15333b22f3556447446d55b9325e28e7 (diff)
downloadfluxbox-55b9d5ffb0c2fd52ff4bf3805840ca3ebf9083fa.zip
fluxbox-55b9d5ffb0c2fd52ff4bf3805840ca3ebf9083fa.tar.bz2
replaced by FbTk Menu
Diffstat (limited to 'src/Workspacemenu.cc')
-rw-r--r--src/Workspacemenu.cc79
1 files changed, 0 insertions, 79 deletions
diff --git a/src/Workspacemenu.cc b/src/Workspacemenu.cc
deleted file mode 100644
index c39c435..0000000
--- a/src/Workspacemenu.cc
+++ /dev/null
@@ -1,79 +0,0 @@
1// Workspacemenu.cc for Fluxbox
2// Copyright (c) 2002 Henrik Kinnunen (fluxgen@linuxmail.org)
3// Workspacemenu.cc for Blackbox - an X11 Window manager
4// Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net)
5//
6// Permission is hereby granted, free of charge, to any person obtaining a
7// copy of this software and associated documentation files (the "Software"),
8// to deal in the Software without restriction, including without limitation
9// the rights to use, copy, modify, merge, publish, distribute, sublicense,
10// and/or sell copies of the Software, and to permit persons to whom the
11// Software is furnished to do so, subject to the following conditions:
12//
13// The above copyright notice and this permission notice shall be included in
14// all copies or substantial portions of the Software.
15//
16// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22// DEALINGS IN THE SOFTWARE.
23
24// $Id: Workspacemenu.cc,v 1.11 2002/12/01 13:42:06 rathnor Exp $
25
26#include "Workspacemenu.hh"
27
28#include "i18n.hh"
29#include "Screen.hh"
30#include "Workspace.hh"
31#include "fluxbox.hh"
32
33//use GNU extension
34#ifndef _GNU_SOURCE
35#define _GNU_SOURCE
36#endif // _GNU_SOURCE
37
38#ifdef HAVE_CONFIG_H
39#include "../config.h"
40#endif // HAVE_CONFIG_H
41
42#include <iostream>
43#include <cassert>
44
45Workspacemenu::Workspacemenu(BScreen *scrn) : Basemenu(scrn) {
46
47 setInternalMenu();
48 I18n *i18n = I18n::instance();
49 using namespace FBNLS;
50 setLabel(i18n->getMessage(
51 WorkspacemenuSet, WorkspacemenuWorkspacesTitle,
52 "Workspaces"));
53 insert(i18n->getMessage(
54 WorkspacemenuSet, WorkspacemenuNewWorkspace,
55 "New Workspace"));
56 insert(i18n->getMessage(
57 WorkspacemenuSet, WorkspacemenuRemoveLast,
58 "Remove Last"));
59}
60
61
62void Workspacemenu::itemSelected(int button, unsigned int index) {
63 if (button == 1) {
64 if (index == 0) {
65 screen()->addWorkspace();
66 Fluxbox::instance()->save_rc();
67 } else if (index == 1) {
68 screen()->removeLastWorkspace();
69 Fluxbox::instance()->save_rc();
70 } else if ((screen()->getCurrentWorkspace()->workspaceID() !=
71 (index - 2)) && ((index - 2) < screen()->getCount())) {
72 screen()->changeWorkspaceID(index - 2);
73 }
74
75 if (! (screen()->getWorkspacemenu()->isTorn() || isTorn()))
76 hide();
77 }
78}
79