""" This file is part of the Ventoo program. This 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. It 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 software. If not, see . Copyright 2010 Christopher Harvey """ import sys import os.path as osp import pygtk pygtk.require('2.0') import gtk import augeas_utils class ErrorDialog(gtk.Dialog): def __init__(self, errorDict): gtk.Dialog.__init__(self, "Error dialog", None, gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, (gtk.STOCK_OK, gtk.RESPONSE_ACCEPT)) self.set_default_size(400,300) errorScroll = gtk.ScrolledWindow() errorBox = gtk.TextView() errorBox.set_editable(False) errorScroll.add(errorBox) errorScroll.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) self.vbox.pack_start(errorScroll) errorBuf = errorBox.get_buffer() for k, v in errorDict.iteritems(): errorBuf.insert_at_cursor(k + " -> " + v + "\n")