main.py: loginscreen now gets list of profiles

This commit is contained in:
ingvar1995 2016-02-18 20:13:55 +03:00
parent 23969b7e2a
commit f11f226890
2 changed files with 11 additions and 4 deletions

View File

@ -1,5 +1,6 @@
from loginscreen import LoginScreen from loginscreen import LoginScreen
from settings import Settings from settings import Settings
from profile import Profile
import sys import sys
from PySide import QtCore, QtGui from PySide import QtCore, QtGui
@ -12,9 +13,15 @@ if __name__ == '__main__':
ls = LoginScreen() ls = LoginScreen()
win = QtGui.QMainWindow() win = QtGui.QMainWindow()
ls.setupUi(win) ls.setupUi(win)
profiles = Profile.find_profiles()
ls.update_select(['tox_save']) ls.update_select(map(lambda x: x[1], profiles))
win.show() win.show()
app.connect(app, QtCore.SIGNAL("lastWindowClosed()"), app, QtCore.SLOT("quit()")) app.connect(app, QtCore.SIGNAL("lastWindowClosed()"), app, QtCore.SLOT("quit()"))
app.exec_() app.exec_()
# TODO: get result from loginscreen and open mainscreen # TODO: get result from loginscreen
# add new default profile (if needed)
# save selected profile to open
# create new profile?
else:
path, name = settings['auto_profile']
# TODO: open mainscreen

View File

@ -36,7 +36,7 @@ class Settings(dict):
'auto_accept_from_friends': [], 'auto_accept_from_friends': [],
'friends_aliases': [], 'friends_aliases': [],
'typing_notifications': True, 'typing_notifications': True,
'auto_profile': '' 'auto_profile': None
} }
def save(self): def save(self):