~noskcaj/ubuntu/saucy/sflphone/merge-1.2.3-2

« back to all changes in this revision

Viewing changes to gnome/src/uimanager.c

  • Committer: Package Import Robot
  • Author(s): Francois Marier
  • Date: 2012-02-18 21:47:09 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20120218214709-6362d71gqdsdkrj5
Tags: 1.0.2-1
* New upstream release
  - remove logging patch (applied upstream)
  - update s390 patch since it was partially applied upstream
* Include the Evolution plugin as a separate binary package

* Fix compilation issues on SH4 (closes: #658987)
* Merge Ubuntu's binutils-gold linking fix

Show diffs side-by-side

added added

removed removed

Lines of Context:
103
103
        gtk_container_remove(GTK_CONTAINER(toolbar_), widget);
104
104
}
105
105
 
 
106
static bool
 
107
is_non_empty(const char *str)
 
108
{
 
109
    return str && strlen(str) > 0;
 
110
}
 
111
 
 
112
/* Inserts an item in a toolbar at a given position, making sure that the index
 
113
 * is valid, that it does not exceed the number of elements */
 
114
static void add_to_toolbar(GtkWidget *toolbar, GtkWidget *item, int pos)
 
115
{
 
116
    g_assert(gtk_toolbar_get_n_items(GTK_TOOLBAR(toolbar)) >= pos);
 
117
    gtk_toolbar_insert(GTK_TOOLBAR(toolbar), GTK_TOOL_ITEM(item), pos);
 
118
}
 
119
 
