New snapshot

This commit is contained in:
2015-04-22 15:34:44 -05:00
parent 96671645bb
commit f51c873324
7 changed files with 31 additions and 16 deletions

View File

@@ -9,8 +9,10 @@ class sessionManagerWindow(widgetUtils.baseDialog):
btnBox = Gtk.Box(spacing=6)
self.new = Gtk.Button("New account")
self.remove = Gtk.Button("Remove account")
self.configuration = Gtk.Button("Configuration")
btnBox.add(self.new)
btnBox.add(self.remove)
btnBox.add(self.configuration)
self.box.add(btnBox)
self.show_all()

View File

@@ -4,6 +4,7 @@ import widgetUtils
import platform
if platform.system() == "Windows":
import wxUI as view
from controller import settings
elif platform.system() == "Linux":
import gtkUI as view
import paths
@@ -18,13 +19,18 @@ import config
log = logging.getLogger("sessionmanager.sessionManager")
class sessionManagerController(object):
def __init__(self):
def __init__(self, started=False):
super(sessionManagerController, self).__init__()
log.debug("Setting up the session manager.")
self.started = started
manager.setup()
self.view = view.sessionManagerWindow()
widgetUtils.connect_event(self.view.new, widgetUtils.BUTTON_PRESSED, self.manage_new_account)
widgetUtils.connect_event(self.view.remove, widgetUtils.BUTTON_PRESSED, self.remove)
if self.started == False:
widgetUtils.connect_event(self.view.configuration, widgetUtils.BUTTON_PRESSED, self.configuration)
else:
self.view.hide_configuration()
self.new_sessions = {}
self.removed_sessions = []
@@ -87,3 +93,9 @@ class sessionManagerController(object):
self.sessions.remove(selected_account)
shutil.rmtree(path=paths.config_path(selected_account), ignore_errors=True)
def configuration(self, *args, **kwargs):
""" Opens the global settings dialogue."""
d = settings.globalSettingsController()
if d.response == widgetUtils.OK:
d.save_configuration()

View File

@@ -15,11 +15,13 @@ class sessionManagerWindow(wx.Dialog):
sizer.Add(listSizer, 0, wx.ALL, 5)
self.new = wx.Button(panel, -1, u"New account", size=wx.DefaultSize)
self.remove = wx.Button(panel, -1, _(u"Remove account"))
self.configuration = wx.Button(panel, -1, _(u"Global Settings"))
ok = wx.Button(panel, wx.ID_OK, size=wx.DefaultSize)
ok.SetDefault()
cancel = wx.Button(panel, wx.ID_CANCEL, size=wx.DefaultSize)
buttons = wx.BoxSizer(wx.HORIZONTAL)
buttons.Add(self.new, 0, wx.ALL, 5)
buttons.Add(self.configuration, 0, wx.ALL, 5)
buttons.Add(ok, 0, wx.ALL, 5)
buttons.Add(cancel, 0, wx.ALL, 5)
sizer.Add(buttons, 0, wx.ALL, 5)
@@ -66,3 +68,6 @@ class sessionManagerWindow(wx.Dialog):
def remove_session(self, sessionID):
self.list.remove_item(sessionID)
def hide_configuration(self):
self.configuration.Hide()