Exemple #1
0
def InitGui():
    import __builtin__
    __builtin__.raw_input = RawInput
    __builtin__.input = Input

    eg.scheduler.start()
    eg.messageReceiver.Start()

    eg.document = eg.Document()

    if eg.config.showTrayIcon:
        if not (eg.config.hideOnStartup or eg.startupArguments.hideOnStartup):
            eg.document.ShowFrame()
    else:
        eg.document.ShowFrame()
        if eg.config.hideOnStartup or eg.startupArguments.hideOnStartup:
            eg.mainFrame.Iconize(True)

    eg.actionThread.Start()

    eg.eventThread.startupEvent = eg.startupArguments.startupEvent

    config = eg.config

    startupFile = eg.startupArguments.startupFile
    if startupFile is None:
        startupFile = config.autoloadFilePath
    if startupFile and not exists(startupFile):
        eg.PrintError(eg.text.Error.FileNotFound % startupFile)
        startupFile = None

    eg.eventThread.Start()
    wx.CallAfter(
        eg.eventThread.Call,
        eg.eventThread.StartSession,
        startupFile
    )

    if config.checkUpdate:
        # avoid more than one check per day
        today = gmtime()[:3]
        if config.lastUpdateCheckDate != today:
            config.lastUpdateCheckDate = today
            wx.CallAfter(eg.CheckUpdate.Start)

    # Register restart handler for easy crash recovery.
    if eg.WindowsVersion >= 'Vista':
        args = " ".join(eg.app.GetArguments())
        windll.kernel32.RegisterApplicationRestart(args, 8)

    eg.Print(eg.text.MainFrame.Logger.welcomeText)

    import LoopbackSocket
    eg.socketSever = LoopbackSocket.Start()
Exemple #2
0
def InitGui():
    #import eg.WinApi.COMServer

    import __builtin__
    __builtin__.raw_input = RawInput
    __builtin__.input = Input

    eg.scheduler.start()
    eg.messageReceiver.Start()

    eg.document = eg.Document()

    if not (eg.config.hideOnStartup or eg.startupArguments.hideOnStartup):
        eg.document.ShowFrame()

    eg.actionThread.Start()

    eg.eventThread.startupEvent = eg.startupArguments.startupEvent

    config = eg.config

    startupFile = eg.startupArguments.startupFile
    if startupFile is None:
        startupFile = config.autoloadFilePath
    if startupFile and not os.path.exists(startupFile):
        eg.PrintError(eg.text.Error.FileNotFound % startupFile)
        startupFile = None

    eg.eventThread.Start()
    wx.CallAfter(
        eg.eventThread.Call,
        eg.eventThread.StartSession,
        startupFile
    )
#    if config.checkUpdate:
#        # avoid more than one check per day
#        today = gmtime()[:3]
#        if config.lastUpdateCheckDate != today:
#            config.lastUpdateCheckDate = today
#            wx.CallAfter(eg.CheckUpdate.Start)

    eg.Print(eg.text.MainFrame.Logger.welcomeText)