106
120
void
107
121
update_actions()
108
122
{
109
 
    DEBUG("UIManager: Update action");
110
 
 
111
123
    gtk_action_set_sensitive(newCallAction_, TRUE);
112
124
    gtk_action_set_sensitive(pickUpAction_, FALSE);
113
125
    gtk_action_set_sensitive(hangUpAction_, FALSE);
157
169
    remove_from_toolbar(newCallWidget_);
158
170
    remove_from_toolbar(pickUpWidget_);
159
171
 
160
 
    gtk_toolbar_insert(GTK_TOOLBAR(toolbar_), GTK_TOOL_ITEM(newCallWidget_), 0);
 
172
    add_to_toolbar(toolbar_, newCallWidget_, 0);
161
173
 
162
174
    remove_from_toolbar(playRecordWidget_);
163
175
    remove_from_toolbar(stopRecordWidget_);
164
176
 
165
177
    if (eel_gconf_get_integer(HISTORY_ENABLED)) {
166
 
        gtk_toolbar_insert(GTK_TOOLBAR(toolbar_), GTK_TOOL_ITEM(historyButton_), -1);
 
178
        add_to_toolbar(toolbar_, historyButton_, -1);
167
179
        gtk_widget_set_sensitive(historyButton_, TRUE);
168
180
    }
169
181
 
170
182
    // If addressbook support has been enabled and all addressbooks are loaded, display the icon
171
183
    if (addrbook && addrbook->is_ready() && addressbook_config_load_parameters()->enable) {
172
 
        gtk_toolbar_insert(GTK_TOOLBAR(toolbar_), GTK_TOOL_ITEM(contactButton_), -1);
 
184
        add_to_toolbar(toolbar_, contactButton_, -1);
173
185
 
174
186
        // Make the icon clickable only if at least one address book is active
175
187
        if (addrbook->is_active()) {
196
208
 
197
209
        switch (selectedCall->_state) {
198
210
            case CALL_STATE_INCOMING:
199
 
                DEBUG("UIManager: Call State Incoming");
200
 
                // Make the button toolbar clickable
201
 
                gtk_action_set_sensitive(pickUpAction_, TRUE);
202
 
                gtk_action_set_sensitive(hangUpAction_, TRUE);
203
 
                // Replace the dial button with the hangup button
204
 
                g_object_ref(newCallWidget_);
205
 
                remove_from_toolbar(newCallWidget_);
206
 
                gtk_toolbar_insert(GTK_TOOLBAR(toolbar_), GTK_TOOL_ITEM(pickUpWidget_),
207
 
                                   0);
208
 
                gtk_toolbar_insert(GTK_TOOLBAR(toolbar_), GTK_TOOL_ITEM(hangUpWidget_),
209
 
                                   1);
210
 
                break;
 
211
                {
 
212
                    DEBUG("UIManager: Call State Incoming");
 
213
                    // Make the button toolbar clickable
 
214
                    gtk_action_set_sensitive(pickUpAction_, TRUE);
 
215
                    gtk_action_set_sensitive(hangUpAction_, TRUE);
 
216
                    // Replace the dial button with the hangup button
 
217
                    g_object_ref(newCallWidget_);
 
218
                    remove_from_toolbar(newCallWidget_);
 
219
                    int pos = 0;
 
220
                    add_to_toolbar(toolbar_, pickUpWidget_, pos++);
 
221
                    add_to_toolbar(toolbar_, hangUpWidget_, pos);
 
222
                    break;
 
223
                }
211
224
            case CALL_STATE_HOLD:
212
 
                DEBUG("UIManager: Call State Hold");
213
 
                gtk_action_set_sensitive(hangUpAction_, TRUE);
214
 
                gtk_widget_set_sensitive(holdMenu_, TRUE);
215
 
                gtk_widget_set_sensitive(offHoldToolbar_, TRUE);
216
 
                gtk_widget_set_sensitive(newCallWidget_, TRUE);
217
 
 
218
 
                // Replace the hold button with the off-hold button
219
 
                gtk_toolbar_insert(GTK_TOOLBAR(toolbar_), GTK_TOOL_ITEM(hangUpWidget_), 1);
220
 
                gtk_toolbar_insert(GTK_TOOLBAR(toolbar_), GTK_TOOL_ITEM(offHoldToolbar_), 2);
221
 
 
222
 
                if (instant_messaging_enabled) {
223
 
                    gtk_action_set_sensitive(imAction_, TRUE);
224
 
                    gtk_toolbar_insert(GTK_TOOLBAR(toolbar_), GTK_TOOL_ITEM(imToolbar_), 3);
 
225
                {
 
226
                    DEBUG("UIManager: Call State Hold");
 
227
                    gtk_action_set_sensitive(hangUpAction_, TRUE);
 
228
                    gtk_widget_set_sensitive(holdMenu_, TRUE);
 
229
                    gtk_widget_set_sensitive(offHoldToolbar_, TRUE);
 
230
                    gtk_widget_set_sensitive(newCallWidget_, TRUE);
 
231
 
 
232
                    // Replace the hold button with the off-hold button
 
233
                    int pos = 1;
 
234
                    add_to_toolbar(toolbar_, hangUpWidget_, pos++);
 
235
                    add_to_toolbar(toolbar_, offHoldToolbar_, pos++);
 
236
 
 
237
                    if (instant_messaging_enabled) {
 
238
                        gtk_action_set_sensitive(imAction_, TRUE);
 
239
                        add_to_toolbar(toolbar_, imToolbar_, pos);
 
240
                    }
 
241
 
 
242
                    break;
225
243
                }
226
 
 
227
 
                break;
228
244
            case CALL_STATE_RINGING:
229
 
                DEBUG("UIManager: Call State Ringing");
230
 
                gtk_action_set_sensitive(pickUpAction_, TRUE);
231
 
                gtk_action_set_sensitive(hangUpAction_, TRUE);
232
 
                gtk_toolbar_insert(GTK_TOOLBAR(toolbar_), GTK_TOOL_ITEM(hangUpWidget_), 1);
233
 
                break;
 
245
                {
 
246
                    DEBUG("UIManager: Call State Ringing");
 
247
                    gtk_action_set_sensitive(pickUpAction_, TRUE);
 
248
                    gtk_action_set_sensitive(hangUpAction_, TRUE);
 
249
                    int pos = 1;
 
250
                    add_to_toolbar(toolbar_, hangUpWidget_, pos);
 
251
                    break;
 
252
                }
234
253
            case CALL_STATE_DIALING:
235
 
                DEBUG("UIManager: Call State Dialing");
236
 
                gtk_action_set_sensitive(pickUpAction_, TRUE);
237
 
 
238
 
                if (active_calltree_tab == current_calls_tab)
239
 
                    gtk_action_set_sensitive(hangUpAction_, TRUE);
240
 
 
241
 
                g_object_ref(newCallWidget_);
242
 
                remove_from_toolbar(newCallWidget_);
243
 
                gtk_toolbar_insert(GTK_TOOLBAR(toolbar_), GTK_TOOL_ITEM(pickUpWidget_), 0);
244
 
 
245
 
                if (active_calltree_tab == current_calls_tab)
246
 
                    gtk_toolbar_insert(GTK_TOOLBAR(toolbar_), GTK_TOOL_ITEM(hangUpWidget_), 1);
247
 
                else if (active_calltree_tab == history_tab) {
248
 
                    if (selectedCall->_recordfile && strlen(selectedCall->_recordfile) > 0) {
249
 
                        if (selectedCall->_record_is_playing)
250
 
                            gtk_toolbar_insert(GTK_TOOLBAR(toolbar_), GTK_TOOL_ITEM(stopRecordWidget_), 3);
251
 
                        else
252
 
                            gtk_toolbar_insert(GTK_TOOLBAR(toolbar_), GTK_TOOL_ITEM(playRecordWidget_), 3);
253
 
                    }
254
 
                }
255
 
 
256
 
                break;
257
 
            case CALL_STATE_CURRENT: {
258
 
                DEBUG("UIManager: Call State Current");
259
 
                gtk_action_set_sensitive(hangUpAction_, TRUE);
260
 
                int pos = 1;
261
 
                gtk_toolbar_insert(GTK_TOOLBAR(toolbar_), GTK_TOOL_ITEM(hangUpWidget_), pos++);
262
 
                gtk_widget_set_sensitive(holdMenu_, TRUE);
263
 
                gtk_widget_set_sensitive(holdToolbar_, TRUE);
264
 
                gtk_widget_set_sensitive(transferToolbar_, TRUE);
265
 
                gtk_action_set_sensitive(recordAction_, TRUE);
266
 
                gtk_toolbar_insert(GTK_TOOLBAR(toolbar_), GTK_TOOL_ITEM(holdToolbar_), pos++);
267
 
                gtk_toolbar_insert(GTK_TOOLBAR(toolbar_), GTK_TOOL_ITEM(transferToolbar_), pos++);
268
 
                gtk_toolbar_insert(GTK_TOOLBAR(toolbar_), GTK_TOOL_ITEM(recordWidget_), pos++);
269
 
                g_signal_handler_block(transferToolbar_, transferButtonConnId_);
270
 
                gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(transferToolbar_), FALSE);
271
 
                g_signal_handler_unblock(transferToolbar_, transferButtonConnId_);
272
 
                g_signal_handler_block(recordWidget_, recordButtonConnId_);
273
 
                gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(recordWidget_), FALSE);
274
 
                g_signal_handler_unblock(recordWidget_, recordButtonConnId_);
275
 
 
276
 
                if (instant_messaging_enabled) {
277
 
                    gtk_action_set_sensitive(imAction_, TRUE);
278
 
                    gtk_toolbar_insert(GTK_TOOLBAR(toolbar_), GTK_TOOL_ITEM(imToolbar_), pos);
279
 
                }
280
 
 
281
 
                break;
282
 
            }
283
 
 
284
 
            case CALL_STATE_RECORD: {
285
 
                DEBUG("UIManager: Call State Record");
286
 
                int pos = 1;
287
 
                gtk_action_set_sensitive(hangUpAction_, TRUE);
288
 
                gtk_toolbar_insert(GTK_TOOLBAR(toolbar_), GTK_TOOL_ITEM(hangUpWidget_), pos++);
289
 
                gtk_widget_set_sensitive(holdMenu_, TRUE);
290
 
                gtk_widget_set_sensitive(holdToolbar_, TRUE);
291
 
                gtk_widget_set_sensitive(transferToolbar_, TRUE);
292
 
                gtk_action_set_sensitive(recordAction_, TRUE);
293
 
                gtk_toolbar_insert(GTK_TOOLBAR(toolbar_), GTK_TOOL_ITEM(holdToolbar_), pos++);
294
 
                gtk_toolbar_insert(GTK_TOOLBAR(toolbar_), GTK_TOOL_ITEM(transferToolbar_), pos++);
295
 
                gtk_toolbar_insert(GTK_TOOLBAR(toolbar_), GTK_TOOL_ITEM(recordWidget_), pos++);
296
 
                g_signal_handler_block(transferToolbar_, transferButtonConnId_);
297
 
                gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(transferToolbar_), FALSE);
298
 
                g_signal_handler_unblock(transferToolbar_, transferButtonConnId_);
299
 
                g_signal_handler_block(recordWidget_, recordButtonConnId_);
300
 
                gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(recordWidget_), TRUE);
301
 
                g_signal_handler_unblock(recordWidget_, recordButtonConnId_);
302
 
 
303
 
                if (instant_messaging_enabled) {
304
 
                    gtk_action_set_sensitive(imAction_, TRUE);
305
 
                    gtk_toolbar_insert(GTK_TOOLBAR(toolbar_), GTK_TOOL_ITEM(imToolbar_), pos);
306
 
                }
307
 
 
308
 
                break;
309
 
            }
 
254
                {
 
255
                    DEBUG("UIManager: Call State Dialing");
 
256
                    gtk_action_set_sensitive(pickUpAction_, TRUE);
 
257
 
 
258
                    if (active_calltree_tab == current_calls_tab)
 
259
                        gtk_action_set_sensitive(hangUpAction_, TRUE);
 
260
 
 
261
                    g_object_ref(newCallWidget_);
 
262
                    remove_from_toolbar(newCallWidget_);
 
263
                    int pos = 0;
 
264
                    add_to_toolbar(toolbar_, pickUpWidget_, pos++);
 
265
 
 
266
                    if (active_calltree_tab == current_calls_tab)
 
267
                        add_to_toolbar(toolbar_, hangUpWidget_, pos++);
 
268
                    else if (active_calltree_tab == history_tab) {
 
269
                        if (is_non_empty(selectedCall->_recordfile)) {
 
270
                            if (selectedCall->_record_is_playing)
 
271
                                add_to_toolbar(toolbar_, stopRecordWidget_, pos);
 
272
                            else
 
273
                                add_to_toolbar(toolbar_, playRecordWidget_, pos);
 
274
                        }
 
275
                    }
 
276
                    break;
 
277
                }
 
278
            case CALL_STATE_CURRENT:
 
279
                {
 
280
                    DEBUG("UIManager: Call State Current");
 
281
                    gtk_action_set_sensitive(hangUpAction_, TRUE);
 
282
                    int pos = 1;
 
283
                    add_to_toolbar(toolbar_, hangUpWidget_, pos++);
 
284
                    gtk_widget_set_sensitive(holdMenu_, TRUE);
 
285
                    gtk_widget_set_sensitive(holdToolbar_, TRUE);
 
286
                    gtk_widget_set_sensitive(transferToolbar_, TRUE);
 
287
                    gtk_action_set_sensitive(recordAction_, TRUE);
 
288
                    add_to_toolbar(toolbar_, holdToolbar_, pos++);
 
289
                    add_to_toolbar(toolbar_, transferToolbar_, pos++);
 
290
                    add_to_toolbar(toolbar_, recordWidget_, pos++);
 
291
                    g_signal_handler_block(transferToolbar_, transferButtonConnId_);
 
292
                    gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(transferToolbar_), FALSE);
 
293
                    g_signal_handler_unblock(transferToolbar_, transferButtonConnId_);
 
294
                    g_signal_handler_block(recordWidget_, recordButtonConnId_);
 
295
                    gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(recordWidget_), FALSE);
 
