mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-23 11:48:07 -06:00
Switch account is now possible from the application menu
This commit is contained in:
parent
1b684cd12c
commit
0f2fbc775a
@ -32,6 +32,7 @@ import output
|
||||
import platform
|
||||
import urllib2
|
||||
import sysTrayIcon
|
||||
import switchModule
|
||||
import languageHandler
|
||||
from sessionmanager import manager
|
||||
from mysc import event
|
||||
@ -56,6 +57,8 @@ class mainFrame(wx.Frame):
|
||||
|
||||
# Application menu
|
||||
app = wx.Menu()
|
||||
switch_account = app.Append(wx.NewId(), _(u"S&witch account"))
|
||||
self.Bind(wx.EVT_MENU, self.switch_account)
|
||||
updateProfile = app.Append(wx.NewId(), _(u"&Update profile"))
|
||||
self.Bind(wx.EVT_MENU, self.update_profile, updateProfile)
|
||||
show_hide = app.Append(wx.NewId(), _(u"&Hide window"))
|
||||
@ -970,6 +973,9 @@ class mainFrame(wx.Frame):
|
||||
return page
|
||||
return page
|
||||
|
||||
def switch_account(self, ev):
|
||||
switchModule.switcher(self)
|
||||
|
||||
### Close App
|
||||
def Destroy(self):
|
||||
self.sysTray.Destroy()
|
||||
|
23
src/gui/switchModule.py
Normal file
23
src/gui/switchModule.py
Normal file
@ -0,0 +1,23 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import wx
|
||||
import gui
|
||||
import config
|
||||
from sessionmanager import gui as sessionManagerUI
|
||||
|
||||
class switcher(object):
|
||||
def __init__(self, window):
|
||||
self.hold_window = window
|
||||
self.hold_window.Hide()
|
||||
sessionManagerWindow = sessionManagerUI.sessionManagerWindow()
|
||||
if sessionManagerWindow.ShowModal() == wx.ID_OK:
|
||||
self.hold_window.Destroy()
|
||||
self.window = gui.main.mainFrame()
|
||||
self.window.Show()
|
||||
self.window.showing = True
|
||||
if config.main != None and config.main["general"]["hide_gui"] == True:
|
||||
self.window.show_hide()
|
||||
self.window.Hide()
|
||||
wx.GetApp().SetTopWindow(self.window)
|
||||
else:
|
||||
self.window.Show()
|
||||
|
Loading…
Reference in New Issue
Block a user