########################################################################
#
#  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/>.
#
########################################################################

import gtk

import lang
import images

class Page:

    widget = None
    title = None
    type = gtk.ASSISTANT_PAGE_CONTENT
    focus_label = 'gtk-go-forward'
    

    def __init__(self, parent):
        self.parent = parent


    def update_parent(self):
        p = self.parent
        p.set_page_type(self.widget, self.type)
        p.set_page_title(self.widget, lang.get_string(self.title))

        img = gtk.Image()
        img.set_from_file(images.fullname('icon_big.png'))
        p.set_page_header_image(self.widget, img.get_pixbuf())


    def on_before_show(self):
        self.set_page_complete(True)


    def on_terminate(self):
        pass


    def get_widget(self):
        return self.widget
        

    def set_page_complete(self, complete):
        self.parent.set_page_complete(self.widget, complete)
