Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KDE PIM Runtime
Commits
cd2b08e6
Commit
cd2b08e6
authored
Aug 30, 2020
by
Shashwat Jolly
Browse files
Change login error messages for faulty URLs
parent
528beb74
Changes
4
Hide whitespace changes
Inline
Side-by-side
resources/etesync/etesyncresource.cpp
View file @
cd2b08e6
...
...
@@ -223,6 +223,7 @@ bool EteSyncResource::handleError()
bool
EteSyncResource
::
credentialsRequired
()
{
if
(
mCredentialsRequired
)
{
qCDebug
(
ETESYNC_LOG
)
<<
"Credentials required"
;
showErrorDialog
(
i18n
(
"Your EteSync credentials were changed. Please click OK to re-enter your credentials."
),
i18n
(
CharPtr
(
etesync_get_error_message
()).
get
()),
i18n
(
"Credentials Changed"
));
configure
(
winIdForDialogs
());
setOnline
(
false
);
...
...
resources/etesync/etesyncresource.h
View file @
cd2b08e6
...
...
@@ -89,7 +89,7 @@ private:
std
::
vector
<
BaseHandler
::
Ptr
>
mHandlers
;
std
::
map
<
QString
,
EteSyncJournalPtr
>
mJournalsCache
;
QDateTime
mJournalsCacheUpdateTime
;
bool
mCredentialsRequired
;
bool
mCredentialsRequired
=
false
;
ContactHandler
::
Ptr
mContactHandler
;
CalendarHandler
::
Ptr
mCalendarHandler
;
...
...
resources/etesync/setupwizard.cpp
View file @
cd2b08e6
...
...
@@ -101,8 +101,13 @@ bool LoginPage::validatePage()
const
bool
loginResult
=
static_cast
<
SetupWizard
*>
(
wizard
())
->
mClientState
->
initToken
(
serverUrl
,
username
,
password
);
if
(
!
loginResult
)
{
auto
err
=
etesync_get_error_code
();
qCDebug
(
ETESYNC_LOG
)
<<
"loginResult error"
<<
err
;
if
(
err
==
EteSyncErrorCode
::
ETESYNC_ERROR_CODE_UNAUTHORIZED
||
err
==
EteSyncErrorCode
::
ETESYNC_ERROR_CODE_HTTP
)
{
mLoginLabel
->
setText
(
i18n
(
"Incorrect login credentials. Please try again."
));
}
else
if
(
err
==
EteSyncErrorCode
::
ETESYNC_ERROR_CODE_ENCODING
)
{
mLoginLabel
->
setText
(
i18n
(
"Please ensure that the server URL is correct. The URL should start with http:// or https://."
));
}
else
if
(
err
==
EteSyncErrorCode
::
ETESYNC_ERROR_CODE_CONNECTION
)
{
mLoginLabel
->
setText
(
i18n
(
"Could not connect to the server. Please ensure that the server URL is correct."
));
}
else
{
mLoginLabel
->
setText
(
i18n
(
CharPtr
(
etesync_get_error_message
()).
get
()));
}
...
...
resources/etesync/setupwizard.h
View file @
cd2b08e6
...
...
@@ -67,7 +67,7 @@ private:
QCheckBox
*
mAdvancedSettings
=
nullptr
;
QLineEdit
*
mServerUrl
=
nullptr
;
QLabel
*
mLoginLabel
=
nullptr
;
bool
mIsInitialized
;
bool
mIsInitialized
=
false
;
};
class
EncryptionPasswordPage
:
public
QWizardPage
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment