Browse Source

Updated advanced_config

pull/1/head
Chris Kiehl 10 years ago
parent
commit
c656c6248e
7 changed files with 30 additions and 14 deletions
  1. 2
      src/app/dialogs/advanced_config.py
  2. BIN
      src/app/dialogs/advanced_config.pyc
  3. 13
      src/app/dialogs/base_window.py
  4. 5
      src/app/dialogs/controller.py
  5. BIN
      src/app/images/image_store.pyc
  6. 1
      src/languages/eng.py
  7. 23
      src/model/gooey.py

2
src/app/dialogs/advanced_config.py

@ -19,7 +19,7 @@ class AdvancedConfigPanel(ScrolledPanel, OptionReader):
'''
Abstract class for the Footer panels.
'''
def __init__(self, parent, params, model=None, **kwargs):
def __init__(self, parent, model=None, **kwargs):
ScrolledPanel.__init__(self, parent, **kwargs)
self.SetupScrolling()

BIN
src/app/dialogs/advanced_config.pyc

13
src/app/dialogs/base_window.py

@ -28,8 +28,7 @@ class BaseWindow(wx.Frame):
self,
parent=None,
id=-1,
title=os.path.basename(__file__),
size=(610,530)
)
self._params = params
@ -47,6 +46,12 @@ class BaseWindow(wx.Frame):
self.registerControllers()
def _init_properties(self):
if not self._params['program_name']:
title=os.path.basename(sys.argv[0].replace('.py', ''))
else:
title = self._params['program_name']
self.SetTitle(title)
self.SetSize((610,530))
self.SetMinSize((400,300))
self.icon = wx.Icon(image_store.icon, wx.BITMAP_TYPE_ICO)
self.SetIcon(self.icon)
@ -103,8 +108,8 @@ class BaseWindow(wx.Frame):
def AttachPayload(self, payload):
self._payload = payload
# def OnXClose(self, event):
# print 'adsfasdfadsf'
def ManualStart(self):
self._controller.ManualStart()
if __name__ == '__main__':

5
src/app/dialogs/controller.py

@ -61,6 +61,11 @@ class Controller(object):
self._model.AddToArgv(cmd_line_args)
self._base.NextPage()
self._payload_runner()
def ManualStart(self):
self._base.NextPage()
wx.CallAfter(wx.ActivateEvent)
self._payload_runner()
def OnCloseButton(self, event):
self._base.Destroy()

BIN
src/app/images/image_store.pyc

1
src/languages/eng.py

@ -33,7 +33,6 @@ if __name__ == '__main__':
'optional_args_msg':'Optional Arguments',
# popup dialogs
"sure_you_want_to_exit":"Are you sure you want to exit?",
'close_program': 'Close Program?',
'status':'Status',

23
src/model/gooey.py

@ -18,7 +18,9 @@ from model.i18n import I18N
from functools import partial
def Gooey(f=None, advanced=False, language='english', noconfig=False):
def Gooey(f=None, advanced=True,
language='english', noconfig=True,
program_name=None):
'''
Decorator for client code's main function.
Entry point for the GUI generator.
@ -26,16 +28,18 @@ def Gooey(f=None, advanced=False, language='english', noconfig=False):
Scans the client code for argparse data.
If found, extracts it and build the proper
configuration page (basic or advanced).
'''
Launched
params= locals()
'''
params = locals()
for k,v in params.iteritems():
print k, v
def build(f):
def inner():
module_path = get_caller_path()
# User doesn't want to display configuration screen
# Just straight to the run panel
try:
parser = source_parser.extract_parser(module_path)
except source_parser.ParserError:
@ -50,7 +54,11 @@ def Gooey(f=None, advanced=False, language='english', noconfig=False):
app = wx.App(False)
frame = BaseWindow(BodyPanel, model, f, params)
frame.Show(True) # Show the frame.
if noconfig:
# gah, ugly.. not sure how else to go
# about it without rewriting a *bunch* of other stuff
frame.ManualStart()
frame.Show(True)
app.MainLoop()
inner.__name__ = f.__name__
@ -62,7 +70,6 @@ def Gooey(f=None, advanced=False, language='english', noconfig=False):
def get_program_name(path):
return '{}'.format(os.path.split(path)[-1])
def get_caller_path():
# utility func for decorator

Loading…
Cancel
Save