From ac2937dc78208e7f3d418e6fa4d098bc1a40f2ea Mon Sep 17 00:00:00 2001 From: Worros Date: Tue, 23 Nov 2010 12:59:23 +0800 Subject: [PATCH] Session Viewer: Add a warning dialog on loading --- pyfpdb/GuiSessionViewer.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/pyfpdb/GuiSessionViewer.py b/pyfpdb/GuiSessionViewer.py index d12f1d10..6f0fd269 100644 --- a/pyfpdb/GuiSessionViewer.py +++ b/pyfpdb/GuiSessionViewer.py @@ -50,11 +50,14 @@ import Database import Filters import Charset +DEBUG = False + class GuiSessionViewer (threading.Thread): def __init__(self, config, querylist, mainwin, debug=True): self.debug = debug self.conf = config self.sql = querylist + self.window = mainwin self.liststore = None @@ -153,6 +156,28 @@ class GuiSessionViewer (threading.Thread): # make sure Hand column is not displayed #[x for x in self.columns if x[0] == 'hand'][0][1] = False + if DEBUG == False: + warning_string = """ +Session Viewer is proof of concept code only, and contains many bugs. + +Feel free to use the viewer, but there is no guarantee that the data is accurate. + +If you are interested in developing the code further please contact us via the usual channels. + +Thankyou +""" + self.warning_box(warning_string) + + def warning_box(self, str, diatitle=_("FPDB WARNING")): + diaWarning = gtk.Dialog(title=diatitle, parent=self.window, flags=gtk.DIALOG_DESTROY_WITH_PARENT, buttons=(gtk.STOCK_OK,gtk.RESPONSE_OK)) + + label = gtk.Label(str) + diaWarning.vbox.add(label) + label.show() + + response = diaWarning.run() + diaWarning.destroy() + return response def get_vbox(self): """returns the vbox of this thread"""