diff --git a/src/ListModels/shortcutslistmodel.cpp b/src/ListModels/shortcutslistmodel.cpp index de8c5a7..21aadb9 100644 --- a/src/ListModels/shortcutslistmodel.cpp +++ b/src/ListModels/shortcutslistmodel.cpp @@ -18,22 +18,6 @@ ShortcutsListModel::ShortcutsListModel(QObject *parent) : QObject{parent} { - /*auto getOpenApiSchemeSection = new ShortcutSection(); - getOpenApiSchemeSection->setMode(m_openApiMode); - getOpenApiSchemeSection->setTitle("Getting Open API Schema"); - getOpenApiSchemeSection->setDescription("Load or reaload OpenAPI scheme from remote server"); - getOpenApiSchemeSection->addShortcut("Ctrl-Z or F5", "Load scheme"); - getOpenApiSchemeSection->addShortcut("Ctrl-B or F4", "Cancel load scheme"); - m_sections.append(getOpenApiSchemeSection); - - auto addressesManagement = new ShortcutSection(); - addressesManagement->setMode(m_openApiMode); - addressesManagement->setTitle("Addresses management"); - addressesManagement->setDescription("Create SavedOption and select it later"); - addressesManagement->addShortcut("Ctrl-Insert", "Create a new SavedOption from the currently filled fields"); - addressesManagement->addShortcut("Ctrl-Home", "Edit current selected SavedOption"); - addressesManagement->addShortcut("Ctrl-Tab", "holding Ctrl and further pressing Tab change selected SavedOption"); - m_sections.append(addressesManagement);*/ } void ShortcutsListModel::setFilter(const QString &filter) noexcept diff --git a/src/Models/globalvariablespostscriptmodel.cpp b/src/Models/globalvariablespostscriptmodel.cpp index cf6b07b..3863c0c 100644 --- a/src/Models/globalvariablespostscriptmodel.cpp +++ b/src/Models/globalvariablespostscriptmodel.cpp @@ -1,3 +1,18 @@ +/* + ArdorQuery http tester + Copyright (C) 2022 Roman Vladimirov + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #include "globalvariablespostscriptmodel.h" GlobalVariablesPostScriptModel::GlobalVariablesPostScriptModel(QObject *parent, GlobalVariablesListModel* globalVariables, @@ -38,7 +53,7 @@ QVariantMap GlobalVariablesPostScriptModel::getQueryStatus(const QString &unique map["hasErrors"] = item->resultModel()->hasError(); map["errorMessage"] = item->resultModel()->networkError(); map["status"] = item->resultModel()->statusCode(); - map["responseSize"] = item->resultModel()->responseSize(); + map["responseSize"] = item->resultModel()->originResponseSize(); return map; } @@ -59,6 +74,6 @@ QList GlobalVariablesPostScriptModel::getQueryHeaders(const QString &un auto item = *iterator; - result.append(item->resultModel()->headers()); + result.append(item->resultModel()->rawHeaders()); return result; } diff --git a/src/Models/globalvariablespostscriptmodel.h b/src/Models/globalvariablespostscriptmodel.h index 541c9be..a386c96 100644 --- a/src/Models/globalvariablespostscriptmodel.h +++ b/src/Models/globalvariablespostscriptmodel.h @@ -1,3 +1,18 @@ +/* + ArdorQuery http tester + Copyright (C) 2022 Roman Vladimirov + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #ifndef GLOBALVARIABLESPOSTSCRIPTMODEL_H #define GLOBALVARIABLESPOSTSCRIPTMODEL_H diff --git a/src/Models/postscriptresultmodel.cpp b/src/Models/postscriptresultmodel.cpp index d183678..dd6e5a5 100644 --- a/src/Models/postscriptresultmodel.cpp +++ b/src/Models/postscriptresultmodel.cpp @@ -22,6 +22,12 @@ void PostScriptResultModel::setErrorMessage(const QString &errorMessage) noexcep emit errorMessageChanged(); } +void PostScriptResultModel::enableError(const QString &message) +{ + setHasErrors(true); + setErrorMessage(message); +} + void PostScriptResultModel::saveToFile(const QString &fileName, bool openAfterSave) { emit needSaveToFile(fileName, openAfterSave); diff --git a/src/Models/postscriptresultmodel.h b/src/Models/postscriptresultmodel.h index bbbd4f5..78c42c8 100644 --- a/src/Models/postscriptresultmodel.h +++ b/src/Models/postscriptresultmodel.h @@ -22,6 +22,7 @@ class PostScriptResultModel : public QObject QString errorMessage() const noexcept { return m_errorMessage; } void setErrorMessage(const QString& errorMessage) noexcept; + Q_INVOKABLE void enableError(const QString& message); Q_INVOKABLE void saveToFile(const QString& fileName, bool openAfterSave); signals: diff --git a/src/ViewModels/backendviewmodel.cpp b/src/ViewModels/backendviewmodel.cpp index b895921..233b711 100644 --- a/src/ViewModels/backendviewmodel.cpp +++ b/src/ViewModels/backendviewmodel.cpp @@ -427,7 +427,6 @@ void BackendViewModel::fillMappings() #endif m_shortcutCommandMapping.insert("control-backspace", m_changeSelectedQueryCommand); m_shortcutCommandMapping.insert("control-m", m_performQueriesMultipleCommand); - m_shortcutCommandMapping.insert("control-z", m_performQueryCommand); m_shortcutCommandMapping.insert("f5", m_performQueryCommand); m_shortcutCommandMapping.insert("control-b", m_cancelQueryCommand); m_shortcutCommandMapping.insert("f4", m_cancelQueryCommand); diff --git a/src/ViewModels/httprequestresultviewmodel.h b/src/ViewModels/httprequestresultviewmodel.h index 4e8231e..ddc324e 100644 --- a/src/ViewModels/httprequestresultviewmodel.h +++ b/src/ViewModels/httprequestresultviewmodel.h @@ -79,6 +79,8 @@ class HttpRequestResultViewModel : public QObject QStringList headers() const noexcept { return m_displayHeaders; } void setHeaders(const QStringList& headers) noexcept; + QStringList rawHeaders() const noexcept { return m_headers; } + void setBody(const QByteArray& body) noexcept; void reformatting() noexcept; diff --git a/src/ViewModels/openapiexporterviewmodel.cpp b/src/ViewModels/openapiexporterviewmodel.cpp index 9a7118d..346b295 100644 --- a/src/ViewModels/openapiexporterviewmodel.cpp +++ b/src/ViewModels/openapiexporterviewmodel.cpp @@ -637,7 +637,6 @@ void OpenApiExporterViewModel::writeCache(const QString& cacheFile, const QList< void OpenApiExporterViewModel::fillMappings() { m_shortcutCommandMapping.insert("f5", m_loadSchemaCommand); - m_shortcutCommandMapping.insert("control-z", m_loadSchemaCommand); m_shortcutCommandMapping.insert("f4", m_cancelLoadSchemaCommand); m_shortcutCommandMapping.insert("control-b", m_cancelLoadSchemaCommand); diff --git a/src/globalenums.h b/src/globalenums.h index 5bcab2a..a666eeb 100644 --- a/src/globalenums.h +++ b/src/globalenums.h @@ -1,3 +1,18 @@ +/* + ArdorQuery http tester + Copyright (C) 2022 Roman Vladimirov + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #ifndef GLOBALENUMS_H #define GLOBALENUMS_H diff --git a/src/globalhelpers.cpp b/src/globalhelpers.cpp index 8005be6..f8f0663 100644 --- a/src/globalhelpers.cpp +++ b/src/globalhelpers.cpp @@ -1,3 +1,18 @@ +/* + ArdorQuery http tester + Copyright (C) 2022 Roman Vladimirov + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #include #include "globalhelpers.h" #include "globalconstants.h" diff --git a/src/globalhelpers.h b/src/globalhelpers.h index ac54a77..6c1d10f 100644 --- a/src/globalhelpers.h +++ b/src/globalhelpers.h @@ -1,3 +1,18 @@ +/* + ArdorQuery http tester + Copyright (C) 2022 Roman Vladimirov + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + #include #include #include