296
                    g_signal_handler_unblock(recordWidget_, recordButtonConnId_);
 
297
 
 
298
                    if (instant_messaging_enabled) {
 
299
                        gtk_action_set_sensitive(imAction_, TRUE);
 
300
                        add_to_toolbar(toolbar_, imToolbar_, pos);
 
301
                    }
 
302
 
 
303
                    break;
 
304
                }
 
305
 
 
306
            case CALL_STATE_RECORD:
 
307
                {
 
308
                    DEBUG("UIManager: Call State Record");
 
309
                    int pos = 1;
 
310
                    gtk_action_set_sensitive(hangUpAction_, TRUE);
 
311
                    add_to_toolbar(toolbar_, hangUpWidget_, pos++);
 
312
                    gtk_widget_set_sensitive(holdMenu_, TRUE);
 
313
                    gtk_widget_set_sensitive(holdToolbar_, TRUE);
 
314
                    gtk_widget_set_sensitive(transferToolbar_, TRUE);
 
315
                    gtk_action_set_sensitive(recordAction_, TRUE);
 
316
                    add_to_toolbar(toolbar_, holdToolbar_, pos++);
 
317
                    add_to_toolbar(toolbar_, transferToolbar_, pos++);
 
318
                    add_to_toolbar(toolbar_, recordWidget_, pos++);
 
319
                    g_signal_handler_block(transferToolbar_, transferButtonConnId_);
 
320
                    gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(transferToolbar_), FALSE);
 
