Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-daemon
Commits
12d9a9de
Commit
12d9a9de
authored
Sep 18, 2007
by
Pierre-Luc Beaudoin
Browse files
Working hang up when dialing
parent
b7b7cdbd
Changes
2
Hide whitespace changes
Inline
Side-by-side
sflphone-gtk/src/actions.c
View file @
12d9a9de
...
...
@@ -201,7 +201,7 @@ sflphone_keypad( guint keyval, gchar * key)
sflphone_place_call
(
c
);
break
;
case
65307
:
/* ESCAPE */
sflphone
_hang_up
(
c
);
dbus
_hang_up
(
c
);
break
;
case
65288
:
/* BACKSPACE */
{
/* Brackets mandatory because of local vars */
...
...
@@ -214,11 +214,11 @@ sflphone_keypad( guint keyval, gchar * key)
g_free
(
c
->
from
);
c
->
from
=
g_strconcat
(
"
\"\"
<"
,
c
->
to
,
">"
,
NULL
);
screen_set_call
(
c
);
update_call_tree
();
update_call_tree
(
c
);
}
else
if
(
strlen
(
c
->
to
)
==
1
)
{
sflphone
_hang_up
(
c
);
dbus
_hang_up
(
c
);
}
}
...
...
@@ -241,7 +241,7 @@ sflphone_keypad( guint keyval, gchar * key)
g_free
(
c
->
from
);
c
->
from
=
g_strconcat
(
"
\"\"
<"
,
c
->
to
,
">"
,
NULL
);
screen_set_call
(
c
);
update_call_tree
();
update_call_tree
(
c
);
}
break
;
}
...
...
@@ -254,23 +254,36 @@ sflphone_keypad( guint keyval, gchar * key)
switch
(
keyval
)
{
case
65307
:
/* ESCAPE */
sflphone
_hang_up
(
c
);
dbus
_hang_up
(
c
);
break
;
}
}
else
// Not in a call, not dialing, create a new call
else
{
if
(
keyval
<
255
||
(
keyval
>
65453
&&
keyval
<
65466
))
{
/* Brackets mandatory because of local vars */
call_t
*
c
=
g_new0
(
call_t
,
1
);
c
->
state
=
CALL_STATE_DIALING
;
c
->
from
=
g_strconcat
(
"
\"\"
<"
,
key
,
">"
,
NULL
);
c
->
callID
=
"asdf"
;
// TODO generate a unique number
c
->
to
=
g_strdup
(
key
);
call_list_add
(
c
);
screen_set_call
(
c
);
update_call_tree
();
call_t
*
c
=
(
call_t
*
)
call_list_get_by_state
(
CALL_STATE_RINGING
);
if
(
c
)
// Currently ring => edit number
{
switch
(
keyval
)
{
case
65307
:
/* ESCAPE */
dbus_hang_up
(
c
);
break
;
}
}
else
{
// Not in a call, not dialing, create a new call
if
(
keyval
<
255
||
(
keyval
>
65453
&&
keyval
<
65466
))
{
/* Brackets mandatory because of local vars */
call_t
*
c
=
g_new0
(
call_t
,
1
);
c
->
state
=
CALL_STATE_DIALING
;
c
->
from
=
g_strconcat
(
"
\"\"
<"
,
key
,
">"
,
NULL
);
c
->
callID
=
"asdf"
;
// TODO generate a unique number
c
->
to
=
g_strdup
(
key
);
call_list_add
(
c
);
screen_set_call
(
c
);
update_call_tree_add
(
c
);
}
}
}
}
...
...
sflphone-gtk/src/calltree.c
View file @
12d9a9de
...
...
@@ -404,7 +404,7 @@ update_call_tree (call_t * c)
{
pixbuf
=
gdk_pixbuf_new_from_file
(
PIXMAPS_DIR
"/hold.svg"
,
NULL
);
}
else
if
(
c
->
state
==
CALL_STATE_RINGING
)
else
if
(
c
->
state
==
CALL_STATE_INCOMING
||
c
->
state
==
CALL_STATE_RINGING
)
{
pixbuf
=
gdk_pixbuf_new_from_file
(
PIXMAPS_DIR
"/ring.svg"
,
NULL
);
}
...
...
@@ -412,6 +412,10 @@ update_call_tree (call_t * c)
{
pixbuf
=
gdk_pixbuf_new_from_file
(
PIXMAPS_DIR
"/current.svg"
,
NULL
);
}
else
if
(
c
->
state
==
CALL_STATE_DIALING
)
{
pixbuf
=
gdk_pixbuf_new_from_file
(
PIXMAPS_DIR
"/dial.svg"
,
NULL
);
}
//Resize it
if
(
pixbuf
)
{
...
...
@@ -446,17 +450,35 @@ update_call_tree_add (call_t * c)
// New call in the list
gchar
*
markup
;
markup
=
g_markup_printf_escaped
(
"<b>%s</b>
\n
"
if
(
c
->
state
==
CALL_STATE_CURRENT
)
{
markup
=
g_markup_printf_escaped
(
"<big><b>%s</b></big>
\n
"
"%s"
,
call_get_name
(
c
),
call_get_number
(
c
));
}
else
{
markup
=
g_markup_printf_escaped
(
"<b>%s</b>
\n
"
"%s"
,
call_get_name
(
c
),
call_get_number
(
c
));
}
gtk_list_store_append
(
store
,
&
iter
);
if
(
c
->
state
==
CALL_STATE_INCOMING
)
if
(
c
->
state
==
CALL_STATE_HOLD
)
{
pixbuf
=
gdk_pixbuf_new_from_file
(
PIXMAPS_DIR
"/hold.svg"
,
NULL
);
}
else
if
(
c
->
state
==
CALL_STATE_INCOMING
||
c
->
state
==
CALL_STATE_RINGING
)
{
pixbuf
=
gdk_pixbuf_new_from_file
(
PIXMAPS_DIR
"/ring.svg"
,
NULL
);
}
else
if
(
c
->
state
==
CALL_STATE_CURRENT
)
{
pixbuf
=
gdk_pixbuf_new_from_file
(
PIXMAPS_DIR
"/current.svg"
,
NULL
);
}
else
if
(
c
->
state
==
CALL_STATE_DIALING
)
{
pixbuf
=
gdk_pixbuf_new_from_file
(
PIXMAPS_DIR
"/dial.svg"
,
NULL
);
...
...
@@ -479,6 +501,8 @@ update_call_tree_add (call_t * c)
g_object_unref
(
G_OBJECT
(
pixbuf
));
//g_free(markup);
update_buttons
();
//return row_ref;
}
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment