@dusted/anqst 1.7.2 → 1.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AnQstWebBase/AnQstWebBaseAbi.cmake +1 -0
- package/AnQstWebBase/CMakeLists.txt +116 -0
- package/AnQstWebBase/CMakeUserPresets.json +14 -0
- package/AnQstWebBase/README.md +65 -0
- package/AnQstWebBase/src/AnQstBase93.cpp +91 -0
- package/AnQstWebBase/src/AnQstBase93.h +15 -0
- package/AnQstWebBase/src/AnQstBridgeProxy.cpp +30 -0
- package/AnQstWebBase/src/AnQstBridgeProxy.h +41 -0
- package/AnQstWebBase/src/AnQstHostBridgeFacade.cpp +345 -0
- package/AnQstWebBase/src/AnQstHostBridgeFacade.h +99 -0
- package/AnQstWebBase/src/AnQstWebBaseAbi.h +4 -0
- package/AnQstWebBase/src/AnQstWebBaseAbi.h.in +4 -0
- package/AnQstWebBase/src/AnQstWebHostBase.cpp +1822 -0
- package/AnQstWebBase/src/AnQstWebHostBase.h +227 -0
- package/AnQstWebBase/src/AnQstWidgetDebugDialog.cpp +425 -0
- package/AnQstWebBase/src/AnQstWidgetDebugDialog.h +105 -0
- package/AnQstWebBase/src/AngularHttpBaseServer.cpp +965 -0
- package/AnQstWebBase/src/AngularHttpBaseServer.h +97 -0
- package/AnQstWebBase/src/UI/AnQstWidgetDebugDialog.ui +235 -0
- package/AnQstWebBase/tests/CMakeLists.txt +22 -0
- package/AnQstWebBase/tests/test_AnQstWebHostBase.cpp +1102 -0
- package/dist/src/abi-hash-stamp.js +5 -0
- package/dist/src/abi-hash.js +33 -0
- package/dist/src/app.js +67 -19
- package/dist/src/boundary-codec-render.js +17 -10
- package/dist/src/emit.js +76 -30
- package/dist/src/project.js +11 -1
- package/dist/src/webbase.js +94 -0
- package/package.json +2 -1
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
|
|
3
|
+
#include <QDialog>
|
|
4
|
+
#include <QStringList>
|
|
5
|
+
#include <QUrl>
|
|
6
|
+
|
|
7
|
+
#include "AnQstWebBaseAbi.h"
|
|
8
|
+
|
|
9
|
+
class QDialogButtonBox;
|
|
10
|
+
class QLayout;
|
|
11
|
+
class QNetworkAccessManager;
|
|
12
|
+
class QNetworkReply;
|
|
13
|
+
class QTimer;
|
|
14
|
+
|
|
15
|
+
namespace Ui {
|
|
16
|
+
class AnQstWidgetBaseClassDialog;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
namespace ANQST_WEBBASE_NAMESPACE {
|
|
20
|
+
|
|
21
|
+
class AnQstWidgetDebugDialog final : public QDialog {
|
|
22
|
+
Q_OBJECT
|
|
23
|
+
|
|
24
|
+
public:
|
|
25
|
+
enum class HostMode {
|
|
26
|
+
Application = 0,
|
|
27
|
+
Browser = 1
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
enum class ResourceProvider {
|
|
31
|
+
Qrc = 0,
|
|
32
|
+
Dir = 1,
|
|
33
|
+
Http = 2
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
struct InitialState {
|
|
37
|
+
QString widgetName;
|
|
38
|
+
HostMode hostMode = HostMode::Application;
|
|
39
|
+
ResourceProvider resourceProvider = ResourceProvider::Qrc;
|
|
40
|
+
QString resourceUrl;
|
|
41
|
+
QString resourceDirectory;
|
|
42
|
+
QStringList jsConsoleHistory;
|
|
43
|
+
QStringList jsConsoleCommandHistory;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
struct ResultState {
|
|
47
|
+
bool accepted = false;
|
|
48
|
+
HostMode hostMode = HostMode::Application;
|
|
49
|
+
ResourceProvider resourceProvider = ResourceProvider::Qrc;
|
|
50
|
+
QString resourceUrl;
|
|
51
|
+
QString resourceDirectory;
|
|
52
|
+
bool openBrowserChecked = false;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
explicit AnQstWidgetDebugDialog(const InitialState& initialState, QWidget* parent = nullptr);
|
|
56
|
+
~AnQstWidgetDebugDialog() override;
|
|
57
|
+
|
|
58
|
+
ResultState resultState() const;
|
|
59
|
+
void appendJsConsoleLine(const QString& line);
|
|
60
|
+
|
|
61
|
+
signals:
|
|
62
|
+
void jsConsoleCommandSubmitted(const QString& source);
|
|
63
|
+
|
|
64
|
+
private slots:
|
|
65
|
+
void onResourceProviderChanged();
|
|
66
|
+
void onHostModeChanged();
|
|
67
|
+
void onUrlInputChanged();
|
|
68
|
+
void onUrlProbeTimeout();
|
|
69
|
+
void onBrowseDirectoryRequested();
|
|
70
|
+
void onDirectoryInputChanged();
|
|
71
|
+
void onTabChanged(int index);
|
|
72
|
+
void onJsConsoleInputSubmitted();
|
|
73
|
+
|
|
74
|
+
private:
|
|
75
|
+
static void setLayoutVisible(QLayout* layout, bool visible);
|
|
76
|
+
bool eventFilter(QObject* watched, QEvent* event) override;
|
|
77
|
+
|
|
78
|
+
void updateDynamicVisibility();
|
|
79
|
+
void updateValidationState();
|
|
80
|
+
void setUrlStatusMessage(const QString& message);
|
|
81
|
+
void focusJsConsoleInput();
|
|
82
|
+
void appendJsConsoleCommandHistoryEntry(const QString& source);
|
|
83
|
+
void showPreviousJsConsoleCommand();
|
|
84
|
+
void showNextJsConsoleCommand();
|
|
85
|
+
bool isHttpProviderSelected() const;
|
|
86
|
+
bool isDirProviderSelected() const;
|
|
87
|
+
QString normalizedDirectoryRoot(const QString& input) const;
|
|
88
|
+
bool isDirectoryInputValid() const;
|
|
89
|
+
bool parseAndNormalizeHttpUrl(const QString& input, QUrl* normalized) const;
|
|
90
|
+
void startUrlProbe(const QUrl& urlToProbe);
|
|
91
|
+
void stopPendingProbe();
|
|
92
|
+
void completeProbeAsInvalid(const QString& message);
|
|
93
|
+
|
|
94
|
+
Ui::AnQstWidgetBaseClassDialog* m_ui;
|
|
95
|
+
QNetworkAccessManager* m_networkManager;
|
|
96
|
+
QTimer* m_urlProbeDebounceTimer;
|
|
97
|
+
QNetworkReply* m_activeProbeReply;
|
|
98
|
+
quint64 m_probeGeneration;
|
|
99
|
+
bool m_isUrlProbeOk;
|
|
100
|
+
QStringList m_jsConsoleHistory;
|
|
101
|
+
QStringList m_jsConsoleCommandHistory;
|
|
102
|
+
int m_jsConsoleCommandHistoryIndex;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
} // namespace ANQST_WEBBASE_NAMESPACE
|