#!/usr/bin/python
# coding=utf-8

##	Virtualbricks - a vde/qemu gui written in python and GTK/Glade.
##	Copyright (C) 2011 Virtualbricks team
##
##	This program is free software; you can redistribute it and/or
##	modify it under the terms of the GNU General Public License
##	as published by the Free Software Foundation; version 2.
##
##	This program is distributed in the hope that it will be useful,
##	but WITHOUT ANY WARRANTY; without even the implied warranty of
##	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
##	GNU General Public License for more details.
##
##	You should have received a copy of the GNU General Public License
##	along with this program; if not, write to the Free Software
##	Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

import sys
import time
from virtualbricks.gui import VBGUI
from virtualbricks.brickfactory import BrickFactory

#Main.

if len(sys.argv) > 1 and sys.argv[1] == '-nogui':
	VB = BrickFactory(nogui=True, server=False)
	VB.start()
	#while True:
	#	time.sleep(100)
elif len(sys.argv) > 1 and sys.argv[1] == '-server':
	VB = BrickFactory(nogui=True, server=True)
	VB.start()
	#while True:
	#	time.sleep(100)
else:
	if len(sys.argv) > 1 and sys.argv[1] == '-noterm':
		VB = VBGUI(True)
	else:
		VB = VBGUI()

