########################################################################
#
#  Copyright (C) 2009, CZ.NIC, z.s.p.o.
# 
#  This file is part of dnstester.
#
#  dnstester 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, either version 3 of the License, or
#  (at your option) any later version.
#
#  dnstester 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, see <http://www.gnu.org/licenses/>.
#
########################################################################

from gtk import MessageDialog
import gtk
import lang


class ErrorBox(MessageDialog):
    
    def __init__(self, parent, msg):
        MessageDialog.__init__(self, 
            parent=parent,
            flags=gtk.DIALOG_MODAL,
            type=gtk.MESSAGE_ERROR,
            buttons=gtk.BUTTONS_OK,
            message_format=lang.get_string(msg))

        self.set_position(gtk.WIN_POS_CENTER_ON_PARENT)
        self.show_all()
        self.connect("response", self.cb_response, None)


    def cb_response(self, a, b, c):
        a.destroy()
