Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jami-client-windows
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
savoirfairelinux
jami-client-windows
Commits
7cc79c08
Commit
7cc79c08
authored
6 years ago
by
Andreas Traczyk
Browse files
Options
Downloads
Patches
Plain Diff
callwidget: remove references to CallModel
Change-Id: Iaa7f805e50d02f234c77083cd68198a00e8884c5
parent
dc2703ed
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
callwidget.cpp
+0
-16
0 additions, 16 deletions
callwidget.cpp
callwidget.h
+0
-1
0 additions, 1 deletion
callwidget.h
utils.cpp
+13
-8
13 additions, 8 deletions
utils.cpp
utils.h
+1
-1
1 addition, 1 deletion
utils.h
videoview.cpp
+22
-24
22 additions, 24 deletions
videoview.cpp
videoview.h
+2
-3
2 additions, 3 deletions
videoview.h
with
38 additions
and
53 deletions
callwidget.cpp
+
0
−
16
View file @
7cc79c08
...
@@ -545,22 +545,6 @@ CallWidget::smartListSelectionChanged(const QItemSelection &selected, const QIt
...
@@ -545,22 +545,6 @@ CallWidget::smartListSelectionChanged(const QItemSelection &selected, const QIt
selectConversation
(
selectedIndex
);
selectConversation
(
selectedIndex
);
}
}
void
CallWidget
::
placeCall
()
{
if
(
ui
->
ringContactLineEdit
->
text
().
isEmpty
())
return
;
Call
*
c
=
CallModel
::
instance
().
dialingCall
(
PhoneDirectoryModel
::
instance
().
getNumber
(
ui
->
ringContactLineEdit
->
text
()));
c
->
performAction
(
Call
::
Action
::
ACCEPT
);
ui
->
ringContactLineEdit
->
clear
();
auto
photoRect
=
ui
->
callingPhoto
->
frameGeometry
();
ui
->
callingPhoto
->
setPixmap
(
QPixmap
::
fromImage
(
GlobalInstances
::
pixmapManipulator
()
.
callPhoto
(
c
,
QSize
(
photoRect
.
width
(),
photoRect
.
height
()))
.
value
<
QImage
>
()));
}
void
void
CallWidget
::
conversationsButtonClicked
()
CallWidget
::
conversationsButtonClicked
()
{
{
...
...
This diff is collapsed.
Click to expand it.
callwidget.h
+
0
−
1
View file @
7cc79c08
...
@@ -33,7 +33,6 @@
...
@@ -33,7 +33,6 @@
#include
"smartlistmodel.h"
#include
"smartlistmodel.h"
// old LRC
// old LRC
#include
"callmodel.h"
#include
"video/renderer.h"
#include
"video/renderer.h"
#include
"video/previewmanager.h"
#include
"video/previewmanager.h"
#include
"accountmodel.h"
#include
"accountmodel.h"
...
...
This diff is collapsed.
Click to expand it.
utils.cpp
+
13
−
8
View file @
7cc79c08
...
@@ -430,18 +430,23 @@ Utils::generateTintedPixmap(const QString& filename, QColor color)
...
@@ -430,18 +430,23 @@ Utils::generateTintedPixmap(const QString& filename, QColor color)
return
QPixmap
::
fromImage
(
tmpImage
);
return
QPixmap
::
fromImage
(
tmpImage
);
}
}
std
::
string
lrc
::
api
::
conversation
::
Info
Utils
::
getConversationFromCallId
(
const
std
::
string
&
callId
)
Utils
::
getConversationFromCallId
(
const
std
::
string
&
callId
)
{
{
auto
convModel
=
LRCInstance
::
getCurrentConversationModel
();
auto
convModel
=
LRCInstance
::
getCurrentConversationModel
();
auto
conversations
=
convModel
->
allFilteredConversations
();
using
namespace
lrc
::
api
::
profile
;
std
::
string
convUid
;
for
(
int
i
=
toUnderlyingValue
(
Type
::
RING
);
i
<=
toUnderlyingValue
(
Type
::
TEMPORARY
);
++
i
)
{
for
(
auto
conversation
:
conversations
)
{
auto
filter
=
toEnum
<
lrc
::
api
::
profile
::
Type
>
(
i
);
if
(
conversation
.
callId
==
callId
)
{
auto
conversations
=
convModel
->
getFilteredConversations
(
filter
);
return
conversation
.
uid
;
auto
conv
=
std
::
find_if
(
conversations
.
begin
(),
conversations
.
end
(),
[
&
](
const
lrc
::
api
::
conversation
::
Info
&
conv
)
{
return
callId
==
conv
.
callId
;
});
if
(
conv
!=
conversations
.
end
())
{
return
*
conv
;
}
}
}
}
return
""
;
return
lrc
::
api
::
conversation
::
Info
()
;
}
}
lrc
::
api
::
conversation
::
Info
lrc
::
api
::
conversation
::
Info
...
...
This diff is collapsed.
Click to expand it.
utils.h
+
1
−
1
View file @
7cc79c08
...
@@ -78,7 +78,7 @@ namespace Utils
...
@@ -78,7 +78,7 @@ namespace Utils
QImage
conversationPhoto
(
const
std
::
string
&
convUid
,
const
lrc
::
api
::
account
::
Info
&
accountInfo
);
QImage
conversationPhoto
(
const
std
::
string
&
convUid
,
const
lrc
::
api
::
account
::
Info
&
accountInfo
);
QByteArray
QByteArrayFromFile
(
const
QString
&
filename
);
QByteArray
QByteArrayFromFile
(
const
QString
&
filename
);
QPixmap
generateTintedPixmap
(
const
QString
&
filename
,
QColor
color
);
QPixmap
generateTintedPixmap
(
const
QString
&
filename
,
QColor
color
);
std
::
string
getConversationFromCallId
(
const
std
::
string
&
callId
);
lrc
::
api
::
conversation
::
Info
getConversationFromCallId
(
const
std
::
string
&
callId
);
lrc
::
api
::
conversation
::
Info
getSelectedConversation
();
lrc
::
api
::
conversation
::
Info
getSelectedConversation
();
lrc
::
api
::
conversation
::
Info
getConversationFromUid
(
const
std
::
string
&
convUid
,
bool
filtered
=
true
);
lrc
::
api
::
conversation
::
Info
getConversationFromUid
(
const
std
::
string
&
convUid
,
bool
filtered
=
true
);
...
...
This diff is collapsed.
Click to expand it.
videoview.cpp
+
22
−
24
View file @
7cc79c08
...
@@ -42,9 +42,6 @@ VideoView::VideoView(QWidget* parent) :
...
@@ -42,9 +42,6 @@ VideoView::VideoView(QWidget* parent) :
{
{
ui
->
setupUi
(
this
);
ui
->
setupUi
(
this
);
connect
(
&
CallModel
::
instance
(),
SIGNAL
(
callStateChanged
(
Call
*
,
Call
::
State
)),
this
,
SLOT
(
callStateChanged
(
Call
*
,
Call
::
State
)));
overlay_
=
new
VideoOverlay
(
this
);
overlay_
=
new
VideoOverlay
(
this
);
auto
effect
=
new
QGraphicsOpacityEffect
(
overlay_
);
auto
effect
=
new
QGraphicsOpacityEffect
(
overlay_
);
effect
->
setOpacity
(
maxOverlayOpacity_
);
effect
->
setOpacity
(
maxOverlayOpacity_
);
...
@@ -150,23 +147,27 @@ VideoView::fadeOverlayOut()
...
@@ -150,23 +147,27 @@ VideoView::fadeOverlayOut()
}
}
void
void
VideoView
::
callStateChanged
(
Call
*
call
,
Call
::
State
previousState
)
VideoView
::
slotCallStatusChanged
(
const
std
::
string
&
callId
)
{
using
namespace
lrc
::
api
::
call
;
auto
call
=
LRCInstance
::
getCurrentCallModel
()
->
getCall
(
callId
);
switch
(
call
.
status
)
{
case
Status
::
IN_PROGRESS
:
{
{
Q_UNUSED
(
previousState
)
if
(
call
->
state
()
==
Call
::
State
::
CURRENT
)
{
ui
->
videoWidget
->
show
();
ui
->
videoWidget
->
show
();
timerConnection_
=
connect
(
call
,
SIGNAL
(
changed
()),
this
,
SLOT
(
updateCall
()));
auto
convInfo
=
Utils
::
getConversationFromCallId
(
call
.
id
);
}
else
{
if
(
!
convInfo
.
uid
.
empty
())
{
QObject
::
disconnect
(
timerConnection_
);
auto
contactInfo
=
LRCInstance
::
getCurrentAccountInfo
().
contactModel
->
getContact
(
convInfo
.
participants
[
0
]);
try
{
auto
contactName
=
Utils
::
bestNameForContact
(
contactInfo
);
if
(
call
)
{
overlay_
->
setName
(
QString
::
fromStdString
(
contactName
));
emit
closing
(
call
->
historyId
().
toStdString
());
}
}
}
catch
(...)
{
return
;
qWarning
()
<<
"VideoView::callStateChanged except"
;
}
}
default
:
emit
closing
(
call
.
id
);
break
;
}
}
QObject
::
disconnect
(
timerConnection_
);
}
}
void
void
...
@@ -182,14 +183,6 @@ VideoView::simulateShowChatview(bool checked)
...
@@ -182,14 +183,6 @@ VideoView::simulateShowChatview(bool checked)
overlay_
->
simulateShowChatview
(
true
);
overlay_
->
simulateShowChatview
(
true
);
}
}
void
VideoView
::
updateCall
()
{
if
(
auto
call
=
CallModel
::
instance
().
selectedCall
())
{
overlay_
->
setName
(
call
->
formattedName
());
}
}
void
void
VideoView
::
mouseDoubleClickEvent
(
QMouseEvent
*
e
)
{
VideoView
::
mouseDoubleClickEvent
(
QMouseEvent
*
e
)
{
QWidget
::
mouseDoubleClickEvent
(
e
);
QWidget
::
mouseDoubleClickEvent
(
e
);
...
@@ -328,6 +321,8 @@ VideoView::pushRenderer(const std::string& callId) {
...
@@ -328,6 +321,8 @@ VideoView::pushRenderer(const std::string& callId) {
auto
callModel
=
LRCInstance
::
getCurrentCallModel
();
auto
callModel
=
LRCInstance
::
getCurrentCallModel
();
QObject
::
disconnect
(
videoStartedConnection_
);
QObject
::
disconnect
(
videoStartedConnection_
);
QObject
::
disconnect
(
callStatusChangedConnection_
);
if
(
!
callModel
->
hasCall
(
callId
))
{
if
(
!
callModel
->
hasCall
(
callId
))
{
return
;
return
;
}
}
...
@@ -337,6 +332,9 @@ VideoView::pushRenderer(const std::string& callId) {
...
@@ -337,6 +332,9 @@ VideoView::pushRenderer(const std::string& callId) {
this
->
overlay_
->
callStarted
(
callId
);
this
->
overlay_
->
callStarted
(
callId
);
this
->
overlay_
->
setVideoMuteVisibility
(
!
LRCInstance
::
getCurrentCallModel
()
->
getCall
(
callId
).
isAudioOnly
);
this
->
overlay_
->
setVideoMuteVisibility
(
!
LRCInstance
::
getCurrentCallModel
()
->
getCall
(
callId
).
isAudioOnly
);
callStatusChangedConnection_
=
QObject
::
connect
(
callModel
,
&
lrc
::
api
::
NewCallModel
::
callStatusChanged
,
this
,
&
VideoView
::
slotCallStatusChanged
);
videoStartedConnection_
=
QObject
::
connect
(
callModel
,
&
lrc
::
api
::
NewCallModel
::
remotePreviewStarted
,
videoStartedConnection_
=
QObject
::
connect
(
callModel
,
&
lrc
::
api
::
NewCallModel
::
remotePreviewStarted
,
[
this
](
const
std
::
string
&
callId
,
Video
::
Renderer
*
renderer
)
{
[
this
](
const
std
::
string
&
callId
,
Video
::
Renderer
*
renderer
)
{
Q_UNUSED
(
callId
);
Q_UNUSED
(
callId
);
...
...
This diff is collapsed.
Click to expand it.
videoview.h
+
2
−
3
View file @
7cc79c08
...
@@ -57,8 +57,7 @@ protected:
...
@@ -57,8 +57,7 @@ protected:
void
mouseMoveEvent
(
QMouseEvent
*
event
);
void
mouseMoveEvent
(
QMouseEvent
*
event
);
private
slots
:
private
slots
:
void
callStateChanged
(
Call
*
call
,
Call
::
State
previousState
);
void
slotCallStatusChanged
(
const
std
::
string
&
callId
);
void
updateCall
();
void
showContextMenu
(
const
QPoint
&
pos
);
void
showContextMenu
(
const
QPoint
&
pos
);
void
slotVideoStarted
(
Video
::
Renderer
*
renderer
);
void
slotVideoStarted
(
Video
::
Renderer
*
renderer
);
void
fadeOverlayOut
();
void
fadeOverlayOut
();
...
@@ -73,6 +72,7 @@ private:
...
@@ -73,6 +72,7 @@ private:
QSize
oldSize_
;
QSize
oldSize_
;
QMetaObject
::
Connection
timerConnection_
;
QMetaObject
::
Connection
timerConnection_
;
QMetaObject
::
Connection
videoStartedConnection_
;
QMetaObject
::
Connection
videoStartedConnection_
;
QMetaObject
::
Connection
callStatusChangedConnection_
;
QPoint
origin_
;
QPoint
origin_
;
QPoint
originMouseDisplacement_
;
QPoint
originMouseDisplacement_
;
bool
draggingPreview_
=
false
;
bool
draggingPreview_
=
false
;
...
@@ -102,4 +102,3 @@ signals:
...
@@ -102,4 +102,3 @@ signals:
void
toggleFullScreenClicked
();
void
toggleFullScreenClicked
();
void
closing
(
const
std
::
string
&
callid
);
void
closing
(
const
std
::
string
&
callid
);
};
};
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment