Source

vpackager / dialogs.py

Full commit
#!/usr/bin/env python

#    This file is part of vpackager.
#
#    vpackager is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License v2 as published by
#    the Free Software Foundation.
#
#    vpackager 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 vpackager.  If not, see <http://www.gnu.org/licenses/>.

import gtk

class question(gtk.MessageDialog):
    def __init__(self, question, parent):
        gtk.MessageDialog.__init__(self,
            type = gtk.MESSAGE_QUESTION,
            parent = parent)
        self.set_markup(question)
        self.add_buttons(gtk.STOCK_YES, gtk.RESPONSE_ACCEPT,
            gtk.STOCK_NO, gtk.RESPONSE_CANCEL)
        self.set_title('Question')

class info(gtk.MessageDialog):
    def __init__(self, message, parent):
        gtk.MessageDialog.__init__(self,
            type = gtk.MESSAGE_INFO,
            parent = parent)
        self.set_markup(message)
        self.add_buttons(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT)
        self.set_title('Info')
        
class error(gtk.MessageDialog):
    def __init__(self, message, parent):
        gtk.MessageDialog.__init__(self,
            type = gtk.MESSAGE_ERROR,
            parent = parent)
        self.set_markup(message)
        self.add_buttons(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT)
        self.set_position(gtk.WIN_POS_CENTER)
        self.set_title('Error')