321
                    g_signal_handler_unblock(transferToolbar_, transferButtonConnId_);
 
322
                    g_signal_handler_block(recordWidget_, recordButtonConnId_);
 
323
                    gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(recordWidget_), TRUE);
 
324
                    g_signal_handler_unblock(recordWidget_, recordButtonConnId_);
 
325
 
 
326
                    if (instant_messaging_enabled) {
 
327
                        gtk_action_set_sensitive(imAction_, TRUE);
 
328
                        add_to_toolbar(toolbar_, imToolbar_, pos);
 
329
                    }
 
330
 
 
331
                    break;
 
332
                }
310
333
            case CALL_STATE_BUSY:
311
334
            case CALL_STATE_FAILURE:
312
 
                DEBUG("UIManager: Call State Busy/Failure");
313
 
                gtk_action_set_sensitive(hangUpAction_, TRUE);
314
 
                gtk_toolbar_insert(GTK_TOOLBAR(toolbar_), GTK_TOOL_ITEM(hangUpWidget_), 1);
315
 
                break;
 
335
                {
 
336
                    int pos = 1;
 
337
                    DEBUG("UIManager: Call State Busy/Failure");
 
338
                    gtk_action_set_sensitive(hangUpAction_, TRUE);
 
339
                    add_to_toolbar(toolbar_, hangUpWidget_, pos);
 
340
                    break;
 
341
                }
