From 9cab3341b65f438553a1972c2e6bb6e11d09fee8 Mon Sep 17 00:00:00 2001 From: Jeena Date: Sat, 10 Jan 2015 15:21:56 +0100 Subject: [PATCH] moved serverLogin to main --- Login.qml | 12 +++--------- main.cpp | 3 ++- main.qml | 12 ++++++++++++ 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/Login.qml b/Login.qml index d4703a2..af5a517 100644 --- a/Login.qml +++ b/Login.qml @@ -1,19 +1,13 @@ import QtQuick 2.0 import QtQuick.Controls 1.2 -import TTRSS 1.0 Rectangle { color: "white" anchors.fill: parent - Login { - id: ttrsslogin - onSessionIdChanged: parent.visible = false - } - - function login() { - ttrsslogin.login(serverUrl.getText(), userName.getText(), password.getText()) - } + property string serverUrl: serverUrl.getText() + property string userName: userName.getText() + property string password: password.getText() Column { width: parent.width diff --git a/main.cpp b/main.cpp index 36186f4..4786772 100644 --- a/main.cpp +++ b/main.cpp @@ -10,7 +10,8 @@ int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); - qmlRegisterType("TTRSS", 1, 0, "Login"); + qmlRegisterType("TTRSS", 1, 0, "ServerLogin"); + // qmlRegisterType("TTRSS", 1, 0, "Server"); QQmlApplicationEngine engine; engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); diff --git a/main.qml b/main.qml index 94aad2a..79cc309 100644 --- a/main.qml +++ b/main.qml @@ -1,5 +1,6 @@ import QtQuick 2.3 import QtQuick.Controls 1.2 +import TTRSS 1.0 ApplicationWindow { id: window @@ -10,12 +11,23 @@ ApplicationWindow { menuBar: TheMenuBar {} Content { + id: content anchors.fill: parent visible: false } Login { + id: login anchors.fill: parent visible: true + + function login() { + serverLogin.login(serverUrl, userName, password) + } + } + + ServerLogin { + id: serverLogin + onSessionIdChanged: login.visible = false } }