forked from Silverfish/proton-bridge
GODT-1824: sign-in error label did not wrap.
This commit is contained in:
@ -392,7 +392,7 @@ Status GRPCService::Login(ServerContext *, LoginRequest const *request, Empty *)
|
|||||||
loginUsername_ = QString::fromStdString(request->username());
|
loginUsername_ = QString::fromStdString(request->username());
|
||||||
if (usersTab.nextUserUsernamePasswordError())
|
if (usersTab.nextUserUsernamePasswordError())
|
||||||
{
|
{
|
||||||
qtProxy_.sendDelayedEvent(newLoginError(LoginErrorType::USERNAME_PASSWORD_ERROR, "Username/password error."));
|
qtProxy_.sendDelayedEvent(newLoginError(LoginErrorType::USERNAME_PASSWORD_ERROR, usersTab.usernamePasswordErrorMessage()));
|
||||||
return Status::OK;
|
return Status::OK;
|
||||||
}
|
}
|
||||||
if (usersTab.nextUserFreeUserError())
|
if (usersTab.nextUserFreeUserError())
|
||||||
|
|||||||
@ -51,6 +51,7 @@ UsersTab::UsersTab(QWidget *parent)
|
|||||||
connect(ui_.buttonEditUser, &QPushButton::clicked, this, &UsersTab::onEditUserButton);
|
connect(ui_.buttonEditUser, &QPushButton::clicked, this, &UsersTab::onEditUserButton);
|
||||||
connect(ui_.tableUserList, &QTableView::doubleClicked, this, &UsersTab::onEditUserButton);
|
connect(ui_.tableUserList, &QTableView::doubleClicked, this, &UsersTab::onEditUserButton);
|
||||||
connect(ui_.buttonRemoveUser, &QPushButton::clicked, this, &UsersTab::onRemoveUserButton);
|
connect(ui_.buttonRemoveUser, &QPushButton::clicked, this, &UsersTab::onRemoveUserButton);
|
||||||
|
connect(ui_.checkUsernamePasswordError, &QCheckBox::toggled, this, &UsersTab::updateGUIState);
|
||||||
|
|
||||||
users_.append(randomUser());
|
users_.append(randomUser());
|
||||||
|
|
||||||
@ -129,6 +130,7 @@ void UsersTab::updateGUIState()
|
|||||||
bool const hasSelectedUser = ui_.tableUserList->selectionModel()->hasSelection();
|
bool const hasSelectedUser = ui_.tableUserList->selectionModel()->hasSelection();
|
||||||
ui_.buttonEditUser->setEnabled(hasSelectedUser);
|
ui_.buttonEditUser->setEnabled(hasSelectedUser);
|
||||||
ui_.buttonRemoveUser->setEnabled(hasSelectedUser);
|
ui_.buttonRemoveUser->setEnabled(hasSelectedUser);
|
||||||
|
ui_.editUsernamePasswordError->setEnabled(ui_.checkUsernamePasswordError->isChecked());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -252,6 +254,15 @@ bool UsersTab::nextUserAlreadyLoggedIn() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//****************************************************************************************************************************************************
|
||||||
|
/// \return the message for the username/password error.
|
||||||
|
//****************************************************************************************************************************************************
|
||||||
|
QString UsersTab::usernamePasswordErrorMessage() const
|
||||||
|
{
|
||||||
|
return ui_.editUsernamePasswordError->text();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//****************************************************************************************************************************************************
|
//****************************************************************************************************************************************************
|
||||||
/// \param[in] userID The userID.
|
/// \param[in] userID The userID.
|
||||||
/// \param[in] makeItActive Should split mode be activated.
|
/// \param[in] makeItActive Should split mode be activated.
|
||||||
|
|||||||
@ -48,6 +48,7 @@ public: // member functions.
|
|||||||
bool nextUserTwoPasswordsError() const; ///< Check if next user login should trigger 2nd password error.
|
bool nextUserTwoPasswordsError() const; ///< Check if next user login should trigger 2nd password error.
|
||||||
bool nextUserTwoPasswordsAbort() const; ///< Check if next user login should trigger 2nd password abort.
|
bool nextUserTwoPasswordsAbort() const; ///< Check if next user login should trigger 2nd password abort.
|
||||||
bool nextUserAlreadyLoggedIn() const; ///< Check if next user login should report user as already logged in.
|
bool nextUserAlreadyLoggedIn() const; ///< Check if next user login should report user as already logged in.
|
||||||
|
QString usernamePasswordErrorMessage() const; ///< Return the username password error message.
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void setUserSplitMode(QString const &userID, bool makeItActive); ///< Slot for the split mode.
|
void setUserSplitMode(QString const &userID, bool makeItActive); ///< Slot for the split mode.
|
||||||
@ -60,9 +61,9 @@ private slots:
|
|||||||
void onEditUserButton(); ///< Edit the currently selected user.
|
void onEditUserButton(); ///< Edit the currently selected user.
|
||||||
void onRemoveUserButton(); ///< Remove the currently selected user.
|
void onRemoveUserButton(); ///< Remove the currently selected user.
|
||||||
void onSelectionChanged(QItemSelection, QItemSelection); ///< Slot for the change of the selection.
|
void onSelectionChanged(QItemSelection, QItemSelection); ///< Slot for the change of the selection.
|
||||||
|
void updateGUIState(); ///< Update the GUI state.
|
||||||
|
|
||||||
private: // member functions.
|
private: // member functions.
|
||||||
void updateGUIState(); ///< Update the GUI state.
|
|
||||||
qint32 selectedIndex() const; ///< Get the index of the selected row.
|
qint32 selectedIndex() const; ///< Get the index of the selected row.
|
||||||
bridgepp::SPUser selectedUser(); ///< Get the selected user.
|
bridgepp::SPUser selectedUser(); ///< Get the selected user.
|
||||||
|
|
||||||
|
|||||||
@ -6,14 +6,14 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>1207</width>
|
<width>1225</width>
|
||||||
<height>709</height>
|
<height>717</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Form</string>
|
<string>Form</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,0">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTableView" name="tableUserList">
|
<widget class="QTableView" name="tableUserList">
|
||||||
<property name="selectionMode">
|
<property name="selectionMode">
|
||||||
@ -81,10 +81,46 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="checkUsernamePasswordError">
|
<widget class="QCheckBox" name="checkUsernamePasswordError">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Username/password error</string>
|
<string>Username/password error:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeType">
|
||||||
|
<enum>QSizePolicy::Fixed</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>10</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="editUsernamePasswordError">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>200</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Username/password error.</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="checkFreeUserError">
|
<widget class="QCheckBox" name="checkFreeUserError">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
|||||||
@ -185,13 +185,15 @@ FocusScope {
|
|||||||
ColorImage {
|
ColorImage {
|
||||||
color: root.colorScheme.signal_danger
|
color: root.colorScheme.signal_danger
|
||||||
source: "/qml/icons/ic-exclamation-circle-filled.svg"
|
source: "/qml/icons/ic-exclamation-circle-filled.svg"
|
||||||
height: errorLabel.height
|
height: errorLabel.lineHeight
|
||||||
sourceSize.height: errorLabel.height
|
sourceSize.height: errorLabel.lineHeight
|
||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
colorScheme: root.colorScheme
|
colorScheme: root.colorScheme
|
||||||
id: errorLabel
|
id: errorLabel
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
Layout.fillWidth: true;
|
||||||
Layout.leftMargin: 4
|
Layout.leftMargin: 4
|
||||||
color: root.colorScheme.signal_danger
|
color: root.colorScheme.signal_danger
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user