316
342
            case CALL_STATE_TRANSFER:
317
 
                gtk_toolbar_insert(GTK_TOOLBAR(toolbar_), GTK_TOOL_ITEM(hangUpWidget_), 1);
318
 
                gtk_toolbar_insert(GTK_TOOLBAR(toolbar_), GTK_TOOL_ITEM(transferToolbar_), 2);
319
 
                g_signal_handler_block(transferToolbar_, transferButtonConnId_);
320
 
                gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(transferToolbar_), TRUE);
321
 
                g_signal_handler_unblock(transferToolbar_, transferButtonConnId_);
322
 
                gtk_action_set_sensitive(hangUpAction_, TRUE);
323
 
                gtk_widget_set_sensitive(holdMenu_, TRUE);
324
 
                gtk_widget_set_sensitive(holdToolbar_, TRUE);
325
 
                gtk_widget_set_sensitive(transferToolbar_, TRUE);
326
 
                break;
 
343
                {
 
344
                    int pos = 1;
 
345
                    add_to_toolbar(toolbar_, hangUpWidget_, pos++);
 
346
                    add_to_toolbar(toolbar_, transferToolbar_, pos);
 
347
                    g_signal_handler_block(transferToolbar_, transferButtonConnId_);
 
348
                    gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(transferToolbar_), TRUE);
 
