Merge remote-tracking branch 'origin/master' into new-chat-from-contacts-7
This commit is contained in:
commit
4bcd4faca9
3 changed files with 19 additions and 6 deletions
|
@ -68,6 +68,14 @@ Page {
|
|||
}
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: openInitializationPageTimer
|
||||
interval: 0
|
||||
onTriggered: {
|
||||
pageStack.push(Qt.resolvedUrl("../pages/InitializationPage.qml"));
|
||||
}
|
||||
}
|
||||
|
||||
function setPageStatus() {
|
||||
switch (overviewPage.connectionState) {
|
||||
case TelegramAPI.WaitingForNetwork:
|
||||
|
@ -102,19 +110,23 @@ Page {
|
|||
|
||||
function initializePage() {
|
||||
overviewPage.authorizationState = tdLibWrapper.getAuthorizationState();
|
||||
overviewPage.handleAuthorizationState();
|
||||
overviewPage.handleAuthorizationState(true);
|
||||
overviewPage.connectionState = tdLibWrapper.getConnectionState();
|
||||
overviewPage.setPageStatus();
|
||||
}
|
||||
|
||||
function handleAuthorizationState() {
|
||||
function handleAuthorizationState(isOnInitialization) {
|
||||
switch (overviewPage.authorizationState) {
|
||||
case TelegramAPI.WaitPhoneNumber:
|
||||
case TelegramAPI.WaitCode:
|
||||
case TelegramAPI.WaitPassword:
|
||||
case TelegramAPI.WaitRegistration:
|
||||
overviewPage.loading = false;
|
||||
pageStack.push(Qt.resolvedUrl("../pages/InitializationPage.qml"));
|
||||
if(isOnInitialization) { // pageStack isn't ready on Component.onCompleted
|
||||
openInitializationPageTimer.start()
|
||||
} else {
|
||||
pageStack.push(Qt.resolvedUrl("../pages/InitializationPage.qml"));
|
||||
}
|
||||
break;
|
||||
case TelegramAPI.AuthorizationReady:
|
||||
overviewPage.loading = false;
|
||||
|
|
|
@ -51,6 +51,7 @@ TDLibWrapper::TDLibWrapper(AppSettings *appSettings, MceInterface *mceInterface,
|
|||
this->appSettings = appSettings;
|
||||
this->mceInterface = mceInterface;
|
||||
this->tdLibClient = td_json_client_create();
|
||||
this->authorizationState = AuthorizationState::Closed;
|
||||
this->tdLibReceiver = new TDLibReceiver(this->tdLibClient, this);
|
||||
|
||||
QString tdLibDatabaseDirectoryPath = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/tdlib";
|
||||
|
|
|
@ -1252,15 +1252,15 @@
|
|||
</message>
|
||||
<message>
|
||||
<source>Notification turns on the display</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Habilitar pantalla en notificaciones</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Storage</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Almacenamiento</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Enable storage optimizer</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Habilitar optimizador de almacenamiento</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
|
Loading…
Reference in a new issue