Switch account is now possible from the application menu

This commit is contained in:
Manuel Cortez 2014-11-26 17:26:53 -06:00
parent 1b684cd12c
commit 0f2fbc775a
2 changed files with 29 additions and 0 deletions

View File

@ -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
View 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()