示例#1
0
def setup():
    log.debug("Starting " + application.name + " %s" % (application.version, ))
    config.setup()
    fixes.setup()
    log.debug("Using %s %s" % (platform.system(), platform.architecture()[0]))
    log.debug("Application path is %s" % (paths.app_path(), ))
    log.debug("config path  is %s" % (paths.config_path(), ))
    sound.setup()
    output.setup()
    languageHandler.setLanguage(config.app["app-settings"]["language"])
    keys.setup()
    from controller import mainController
    from sessionmanager import sessionManager
    app = widgetUtils.mainLoopObject()
    if system == "Windows":
        if config.app["app-settings"]["donation_dialog_displayed"] == False:
            donation()
        updater.do_update()
    sm = sessionManager.sessionManagerController()
    sm.fill_list()
    if len(sm.sessions) == 0: sm.show()
    else:
        sm.do_ok()
    if hasattr(sm.view, "destroy"):
        sm.view.destroy()
    del sm
    r = mainController.Controller()
    r.view.show()
    r.do_work()
    r.check_invisible_at_startup()
    if system == "Windows":
        call_threaded(r.start)
    elif system == "Linux":
        GLib.idle_add(r.start)
    app.run()
示例#2
0
文件: gui.py 项目: Oire/TWBlue
 def ok(self, ev):
  if self.list.get_count() == 0:
   wx.MessageDialog(None, _(u"You need to configure an account."), _(u"Account Error"), wx.ICON_ERROR).ShowModal()
   return
  current_session = self.sessions[self.list.get_selected()]
  manager.manager.set_current_session(current_session)
  config.MAINFILE = "%s/session.conf" % (manager.manager.get_current_session())
  config.setup()
  lang=config.main['general']['language']
  languageHandler.setLanguage(lang)
  sound.setup()
  output.setup()
  self.EndModal(wx.ID_OK)
示例#3
0
文件: gui.py 项目: zywek123/TWBlue
 def ok(self, ev):
     if self.list.get_count() == 0:
         wx.MessageDialog(None, _(u"You need to configure an account."),
                          _(u"Account Error"), wx.ICON_ERROR).ShowModal()
         return
     current_session = self.sessions[self.list.get_selected()]
     manager.manager.set_current_session(current_session)
     config.MAINFILE = "%s/session.conf" % (
         manager.manager.get_current_session())
     config.setup()
     lang = config.main['general']['language']
     languageHandler.setLanguage(lang)
     sound.setup()
     output.setup()
     self.EndModal(wx.ID_OK)
示例#4
0
文件: main.py 项目: TWBlueQS/TWBlueQS
def setup():
    log.debug("Starting " + application.name + " %s" % (application.version,))
    config.setup()
    log.debug("Using %s %s" % (platform.system(), platform.architecture()[0]))
    log.debug("Application path is %s" % (paths.app_path(),))
    log.debug("config path  is %s" % (paths.config_path(),))
    sound.setup()
    output.setup()
    languageHandler.setLanguage(config.app["app-settings"]["language"])
    message(message=_(u"Loading files and configuration, please wait..."))
    fixes.setup()
    keys.setup()
    from controller import mainController
    from sessionmanager import sessionManager

    app = widgetUtils.mainLoopObject()
    gplwarning()

    if system == "Windows":
        if config.app["app-settings"]["donation_dialog_displayed"] == False:
            donation()
        if config.app["app-settings"]["check_updates"] == True:
            updater.do_update()
        else:
            message(message=_(u"Set to ignore updates at startup. To change this preference, go to global config"))
    sm = sessionManager.sessionManagerController()
    sm.fill_list()
    if len(sm.sessions) == 0:
        sm.show()
    else:
        sm.do_ok()
    if hasattr(sm.view, "destroy"):
        sm.view.destroy()
    del sm
    r = mainController.Controller()
    r.view.show()
    r.do_work()
    r.check_invisible_at_startup()
    if system == "Windows":
        call_threaded(r.start)
    elif system == "Linux":
        GLib.idle_add(r.start)
    message(
        message=_(u"Welcome to %s. Main application's window will appears shortly. Happy tweeting!") % application.name
    )
    app.run()
示例#5
0
文件: main.py 项目: Oire/TWBlue
#finally, remove the temporal files. TW Blue doesn't need them anymore, and we will get more free space on the harddrive
os.remove(stdout_temp.name)
os.remove(stderr_temp.name)
app = wx.App()
#app = wx.App(redirect=True, useBestVisual=True, filename=paths.logs_path('tracebacks.log'))
configured = False
configs = []
for i in os.listdir(paths.config_path()):
 if os.path.isdir(paths.config_path(i)): configs.append(i)
if len(configs) == 1:
 manager.manager.set_current_session(configs[0])
 config.MAINFILE = "%s/session.conf" % (manager.manager.get_current_session())
 config.setup()
 lang=config.main['general']['language']
 languageHandler.setLanguage(lang)
 sound.setup()
 output.setup()
 configured = True
else:
 ssmg = smGUI.sessionManagerWindow()
if configured == True or ssmg.ShowModal() == wx.ID_OK:
 frame = gui.main.mainFrame()
 frame.Show()
 frame.showing = True
 if config.main != None and config.main["general"]["hide_gui"] == True and platform.system() == "Windows":
  frame.show_hide()
  frame.Hide()
 app.SetTopWindow(frame)
else:
 app.Exit()
 ### I should uncomment this
示例#6
0
os.remove(stdout_temp.name)
os.remove(stderr_temp.name)
app = wx.App()
#app = wx.App(redirect=True, useBestVisual=True, filename=paths.logs_path('tracebacks.log'))
configured = False
configs = []
for i in os.listdir(paths.config_path()):
    if os.path.isdir(paths.config_path(i)): configs.append(i)
if len(configs) == 1:
    manager.manager.set_current_session(configs[0])
    config.MAINFILE = "%s/session.conf" % (
        manager.manager.get_current_session())
    config.setup()
    lang = config.main['general']['language']
    languageHandler.setLanguage(lang)
    sound.setup()
    output.setup()
    configured = True
else:
    ssmg = smGUI.sessionManagerWindow()
if configured == True or ssmg.ShowModal() == wx.ID_OK:
    frame = gui.main.mainFrame()
    frame.Show()
    frame.showing = True
    if config.main != None and config.main["general"][
            "hide_gui"] == True and platform.system() == "Windows":
        frame.show_hide()
        frame.Hide()
    app.SetTopWindow(frame)
else:
    app.Exit()