- Many fixes.
This commit is contained in:
parent
683cae8d90
commit
c3ce3c37d4
@ -16,24 +16,32 @@ class AboutScyther(wx.Dialog):
|
||||
text = '''
|
||||
<html>
|
||||
<body bgcolor="#ffffff">
|
||||
<center><table bgcolor = "#000000" width="100%" cellspacing="0"
|
||||
cellpadding="0" border="1">
|
||||
<tr>
|
||||
<td align="center"><h1>Scyther</h1></td>
|
||||
</tr>
|
||||
</table>
|
||||
</center>
|
||||
<p><b>Scyther</b> is cool.
|
||||
Scyther and Scyther GUI
|
||||
developed by Cas Cremers 2004-2006
|
||||
Credits: Gijs Hollestelle (Python wrapper around Scyther XML)
|
||||
<center><h2>Scyther</h2></center>
|
||||
<hr>
|
||||
<p>
|
||||
<b>Scyther</b> is an automatic tool for the verification and
|
||||
falsification of security protocols.
|
||||
</p>
|
||||
<p>
|
||||
Scyther and Scyther GUI developed by
|
||||
Cas Cremers 2004-2006.
|
||||
</p>
|
||||
<p>
|
||||
For news and updates visit the Scyther pages at
|
||||
http://www.win.tue.nl/~ccremers/scyther/index.html
|
||||
</p>
|
||||
<p>
|
||||
Credits: Cas Cremers (Scyther theory, backend, and main GUI
|
||||
code), Gijs Hollestelle (Python wrapper for Scyther XML output).
|
||||
</p>
|
||||
'''
|
||||
|
||||
def __init__(self,parent):
|
||||
wx.Dialog.__init__(self, parent, -1, 'About Scyther',
|
||||
size=(440,400))
|
||||
size=(400,300))
|
||||
html = wx.html.HtmlWindow(self)
|
||||
if "gtk2" in wx.PlatformInfo:
|
||||
html.SetStandardFonts()
|
||||
html.SetPage(self.text)
|
||||
button = wx.Button(self, wx.ID_OK, "Okay")
|
||||
|
||||
|
@ -16,14 +16,31 @@ import Scyther.Claim as Claim
|
||||
|
||||
class MyGrid(wx.GridBagSizer):
|
||||
|
||||
def stepInit(self):
|
||||
def __init__(self,parent):
|
||||
wx.GridBagSizer.__init__(self,hgap=5, vgap=5)
|
||||
self.ypos = 0
|
||||
self.parent = parent
|
||||
|
||||
def stepAdd(self,ctrl,txt):
|
||||
self.Add(ctrl,(self.ypos,0),flag=wx.ALIGN_RIGHT)
|
||||
self.Add(txt,(self.ypos,1),flag=wx.ALIGN_CENTER_VERTICAL)
|
||||
self.Add(ctrl,(self.ypos,1),flag=wx.ALIGN_LEFT)
|
||||
self.Add(txt,(self.ypos,0),flag=wx.ALIGN_RIGHT|wx.ALIGN_CENTER_VERTICAL)
|
||||
self.ypos += 1
|
||||
|
||||
def lineAdd(self):
|
||||
line = wx.StaticLine(self.parent,-1)
|
||||
self.Add(line,pos=(self.ypos,0),span=(1,2),flag=wx.EXPAND|wx.ALIGN_BOTTOM)
|
||||
self.ypos += 1
|
||||
|
||||
def titleAdd(self,title,firstLine=True):
|
||||
if firstLine:
|
||||
self.lineAdd()
|
||||
self.ypos += 1
|
||||
txt = wx.StaticText(self.parent,-1,title)
|
||||
font = wx.Font(12,wx.DEFAULT,wx.BOLD,wx.NORMAL)
|
||||
txt.SetFont(font)
|
||||
self.Add(txt,pos=(self.ypos,0),span=(1,2),flag=wx.ALIGN_CENTER)
|
||||
self.ypos += 1
|
||||
self.lineAdd()
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
@ -33,9 +50,10 @@ class SettingsWindow(wx.Panel):
|
||||
wx.Panel.__init__(self,parent,-1)
|
||||
|
||||
self.win = daddy
|
||||
space = 10
|
||||
grid = MyGrid(hgap=space,vgap=space)
|
||||
grid.stepInit()
|
||||
grid = MyGrid(self)
|
||||
|
||||
### Parameters
|
||||
grid.titleAdd("Verification parameters",False)
|
||||
|
||||
# Bound on the number of runs
|
||||
self.maxruns = int(Preference.get('maxruns','5'))
|
||||
@ -56,6 +74,7 @@ class SettingsWindow(wx.Panel):
|
||||
grid.stepAdd(l2,r2)
|
||||
|
||||
### MISC expert stuff
|
||||
grid.titleAdd("Advanced parameters")
|
||||
|
||||
# Bound on the number of classes/attacks
|
||||
self.maxattacks = int(Preference.get('maxattacks','100'))
|
||||
@ -76,6 +95,7 @@ class SettingsWindow(wx.Panel):
|
||||
grid.stepAdd(l10,r10)
|
||||
|
||||
### Graph output stuff
|
||||
grid.titleAdd("Graph output parameters")
|
||||
|
||||
# Bound on the number of classes/attacks
|
||||
if sys.platform.startswith("lin"):
|
||||
@ -91,6 +111,7 @@ class SettingsWindow(wx.Panel):
|
||||
grid.stepAdd(ctrl,txt)
|
||||
|
||||
### Combine
|
||||
grid.lineAdd()
|
||||
self.SetSizer(grid)
|
||||
self.SetAutoLayout(True)
|
||||
|
||||
|
@ -11,6 +11,7 @@ from optparse import OptionParser, SUPPRESS_HELP
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
""" Import scyther-gui components """
|
||||
import Gui.About as About
|
||||
import Gui.Preference as Preference
|
||||
import Gui.Mainwindow as Mainwindow
|
||||
import Gui.Misc as Misc
|
||||
@ -76,6 +77,14 @@ class MySplashScreen(wx.SplashScreen):
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
def isSplashNeeded(opts):
|
||||
if not opts.command:
|
||||
if opts.splashscreen and not (Preference.get('splashscreen') in ['false','off','disable','0']):
|
||||
return True
|
||||
return False
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
class ScytherApp(wx.App):
|
||||
def OnInit(self):
|
||||
|
||||
@ -99,15 +108,19 @@ class ScytherApp(wx.App):
|
||||
#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()
|
||||
#if isSplashNeeded(opts):
|
||||
# splash = MySplashScreen(basedir)
|
||||
# splash.Show()
|
||||
|
||||
self.mainWindow = Mainwindow.MainWindow(opts,args)
|
||||
self.SetTopWindow(self.mainWindow)
|
||||
self.mainWindow.Show()
|
||||
|
||||
if isSplashNeeded(opts):
|
||||
dlg = About.AboutScyther(self.mainWindow)
|
||||
dlg.ShowModal()
|
||||
dlg.Destroy()
|
||||
|
||||
return True
|
||||
|
||||
def OnExit(self):
|
||||
|
Loading…
Reference in New Issue
Block a user