349
                    g_signal_handler_unblock(transferToolbar_, transferButtonConnId_);
 
350
                    gtk_action_set_sensitive(hangUpAction_, TRUE);
 
351
                    gtk_widget_set_sensitive(holdMenu_, TRUE);
 
352
                    gtk_widget_set_sensitive(holdToolbar_, TRUE);
 
353
                    gtk_widget_set_sensitive(transferToolbar_, TRUE);
 
354
                    break;
 
355
                }
327
356
            default:
328
357
                ERROR("UIMAnager: Error: Unknown state in action update!");
329
358
                break;
342
371
                DEBUG("UIManager: Conference State Active");
343
372
 
344
373
                if (active_calltree_tab == current_calls_tab) {
345
 
                    int pos = 1;
346
374
                    gtk_action_set_sensitive(hangUpAction_, TRUE);
347
375
                    gtk_widget_set_sensitive(holdToolbar_, TRUE);
348
376
                    gtk_action_set_sensitive(recordAction_, TRUE);
349
 
                    gtk_toolbar_insert(GTK_TOOLBAR(toolbar_), GTK_TOOL_ITEM(hangUpWidget_), pos++);
350
 
                    gtk_toolbar_insert(GTK_TOOLBAR(toolbar_), GTK_TOOL_ITEM(holdToolbar_), pos++);
351
 
                    gtk_toolbar_insert(GTK_TOOLBAR(toolbar_), GTK_TOOL_ITEM(recordWidget_), pos++);
 
377
                    int pos = 1;
 
378
                    add_to_toolbar(toolbar_, hangUpWidget_, pos++);
 
379
                    add_to_toolbar(toolbar_, holdToolbar_, pos++);
 
380
                    add_to_toolbar(toolbar_, recordWidget_, pos++);
352
381
 
353
382
                    if (instant_messaging_enabled) {
354
383
                        gtk_action_set_sensitive(imAction_, TRUE);
355
 
                        gtk_toolbar_insert(GTK_TOOLBAR(toolbar_), GTK_TOOL_ITEM(imToolbar_), pos);
 
384
                        add_to_toolbar(toolbar_, imToolbar_, pos);
356
385
                    }
357
386
                } else if (active_calltree_tab == history_tab) {
358
 
                    if (selectedConf->_recordfile && strlen(selectedConf->_recordfile) > 0) {
 
387
                    if (is_non_empty(selectedConf->_recordfile)) {
 
388
                        int pos = 2;
359
389
                        if (selectedConf->_record_is_playing)
360
 
                            gtk_toolbar_insert(GTK_TOOLBAR(toolbar_), GTK_TOOL_ITEM(stopRecordWidget_), 3);
 
390
                            add_to_toolbar(toolbar_, stopRecordWidget_, pos);
361
391
                        else
362
 
                            gtk_toolbar_insert(GTK_TOOLBAR(toolbar_), GTK_TOOL_ITEM(playRecordWidget_), 3);
 
392
                            add_to_toolbar(toolbar_, playRecordWidget_, pos);
363
393
                    }
364
394
                }
365
395
 
371
401
                gtk_action_set_sensitive(hangUpAction_, TRUE);
372
402
                gtk_widget_set_sensitive(holdToolbar_, TRUE);
373
403
                gtk_action_set_sensitive(recordAction_, TRUE);
374
 
                gtk_toolbar_insert(GTK_TOOLBAR(toolbar_), GTK_TOOL_ITEM(hangUpWidget_), pos++);
375
 
                gtk_toolbar_insert(GTK_TOOLBAR(toolbar_), GTK_TOOL_ITEM(holdToolbar_), pos++);
376
 
                gtk_toolbar_insert(GTK_TOOLBAR(toolbar_), GTK_TOOL_ITEM(recordWidget_), pos++);
 
404
                add_to_toolbar(toolbar_, hangUpWidget_, pos++);
 
405
                add_to_toolbar(toolbar_, holdToolbar_, pos++);
 
406
                add_to_toolbar(toolbar_, recordWidget_, pos++);
377
407
 
378
408
                if (instant_messaging_enabled) {
379
409
                    gtk_action_set_sensitive(imAction_, TRUE);
380
 
                    gtk_toolbar_insert(GTK_TOOLBAR(toolbar_), GTK_TOOL_ITEM(imToolbar_), pos);
 
410
                    add_to_toolbar(toolbar_, imToolbar_, pos);
381
411
                }
382
412
 
383
413
                break;
389
419
                gtk_action_set_sensitive(hangUpAction_, TRUE);
390
420
                gtk_widget_set_sensitive(offHoldToolbar_, TRUE);
391
421
                gtk_action_set_sensitive(recordAction_, TRUE);
392
 
                gtk_toolbar_insert(GTK_TOOLBAR(toolbar_), GTK_TOOL_ITEM(hangUpWidget_), pos++);
393
 
                gtk_toolbar_insert(GTK_TOOLBAR(toolbar_), GTK_TOOL_ITEM(offHoldToolbar_), pos++);
394
 
                gtk_toolbar_insert(GTK_TOOLBAR(toolbar_), GTK_TOOL_ITEM(recordWidget_), pos++);
 
422
                add_to_toolbar(toolbar_, hangUpWidget_, pos++);
 
423
                add_to_toolbar(toolbar_, offHoldToolbar_, pos++);
 
424
                add_to_toolbar(toolbar_, recordWidget_, pos++);
395
425
 
396
426
                if (instant_messaging_enabled) {
397
427
                    gtk_action_set_sensitive(imAction_, TRUE);
398
 
                    gtk_toolbar_insert(GTK_TOOLBAR(toolbar_), GTK_TOOL_ITEM(imToolbar_), pos);
 
428
                    add_to_toolbar(toolbar_, imToolbar_, pos);
399
429
                }
400
430
 
401
431
                break;
409
439
        hide_status_hangup_icon();
410
440
 
411
441
        if (account_list_get_size() > 0 && current_account_has_mailbox()) {
412
 
            gtk_toolbar_insert(GTK_TOOLBAR(toolbar_),
413
 
                               GTK_TOOL_ITEM(voicemailToolbar_), -2);
 
442
            add_to_toolbar(toolbar_, voicemailToolbar_, -1);
414
443
            update_voicemail_status();
415
444
        }
416
445
    }
