Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-client-windows
Commits
1b197eb0
Commit
1b197eb0
authored
Jun 01, 2015
by
Edric Milaret
Committed by
Guillaume Roguez
Jun 02, 2015
Browse files
im: link ui to LRC media text API
Refs #74275 Change-Id: If02ceef8b7bf7dce2785953377c873d5d6b13272
parent
a34e4bac
Changes
4
Hide whitespace changes
Inline
Side-by-side
callwidget.cpp
View file @
1b197eb0
...
...
@@ -30,6 +30,9 @@
#include "historydelegate.h"
#include "contactdelegate.h"
#include "localhistorycollection.h"
#include "media/text.h"
#include "media/recording.h"
#include "media/textrecording.h"
#include "wizarddialog.h"
...
...
@@ -221,6 +224,51 @@ CallWidget::callStateChanged(Call* call, Call::State previousState)
ui
->
callStateLabel
->
setText
(
"Call State : "
+
state
.
at
((
int
)
call
->
state
()));
}
void
CallWidget
::
setMediaText
(
Call
*
call
)
{
if
(
call
!=
nullptr
)
{
connect
(
call
,
SIGNAL
(
mediaAdded
(
Media
::
Media
*
)),
this
,
SLOT
(
mediaAdd
(
Media
::
Media
*
)));
Media
::
Text
*
textMedia
=
call
->
addOutgoingMedia
<
Media
::
Text
>
();
connect
(
ui
->
messageInput
,
&
QLineEdit
::
returnPressed
,
[
=
]()
{
textMedia
->
send
(
ui
->
messageInput
->
text
());
ui
->
messageInput
->
clear
();
});
ui
->
messageInput
->
show
();
}
else
{
ui
->
messageOutput
->
disconnect
();
ui
->
messageInput
->
disconnect
();
ui
->
messageOutput
->
hide
();
ui
->
messageInput
->
hide
();
}
}
void
CallWidget
::
mediaAdd
(
Media
::
Media
*
media
)
{
switch
(
static_cast
<
int
>
(
media
->
type
()))
{
case
0
:
/*AUDIO*/
break
;
case
1
:
/*VIDEO*/
break
;
case
2
:
/*TEXT*/
if
(
media
->
direction
()
==
Media
::
Text
::
Direction
::
IN
)
{
ui
->
messageOutput
->
setModel
(
static_cast
<
Media
::
Text
*>
(
media
)
->
recording
()
->
instantMessagingModel
());
connect
(
ui
->
messageOutput
->
model
(),
SIGNAL
(
rowsInserted
(
const
QModelIndex
&
,
int
,
int
)),
ui
->
messageOutput
,
SLOT
(
scrollToBottom
()));
ui
->
messageOutput
->
show
();
}
break
;
case
3
:
/*FILE*/
break
;
}
}
void
CallWidget
::
on_callList_activated
(
const
QModelIndex
&
index
)
{
...
...
@@ -317,7 +365,9 @@ CallWidget::setActualCall(Call* value)
actualCall_
=
value
;
ui
->
holdButton
->
setEnabled
(
actualCall_
!=
nullptr
);
ui
->
hangupButton
->
setEnabled
(
actualCall_
!=
nullptr
);
ui
->
messageInput
->
setEnabled
(
actualCall_
!=
nullptr
);
ui
->
messageOutput
->
setEnabled
(
actualCall_
!=
nullptr
);
setMediaText
(
actualCall_
);
}
void
CallWidget
::
on_sortComboBox_currentIndexChanged
(
int
index
)
...
...
callwidget.h
View file @
1b197eb0
...
...
@@ -66,14 +66,14 @@ private slots:
void
on_micSlider_sliderReleased
();
void
on_contactView_doubleClicked
(
const
QModelIndex
&
index
);
void
on_historyList_doubleClicked
(
const
QModelIndex
&
index
);
void
on_sortComboBox_currentIndexChanged
(
int
index
);
private
slots
:
void
callIncoming
(
Call
*
call
);
void
addedCall
(
Call
*
call
,
Call
*
parent
);
void
callStateChanged
(
Call
*
call
,
Call
::
State
previousState
);
void
findRingAccount
(
QModelIndex
idx1
,
QModelIndex
idx2
,
QVector
<
int
>
vec
);
void
on_sortComboBox_currentIndexChanged
(
int
index
);
void
mediaAdd
(
Media
::
Media
*
media
);
private:
Ui
::
CallWidget
*
ui
;
...
...
@@ -86,6 +86,7 @@ private:
private:
void
findRingAccount
();
void
setActualCall
(
Call
*
value
);
void
setMediaText
(
Call
*
call
);
};
#endif // CALLWIDGET_H
callwidget.ui
View file @
1b197eb0
...
...
@@ -405,10 +405,22 @@
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
<property
name=
"flow"
>
<enum>
QListView::TopToBottom
</enum>
</property>
<property
name=
"isWrapping"
stdset=
"0"
>
<bool>
false
</bool>
</property>
<property
name=
"wordWrap"
>
<bool>
true
</bool>
</property>
</widget>
</item>
<item>
<widget
class=
"QLineEdit"
name=
"messageInput"
>
<property
name=
"placeholderText"
>
<string>
Send text message...
</string>
</property>
<property
name=
"clearButtonEnabled"
>
<bool>
true
</bool>
</property>
...
...
main.cpp
View file @
1b197eb0
...
...
@@ -21,12 +21,18 @@
#include <QFile>
#include "callmodel.h"
#include "media/audio.h"
#include "media/video.h"
#include "media/text.h"
#include "media/file.h"
#include <iostream>
#include <QThread>
#include <windows.h>
REGISTER_MEDIA
();
int
main
(
int
argc
,
char
*
argv
[])
{
...
...
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