Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
40a68b9d
Commit
40a68b9d
authored
13 years ago
by
Rafaël Carré
Browse files
Options
Downloads
Patches
Plain Diff
* #6886 : hitting backspace on empty number have no side effects
parent
64bf85eb
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gnome/src/actions.c
+19
-47
19 additions, 47 deletions
gnome/src/actions.c
with
19 additions
and
47 deletions
gnome/src/actions.c
+
19
−
47
View file @
40a68b9d
...
@@ -241,23 +241,13 @@ sflphone_hung_up (callable_obj_t * c)
...
@@ -241,23 +241,13 @@ sflphone_hung_up (callable_obj_t * c)
/** Internal to actions: Fill account list */
/** Internal to actions: Fill account list */
void
sflphone_fill_account_list
(
void
)
void
sflphone_fill_account_list
(
void
)
{
{
int
count
=
current_account_get_message_number
();
gchar
**
array
;
gchar
**
accountID
;
unsigned
int
i
;
int
count
;
DEBUG
(
"SFLphone: Fill account list"
);
count
=
current_account_get_message_number
();
account_list_clear
();
account_list_clear
();
array
=
(
gchar
**
)
dbus_account_list
();
gchar
**
array
=
dbus_account_list
();
if
(
array
)
{
if
(
array
)
{
for
(
gchar
**
accountID
=
array
;
*
accountID
;
accountID
++
)
{
for
(
accountID
=
array
;
*
accountID
;
accountID
++
)
{
account_t
*
a
=
g_new0
(
account_t
,
1
);
account_t
*
a
=
g_new0
(
account_t
,
1
);
a
->
accountID
=
g_strdup
(
*
accountID
);
a
->
accountID
=
g_strdup
(
*
accountID
);
a
->
credential_information
=
NULL
;
a
->
credential_information
=
NULL
;
...
@@ -267,7 +257,7 @@ void sflphone_fill_account_list (void)
...
@@ -267,7 +257,7 @@ void sflphone_fill_account_list (void)
g_strfreev
(
array
);
g_strfreev
(
array
);
}
}
for
(
i
=
0
;
i
<
account_list_get_size
();
i
++
)
{
for
(
unsigned
i
=
0
;
i
<
account_list_get_size
();
i
++
)
{
account_t
*
a
=
account_list_get_nth
(
i
);
account_t
*
a
=
account_list_get_nth
(
i
);
if
(
a
==
NULL
)
{
if
(
a
==
NULL
)
{
ERROR
(
"SFLphone: Error: Could not find account %d in list"
,
i
);
ERROR
(
"SFLphone: Error: Could not find account %d in list"
,
i
);
...
@@ -311,12 +301,9 @@ void sflphone_fill_account_list (void)
...
@@ -311,12 +301,9 @@ void sflphone_fill_account_list (void)
a
->
state
=
ACCOUNT_STATE_INVALID
;
a
->
state
=
ACCOUNT_STATE_INVALID
;
}
}
gchar
*
code
=
NULL
;
gchar
*
code
=
g_hash_table_lookup
(
details
,
REGISTRATION_STATE_CODE
);
code
=
g_hash_table_lookup
(
details
,
REGISTRATION_STATE_CODE
);
if
(
code
!=
NULL
)
if
(
code
!=
NULL
)
{
a
->
protocol_state_code
=
atoi
(
code
);
a
->
protocol_state_code
=
atoi
(
code
);
}
g_free
(
a
->
protocol_state_description
);
g_free
(
a
->
protocol_state_description
);
a
->
protocol_state_description
=
g_hash_table_lookup
(
details
,
REGISTRATION_STATE_DESCRIPTION
);
a
->
protocol_state_description
=
g_hash_table_lookup
(
details
,
REGISTRATION_STATE_DESCRIPTION
);
...
@@ -438,13 +425,11 @@ void
...
@@ -438,13 +425,11 @@ void
sflphone_pick_up
()
sflphone_pick_up
()
{
{
callable_obj_t
*
selectedCall
=
calltab_get_selected_call
(
active_calltree
);
callable_obj_t
*
selectedCall
=
calltab_get_selected_call
(
active_calltree
);
DEBUG
(
"SFLphone: Pick up"
);
if
(
!
selectedCall
)
{
if
(
!
selectedCall
)
{
sflphone_new_call
();
sflphone_new_call
();
return
;
return
;
}
}
switch
(
selectedCall
->
_state
)
{
switch
(
selectedCall
->
_state
)
{
case
CALL_STATE_DIALING
:
case
CALL_STATE_DIALING
:
sflphone_place_call
(
selectedCall
);
sflphone_place_call
(
selectedCall
);
...
@@ -489,13 +474,9 @@ sflphone_on_hold ()
...
@@ -489,13 +474,9 @@ sflphone_on_hold ()
callable_obj_t
*
selectedCall
=
calltab_get_selected_call
(
current_calls
);
callable_obj_t
*
selectedCall
=
calltab_get_selected_call
(
current_calls
);
conference_obj_t
*
selectedConf
=
calltab_get_selected_conf
(
active_calltree
);
conference_obj_t
*
selectedConf
=
calltab_get_selected_conf
(
active_calltree
);
DEBUG
(
"sflphone_on_hold"
);
if
(
selectedCall
)
{
if
(
selectedCall
)
{
switch
(
selectedCall
->
_state
)
{
switch
(
selectedCall
->
_state
)
{
case
CALL_STATE_CURRENT
:
case
CALL_STATE_CURRENT
:
dbus_hold
(
selectedCall
);
break
;
case
CALL_STATE_RECORD
:
case
CALL_STATE_RECORD
:
dbus_hold
(
selectedCall
);
dbus_hold
(
selectedCall
);
break
;
break
;
...
@@ -525,8 +506,6 @@ sflphone_off_hold ()
...
@@ -525,8 +506,6 @@ sflphone_off_hold ()
break
;
break
;
}
}
}
else
if
(
selectedConf
)
{
}
else
if
(
selectedConf
)
{
dbus_unhold_conference
(
selectedConf
);
dbus_unhold_conference
(
selectedConf
);
}
}
}
}
...
@@ -626,18 +605,7 @@ sflphone_incoming_call (callable_obj_t * c)
...
@@ -626,18 +605,7 @@ sflphone_incoming_call (callable_obj_t * c)
}
}
}
}
/* Truncates last char from dynamically allocated string */
static
void
static
void
truncate_last_char
(
gchar
**
str
)
{
if
(
strlen
(
*
str
)
>
0
)
{
gchar
*
tmp
=
*
str
;
tmp
=
g_strndup
(
*
str
,
strlen
(
*
str
)
-
1
);
g_free
(
*
str
);
*
str
=
tmp
;
}
}
void
process_dialing
(
callable_obj_t
*
c
,
guint
keyval
,
gchar
*
key
)
process_dialing
(
callable_obj_t
*
c
,
guint
keyval
,
gchar
*
key
)
{
{
// We stop the tone
// We stop the tone
...
@@ -653,18 +621,21 @@ process_dialing (callable_obj_t *c, guint keyval, gchar *key)
...
@@ -653,18 +621,21 @@ process_dialing (callable_obj_t *c, guint keyval, gchar *key)
sflphone_hang_up
();
sflphone_hang_up
();
break
;
break
;
case
GDK_BackSpace
:
case
GDK_BackSpace
:
if
(
c
->
_state
==
CALL_STATE_TRANSFER
)
{
{
truncate_last_char
(
&
c
->
_trsft_to
);
gchar
*
num
=
(
c
->
_state
==
CALL_STATE_TRANSFER
)
?
c
->
_trsft_to
:
c
->
_peer_number
;
calltree_update_call
(
current_calls
,
c
,
NULL
);
size_t
len
=
strlen
(
num
);
}
else
{
printf
(
"
\"
%s
\"
: %zu
\n
"
,
num
,
len
);
truncate_last_char
(
&
c
->
_peer_number
);
if
(
len
)
{
len
--
;
// delete one character
num
[
len
]
=
'\0'
;
calltree_update_call
(
current_calls
,
c
,
NULL
);
calltree_update_call
(
current_calls
,
c
,
NULL
);
/* If number is now empty, hang up immediately */
/* If number is now empty, hang up immediately */
if
(
strlen
(
c
->
_peer_number
)
==
0
)
if
(
c
->
_state
!=
CALL_STATE_TRANSFER
&&
len
==
0
)
dbus_hang_up
(
c
);
dbus_hang_up
(
c
);
}
}
break
;
break
;
}
case
GDK_Tab
:
case
GDK_Tab
:
case
GDK_Alt_L
:
case
GDK_Alt_L
:
case
GDK_Control_L
:
case
GDK_Control_L
:
...
@@ -729,6 +700,7 @@ sflphone_keypad (guint keyval, gchar * key)
...
@@ -729,6 +700,7 @@ sflphone_keypad (guint keyval, gchar * key)
case
GDK_Return
:
case
GDK_Return
:
case
GDK_KP_Enter
:
case
GDK_KP_Enter
:
case
GDK_Escape
:
case
GDK_Escape
:
case
GDK_BackSpace
:
break
;
break
;
default:
default:
calltree_display
(
current_calls
);
calltree_display
(
current_calls
);
...
...
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