771
800
    }
772
801
 
773
802
    callable_obj_t *new_call = create_new_call(CALL, CALL_STATE_DIALING, "",
774
 
                               "", selected_call->_peer_name,
 
803
                               "", selected_call->_display_name,
775
804
                               selected_call->_peer_number);
776
805
 
777
806
    calllist_add_call(current_calls_tab, new_call);
866
895
                    gchar * temp = g_strconcat(selectedCall->_peer_number,
867
896
                                               oneNo, NULL);
868
897
                    g_free(selectedCall->_peer_info);
869
 
                    selectedCall->_peer_info = get_peer_info(temp, selectedCall->_peer_name);
 
898
                    selectedCall->_peer_info = get_peer_info(temp, selectedCall->_display_name);
870
899
                    g_free(temp);
871
900
                    g_free(oneNo);
872
901
                    calltree_update_call(current_calls_tab, selectedCall);
895
924
clear_history(void)
896
925
{
897
926
    calllist_clean_history();
 
927
    dbus_clear_history();
898
928
}
899
929
 
900
930
/**
1454
1484
 
1455
1485
    // Create the new call
1456
1486
    callable_obj_t *modified_call = create_new_call(CALL, CALL_STATE_DIALING, "", original->_accountID,
1457
 
                                    original->_peer_name, new_number);
 
1487
                                    original->_display_name, new_number);
1458
1488
 
1459
1489
    // Update the internal data structure and the GUI
1460
1490
    calllist_add_call(current_calls_tab, modified_call);