moved serverLogin to main
This commit is contained in:
parent
bd1a80af61
commit
9cab3341b6
3 changed files with 17 additions and 10 deletions
12
Login.qml
12
Login.qml
|
@ -1,19 +1,13 @@
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
import QtQuick.Controls 1.2
|
import QtQuick.Controls 1.2
|
||||||
import TTRSS 1.0
|
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
color: "white"
|
color: "white"
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
Login {
|
property string serverUrl: serverUrl.getText()
|
||||||
id: ttrsslogin
|
property string userName: userName.getText()
|
||||||
onSessionIdChanged: parent.visible = false
|
property string password: password.getText()
|
||||||
}
|
|
||||||
|
|
||||||
function login() {
|
|
||||||
ttrsslogin.login(serverUrl.getText(), userName.getText(), password.getText())
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
|
3
main.cpp
3
main.cpp
|
@ -10,7 +10,8 @@ int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
QGuiApplication app(argc, argv);
|
QGuiApplication app(argc, argv);
|
||||||
|
|
||||||
qmlRegisterType<TinyTinyRSSLogin>("TTRSS", 1, 0, "Login");
|
qmlRegisterType<TinyTinyRSSLogin>("TTRSS", 1, 0, "ServerLogin");
|
||||||
|
// qmlRegisterType<TinyTinyRSS>("TTRSS", 1, 0, "Server");
|
||||||
|
|
||||||
QQmlApplicationEngine engine;
|
QQmlApplicationEngine engine;
|
||||||
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
|
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
|
||||||
|
|
12
main.qml
12
main.qml
|
@ -1,5 +1,6 @@
|
||||||
import QtQuick 2.3
|
import QtQuick 2.3
|
||||||
import QtQuick.Controls 1.2
|
import QtQuick.Controls 1.2
|
||||||
|
import TTRSS 1.0
|
||||||
|
|
||||||
ApplicationWindow {
|
ApplicationWindow {
|
||||||
id: window
|
id: window
|
||||||
|
@ -10,12 +11,23 @@ ApplicationWindow {
|
||||||
menuBar: TheMenuBar {}
|
menuBar: TheMenuBar {}
|
||||||
|
|
||||||
Content {
|
Content {
|
||||||
|
id: content
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
visible: false
|
visible: false
|
||||||
}
|
}
|
||||||
|
|
||||||
Login {
|
Login {
|
||||||
|
id: login
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
visible: true
|
visible: true
|
||||||
|
|
||||||
|
function login() {
|
||||||
|
serverLogin.login(serverUrl, userName, password)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ServerLogin {
|
||||||
|
id: serverLogin
|
||||||
|
onSessionIdChanged: login.visible = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue