Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
c714ad8d
Commit
c714ad8d
authored
Apr 13, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(ui/views/App/Main): display popup when auth failed
parent
c1645184
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
307 additions
and
8 deletions
+307
-8
CMakeLists.txt
linphone-desktop/CMakeLists.txt
+3
-1
en.ts
linphone-desktop/assets/languages/en.ts
+27
-0
fr.ts
linphone-desktop/assets/languages/fr.ts
+27
-0
resources.qrc
linphone-desktop/resources.qrc
+3
-0
App.cpp
linphone-desktop/src/app/App.cpp
+3
-2
Components.hpp
linphone-desktop/src/components/Components.hpp
+1
-0
Authentication.cpp
...-desktop/src/components/authentication/Authentication.cpp
+49
-0
Authentication.hpp
...-desktop/src/components/authentication/Authentication.hpp
+48
-0
CoreHandlers.cpp
linphone-desktop/src/components/core/CoreHandlers.cpp
+2
-2
CoreHandlers.hpp
linphone-desktop/src/components/core/CoreHandlers.hpp
+1
-0
AccountSettingsModel.cpp
...-desktop/src/components/settings/AccountSettingsModel.cpp
+11
-0
AccountSettingsModel.hpp
...-desktop/src/components/settings/AccountSettingsModel.hpp
+6
-0
DialogStyle.qml
...e-desktop/ui/modules/Common/Styles/Dialog/DialogStyle.qml
+1
-1
AuthenticationRequest.js
linphone-desktop/ui/views/App/Main/AuthenticationRequest.js
+11
-0
AuthenticationRequest.qml
linphone-desktop/ui/views/App/Main/AuthenticationRequest.qml
+86
-0
MainWindow.js
linphone-desktop/ui/views/App/Main/MainWindow.js
+10
-0
MainWindow.qml
linphone-desktop/ui/views/App/Main/MainWindow.qml
+6
-0
AuthenticationRequestStyle.qml
...p/ui/views/App/Styles/Main/AuthenticationRequestStyle.qml
+11
-0
ManageAccountsStyle.qml
...-desktop/ui/views/App/Styles/Main/ManageAccountsStyle.qml
+0
-2
qmldir
linphone-desktop/ui/views/App/Styles/qmldir
+1
-0
No files found.
linphone-desktop/CMakeLists.txt
View file @
c714ad8d
...
...
@@ -89,6 +89,7 @@ set(SOURCES
src/app/providers/ThumbnailProvider.cpp
src/app/translator/DefaultTranslator.cpp
src/components/assistant/AssistantModel.cpp
src/components/authentication/Authentication.cpp
src/components/call/CallModel.cpp
src/components/calls/CallsListModel.cpp
src/components/camera/Camera.cpp
...
...
@@ -126,9 +127,10 @@ set(HEADERS
src/app/providers/ThumbnailProvider.hpp
src/app/translator/DefaultTranslator.hpp
src/components/assistant/AssistantModel.hpp
src/components/
camera/Camera
.hpp
src/components/
authentication/Authentication
.hpp
src/components/call/CallModel.hpp
src/components/calls/CallsListModel.hpp
src/components/camera/Camera.hpp
src/components/camera/MSFunctions.hpp
src/components/chat/ChatModel.hpp
src/components/chat/ChatProxyModel.hpp
...
...
linphone-desktop/assets/languages/en.ts
View file @
c714ad8d
...
...
@@ -144,6 +144,33 @@
<
translation
>
Please
verify
that
you
have
validated
your
account
or
try
again
.
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
AuthenticationRequest
<
/name
>
<
message
>
<
source
>
cancel
<
/source
>
<
translation
>
CANCEL
<
/translation
>
<
/message
>
<
message
>
<
source
>
confirm
<
/source
>
<
translation
>
LOGIN
<
/translation
>
<
/message
>
<
message
>
<
source
>
identityLabel
<
/source
>
<
translation
>
Identity
<
/translation
>
<
/message
>
<
message
>
<
source
>
passwordLabel
<
/source
>
<
translation
>
Password
<
/translation
>
<
/message
>
<
message
>
<
source
>
authentificationRequestDescription
<
/source
>
<
translation
>
Unable
to
authenticate
.
Please
verify
your
password
.
<
/translation
>
<
/message
>
<
message
>
<
source
>
userIdLabel
<
/source
>
<
translation
>
User
ID
(
optional
)
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
Calls
<
/name
>
<
message
>
...
...
linphone-desktop/assets/languages/fr.ts
View file @
c714ad8d
...
...
@@ -144,6 +144,33 @@
<
translation
>
Merci
de
v
é
rifier
que
vous
avez
valid
é
votre
compte
ou
r
é
essayez
plus
tard
.
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
AuthenticationRequest
<
/name
>
<
message
>
<
source
>
cancel
<
/source
>
<
translation
>
ANNULER
<
/translation
>
<
/message
>
<
message
>
<
source
>
confirm
<
/source
>
<
translation
>
SE
CONNECTER
<
/translation
>
<
/message
>
<
message
>
<
source
>
identityLabel
<
/source
>
<
translation
>
Identit
é
<
/translation
>
<
/message
>
<
message
>
<
source
>
passwordLabel
<
/source
>
<
translation
>
Mot
de
passe
<
/translation
>
<
/message
>
<
message
>
<
source
>
authentificationRequestDescription
<
/source
>
<
translation
>
Impossible
de
vous
authentifier
.
Merci
de
v
é
rifier
votre
mot
de
passe
.
<
/translation
>
<
/message
>
<
message
>
<
source
>
userIdLabel
<
/source
>
<
translation
>
ID
utilisateur
(
optionnel
)
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
Calls
<
/name
>
<
message
>
...
...
linphone-desktop/resources.qrc
View file @
c714ad8d
...
...
@@ -345,6 +345,8 @@
<file>
ui/views/App/Main/Assistant/UseLinphoneSipAccountWithPhoneNumber.qml
</file>
<file>
ui/views/App/Main/Assistant/UseLinphoneSipAccountWithUsername.qml
</file>
<file>
ui/views/App/Main/Assistant/UseOtherSipAccount.qml
</file>
<file>
ui/views/App/Main/AuthenticationRequest.js
</file>
<file>
ui/views/App/Main/AuthenticationRequest.qml
</file>
<file>
ui/views/App/Main/ContactEdit.js
</file>
<file>
ui/views/App/Main/ContactEdit.qml
</file>
<file>
ui/views/App/Main/Contacts.qml
</file>
...
...
@@ -375,6 +377,7 @@
<file>
ui/views/App/Styles/Main/Assistant/CreateLinphoneSipAccountStyle.qml
</file>
<file>
ui/views/App/Styles/Main/AssistantStyle.qml
</file>
<file>
ui/views/App/Styles/Main/Assistant/UseLinphoneSipAccountStyle.qml
</file>
<file>
ui/views/App/Styles/Main/AuthenticationRequestStyle.qml
</file>
<file>
ui/views/App/Styles/Main/ContactEditStyle.qml
</file>
<file>
ui/views/App/Styles/Main/ContactsStyle.qml
</file>
<file>
ui/views/App/Styles/Main/ConversationStyle.qml
</file>
...
...
linphone-desktop/src/app/App.cpp
View file @
c714ad8d
...
...
@@ -276,10 +276,11 @@ void App::registerTypes () {
qInfo
()
<<
"Registering types..."
;
qmlRegisterType
<
AssistantModel
>
(
"Linphone"
,
1
,
0
,
"AssistantModel"
);
qmlRegisterType
<
Authentication
>
(
"Linphone"
,
1
,
0
,
"Authentication"
);
qmlRegisterType
<
Camera
>
(
"Linphone"
,
1
,
0
,
"Camera"
);
qmlRegisterType
<
ContactsListProxyModel
>
(
"Linphone"
,
1
,
0
,
"ContactsListProxyModel"
);
qmlRegisterType
<
ChatModel
>
(
"Linphone"
,
1
,
0
,
"ChatModel"
);
qmlRegisterType
<
ChatProxyModel
>
(
"Linphone"
,
1
,
0
,
"ChatProxyModel"
);
qmlRegisterType
<
ContactsListProxyModel
>
(
"Linphone"
,
1
,
0
,
"ContactsListProxyModel"
);
qmlRegisterType
<
SmartSearchBarModel
>
(
"Linphone"
,
1
,
0
,
"SmartSearchBarModel"
);
qRegisterMetaType
<
ChatModel
::
EntryType
>
(
"ChatModel::EntryType"
);
...
...
@@ -394,7 +395,7 @@ void App::openAppAfterInit () {
getMainWindow
()
->
showNormal
();
#else
getMainWindow
()
->
showNormal
();
#endif
// ifndef __APPLE__
#endif // ifndef __APPLE__
}
// -----------------------------------------------------------------------------
...
...
linphone-desktop/src/components/Components.hpp
View file @
c714ad8d
...
...
@@ -21,6 +21,7 @@
*/
#include "assistant/AssistantModel.hpp"
#include "authentication/Authentication.hpp"
#include "calls/CallsListModel.hpp"
#include "camera/Camera.hpp"
#include "chat/ChatProxyModel.hpp"
...
...
linphone-desktop/src/components/authentication/Authentication.cpp
0 → 100644
View file @
c714ad8d
/*
* Authentication.cpp
* Copyright (C) 2017 Belledonne Communications, Grenoble, France
*
* 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 2
* 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, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Created on: April 13, 2017
* Author: Ronan Abhamon
*/
#include "../../utils.hpp"
#include "../core/CoreManager.hpp"
#include "Authentication.hpp"
using
namespace
std
;
// =============================================================================
Authentication
::
Authentication
(
QObject
*
parent
)
:
QObject
(
parent
)
{
QObject
::
connect
(
&
(
*
CoreManager
::
getInstance
()
->
getHandlers
()),
&
CoreHandlers
::
authenticationRequested
,
this
,
&
Authentication
::
handleAuthenticationRequested
);
}
void
Authentication
::
handleAuthenticationRequested
(
const
shared_ptr
<
linphone
::
AuthInfo
>
&
authInfo
)
{
emit
authenticationRequested
(
QVariant
::
fromValue
(
authInfo
),
QStringLiteral
(
"%1@%2"
).
arg
(
::
Utils
::
linphoneStringToQString
(
authInfo
->
getUsername
())
).
arg
(
::
Utils
::
linphoneStringToQString
(
authInfo
->
getDomain
())
),
::
Utils
::
linphoneStringToQString
(
authInfo
->
getUserid
())
);
}
linphone-desktop/src/components/authentication/Authentication.hpp
0 → 100644
View file @
c714ad8d
/*
* Authentication.hpp
* Copyright (C) 2017 Belledonne Communications, Grenoble, France
*
* 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 2
* 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, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Created on: April 13, 2017
* Author: Ronan Abhamon
*/
#ifndef AUTHENTICATION_H_
#define AUTHENTICATION_H_
#include <linphone++/linphone.hh>
#include <QObject>
// =============================================================================
class
Authentication
:
public
QObject
{
Q_OBJECT
;
public:
Authentication
(
QObject
*
parent
=
Q_NULLPTR
);
~
Authentication
()
=
default
;
signals:
void
authenticationRequested
(
const
QVariant
&
authInfo
,
const
QString
&
sipAddress
,
const
QString
&
userId
);
private:
void
handleAuthenticationRequested
(
const
std
::
shared_ptr
<
linphone
::
AuthInfo
>
&
authInfo
);
};
Q_DECLARE_METATYPE
(
std
::
shared_ptr
<
linphone
::
AuthInfo
>
);
#endif // AUTHENTICATION_H_
linphone-desktop/src/components/core/CoreHandlers.cpp
View file @
c714ad8d
...
...
@@ -34,10 +34,10 @@ using namespace std;
void
CoreHandlers
::
onAuthenticationRequested
(
const
shared_ptr
<
linphone
::
Core
>
&
,
const
shared_ptr
<
linphone
::
AuthInfo
>
&
,
const
shared_ptr
<
linphone
::
AuthInfo
>
&
auth_info
,
linphone
::
AuthMethod
)
{
qDebug
()
<<
"Auth request"
;
emit
authenticationRequested
(
auth_info
)
;
}
void
CoreHandlers
::
onCallStateChanged
(
...
...
linphone-desktop/src/components/core/CoreHandlers.hpp
View file @
c714ad8d
...
...
@@ -34,6 +34,7 @@ class CoreHandlers :
Q_OBJECT
;
signals:
void
authenticationRequested
(
const
std
::
shared_ptr
<
linphone
::
AuthInfo
>
&
auth_info
);
void
callStateChanged
(
const
std
::
shared_ptr
<
linphone
::
Call
>
&
call
,
linphone
::
CallState
state
);
void
messageReceived
(
const
std
::
shared_ptr
<
linphone
::
ChatMessage
>
&
message
);
void
presenceReceived
(
const
QString
&
sip_address
,
const
std
::
shared_ptr
<
const
linphone
::
PresenceModel
>
&
presence_model
);
...
...
linphone-desktop/src/components/settings/AccountSettingsModel.cpp
View file @
c714ad8d
...
...
@@ -171,6 +171,17 @@ shared_ptr<linphone::ProxyConfig> AccountSettingsModel::createProxyConfig () {
return
CoreManager
::
getInstance
()
->
getCore
()
->
createProxyConfig
();
}
void
AccountSettingsModel
::
addAuthInfo
(
const
shared_ptr
<
linphone
::
AuthInfo
>
&
auth_info
,
const
QString
&
password
,
const
QString
&
user_id
)
{
auth_info
->
setPasswd
(
::
Utils
::
qStringToLinphoneString
(
password
));
auth_info
->
setUserid
(
::
Utils
::
qStringToLinphoneString
(
user_id
));
CoreManager
::
getInstance
()
->
getCore
()
->
addAuthInfo
(
auth_info
);
}
void
AccountSettingsModel
::
eraseAllPasswords
()
{
CoreManager
::
getInstance
()
->
getCore
()
->
clearAllAuthInfo
();
}
...
...
linphone-desktop/src/components/settings/AccountSettingsModel.hpp
View file @
c714ad8d
...
...
@@ -66,6 +66,12 @@ public:
Q_INVOKABLE
std
::
shared_ptr
<
linphone
::
ProxyConfig
>
createProxyConfig
();
Q_INVOKABLE
void
addAuthInfo
(
const
std
::
shared_ptr
<
linphone
::
AuthInfo
>
&
auth_info
,
const
QString
&
password
,
const
QString
&
user_id
);
Q_INVOKABLE
void
eraseAllPasswords
();
signals:
...
...
linphone-desktop/ui/modules/Common/Styles/Dialog/DialogStyle.qml
View file @
c714ad8d
...
...
@@ -23,7 +23,7 @@ QtObject {
}
property
QtObject
description
:
QtObject
{
property
color
color
:
Colors
.
l
property
color
color
:
Colors
.
j
property
int
fontSize
:
11
property
int
verticalMargin
:
25
}
...
...
linphone-desktop/ui/views/App/Main/AuthenticationRequest.js
0 → 100644
View file @
c714ad8d
// =============================================================================
// `AuthenticationRequest.qml` Logic.
// =============================================================================
.
import
Linphone
1.0
as
Linphone
// =============================================================================
function
confirmPassword
()
{
Linphone
.
AccountSettingsModel
.
addAuthInfo
(
dialog
.
authInfo
,
password
.
text
,
userId
.
text
)
}
linphone-desktop/ui/views/App/Main/AuthenticationRequest.qml
0 → 100644
View file @
c714ad8d
import
QtQuick
2.7
import
Common
1.0
import
App
.
Styles
1.0
import
'
AuthenticationRequest.js
'
as
Logic
// =============================================================================
DialogPlus
{
id
:
dialog
property
alias
sipAddress
:
identity
.
text
property
alias
userId
:
userId
.
text
property
var
authInfo
buttons
:
[
TextButtonA
{
text
:
qsTr
(
'
cancel
'
)
onClicked
:
exit
(
0
)
},
TextButtonB
{
enabled
:
password
.
length
>
0
text
:
qsTr
(
'
confirm
'
)
onClicked
:
{
Logic
.
confirmPassword
()
exit
(
1
)
}
}
]
centeredButtons
:
true
descriptionText
:
qsTr
(
'
authentificationRequestDescription
'
)
height
:
AuthenticationRequestStyle
.
height
width
:
AuthenticationRequestStyle
.
width
// ---------------------------------------------------------------------------
Form
{
orientation
:
Qt
.
Vertical
anchors
{
left
:
parent
.
left
leftMargin
:
AuthenticationRequestStyle
.
leftMargin
right
:
parent
.
right
rightMargin
:
AuthenticationRequestStyle
.
rightMargin
}
FormLine
{
FormGroup
{
label
:
qsTr
(
'
identityLabel
'
)
TextField
{
id
:
identity
readOnly
:
true
}
}
}
FormLine
{
FormGroup
{
label
:
qsTr
(
'
userIdLabel
'
)
TextField
{
id
:
userId
}
}
}
FormLine
{
FormGroup
{
label
:
qsTr
(
'
passwordLabel
'
)
TextField
{
id
:
password
}
}
}
}
}
linphone-desktop/ui/views/App/Main/MainWindow.js
View file @
c714ad8d
...
...
@@ -85,3 +85,13 @@ function updateSelectedEntry (view, props) {
timeline
.
resetSelectedEntry
()
}
}
// -----------------------------------------------------------------------------
function
handleAuthenticationRequested
(
authInfo
,
sipAddress
,
userId
)
{
window
.
attachVirtualWindow
(
Qt
.
resolvedUrl
(
'
AuthenticationRequest.qml
'
),
{
authInfo
:
authInfo
,
sipAddress
:
sipAddress
,
userId
:
userId
})
}
linphone-desktop/ui/views/App/Main/MainWindow.qml
View file @
c714ad8d
...
...
@@ -84,6 +84,12 @@ ApplicationWindow {
spacing
:
0
// -----------------------------------------------------------------------
Authentication
{
onAuthenticationRequested
:
Logic
.
handleAuthenticationRequested
(
authInfo
,
sipAddress
,
userId
)
}
// -----------------------------------------------------------------------
// Toolbar properties.
// -----------------------------------------------------------------------
...
...
linphone-desktop/ui/views/App/Styles/Main/AuthenticationRequestStyle.qml
0 → 100644
View file @
c714ad8d
pragma
Singleton
import
QtQuick
2.7
// =============================================================================
QtObject
{
property
int
height
:
366
property
int
leftMargin
:
35
property
int
rightMargin
:
35
property
int
width
:
480
}
linphone-desktop/ui/views/App/Styles/Main/ManageAccountsStyle.qml
View file @
c714ad8d
pragma
Singleton
import
QtQuick
2.7
import
Common
1.0
// =============================================================================
QtObject
{
...
...
linphone-desktop/ui/views/App/Styles/qmldir
View file @
c714ad8d
...
...
@@ -14,6 +14,7 @@ singleton CreateLinphoneSipAccountStyle 1.0 Main/Assistant/CreateLinp
singleton UseLinphoneSipAccountStyle 1.0 Main/Assistant/UseLinphoneSipAccountStyle.qml
singleton AssistantStyle 1.0 Main/AssistantStyle.qml
singleton AuthenticationRequestStyle 1.0 Main/AuthenticationRequestStyle.qml
singleton ContactEditStyle 1.0 Main/ContactEditStyle.qml
singleton ContactsStyle 1.0 Main/ContactsStyle.qml
singleton ConversationStyle 1.0 Main/ConversationStyle.qml
...
...
Write
Preview
Markdown
is supported
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