2016-02-18 17:15:38 +01:00
|
|
|
from loginscreen import LoginScreen
|
|
|
|
from settings import Settings
|
2016-02-18 18:13:55 +01:00
|
|
|
from profile import Profile
|
2016-02-18 17:15:38 +01:00
|
|
|
import sys
|
|
|
|
from PySide import QtCore, QtGui
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
app = QtGui.QApplication(sys.argv)
|
|
|
|
settings = Settings()
|
|
|
|
if not settings['auto_profile']:
|
|
|
|
# show login screen if default profile not found
|
|
|
|
ls = LoginScreen()
|
|
|
|
win = QtGui.QMainWindow()
|
|
|
|
ls.setupUi(win)
|
2016-02-18 18:13:55 +01:00
|
|
|
profiles = Profile.find_profiles()
|
|
|
|
ls.update_select(map(lambda x: x[1], profiles))
|
2016-02-18 17:15:38 +01:00
|
|
|
win.show()
|
|
|
|
app.connect(app, QtCore.SIGNAL("lastWindowClosed()"), app, QtCore.SLOT("quit()"))
|
|
|
|
app.exec_()
|
2016-02-18 18:13:55 +01:00
|
|
|
# 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
|