1
# mainmenu.py - Copyright (C) 2009 Red Hat, Inc.
2
# Written by Darryl L. Pierce <dpierce@redhat.com>
4
# This program is free software; you can redistribute it and/or modify
5
# it under the terms of the GNU General Public License as published by
6
# the Free Software Foundation; version 2 of the License.
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
# GNU General Public License for more details.
13
# You should have received a copy of the GNU General Public License
14
# along with this program; if not, write to the Free Software
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
16
# MA 02110-1301, USA. A copy of the GNU General Public License is
17
# also available at http://www.gnu.org/copyleft/gpl.html.
22
from menuscreen import MenuScreen
23
from definenet import DefineNetwork
24
from createnetwork import CreateNetwork
25
from destroynetwork import DestroyNetwork
26
from undefinenetwork import UndefineNetwork
27
from listnetworks import ListNetworks
38
class NetworkMenuScreen(MenuScreen):
40
MenuScreen.__init__(self, "Network Administration")
42
def get_menu_items(self):
43
return (("Define A Network", DEFINE_NETWORK),
44
("Create A Network", CREATE_NETWORK),
45
("Destroy A Network", DESTROY_NETWORK),
46
("Undefine A Network", UNDEFINE_NETWORK),
47
("List Networks", LIST_NETWORKS))
49
def handle_selection(self, item):
50
if item is DEFINE_NETWORK: DefineNetwork()
51
elif item is CREATE_NETWORK: CreateNetwork()
52
elif item is DESTROY_NETWORK: DestroyNetwork()
53
elif item is UNDEFINE_NETWORK: UndefineNetwork()
54
elif item is LIST_NETWORKS: ListNetworks()
57
screen = NetworkMenuScreen()