mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2025-04-06 03:42:29 -04: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 platform
|
||||||
import urllib2
|
import urllib2
|
||||||
import sysTrayIcon
|
import sysTrayIcon
|
||||||
|
import switchModule
|
||||||
import languageHandler
|
import languageHandler
|
||||||
from sessionmanager import manager
|
from sessionmanager import manager
|
||||||
from mysc import event
|
from mysc import event
|
||||||
@ -56,6 +57,8 @@ class mainFrame(wx.Frame):
|
|||||||
|
|
||||||
# Application menu
|
# Application menu
|
||||||
app = wx.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"))
|
updateProfile = app.Append(wx.NewId(), _(u"&Update profile"))
|
||||||
self.Bind(wx.EVT_MENU, self.update_profile, updateProfile)
|
self.Bind(wx.EVT_MENU, self.update_profile, updateProfile)
|
||||||
show_hide = app.Append(wx.NewId(), _(u"&Hide window"))
|
show_hide = app.Append(wx.NewId(), _(u"&Hide window"))
|
||||||
@ -970,6 +973,9 @@ class mainFrame(wx.Frame):
|
|||||||
return page
|
return page
|
||||||
return page
|
return page
|
||||||
|
|
||||||
|
def switch_account(self, ev):
|
||||||
|
switchModule.switcher(self)
|
||||||
|
|
||||||
### Close App
|
### Close App
|
||||||
def Destroy(self):
|
def Destroy(self):
|
||||||
self.sysTray.Destroy()
|
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…
x
Reference in New Issue
Block a user