--- elogviewer.orig 2008-04-24 17:41:01.000000000 -0400 +++ elogviewer 2008-04-24 18:59:09.000000000 -0400 @@ -47,6 +47,10 @@ Christian Faulhammer (V-Li) has written the man page. ''' +_clearwarn = ''' +WARNING: Are you sure you want to clear all entries? This will permanently delete all elog files! +''' + # Redirect messages to stderr import sys @@ -435,6 +439,23 @@ self.destroy() +class ClearPrompt(gtk.MessageDialog): + + def __init__(self): + gtk.MessageDialog.__init__(self, + parent=None, + #flasgs=0, + type=gtk.MESSAGE_WARNING, + buttons=gtk.BUTTONS_YES_NO, + message_format=None) + self.set_markup ( _clearwarn ) + + def do_prompt(self): + response = self.run() + self.destroy() + return response + + class ActionGroup(gtk.ActionGroup): def __init__(self, activate_action): @@ -641,7 +662,10 @@ if action == "Delete": self.delete() if action == "Clear": - self.clear() + cp = ClearPrompt() + confirmation = cp.do_prompt() + if confirmation == gtk.RESPONSE_YES: + self.clear() if action == "Refresh": self.refresh() if action == "Quit":