diff --git a/gui/Gui/About.py b/gui/Gui/About.py new file mode 100644 index 0000000..4e750b6 --- /dev/null +++ b/gui/Gui/About.py @@ -0,0 +1,46 @@ +#!/usr/bin/python + +#--------------------------------------------------------------------------- + +""" Import externals """ +import wx +import wx.html + +#--------------------------------------------------------------------------- + +""" Import scyther-gui components """ + +#--------------------------------------------------------------------------- + +class AboutScyther(wx.Dialog): + text = ''' + +
+Scyther |
+
Scyther is cool. + Scyther and Scyther GUI + developed by Cas Cremers 2004-2006 + Credits: Gijs Hollestelle (Python wrapper around Scyther XML) +
+''' + + def __init__(self,parent): + wx.Dialog.__init__(self, parent, -1, 'About Scyther', + size=(440,400)) + html = wx.html.HtmlWindow(self) + html.SetPage(self.text) + button = wx.Button(self, wx.ID_OK, "Okay") + + sizer = wx.BoxSizer(wx.VERTICAL) + sizer.Add(html, 1, wx.EXPAND|wx.ALL,5) + sizer.Add(button,0,wx.ALIGN_CENTER|wx.ALL,5) + + self.SetSizer(sizer) + self.Layout() + diff --git a/gui/Gui/Mainwindow.py b/gui/Gui/Mainwindow.py index 5cc5426..f608979 100644 --- a/gui/Gui/Mainwindow.py +++ b/gui/Gui/Mainwindow.py @@ -12,6 +12,7 @@ import os.path import Settingswindow import Scytherthread import Icon +import About #--------------------------------------------------------------------------- @@ -138,8 +139,9 @@ class MainWindow(wx.Frame): (ID_STATESPACE, 'Generate &statespace\tF2','TODO' , self.OnStatespace) , (None, None, None, None), - (ID_CHECK, '&Check protocol\tF5','TODO', - self.OnCheck) , + ### Disabled for now (given that it is not reliable enough yet) + #(ID_CHECK, '&Check protocol\tF5','TODO', + # self.OnCheck) , (ID_AUTOVERIFY, 'Verify &automatic claims\tF6','TODO', self.OnAutoVerify) ]) @@ -178,15 +180,9 @@ class MainWindow(wx.Frame): # Event handlers: def OnAbout(self, event): - msg = "Scyther" - msg += "\n" - msg += "\nScyther and Scyther GUI" - msg += "\ndeveloped by Cas Cremers 2004-2006" - msg += "\n" - msg += "\nCredits: Gijs Hollestelle (Python wrapper around Scyther XML)" - dialog = wx.MessageDialog(self,msg, 'About scyther-gui', wx.OK) - dialog.ShowModal() - dialog.Destroy() + dlg = About.AboutScyther(self) + dlg.ShowModal() + dlg.Destroy() def OnExit(self, event): self.Close() # Close the main window. diff --git a/gui/Gui/Scytherthread.py b/gui/Gui/Scytherthread.py index 77deb57..6bff3f0 100644 --- a/gui/Gui/Scytherthread.py +++ b/gui/Gui/Scytherthread.py @@ -148,8 +148,9 @@ class AttackThread(threading.Thread): setAttr("fontname=\"Helvetica\"") else: setAttr("fontname=\"Arial\"") - fontsize = self.parent.mainwin.settings.fontsize - setAttr("fontsize=%s" % fontsize) + if self.parent and self.parent.mainwin: + fontsize = self.parent.mainwin.settings.fontsize + setAttr("fontsize=%s" % fontsize) setAttr("height=\"0.01\"",NODE) setAttr("width=\"0.01\"",NODE) setAttr("margin=\"0.08,0.03\"",NODE) diff --git a/gui/scyther-gui.py b/gui/scyther-gui.py index 1dbe6ea..b423630 100755 --- a/gui/scyther-gui.py +++ b/gui/scyther-gui.py @@ -46,8 +46,10 @@ def parseArgs(): #--------------------------------------------------------------------------- class MySplashScreen(wx.SplashScreen): - def __init__(self): - bmp = wx.Image(os.path.join("Images","scyther-splash.png")).ConvertToBitmap() + def __init__(self,basedir): + path = os.path.join(basedir,"Images") + image = os.path.join(path,"scyther-splash.png") + bmp = wx.Image(image).ConvertToBitmap() wx.SplashScreen.__init__(self, bmp, wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT, 5000, None, -1) @@ -90,17 +92,17 @@ class ScytherApp(wx.App): bindir = Preference.get("bindir",Scyther.getBinDir()) Scyther.setBinDir(bindir) - """ - Create and show the splash screen. It will then create and show - the main frame when it is time to do so. - - The splash screen is disabled for automatic commands, and also - by a setting in the preferences file. - """ - if not opts.command: - if opts.splashscreen and not (Preference.get('splashscreen') in ['false','off','disable','0']): - splash = MySplashScreen() - splash.Show() + #""" + #Create and show the splash screen. It will then create and show + #the main frame when it is time to do so. + # + #The splash screen is disabled for automatic commands, and also + #by a setting in the preferences file. + #""" + #if not opts.command: + # if opts.splashscreen and not (Preference.get('splashscreen') in ['false','off','disable','0']): + # splash = MySplashScreen(basedir) + # splash.Show() self.mainWindow = Mainwindow.MainWindow(opts,args) self.SetTopWindow(self.mainWindow)