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.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
|
||||
|
|
3
main.cpp
3
main.cpp
|
@ -10,7 +10,8 @@ int main(int argc, char *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;
|
||||
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
|
||||
|
|
12
main.qml
12
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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue