blob: fc3018018eb1e7628c2f665d277feba30881df3e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "qmldebugtranslationclient.h"
#include <qmldebug/qpacketprotocol.h>
#include <QUrl>
#include <private/qqmldebugtranslationprotocol_p.h>
namespace QmlPreview {
QmlDebugTranslationClient::QmlDebugTranslationClient(QmlDebug::QmlDebugConnection *connection) :
QmlDebug::QmlDebugClient(QLatin1String("DebugTranslation"), connection)
{
}
void QmlDebugTranslationClient::changeLanguage(const QUrl &url, const QString &localeIsoCode)
{
QmlDebug::QPacket packet(dataStreamVersion());
const int request_change_language = 1;
packet << request_change_language << url << localeIsoCode;
sendMessage(packet.data());
}
void QmlDebugTranslationClient::stateChanged(QmlDebug::QmlDebugClient::State state)
{
if (state == Unavailable)
emit debugServiceUnavailable();
}
} // namespace QmlPreview
|