Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
savoirfairelinux
jami-daemon
Commits
7bcd6e91
Commit
7bcd6e91
authored
Oct 03, 2005
by
jpbl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
we can mute
parent
4efc809c
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
115 additions
and
11 deletions
+115
-11
src/gui/official/JPushButton.cpp
src/gui/official/JPushButton.cpp
+26
-8
src/gui/official/JPushButton.hpp
src/gui/official/JPushButton.hpp
+8
-2
src/gui/official/PhoneLine.cpp
src/gui/official/PhoneLine.cpp
+0
-1
src/gui/official/PhoneLineManagerImpl.cpp
src/gui/official/PhoneLineManagerImpl.cpp
+27
-0
src/gui/official/PhoneLineManagerImpl.hpp
src/gui/official/PhoneLineManagerImpl.hpp
+19
-0
src/gui/official/SFLPhoneApp.cpp
src/gui/official/SFLPhoneApp.cpp
+4
-0
src/gui/official/SFLPhoneWindow.cpp
src/gui/official/SFLPhoneWindow.cpp
+6
-0
src/gui/official/SFLPhoneWindow.hpp
src/gui/official/SFLPhoneWindow.hpp
+1
-0
src/gui/official/Session.cpp
src/gui/official/Session.cpp
+12
-0
src/gui/official/Session.hpp
src/gui/official/Session.hpp
+10
-0
src/gui/official/sflphone.qrc
src/gui/official/sflphone.qrc
+2
-0
No files found.
src/gui/official/JPushButton.cpp
View file @
7bcd6e91
...
...
@@ -35,8 +35,9 @@ JPushButton::JPushButton(const QString &released,
QWidget
*
parent
,
Qt
::
WFlags
flags
)
:
QLabel
(
parent
,
flags
)
,
mIsPressed
(
false
)
,
mIsToggling
(
false
)
{
mImages
[
0
]
=
transparize
(
released
);
mImages
[
1
]
=
transparize
(
pressed
);
release
();
...
...
@@ -45,6 +46,12 @@ JPushButton::JPushButton(const QString &released,
JPushButton
::~
JPushButton
()
{}
void
JPushButton
::
setToggle
(
bool
toggle
)
{
mIsToggling
=
toggle
;
}
QPixmap
JPushButton
::
transparize
(
const
QString
&
image
)
{
...
...
@@ -63,9 +70,8 @@ JPushButton::transparize(const QString &image)
}
void
JPushButton
::
release
()
JPushButton
::
release
(
bool
modify
)
{
mIsPressed
=
false
;
setPixmap
(
mImages
[
0
]);
if
(
mImages
[
0
].
hasAlpha
())
{
setMask
(
mImages
[
0
].
mask
());
...
...
@@ -74,9 +80,8 @@ JPushButton::release()
}
void
JPushButton
::
press
()
JPushButton
::
press
(
bool
modify
)
{
mIsPressed
=
true
;
setPixmap
(
mImages
[
1
]);
if
(
mImages
[
1
].
hasAlpha
())
{
setMask
(
mImages
[
1
].
mask
());
...
...
@@ -104,11 +109,24 @@ void
JPushButton
::
mouseReleaseEvent
(
QMouseEvent
*
e
)
{
switch
(
e
->
button
())
{
case
Qt
::
LeftButton
:
release
();
// Emulate the left mouse click
if
(
this
->
rect
().
contains
(
e
->
pos
()))
{
if
(
mIsToggling
)
{
mIsPressed
=
!
mIsPressed
;
if
(
mIsPressed
)
{
press
();
}
else
{
release
();
}
emit
clicked
(
mIsPressed
);
}
else
{
release
();
emit
clicked
();
}
// Emulate the left mouse click
//if (this->rect().contains(e->pos())) {
// emit clicked();
//}
break
;
default:
...
...
src/gui/official/JPushButton.hpp
View file @
7bcd6e91
...
...
@@ -52,8 +52,10 @@ public slots:
/**
* This function will switch the button
*/
virtual
void
press
();
virtual
void
release
();
virtual
void
press
(
bool
modify
=
true
);
virtual
void
release
(
bool
modify
=
true
);
virtual
void
setToggle
(
bool
toggled
);
protected:
QPixmap
mImages
[
2
];
...
...
@@ -63,9 +65,13 @@ protected:
void
mousePressEvent
(
QMouseEvent
*
);
void
mouseReleaseEvent
(
QMouseEvent
*
);
void
mouseMoveEvent
(
QMouseEvent
*
);
signals:
void
clicked
(
bool
);
void
clicked
();
private:
bool
mIsToggling
;
};
#endif // defined(__J_PUSH_BUTTON_H__)
src/gui/official/PhoneLine.cpp
View file @
7bcd6e91
...
...
@@ -284,7 +284,6 @@ PhoneLine::hangup()
unselect
();
}
QString
PhoneLine
::
getCallId
()
{
...
...
src/gui/official/PhoneLineManagerImpl.cpp
View file @
7bcd6e91
...
...
@@ -426,6 +426,33 @@ PhoneLineManagerImpl::hangup()
}
}
void
PhoneLineManagerImpl
::
mute
(
bool
muting
)
{
if
(
muting
)
{
mute
();
}
else
{
unmute
();
}
}
void
PhoneLineManagerImpl
::
mute
()
{
isInitialized
();
mSession
->
mute
();
}
void
PhoneLineManagerImpl
::
unmute
()
{
isInitialized
();
mSession
->
unmute
();
}
void
PhoneLineManagerImpl
::
hangup
(
const
QString
&
callId
)
{
...
...
src/gui/official/PhoneLineManagerImpl.hpp
View file @
7bcd6e91
...
...
@@ -93,6 +93,25 @@ public slots:
*/
void
hangup
();
/**
* This function will mute the current line if muting
* is true, it will unmute otherwise.
* If there's no current line, it will do nothing.
*/
void
mute
(
bool
);
/**
* This function will mute the current line
* If there's no current line, it will do nothing.
*/
void
mute
();
/**
* This function will unmute the current line
* If there's no current line, it will do nothing.
*/
void
unmute
();
/**
* This function will hanp up the line number given
* argument. Be aware that the first line is 1, not
...
...
src/gui/official/SFLPhoneApp.cpp
View file @
7bcd6e91
...
...
@@ -27,6 +27,8 @@ SFLPhoneApp::SFLPhoneApp(int argc, char **argv)
Requester
::
instance
().
registerObject
<
PermanentRequest
>
(
QString
(
"refuse"
));
Requester
::
instance
().
registerObject
<
PermanentRequest
>
(
QString
(
"call"
));
Requester
::
instance
().
registerObject
<
PermanentRequest
>
(
QString
(
"hangup"
));
Requester
::
instance
().
registerObject
<
TemporaryRequest
>
(
QString
(
"mute"
));
Requester
::
instance
().
registerObject
<
TemporaryRequest
>
(
QString
(
"unmute"
));
Requester
::
instance
().
registerObject
<
TemporaryRequest
>
(
QString
(
"hold"
));
Requester
::
instance
().
registerObject
<
TemporaryRequest
>
(
QString
(
"unhold"
));
Requester
::
instance
().
registerObject
<
TemporaryRequest
>
(
QString
(
"senddtmf"
));
...
...
@@ -55,6 +57,8 @@ SFLPhoneApp::initConnections(SFLPhoneWindow *w)
QObject
::
connect
(
w
->
mOk
,
SIGNAL
(
clicked
()),
&
PhoneLineManager
::
instance
(),
SLOT
(
call
()));
QObject
::
connect
(
w
->
mMute
,
SIGNAL
(
clicked
(
bool
)),
&
PhoneLineManager
::
instance
(),
SLOT
(
mute
(
bool
)));
QObject
::
connect
(
w
->
mHangup
,
SIGNAL
(
clicked
()),
&
PhoneLineManager
::
instance
(),
SLOT
(
hangup
()));
QObject
::
connect
(
w
->
mHold
,
SIGNAL
(
clicked
()),
...
...
src/gui/official/SFLPhoneWindow.cpp
View file @
7bcd6e91
...
...
@@ -72,6 +72,12 @@ SFLPhoneWindow::initGUIButtons()
":/sflphone/images/clear_on"
,
this
);
mClear
->
move
(
225
,
130
);
mMute
=
new
JPushButton
(
":/sflphone/images/mute_off"
,
":/sflphone/images/mute_on"
,
this
);
mMute
->
move
(
225
,
94
);
mMute
->
setToggle
(
true
);
}
void
...
...
src/gui/official/SFLPhoneWindow.hpp
View file @
7bcd6e91
...
...
@@ -57,6 +57,7 @@ private:
JPushButton
*
mHold
;
JPushButton
*
mOk
;
JPushButton
*
mClear
;
JPushButton
*
mMute
;
SFLLcd
*
mLcd
;
...
...
src/gui/official/Session.cpp
View file @
7bcd6e91
...
...
@@ -62,6 +62,18 @@ Session::getEvents() const
return
Requester
::
instance
().
send
(
mId
,
"getevents"
,
std
::
list
<
QString
>
());
}
QString
Session
::
mute
()
const
{
return
Requester
::
instance
().
send
(
mId
,
"mute"
,
std
::
list
<
QString
>
());
}
QString
Session
::
unmute
()
const
{
return
Requester
::
instance
().
send
(
mId
,
"unmute"
,
std
::
list
<
QString
>
());
}
QString
Session
::
getCallStatus
()
const
{
...
...
src/gui/official/Session.hpp
View file @
7bcd6e91
...
...
@@ -54,6 +54,16 @@ class Session
*/
QString
getCallStatus
()
const
;
/**
* This function will mute the microphone.
*/
QString
mute
()
const
;
/**
* This function will unmute the microphone.
*/
QString
unmute
()
const
;
/**
* This function will ask to the SessionIO
* linked to this session to connect.
...
...
src/gui/official/sflphone.qrc
View file @
7bcd6e91
...
...
@@ -26,6 +26,8 @@
<file>images/main.png</file>
<file>images/minimize_off.png</file>
<file>images/minimize_on.png</file>
<file>images/mute_off.png</file>
<file>images/mute_on.png</file>
<file>images/ok_off.png</file>
<file>images/ok_on.png</file>
<file>images/overscreen.png</file>
...
...
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