forked from qt-creator/qt-creator
For easier testing a docker file is added. You can start "buildandrun.sh" in copilot/tests/proxy to get a simple proxy server up and running. The argument "PWDMODE" in buildandrun.sh can be set to "with" and "without" to get a proxy server that needs a password or not. The username and password are user/1234. Fixes: QTCREATORBUG-29485 Change-Id: I3859c9ad04ebd4f9349e25665ba710e23fb64dea Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
49 lines
1.0 KiB
C++
49 lines
1.0 KiB
C++
// Copyright (C) 2023 The Qt Company Ltd.
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
|
|
|
#pragma once
|
|
|
|
#include "copilotclient.h"
|
|
|
|
#include <utils/progressindicator.h>
|
|
|
|
#include <QLabel>
|
|
#include <QPushButton>
|
|
#include <QWidget>
|
|
|
|
namespace LanguageClient {
|
|
class Client;
|
|
}
|
|
|
|
namespace Copilot {
|
|
|
|
class AuthWidget : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
enum class Status { SignedIn, SignedOut, Unknown };
|
|
|
|
public:
|
|
explicit AuthWidget(QWidget *parent = nullptr);
|
|
~AuthWidget() override;
|
|
|
|
void updateClient(const Utils::FilePath &nodeJs, const Utils::FilePath &agent);
|
|
|
|
private:
|
|
void setState(const QString &buttonText, const QString &errorText, bool working);
|
|
void checkStatus();
|
|
|
|
|
|
void signIn();
|
|
void signOut();
|
|
|
|
private:
|
|
Status m_status = Status::Unknown;
|
|
QPushButton *m_button = nullptr;
|
|
QLabel *m_statusLabel = nullptr;
|
|
Utils::ProgressIndicator *m_progressIndicator = nullptr;
|
|
Internal::CopilotClient *m_client = nullptr;
|
|
};
|
|
|
|
} // namespace Copilot
|