feat(GODT-3121): implement suggestion list in bridge-gui.
This commit is contained in:
parent
2206cb3f12
commit
ebeca394c7
|
@ -66,11 +66,13 @@ add_executable(bridge-gui-tester
|
|||
GRPCQtProxy.cpp GRPCQtProxy.h
|
||||
GRPCService.cpp GRPCService.h
|
||||
GRPCServerWorker.cpp GRPCServerWorker.h
|
||||
Tabs/EventsTab.cpp Tabs/EventsTab.h
|
||||
Tabs/KnowledgeBaseTab.cpp Tabs/KnowledgeBaseTab.h
|
||||
Tabs/SettingsTab.cpp Tabs/SettingsTab.h
|
||||
Tabs/UsersTab.cpp Tabs/UsersTab.h
|
||||
UserDialog.cpp UserDialog.h
|
||||
UserTable.cpp UserTable.h
|
||||
)
|
||||
)
|
||||
|
||||
target_precompile_headers(bridge-gui-tester PRIVATE Pch.h)
|
||||
target_include_directories(bridge-gui-tester PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
|
|
@ -367,7 +367,7 @@ grpc::Status GRPCService::RequestKnowledgeBaseSuggestions(ServerContext*, String
|
|||
.url = QString("https://proton.me/support/bridge#%1").arg(i),
|
||||
});
|
||||
}
|
||||
qtProxy_.sendDelayedEvent(newKnowledgeBaseSuggestionsEvent(suggestions));
|
||||
qtProxy_.sendDelayedEvent(newKnowledgeBaseSuggestionsEvent(app().mainWindow().knowledgeBaseTab().getSuggestions()));
|
||||
return Status::OK;
|
||||
}
|
||||
|
||||
|
@ -377,19 +377,19 @@ grpc::Status GRPCService::RequestKnowledgeBaseSuggestions(ServerContext*, String
|
|||
//****************************************************************************************************************************************************
|
||||
Status GRPCService::ReportBug(ServerContext *, ReportBugRequest const *request, Empty *) {
|
||||
app().log().debug(__FUNCTION__);
|
||||
SettingsTab &tab = app().mainWindow().settingsTab();
|
||||
EventsTab const&eventsTab = app().mainWindow().eventsTab();
|
||||
qtProxy_.reportBug(QString::fromStdString(request->ostype()), QString::fromStdString(request->osversion()),
|
||||
QString::fromStdString(request->emailclient()), QString::fromStdString(request->address()), QString::fromStdString(request->description()),
|
||||
request->includelogs());
|
||||
SPStreamEvent event;
|
||||
switch (tab.nextBugReportResult()) {
|
||||
case SettingsTab::BugReportResult::Success:
|
||||
switch (eventsTab.nextBugReportResult()) {
|
||||
case EventsTab::BugReportResult::Success:
|
||||
event = newReportBugSuccessEvent();
|
||||
break;
|
||||
case SettingsTab::BugReportResult::Error:
|
||||
case EventsTab::BugReportResult::Error:
|
||||
event = newReportBugErrorEvent();
|
||||
break;
|
||||
case SettingsTab::BugReportResult::DataSharingError:
|
||||
case EventsTab::BugReportResult::DataSharingError:
|
||||
event = newReportBugFallbackEvent();
|
||||
break;
|
||||
}
|
||||
|
@ -559,11 +559,11 @@ Status GRPCService::DiskCachePath(ServerContext *, Empty const *, StringValue *r
|
|||
Status GRPCService::SetDiskCachePath(ServerContext *, StringValue const *path, Empty *) {
|
||||
app().log().debug(__FUNCTION__);
|
||||
|
||||
SettingsTab &tab = app().mainWindow().settingsTab();
|
||||
EventsTab &eventsTab = app().mainWindow().eventsTab();
|
||||
QString const qPath = QString::fromStdString(path->value());
|
||||
|
||||
// we mimic the behaviour of Bridge
|
||||
if (!tab.nextCacheChangeWillSucceed()) {
|
||||
if (!eventsTab.nextCacheChangeWillSucceed()) {
|
||||
qtProxy_.sendDelayedEvent(newDiskCacheErrorEvent(grpc::DiskCacheErrorType(CANT_MOVE_DISK_CACHE_ERROR)));
|
||||
} else {
|
||||
qtProxy_.setDiskCachePath(qPath);
|
||||
|
@ -643,7 +643,7 @@ Status GRPCService::Hostname(ServerContext *, Empty const *, StringValue *respon
|
|||
//****************************************************************************************************************************************************
|
||||
Status GRPCService::IsPortFree(ServerContext *, Int32Value const *request, BoolValue *response) {
|
||||
app().log().debug(__FUNCTION__);
|
||||
response->set_value(app().mainWindow().settingsTab().isPortFree());
|
||||
response->set_value(app().mainWindow().eventsTab().isPortFree());
|
||||
return Status::OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -71,11 +71,27 @@ SettingsTab &MainWindow::settingsTab() {
|
|||
//****************************************************************************************************************************************************
|
||||
/// \return A reference to the users tab.
|
||||
//****************************************************************************************************************************************************
|
||||
UsersTab &MainWindow::usersTab() {
|
||||
UsersTab &MainWindow::usersTab() const {
|
||||
return *ui_.usersTab;
|
||||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \return A reference to the events tab.
|
||||
//****************************************************************************************************************************************************
|
||||
EventsTab& MainWindow::eventsTab() const {
|
||||
return *ui_.eventsTab;
|
||||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \return A reference to the knowledge base tab.
|
||||
//****************************************************************************************************************************************************
|
||||
KnowledgeBaseTab& MainWindow::knowledgeBaseTab() const {
|
||||
return *ui_.knowledgeBaseTab;
|
||||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \param[in] level The log level.
|
||||
/// \param[in] message The log message
|
||||
|
@ -98,7 +114,7 @@ void MainWindow::addBridgeGUILogEntry(bridgepp::Log::Level level, const QString
|
|||
/// \param[in] event The event.
|
||||
//****************************************************************************************************************************************************
|
||||
void MainWindow::sendDelayedEvent(SPStreamEvent const &event) {
|
||||
QTimer::singleShot(this->settingsTab().eventDelayMs(), [event] { app().grpc().sendEvent(event); });
|
||||
QTimer::singleShot(this->eventsTab().eventDelayMs(), [event] { app().grpc().sendEvent(event); });
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -39,7 +39,9 @@ public: // member functions.
|
|||
MainWindow &operator=(MainWindow &&) = delete; ///< Disabled move assignment operator.
|
||||
|
||||
SettingsTab &settingsTab(); ///< Returns a reference the 'Settings' tab.
|
||||
UsersTab &usersTab(); ///< Returns a reference to the 'Users' tab.
|
||||
UsersTab &usersTab() const; ///< Returns a reference to the 'Users' tab.
|
||||
EventsTab &eventsTab() const; ///< Returns a reference to the 'Events' tab.
|
||||
KnowledgeBaseTab &knowledgeBaseTab() const; ///< Returns a reference to the 'Knowledge Base' tab.
|
||||
|
||||
public slots:
|
||||
void sendDelayedEvent(bridgepp::SPStreamEvent const &event); ///< Sends a gRPC event after the delay specified in the UI. The call is non blocking.
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1226</width>
|
||||
<height>1086</height>
|
||||
<width>1096</width>
|
||||
<height>876</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
@ -22,7 +22,7 @@
|
|||
</property>
|
||||
<widget class="QTabWidget" name="tabTop">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
<number>3</number>
|
||||
</property>
|
||||
<widget class="SettingsTab" name="settingsTab">
|
||||
<attribute name="title">
|
||||
|
@ -34,6 +34,16 @@
|
|||
<string>Users</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="EventsTab" name="eventsTab">
|
||||
<attribute name="title">
|
||||
<string>Events && Errors</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="KnowledgeBaseTab" name="knowledgeBaseTab">
|
||||
<attribute name="title">
|
||||
<string>Knowledge Base</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QTabWidget" name="tabBottom">
|
||||
<property name="currentIndex">
|
||||
|
@ -96,6 +106,18 @@
|
|||
<header>Tabs/UsersTab.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>EventsTab</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>Tabs/EventsTab.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>KnowledgeBaseTab</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>Tabs/KnowledgeBaseTab.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
|
|
@ -0,0 +1,116 @@
|
|||
// Copyright (c) 2023 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
// Proton Mail Bridge 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.
|
||||
//
|
||||
// Proton Mail Bridge 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 Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
#include "EventsTab.h"
|
||||
#include "GRPCService.h"
|
||||
#include <bridgepp/GRPC/EventFactory.h>
|
||||
|
||||
|
||||
using namespace bridgepp;
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \brief Connect an address error button to the generation of an address error event.
|
||||
///
|
||||
/// \param[in] button The error button.
|
||||
/// \param[in] edit The edit containing the address.
|
||||
/// \param[in] eventGenerator The factory function creating the event.
|
||||
//****************************************************************************************************************************************************
|
||||
void connectAddressError(QPushButton* button, QLineEdit* edit, bridgepp::SPStreamEvent (*eventGenerator)(QString const&)) {
|
||||
QObject::connect(button, &QPushButton::clicked, [edit, eventGenerator]() { app().grpc().sendEvent(eventGenerator(edit->text())); });
|
||||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \param[in] parent The parent widget.
|
||||
//****************************************************************************************************************************************************
|
||||
EventsTab::EventsTab(QWidget* parent)
|
||||
: QWidget(parent) {
|
||||
ui_.setupUi(this);
|
||||
this->resetUI();
|
||||
|
||||
connect(ui_.buttonInternetOn, &QPushButton::clicked, []() { app().grpc().sendEvent(newInternetStatusEvent(true)); });
|
||||
connect(ui_.buttonInternetOff, &QPushButton::clicked, []() { app().grpc().sendEvent(newInternetStatusEvent(false)); });
|
||||
connect(ui_.buttonShowMainWindow, &QPushButton::clicked, []() { app().grpc().sendEvent(newShowMainWindowEvent()); });
|
||||
connect(ui_.buttonNoKeychain, &QPushButton::clicked, []() { app().grpc().sendEvent(newHasNoKeychainEvent()); });
|
||||
connect(ui_.buttonAPICertIssue, &QPushButton::clicked, []() { app().grpc().sendEvent(newApiCertIssueEvent()); });
|
||||
connectAddressError(ui_.buttonAddressChanged, ui_.editAddressErrors, newAddressChangedEvent);
|
||||
connectAddressError(ui_.buttonAddressChangedLogout, ui_.editAddressErrors, newAddressChangedLogoutEvent);
|
||||
//connect(ui_.checkNextCacheChangeWillSucceed, &QCheckBox::toggled, this, &SettingsTab::updateGUIState);
|
||||
connect(ui_.buttonUpdateError, &QPushButton::clicked, [&]() {
|
||||
app().grpc().sendEvent(newUpdateErrorEvent(static_cast<grpc::UpdateErrorType>(ui_.comboUpdateError->currentIndex())));
|
||||
});
|
||||
connect(ui_.buttonUpdateManualReady, &QPushButton::clicked, [&] {
|
||||
app().grpc().sendEvent(newUpdateManualReadyEvent(ui_.editUpdateVersion->text()));
|
||||
});
|
||||
connect(ui_.buttonUpdateForce, &QPushButton::clicked, [&] {
|
||||
app().grpc().sendEvent(newUpdateForceEvent(ui_.editUpdateVersion->text()));
|
||||
});
|
||||
connect(ui_.buttonUpdateManualRestart, &QPushButton::clicked, []() { app().grpc().sendEvent(newUpdateManualRestartNeededEvent()); });
|
||||
connect(ui_.buttonUpdateSilentRestart, &QPushButton::clicked, []() { app().grpc().sendEvent(newUpdateSilentRestartNeededEvent()); });
|
||||
connect(ui_.buttonUpdateIsLatest, &QPushButton::clicked, []() { app().grpc().sendEvent(newUpdateIsLatestVersionEvent()); });
|
||||
connect(ui_.buttonUpdateCheckFinished, &QPushButton::clicked, []() { app().grpc().sendEvent(newUpdateCheckFinishedEvent()); });
|
||||
connect(ui_.buttonUpdateVersionChanged, &QPushButton::clicked, []() { app().grpc().sendEvent(newUpdateVersionChangedEvent()); });
|
||||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \return The delay to apply before sending automatically generated events.
|
||||
//****************************************************************************************************************************************************
|
||||
qint32 EventsTab::eventDelayMs() const {
|
||||
return ui_.spinEventDelay->value();
|
||||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
//
|
||||
//****************************************************************************************************************************************************
|
||||
void EventsTab::updateGUIState() {
|
||||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \return The bug report results
|
||||
//****************************************************************************************************************************************************
|
||||
EventsTab::BugReportResult EventsTab::nextBugReportResult() const {
|
||||
return static_cast<BugReportResult>(ui_.comboBugReportResult->currentIndex());
|
||||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \return The reply for the next IsPortFree gRPC call.
|
||||
//****************************************************************************************************************************************************
|
||||
bool EventsTab::isPortFree() const {
|
||||
return ui_.checkIsPortFree->isChecked();
|
||||
}
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \return The value for the 'Next Cache Change Will Succeed' check box.
|
||||
//****************************************************************************************************************************************************
|
||||
bool EventsTab::nextCacheChangeWillSucceed() const {
|
||||
return ui_.checkNextCacheChangeWillSucceed->isChecked();
|
||||
}
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
//
|
||||
//****************************************************************************************************************************************************
|
||||
void EventsTab::resetUI() const {
|
||||
ui_.comboBugReportResult->setCurrentIndex(0);
|
||||
ui_.checkIsPortFree->setChecked(true);
|
||||
ui_.checkNextCacheChangeWillSucceed->setChecked(true);
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
// Copyright (c) 2023 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
// Proton Mail Bridge 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.
|
||||
//
|
||||
// Proton Mail Bridge 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 Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
#ifndef BRIDGE_GUI_TESTER_EVENTS_TAB_H
|
||||
#define BRIDGE_GUI_TESTER_EVENTS_TAB_H
|
||||
|
||||
|
||||
#include "ui_EventsTab.h"
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \brief Events tabs
|
||||
//****************************************************************************************************************************************************
|
||||
class EventsTab: public QWidget {
|
||||
Q_OBJECT
|
||||
|
||||
public: // data types
|
||||
enum class BugReportResult {
|
||||
Success = 0,
|
||||
Error = 1,
|
||||
DataSharingError = 2,
|
||||
}; ///< Enumeration for the result of bug report sending
|
||||
|
||||
public: // member functions.
|
||||
explicit EventsTab(QWidget *parent = nullptr); ///< Default constructor.
|
||||
EventsTab(EventsTab const&) = delete; ///< Disabled copy-constructor.
|
||||
EventsTab(EventsTab&&) = delete; ///< Disabled assignment copy-constructor.
|
||||
~EventsTab() override = default; ///< Destructor.
|
||||
EventsTab& operator=(EventsTab const&) = delete; ///< Disabled assignment operator.
|
||||
EventsTab& operator=(EventsTab&&) = delete; ///< Disabled move assignment operator.
|
||||
|
||||
qint32 eventDelayMs() const; ///< Get the delay for sending automatically generated events.
|
||||
void updateGUIState(); ///< Update the GUI state.
|
||||
BugReportResult nextBugReportResult() const; ///< Get the value of the 'Next bug report result' combo box.
|
||||
bool isPortFree() const; ///< Get the value for the "Is Port Free" check box.
|
||||
bool nextCacheChangeWillSucceed() const; ///< Get the value for the 'Next Cache Change will succeed' edit.
|
||||
|
||||
void resetUI() const; ///< Resets the UI.
|
||||
|
||||
private: // data members
|
||||
Ui::EventsTab ui_; ///< The UI for the widget.
|
||||
};
|
||||
|
||||
|
||||
#endif
|
|
@ -0,0 +1,359 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>EventsTab</class>
|
||||
<widget class="QWidget" name="EventsTab">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>563</width>
|
||||
<height>571</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_11">
|
||||
<item>
|
||||
<widget class="QLabel" name="labelEventDelay">
|
||||
<property name="toolTip">
|
||||
<string>Delay applied before sending automatically generated events</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Delay for asynchronous events</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="spinEventDelay">
|
||||
<property name="suffix">
|
||||
<string> ms</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>3600000</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>1</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Address related errors</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_9">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_12">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Address</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="editAddressErrors">
|
||||
<property name="text">
|
||||
<string>dummy.user@proton.me</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_15">
|
||||
<item>
|
||||
<widget class="QPushButton" name="buttonAddressChanged">
|
||||
<property name="text">
|
||||
<string>Address Changed</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="buttonAddressChangedLogout">
|
||||
<property name="text">
|
||||
<string>Address Changed Logout</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="2">
|
||||
<widget class="QCheckBox" name="checkNextCacheChangeWillSucceed">
|
||||
<property name="text">
|
||||
<string>Next Cache Change will succeed</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>1</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QCheckBox" name="checkIsPortFree">
|
||||
<property name="text">
|
||||
<string>Reply true to the next 'Is Port Free' request.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_13">
|
||||
<item>
|
||||
<widget class="QLabel" name="labelNextBugReportResult">
|
||||
<property name="text">
|
||||
<string>Next bug report result</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboBugReportResult">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Success</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Error</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Data sharing error</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>1</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout_6">
|
||||
<property name="verticalSpacing">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QPushButton" name="buttonUpdateManualReady">
|
||||
<property name="text">
|
||||
<string>Update Manual Ready</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLineEdit" name="editUpdateVersion">
|
||||
<property name="text">
|
||||
<string>4.0</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QPushButton" name="buttonUpdateVersionChanged">
|
||||
<property name="text">
|
||||
<string>Update version changed</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QPushButton" name="buttonUpdateForce">
|
||||
<property name="text">
|
||||
<string>Update Force</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="buttonUpdateManualRestart">
|
||||
<property name="text">
|
||||
<string>Update manual restart</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="buttonUpdateCheckFinished">
|
||||
<property name="text">
|
||||
<string>Update check finished</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="buttonUpdateSilentRestart">
|
||||
<property name="text">
|
||||
<string>Update silent restart</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QComboBox" name="comboUpdateError">
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QComboBox::AdjustToContents</enum>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Update manual error</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Update force error</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Update silent error</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QPushButton" name="buttonUpdateError">
|
||||
<property name="text">
|
||||
<string>Update error</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QPushButton" name="buttonUpdateIsLatest">
|
||||
<property name="text">
|
||||
<string>Update is latest</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1" colspan="2">
|
||||
<spacer name="horizontalSpacer_6">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>1</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
<property name="horizontalSpacing">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
<property name="verticalSpacing">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<item row="0" column="1">
|
||||
<widget class="QPushButton" name="buttonInternetOn">
|
||||
<property name="text">
|
||||
<string>Internet On</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QPushButton" name="buttonShowMainWindow">
|
||||
<property name="text">
|
||||
<string>Show Main Window</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QPushButton" name="buttonInternetOff">
|
||||
<property name="text">
|
||||
<string>Internet Off</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="buttonAPICertIssue">
|
||||
<property name="text">
|
||||
<string>API Certficate Issue</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="buttonNoKeychain">
|
||||
<property name="text">
|
||||
<string>No Keychain</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>200</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
|
@ -0,0 +1,86 @@
|
|||
// Copyright (c) 2023 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
// Proton Mail Bridge 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.
|
||||
//
|
||||
// Proton Mail Bridge 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 Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
#include "KnowledgeBaseTab.h"
|
||||
|
||||
#include "GRPCService.h"
|
||||
#include "bridgepp/GRPC/EventFactory.h"
|
||||
|
||||
|
||||
using namespace bridgepp;
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \param[in] parent The parent widget of the tab.
|
||||
//****************************************************************************************************************************************************
|
||||
KnowledgeBaseTab::KnowledgeBaseTab(QWidget* parent)
|
||||
: QWidget(parent) {
|
||||
ui_.setupUi(this);
|
||||
|
||||
connect(ui_.checkSuggestion1, &QCheckBox::stateChanged, this, &KnowledgeBaseTab::updateGuiState);
|
||||
connect(ui_.checkSuggestion2, &QCheckBox::stateChanged, this, &KnowledgeBaseTab::updateGuiState);
|
||||
connect(ui_.checkSuggestion3, &QCheckBox::stateChanged, this, &KnowledgeBaseTab::updateGuiState);
|
||||
connect(ui_.buttonSend, &QCheckBox::clicked, this, &KnowledgeBaseTab::sendKnowledgeBaseSuggestions);
|
||||
|
||||
}
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \param[in] checkbox The check box.
|
||||
/// \param[in] widgets The widgets to conditionally enable.
|
||||
//****************************************************************************************************************************************************
|
||||
void enableWidgetsIfChecked(QCheckBox const* checkbox, QWidgetList const& widgets) {
|
||||
bool const checked = checkbox->isChecked();
|
||||
for (QWidget *const widget: widgets) {
|
||||
widget->setEnabled(checked);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \return The suggestions.
|
||||
//****************************************************************************************************************************************************
|
||||
QList<KnowledgeBaseSuggestion> KnowledgeBaseTab::getSuggestions() const {
|
||||
QList<KnowledgeBaseSuggestion> result;
|
||||
if (ui_.checkSuggestion1->isChecked()) {
|
||||
result.push_back({ .url = ui_.editUrl1->text(), .title = ui_.editTitle1->text() });
|
||||
}
|
||||
if (ui_.checkSuggestion2->isChecked()) {
|
||||
result.push_back({ .url = ui_.editUrl2->text(), .title = ui_.editTitle2->text() });
|
||||
}
|
||||
if (ui_.checkSuggestion3->isChecked()) {
|
||||
result.push_back({ .url = ui_.editUrl3->text(), .title = ui_.editTitle3->text() });
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
//
|
||||
//****************************************************************************************************************************************************
|
||||
void KnowledgeBaseTab::sendKnowledgeBaseSuggestions() const {
|
||||
app().grpc().sendEvent(newKnowledgeBaseSuggestionsEvent(this->getSuggestions()));
|
||||
}
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
//
|
||||
//****************************************************************************************************************************************************
|
||||
void KnowledgeBaseTab::updateGuiState() {
|
||||
enableWidgetsIfChecked(ui_.checkSuggestion1, { ui_.labelTitle1, ui_.editTitle1, ui_.labelUrl1, ui_.editUrl1});
|
||||
enableWidgetsIfChecked(ui_.checkSuggestion2, { ui_.labelTitle2, ui_.editTitle2, ui_.labelUrl2, ui_.editUrl2});
|
||||
enableWidgetsIfChecked(ui_.checkSuggestion3, { ui_.labelTitle3, ui_.editTitle3, ui_.labelUrl3, ui_.editUrl3});
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
// Copyright (c) 2023 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
// Proton Mail Bridge 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.
|
||||
//
|
||||
// Proton Mail Bridge 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 Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
#ifndef BRIDGE_GUI_TESTER_KNOWLEDGE_BASE_TAB_H
|
||||
#define BRIDGE_GUI_TESTER_KNOWLEDGE_BASE_TAB_H
|
||||
|
||||
|
||||
#include "ui_KnowledgeBaseTab.h"
|
||||
#include <bridgepp/GRPC/GRPCClient.h>
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \brief Knowledge base table.
|
||||
//****************************************************************************************************************************************************
|
||||
class KnowledgeBaseTab: public QWidget {
|
||||
public: // member functions.
|
||||
explicit KnowledgeBaseTab(QWidget *parent = nullptr); ///< Default constructor.
|
||||
KnowledgeBaseTab(KnowledgeBaseTab const&) = delete; ///< Disabled copy-constructor.
|
||||
KnowledgeBaseTab(KnowledgeBaseTab&&) = delete; ///< Disabled assignment copy-constructor.
|
||||
~KnowledgeBaseTab() override = default; ///< Destructor.
|
||||
KnowledgeBaseTab& operator=(KnowledgeBaseTab const&) = delete; ///< Disabled assignment operator.
|
||||
KnowledgeBaseTab& operator=(KnowledgeBaseTab&&) = delete; ///< Disabled move assignment operator.
|
||||
QList<bridgepp::KnowledgeBaseSuggestion> getSuggestions() const; ///< Returns the suggestions.
|
||||
|
||||
private slots:
|
||||
void sendKnowledgeBaseSuggestions() const; ///< Send a KnowledgeBaseSuggestions event.
|
||||
void updateGuiState(); ///< Update the GUI state.
|
||||
|
||||
private: // data members
|
||||
Ui::KnowledgeBaseTab ui_ {}; ///< The UI for the widget.
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif //BRIDGE_GUI_TESTER_KNOWLEDGE_BASE_TAB_H
|
|
@ -0,0 +1,202 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>KnowledgeBaseTab</class>
|
||||
<widget class="QWidget" name="KnowledgeBaseTab">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>483</width>
|
||||
<height>715</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="spacing">
|
||||
<number>5</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBoxSuggestion1">
|
||||
<property name="title">
|
||||
<string>Suggestion 1</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="checkSuggestion1">
|
||||
<property name="text">
|
||||
<string>Enabled</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="labelTitle1">
|
||||
<property name="text">
|
||||
<string>Title</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="editTitle1">
|
||||
<property name="text">
|
||||
<string>Automatically start Bridge</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="labelUrl1">
|
||||
<property name="text">
|
||||
<string>URL</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="editUrl1">
|
||||
<property name="text">
|
||||
<string>https://proton.me/support/automatically-start-bridge</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBoxSuggestion2">
|
||||
<property name="title">
|
||||
<string>Suggestion 2</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="checkSuggestion2">
|
||||
<property name="text">
|
||||
<string>Enabled</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="labelTitle2">
|
||||
<property name="text">
|
||||
<string>Title</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="editTitle2">
|
||||
<property name="text">
|
||||
<string>Proton Mail Bridge connection issues with Thunderbird, Outlook, and Apple Mail</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="labelUrl2">
|
||||
<property name="text">
|
||||
<string>URL</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="editUrl2">
|
||||
<property name="text">
|
||||
<string>https://proton.me/support/bridge-ssl-connection-issue</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBoxSuggestion3">
|
||||
<property name="title">
|
||||
<string>Suggestion 3</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QCheckBox" name="checkSuggestion3">
|
||||
<property name="text">
|
||||
<string>Enabled</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="labelTitle3">
|
||||
<property name="text">
|
||||
<string>Title</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="editTitle3">
|
||||
<property name="text">
|
||||
<string>Difference between combined addresses mode and split addresses mode</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="labelUrl3">
|
||||
<property name="text">
|
||||
<string>URL</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="editUrl3">
|
||||
<property name="text">
|
||||
<string>https://proton.me/support/difference-combined-addresses-mode-split-addresses-mode</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="buttonSend">
|
||||
<property name="text">
|
||||
<string>Send Knowledge Base Suggestions</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
|
@ -31,18 +31,6 @@ QString const colorSchemeLight = "light"; ///< THe light color scheme name.
|
|||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \brief Connect an address error button to the generation of an address error event.
|
||||
///
|
||||
/// \param[in] button The error button.
|
||||
/// \param[in] edit The edit containing the address.
|
||||
/// \param[in] eventGenerator The factory function creating the event.
|
||||
//****************************************************************************************************************************************************
|
||||
void connectAddressError(QPushButton *button, QLineEdit* edit, bridgepp::SPStreamEvent (*eventGenerator)(QString const &)) {
|
||||
QObject::connect(button, &QPushButton::clicked, [edit, eventGenerator]() { app().grpc().sendEvent(eventGenerator(edit->text())); });
|
||||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \param[in] parent The parent widget of the tab.
|
||||
//****************************************************************************************************************************************************
|
||||
|
@ -50,29 +38,6 @@ SettingsTab::SettingsTab(QWidget *parent)
|
|||
: QWidget(parent) {
|
||||
ui_.setupUi(this);
|
||||
|
||||
connect(ui_.buttonInternetOn, &QPushButton::clicked, []() { app().grpc().sendEvent(newInternetStatusEvent(true)); });
|
||||
connect(ui_.buttonInternetOff, &QPushButton::clicked, []() { app().grpc().sendEvent(newInternetStatusEvent(false)); });
|
||||
connect(ui_.buttonShowMainWindow, &QPushButton::clicked, []() { app().grpc().sendEvent(newShowMainWindowEvent()); });
|
||||
connect(ui_.buttonNoKeychain, &QPushButton::clicked, []() { app().grpc().sendEvent(newHasNoKeychainEvent()); });
|
||||
connect(ui_.buttonAPICertIssue, &QPushButton::clicked, []() { app().grpc().sendEvent(newApiCertIssueEvent()); });
|
||||
connectAddressError(ui_.buttonAddressChanged, ui_.editAddressErrors, newAddressChangedEvent);
|
||||
connectAddressError(ui_.buttonAddressChangedLogout, ui_.editAddressErrors, newAddressChangedLogoutEvent);
|
||||
connect(ui_.checkNextCacheChangeWillSucceed, &QCheckBox::toggled, this, &SettingsTab::updateGUIState);
|
||||
connect(ui_.buttonUpdateError, &QPushButton::clicked, [&]() {
|
||||
app().grpc().sendEvent(newUpdateErrorEvent(static_cast<grpc::UpdateErrorType>(ui_.comboUpdateError->currentIndex())));
|
||||
});
|
||||
connect(ui_.buttonUpdateManualReady, &QPushButton::clicked, [&] {
|
||||
app().grpc().sendEvent(newUpdateManualReadyEvent(ui_.editUpdateVersion->text()));
|
||||
});
|
||||
connect(ui_.buttonUpdateForce, &QPushButton::clicked, [&] {
|
||||
app().grpc().sendEvent(newUpdateForceEvent(ui_.editUpdateVersion->text()));
|
||||
});
|
||||
connect(ui_.buttonUpdateManualRestart, &QPushButton::clicked, []() { app().grpc().sendEvent(newUpdateManualRestartNeededEvent()); });
|
||||
connect(ui_.buttonUpdateSilentRestart, &QPushButton::clicked, []() { app().grpc().sendEvent(newUpdateSilentRestartNeededEvent()); });
|
||||
connect(ui_.buttonUpdateIsLatest, &QPushButton::clicked, []() { app().grpc().sendEvent(newUpdateIsLatestVersionEvent()); });
|
||||
connect(ui_.buttonUpdateCheckFinished, &QPushButton::clicked, []() { app().grpc().sendEvent(newUpdateCheckFinishedEvent()); });
|
||||
connect(ui_.buttonUpdateVersionChanged, &QPushButton::clicked, []() { app().grpc().sendEvent(newUpdateVersionChangedEvent()); });
|
||||
|
||||
this->resetUI();
|
||||
this->updateGUIState();
|
||||
}
|
||||
|
@ -235,14 +200,6 @@ void SettingsTab::setIsTelemetryDisabled(bool isDisabled) {
|
|||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \return The delay to apply before sending automatically generated events.
|
||||
//****************************************************************************************************************************************************
|
||||
qint32 SettingsTab::eventDelayMs() const {
|
||||
return ui_.spinEventDelay->value();
|
||||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \return The path
|
||||
//****************************************************************************************************************************************************
|
||||
|
@ -319,14 +276,6 @@ void SettingsTab::exportTLSCertificates(QString const &folderPath) {
|
|||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \return The state of the check box.
|
||||
//****************************************************************************************************************************************************
|
||||
SettingsTab::BugReportResult SettingsTab::nextBugReportResult() const {
|
||||
return BugReportResult(ui_.comboBugReportResult->currentIndex());
|
||||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \return the state of the 'TLS Certificate is installed' check box.
|
||||
//****************************************************************************************************************************************************
|
||||
|
@ -429,14 +378,6 @@ void SettingsTab::setIsDoHEnabled(bool enabled) {
|
|||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \return The reply for the next IsPortFree gRPC call.
|
||||
//****************************************************************************************************************************************************
|
||||
bool SettingsTab::isPortFree() const {
|
||||
return ui_.checkIsPortFree->isChecked();
|
||||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \param[in] path The path of the local cache.
|
||||
//****************************************************************************************************************************************************
|
||||
|
@ -453,14 +394,6 @@ QString SettingsTab::diskCachePath() const {
|
|||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \return The value for the 'Next Cache Change Will Succeed' check box.
|
||||
//****************************************************************************************************************************************************
|
||||
bool SettingsTab::nextCacheChangeWillSucceed() const {
|
||||
return ui_.checkNextCacheChangeWillSucceed->isChecked();
|
||||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************************************************
|
||||
/// \return the value for the 'Automatic Update' check.
|
||||
//****************************************************************************************************************************************************
|
||||
|
@ -521,19 +454,16 @@ void SettingsTab::resetUI() {
|
|||
ui_.editAddress->setText(QString());
|
||||
ui_.editDescription->setPlainText(QString());
|
||||
ui_.labelIncludeLogsValue->setText(QString());
|
||||
ui_.comboBugReportResult->setCurrentIndex(0);
|
||||
|
||||
ui_.editHostname->setText("localhost");
|
||||
ui_.spinPortIMAP->setValue(1143);
|
||||
ui_.spinPortSMTP->setValue(1025);
|
||||
ui_.checkUseSSLForSMTP->setChecked(false);
|
||||
ui_.checkDoHEnabled->setChecked(true);
|
||||
ui_.checkIsPortFree->setChecked(true);
|
||||
|
||||
QString const cacheDir = QDir(tmpDir).absoluteFilePath("cache");
|
||||
QDir().mkpath(cacheDir);
|
||||
ui_.editDiskCachePath->setText(QDir::toNativeSeparators(cacheDir));
|
||||
ui_.checkNextCacheChangeWillSucceed->setChecked(true);
|
||||
|
||||
ui_.checkAutomaticUpdate->setChecked(true);
|
||||
|
||||
|
|
|
@ -35,12 +35,6 @@ public: // data types.
|
|||
Failure = 2
|
||||
}; ///< Enumeration for the result of a TLS certificate installation.
|
||||
|
||||
enum class BugReportResult {
|
||||
Success = 0,
|
||||
Error = 1,
|
||||
DataSharingError = 2,
|
||||
}; ///< Enumeration for the result of bug report sending
|
||||
|
||||
public: // member functions.
|
||||
explicit SettingsTab(QWidget *parent = nullptr); ///< Default constructor.
|
||||
SettingsTab(SettingsTab const &) = delete; ///< Disabled copy-constructor.
|
||||
|
@ -60,13 +54,11 @@ public: // member functions.
|
|||
bool isAllMailVisible() const; ///< Get the value for the 'All Mail Visible' check.
|
||||
bool isTelemetryDisabled() const; ///< Get the value for the 'Disable Telemetry' check box.
|
||||
QString colorSchemeName() const; ///< Get the value of the 'Use Dark Theme' checkbox.
|
||||
qint32 eventDelayMs() const; ///< Get the delay for sending automatically generated events.
|
||||
QString logsPath() const; ///< Get the content of the 'Logs Path' edit.
|
||||
QString licensePath() const; ///< Get the content of the 'License Path' edit.
|
||||
QString releaseNotesPageLink() const; ///< Get the content of the 'Release Notes Page Link' edit.
|
||||
QString dependencyLicenseLink() const; ///< Get the content of the 'Dependency License Link' edit.
|
||||
QString landingPageLink() const; ///< Get the content of the 'Landing Page Link' edit.
|
||||
BugReportResult nextBugReportResult() const; ///< Get the value of the 'Next bug report result' combo box.
|
||||
bool isTLSCertificateInstalled() const; ///< Get the status of the 'TLS Certificate is installed' check box.
|
||||
TLSCertInstallResult nextTLSCertInstallResult() const; ///< Get the value of the 'Next TLS Certificate install result' combo box.
|
||||
bool nextTLSCertExportWillSucceed() const; ///< Get the status of the 'Next TLS Cert export will succeed' check box.
|
||||
|
@ -77,9 +69,7 @@ public: // member functions.
|
|||
bool useSSLForSMTP() const; ///< Get the value for the 'Use SSL for SMTP' check box.
|
||||
bool useSSLForIMAP() const; ///< Get the value for the 'Use SSL for IMAP' check box.
|
||||
bool isDoHEnabled() const; ///< Get the value for the 'DoH Enabled' check box.
|
||||
bool isPortFree() const; ///< Get the value for the "Is Port Free" check box.
|
||||
QString diskCachePath() const; ///< Get the value for the 'Disk Cache Path' edit.
|
||||
bool nextCacheChangeWillSucceed() const; ///< Get the value for the 'Next Cache Change will succeed' edit.
|
||||
bool isAutomaticUpdateOn() const; ///<Get the value for the 'Automatic Update' check box.
|
||||
|
||||
public slots:
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1160</width>
|
||||
<height>777</height>
|
||||
<width>1146</width>
|
||||
<height>716</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
@ -208,7 +208,7 @@
|
|||
<widget class="QLineEdit" name="editHostname">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
|
@ -749,328 +749,6 @@
|
|||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupApp">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Events && Errors</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_8">
|
||||
<property name="spacing">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_11">
|
||||
<item>
|
||||
<widget class="QLabel" name="labelEventDelay">
|
||||
<property name="toolTip">
|
||||
<string>Delay applied before sending automatically generated events</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Delay for asynchronous events</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="spinEventDelay">
|
||||
<property name="suffix">
|
||||
<string> ms</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>3600000</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_5">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>1</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
<property name="horizontalSpacing">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
<property name="verticalSpacing">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<item row="0" column="1">
|
||||
<widget class="QPushButton" name="buttonInternetOn">
|
||||
<property name="text">
|
||||
<string>Internet On</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QPushButton" name="buttonShowMainWindow">
|
||||
<property name="text">
|
||||
<string>Show Main Window</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QPushButton" name="buttonInternetOff">
|
||||
<property name="text">
|
||||
<string>Internet Off</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="buttonAPICertIssue">
|
||||
<property name="text">
|
||||
<string>API Certficate Issue</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="buttonNoKeychain">
|
||||
<property name="text">
|
||||
<string>No Keychain</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Address related errors</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_9">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_12">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Address</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="editAddressErrors">
|
||||
<property name="text">
|
||||
<string>dummy.user@proton.me</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_15">
|
||||
<item>
|
||||
<widget class="QPushButton" name="buttonAddressChanged">
|
||||
<property name="text">
|
||||
<string>Address Changed</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="buttonAddressChangedLogout">
|
||||
<property name="text">
|
||||
<string>Address Changed Logout</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkIsPortFree">
|
||||
<property name="text">
|
||||
<string>Reply true to the next 'Is Port Free' request.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkNextCacheChangeWillSucceed">
|
||||
<property name="text">
|
||||
<string>Next Cache Change will succeed</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_13">
|
||||
<item>
|
||||
<widget class="QLabel" name="labelNextBugReportResult">
|
||||
<property name="text">
|
||||
<string>Next bug report result</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboBugReportResult">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Success</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Error</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Data sharing error</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>1</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout_6">
|
||||
<property name="verticalSpacing">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QPushButton" name="buttonUpdateManualReady">
|
||||
<property name="text">
|
||||
<string>Update Manual Ready</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QLineEdit" name="editUpdateVersion">
|
||||
<property name="text">
|
||||
<string>4.0</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QPushButton" name="buttonUpdateVersionChanged">
|
||||
<property name="text">
|
||||
<string>Update version changed</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QPushButton" name="buttonUpdateForce">
|
||||
<property name="text">
|
||||
<string>Update Force</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QPushButton" name="buttonUpdateManualRestart">
|
||||
<property name="text">
|
||||
<string>Update manual restart</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="buttonUpdateCheckFinished">
|
||||
<property name="text">
|
||||
<string>Update check finished</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="buttonUpdateSilentRestart">
|
||||
<property name="text">
|
||||
<string>Update silent restart</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QComboBox" name="comboUpdateError">
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QComboBox::AdjustToContents</enum>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Update manual error</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Update force error</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Update silent error</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QPushButton" name="buttonUpdateError">
|
||||
<property name="text">
|
||||
<string>Update error</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QPushButton" name="buttonUpdateIsLatest">
|
||||
<property name="text">
|
||||
<string>Update is latest</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1" colspan="2">
|
||||
<spacer name="horizontalSpacer_6">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>1</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
|
@ -1096,8 +774,6 @@
|
|||
<tabstop>editDiskCachePath</tabstop>
|
||||
<tabstop>editOSVersion</tabstop>
|
||||
<tabstop>editEmailClient</tabstop>
|
||||
<tabstop>spinEventDelay</tabstop>
|
||||
<tabstop>checkIsPortFree</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
|
Loading…
Reference in New Issue