#!/usr/bin/python
# -*- coding: ISO-8859-15 -*-
#
# Fichero:	msg.py
# Copyright:	Junta de Andaluca <devmaster@guadalinex.org>
# Autor:	Maria Dolores Perez Gutierrez y Nestor Chacon Manzano
# Fecha:	lun mar 27 17:01:32 CET 2006
# Licencia:	GPL v.2
#
# Mensaje mostrado a usuario intenta lanzar aplicacion sin permisos

import os
import utmp
from sys import argv, exit
from time import sleep
from UTMPCONST import USER_PROCESS

mensaje = "No tiene permisos para administrar ACEPT" 
    
	    
# Establece las variables de entorno.
# En caso de no encontrar el archivo Xauthority del usuario, 
# finaliza el subproceso

import wx
class Alerta(wx.Frame):
    def __init__(self, *args, **kwds):
	kwds["style"] = wx.DEFAULT_FRAME_STYLE
	wx.Frame.__init__(self, *args, **kwds)
	self.label_1 = wx.StaticText(self, -1, mensaje)
	self.button_1 = wx.Button(self, -1, "Aceptar")
        self.__set_properties()
	self.__do_layout()

	wx.EVT_BUTTON(self,self.button_1.GetId(),self.cierra)

    def __set_properties(self):
        self.SetTitle("Alarma ACEPT")
	self.label_1.SetFont(wx.Font(18, wx.DEFAULT, wx.BOLD, wx.NORMAL, False,""))
	_icon = wx.EmptyIcon()
	_icon.CopyFromBitmap(wx.Bitmap("/usr/share/acept/pixmaps/fondo_junta.gif", wx.BITMAP_TYPE_ANY))
	self.SetIcon(_icon)

    def __do_layout(self):
        sizer_1 = wx.BoxSizer(wx.VERTICAL)
        sizer_2 = wx.BoxSizer(wx.HORIZONTAL)
        sizer_4 = wx.BoxSizer(wx.VERTICAL)
        sizer_2.Add((20, 20), 0, 0, 0)
        sizer_4.Add((20, 20), 1, 0, 0)
        sizer_4.Add(self.label_1, 1, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 0)
        sizer_4.Add((20, 20), 1, 0, 0)
        sizer_4.Add(self.button_1, 0, wx.EXPAND, 0)
        sizer_4.Add((20, 20), 0, 0, 0)
        sizer_2.Add(sizer_4, 1, wx.EXPAND, 0)
        sizer_2.Add((20, 20), 0, 0, 0)
        sizer_1.Add(sizer_2, 1, wx.EXPAND, 0)
        self.SetAutoLayout(True)
        self.SetSizer(sizer_1)
        sizer_1.Fit(self)
        sizer_1.SetSizeHints(self)
        self.Layout()
	
    def cierra (self, event) :
        self.Close()
    
class Inicio_App(wx.App):
    def OnInit(self):
        wx.InitAllImageHandlers()
        self.alerta=Alerta(None,-1,"")
        self.alerta.Show()
        return True
		
inicio=Inicio_App()
inicio.MainLoop()
	    
exit()
	

