~ubuntu-branches/ubuntu/wily/sflphone/wily

« back to all changes in this revision

Viewing changes to gnome/src/uimanager.c

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2014-01-28 18:23:36 UTC
  • mfrom: (1.1.11)
  • mto: This revision was merged to the branch mainline in revision 24.
  • Revision ID: package-import@ubuntu.com-20140128182336-3xenud1kbnwmf3mz
* New upstream release 
  - Fixes "New Upstream Release" (Closes: #735846)
  - Fixes "Ringtone does not stop" (Closes: #727164)
  - Fixes "[sflphone-kde] crash on startup" (Closes: #718178)
  - Fixes "sflphone GUI crashes when call is hung up" (Closes: #736583)
* Build-Depends: ensure GnuTLS 2.6
  - libucommon-dev (>= 6.0.7-1.1), libccrtp-dev (>= 2.0.6-3)
  - Fixes "FTBFS Build-Depends libgnutls{26,28}-dev" (Closes: #722040)
* Fix "boost 1.49 is going away" unversioned Build-Depends: (Closes: #736746)
* Add Build-Depends: libsndfile-dev, nepomuk-core-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 *  Copyright (C) 2004-2012 Savoir-Faire Linux Inc.
 
2
 *  Copyright (C) 2004-2013 Savoir-Faire Linux Inc.
3
3
 *  Author: Pierre-Luc Bacon <pierre-luc.bacon@savoirfairelinux.com
4
4
 *
5
5
 *  This program is free software; you can redistribute it and/or modify
45
45
 
46
46
#include "uimanager.h"
47
47
#include "statusicon.h"
48
 
 
49
48
#include "config/audioconf.h"
50
49
#include "uimanager.h"
51
50
#include "statusicon.h"
64
63
 
65
64
#include "sliders.h"
66
65
 
 
66
#ifdef SFL_PRESENCE
 
67
#include "presencewindow.h"
 
68
#include "presence.h"
 
69
#endif
 
70
 
67
71
typedef struct
68
72
{
69
73
    callable_obj_t *call;
83
87
static GtkAction * copyAction_;
84
88
static GtkAction * pasteAction_;
85
89
static GtkAction * recordAction_;
86
 
static GtkAction * muteAction_;
87
90
static GtkAction * imAction_;
88
91
 
89
92
static GtkWidget * pickUpWidget_;
94
97
static GtkWidget * offHoldToolbar_;
95
98
static GtkWidget * transferToolbar_;
96
99
static GtkWidget * recordWidget_;
97
 
static GtkWidget * muteWidget_;
98
100
static GtkWidget * voicemailToolbar_;
99
101
static GtkWidget * imToolbar_;
100
102
 
128
130
}
129
131
 
130
132
static void
131
 
call_mute(void)
132
 
{
133
 
    g_debug("Mute call button pressed");
134
 
    sflphone_mute_call();
135
 
}
136
 
 
137
 
 
138
 
static void
139
133
update_toolbar_for_call(callable_obj_t *selectedCall, gboolean instant_messaging_enabled, SFLPhoneClient *client)
140
134
{
141
135
    int pos = 0;
161
155
                // Make the button toolbar clickable
162
156
                gtk_action_set_sensitive(pickUpAction_, TRUE);
163
157
                gtk_action_set_sensitive(hangUpAction_, TRUE);
164
 
                gtk_action_set_sensitive(muteAction_, TRUE);
165
158
                // Replace the dial button with the hangup button
166
159
                g_object_ref(newCallWidget_);
167
160
                remove_from_toolbar(toolbar, newCallWidget_);
168
161
                pos = 0;
169
162
                add_to_toolbar(toolbar, pickUpWidget_, pos++);
170
163
                add_to_toolbar(toolbar, hangUpWidget_, pos++);
171
 
                add_to_toolbar(toolbar, muteWidget_, pos++);
172
164
                break;
173
165
        }
174
166
        case CALL_STATE_HOLD:
198
190
                gtk_action_set_sensitive(hangUpAction_, TRUE);
199
191
                pos = 1;
200
192
                add_to_toolbar(toolbar, hangUpWidget_, pos++);
201
 
                add_to_toolbar(toolbar, muteWidget_, pos++);
202
193
                break;
203
194
        }
204
195
        case CALL_STATE_DIALING:
236
227
 
237
228
                gtk_action_set_sensitive(hangUpAction_, TRUE);
238
229
                gtk_action_set_sensitive(recordAction_, TRUE);
239
 
                gtk_action_set_sensitive(muteAction_, TRUE);
240
230
                gtk_widget_set_sensitive(holdMenu_, TRUE);
241
231
                gtk_widget_set_sensitive(holdToolbar_, TRUE);
242
232
                gtk_widget_set_sensitive(transferToolbar_, TRUE);
243
 
                gtk_widget_set_sensitive(muteWidget_, TRUE);
244
233
                if (instant_messaging_enabled)
245
234
                    gtk_action_set_sensitive(imAction_, TRUE);
246
235
 
249
238
                add_to_toolbar(toolbar, holdToolbar_, pos++);
250
239
                add_to_toolbar(toolbar, transferToolbar_, pos++);
251
240
                add_to_toolbar(toolbar, recordWidget_, pos++);
252
 
                add_to_toolbar(toolbar, muteWidget_, pos++);
253
241
                if (instant_messaging_enabled)
254
242
                    add_to_toolbar(toolbar, imToolbar_, pos++);
255
243
 
274
262
        {
275
263
                pos = 1;
276
264
                gtk_action_set_sensitive(hangUpAction_, TRUE);
277
 
                gtk_action_set_sensitive(muteAction_, TRUE);
278
265
                gtk_widget_set_sensitive(holdMenu_, TRUE);
279
266
                gtk_widget_set_sensitive(holdToolbar_, TRUE);
280
267
                gtk_widget_set_sensitive(transferToolbar_, TRUE);
281
268
                gtk_widget_set_sensitive(transferToolbar_, TRUE);
282
 
                gtk_widget_set_sensitive(muteWidget_, TRUE);
283
269
 
284
270
                add_to_toolbar(toolbar, hangUpWidget_, pos++);
285
271
                add_to_toolbar(toolbar, transferToolbar_, pos++);
286
272
                g_signal_handler_block(transferToolbar_, transferButtonConnId_);
287
273
                gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(transferToolbar_), TRUE);
288
274
                g_signal_handler_unblock(transferToolbar_, transferButtonConnId_);
289
 
                add_to_toolbar(toolbar, muteWidget_, pos++);
290
275
                break;
291
276
        }
292
277
        default:
389
374
    gtk_action_set_sensitive(pickUpAction_, FALSE);
390
375
    gtk_action_set_sensitive(hangUpAction_, FALSE);
391
376
    gtk_action_set_sensitive(recordAction_, FALSE);
392
 
    gtk_action_set_sensitive(muteAction_, FALSE);
393
377
    gtk_action_set_sensitive(copyAction_, FALSE);
394
378
    gtk_action_set_sensitive(imAction_, FALSE);
395
379
 
397
381
    gtk_widget_set_sensitive(holdToolbar_, FALSE);
398
382
    gtk_widget_set_sensitive(offHoldToolbar_, FALSE);
399
383
    gtk_widget_set_sensitive(recordWidget_, FALSE);
400
 
    gtk_widget_set_sensitive(muteWidget_, FALSE);
401
384
    gtk_widget_set_sensitive(historyButton_, FALSE);
402
385
 
403
386
    // Increment the reference counter
404
387
    g_object_ref(hangUpWidget_);
405
388
    g_object_ref(recordWidget_);
406
 
    g_object_ref(muteWidget_);
407
389
    g_object_ref(holdToolbar_);
408
390
    g_object_ref(offHoldToolbar_);
409
391
    g_object_ref(historyButton_);
420
402
    GtkWidget *toolbar = client->toolbar;
421
403
    remove_from_toolbar(toolbar, hangUpWidget_);
422
404
    remove_from_toolbar(toolbar, recordWidget_);
423
 
    remove_from_toolbar(toolbar, muteWidget_);
424
405
    remove_from_toolbar(toolbar, transferToolbar_);
425
406
    remove_from_toolbar(toolbar, historyButton_);
426
407
    remove_from_toolbar(toolbar, voicemailToolbar_);
457
438
        }
458
439
    }
459
440
 
460
 
    callable_obj_t * selectedCall = calltab_get_selected_call(active_calltree_tab);
461
 
    conference_obj_t * selectedConf = calltab_get_selected_conf(active_calltree_tab);
 
441
    callable_obj_t * selectedCall = NULL;
 
442
    conference_obj_t * selectedConf = NULL;
462
443
 
463
444
    const gboolean instant_messaging_enabled = g_settings_get_boolean(client->settings, "instant-messaging-enabled");
464
445
 
 
446
    if (!calllist_empty(active_calltree_tab)) {
 
447
        selectedCall = calltab_get_selected_call(active_calltree_tab);
 
448
        selectedConf = calltab_get_selected_conf(active_calltree_tab);
 
449
    }
 
450
 
465
451
    if (selectedCall) {
466
452
        update_toolbar_for_call(selectedCall, instant_messaging_enabled, client);
467
453
    } else if (selectedConf) {
519
505
        g_settings_set_boolean(client->settings, "show-dialpad", toggled);
520
506
}
521
507
 
 
508
#ifdef SFL_PRESENCE
 
509
static void
 
510
toggle_presence_window_cb(GtkToggleAction *togglemenuitem, SFLPhoneClient *client)
 
511
{
 
512
    const gboolean toggled = gtk_toggle_action_get_active(togglemenuitem);
 
513
    if (toggled)
 
514
        create_presence_window(client, togglemenuitem);
 
515
    else
 
516
        destroy_presence_window();
 
517
}
 
518
#endif
 
519
 
522
520
static void
523
521
help_contents_cb(G_GNUC_UNUSED GtkAction *action, G_GNUC_UNUSED gpointer data)
524
522
{
550
548
        "Rafaël Carré <rafael.carre@savoirfairelinux.com>",
551
549
        "Vivien Didelot <vivien.didelot@savoirfairelinux.com>",
552
550
        "Emmanuel Lepage <emmanuel.lepage@savoirfairelinux.com>",
 
551
        "Partick Keroulas <patrick.keroulas@savoirfairelinux.com>",
553
552
        NULL
554
553
    };
555
554
    static const gchar *artists[] = {
561
560
            "artists", artists,
562
561
            "authors", authors,
563
562
            "comments", _("SFLphone is a VoIP client compatible with SIP and IAX2 protocols."),
564
 
            "copyright", "Copyright © 2004-2012 Savoir-faire Linux Inc.",
 
563
            "copyright", "Copyright © 2004-2014 Savoir-faire Linux Inc.",
565
564
            "name", PACKAGE_NAME,
566
565
            "title", _("About SFLphone"),
567
566
            "version", PACKAGE_VERSION,
748
747
call_record(G_GNUC_UNUSED GtkAction *action, SFLPhoneClient *client)
749
748
{
750
749
    g_debug("Record button pressed");
751
 
    sflphone_rec_call(client);
 
750
    /* Ensure that button is set to correct state, but suppress signal */
 
751
    g_signal_handler_block(recordWidget_, recordButtonConnId_);
 
752
    gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(recordWidget_), sflphone_rec_call(client));
 
753
    g_signal_handler_unblock(recordWidget_, recordButtonConnId_);
752
754
}
753
755
 
754
756
static void
757
759
    build_wizard();
758
760
}
759
761
 
 
762
typedef struct
 
763
{
 
764
    callable_obj_t *call;
 
765
    SFLPhoneClient *client;
 
766
} EditNumberData;
 
767
 
760
768
static void
761
 
remove_from_history(G_GNUC_UNUSED GtkAction *action, SFLPhoneClient *client)
 
769
remove_from_history(G_GNUC_UNUSED GtkAction *action, EditNumberData *data)
762
770
{
763
 
    callable_obj_t* call = calltab_get_selected_call(history_tab);
764
 
 
765
 
    g_debug("Remove the call from the history");
766
 
 
767
 
    if (call == NULL) {
 
771
    if (data->call == NULL) {
768
772
        g_warning("Call is NULL");
769
773
        return;
770
774
    }
771
775
 
772
 
    calllist_remove_from_history(call, client);
773
 
    update_actions(client);
 
776
    calllist_remove_from_history(data->call, data->client);
774
777
}
775
778
 
776
779
static void
1057
1060
      N_("About this application"), G_CALLBACK(help_about) }
1058
1061
};
1059
1062
 
1060
 
static void register_custom_stock_icon(void) {
1061
 
 
1062
 
    static gboolean registered = FALSE;
1063
 
 
1064
 
    if (!registered) {
1065
 
        GdkPixbuf *pixbuf;
1066
 
        GtkIconFactory *factory;
1067
 
 
1068
 
        static GtkStockItem items[] = {
1069
 
            { "SFLPHONE_MUTE_CALL",
1070
 
              "_GTK!",
1071
 
              0, 0, NULL }
1072
 
        };
1073
 
 
1074
 
        registered = TRUE;
1075
 
 
1076
 
        /* Register our stock items */
1077
 
        gtk_stock_add (items, G_N_ELEMENTS (items));
1078
 
 
1079
 
        /* Add our custom icon factory to the list of defaults */
1080
 
        factory = gtk_icon_factory_new ();
1081
 
        gtk_icon_factory_add_default (factory);
1082
 
 
1083
 
        /* demo_find_file() looks in the current directory first,
1084
 
         * so you can run gtk-demo without installing GTK, then looks
1085
 
         * in the location where the file is installed.
1086
 
         */
1087
 
        pixbuf = NULL;
1088
 
        pixbuf = gdk_pixbuf_new_from_file (ICONS_DIR "/mic.svg", NULL);
1089
 
        if (pixbuf == NULL) {
1090
 
            g_debug("Error could not create mic.svg pixbuf");
1091
 
        }
1092
 
 
1093
 
        /* Register icon to accompany stock item */
1094
 
        if (pixbuf != NULL) {
1095
 
            GtkIconSet *icon_set;
1096
 
            GdkPixbuf *transparent;
1097
 
 
1098
 
            /* The gtk-logo-rgb icon has a white background, make it transparent */
1099
 
            transparent = gdk_pixbuf_add_alpha (pixbuf, TRUE, 0xff, 0xff, 0xff);
1100
 
 
1101
 
            icon_set = gtk_icon_set_new_from_pixbuf (transparent);
1102
 
            gtk_icon_factory_add (factory, "SFLPHONE_MUTE_CALL", icon_set);
1103
 
            gtk_icon_set_unref (icon_set);
1104
 
            g_object_unref (pixbuf);
1105
 
            g_object_unref (transparent);
1106
 
        }
1107
 
        else
1108
 
            g_warning ("failed to load GTK logo for toolbar");
1109
 
 
1110
 
        /* Drop our reference to the factory, GTK will hold a reference. */
1111
 
        g_object_unref (factory);
1112
 
    }
1113
 
}
1114
 
 
1115
1063
static const GtkToggleActionEntry toggle_menu_entries[] = {
1116
1064
    { "Transfer", GTK_STOCK_TRANSFER, N_("_Transfer"), "<control>T", N_("Transfer the call"), NULL, TRUE },
1117
1065
    { "Record", GTK_STOCK_MEDIA_RECORD, N_("_Record"), "<control>R", N_("Record the current conversation"), NULL, TRUE },
1118
 
    { "Mute", "SFLPHONE_MUTE_CALL", N_("_Mute"), "<control>M", N_("Mute microphone for this call"), G_CALLBACK(call_mute), FALSE },
1119
1066
    { "Toolbar", NULL, N_("_Show toolbar"), "<control>T", N_("Show the toolbar"), NULL, TRUE },
1120
1067
    { "Dialpad", NULL, N_("_Dialpad"), "<control>D", N_("Show the dialpad"), G_CALLBACK(dialpad_bar_cb), TRUE },
1121
1068
    { "VolumeControls", NULL, N_("_Volume controls"), "<control>V", N_("Show the volume controls"), G_CALLBACK(volume_bar_cb), TRUE },
1122
1069
    { "History", "appointment-soon", N_("_History"), NULL, N_("Calls history"), G_CALLBACK(toggle_history_cb), FALSE },
1123
1070
    { "Addressbook", GTK_STOCK_ADDRESSBOOK, N_("_Address book"), NULL, N_("Address book"), G_CALLBACK(toggle_addressbook_cb), FALSE },
 
1071
#ifdef SFL_PRESENCE
 
1072
    { "Buddies", NULL, N_("_Buddy list"), NULL, N_("Display the buddy list"), G_CALLBACK(toggle_presence_window_cb), FALSE},
 
1073
#endif
1124
1074
};
1125
1075
 
1126
1076
GtkUIManager *uimanager_new(SFLPhoneClient *client)
1127
1077
{
1128
 
    const gint nb_entries = addrbook ? 8 : 7;
 
1078
    const gint nb_entries = sizeof(toggle_menu_entries) / sizeof(toggle_menu_entries[0]);
1129
1079
 
1130
1080
    GtkUIManager *ui = gtk_ui_manager_new();
1131
1081
 
1132
 
    /* Register new icons as GTK_STOCK_ITEMS */
1133
 
    register_custom_stock_icon();
1134
 
 
1135
1082
    /* Create an accel group for window's shortcuts */
1136
1083
    gchar *path = g_build_filename(SFLPHONE_UIDIR_UNINSTALLED, "./ui.xml", NULL);
1137
1084
    guint manager_id;
1184
1131
    return NULL;
1185
1132
}
1186
1133
 
1187
 
typedef struct
1188
 
{
1189
 
    callable_obj_t *call;
1190
 
    SFLPhoneClient *client;
1191
 
} EditNumberData;
1192
 
 
1193
1134
static void
1194
1135
edit_number_cb(G_GNUC_UNUSED GtkWidget *widget, EditNumberData *data)
1195
1136
{
1197
1138
    g_free(data);
1198
1139
}
1199
1140
 
 
1141
#ifdef SFL_PRESENCE
 
1142
void
 
1143
add_presence_subscription_cb(G_GNUC_UNUSED GtkWidget * widget, G_GNUC_UNUSED calltab_t * tab)
 
1144
{
 
1145
    callable_obj_t * c = calltab_get_selected_call(tab);
 
1146
    buddy_t * b = presence_buddy_create();
 
1147
 
 
1148
    presence_callable_to_buddy(c, b);
 
1149
 
 
1150
    g_debug("Presence : trying to create a new subscription (%s,%s)", b->uri, b->acc);
 
1151
 
 
1152
    // popup
 
1153
    if(show_buddy_info_dialog(_("Add new buddy"), b))
 
1154
    {
 
1155
        presence_buddy_list_add_buddy(b);
 
1156
        update_presence_view();
 
1157
    }
 
1158
    else
 
1159
        presence_buddy_delete(b);
 
1160
}
 
1161
#endif
 
1162
 
1200
1163
void
1201
1164
add_registered_accounts_to_menu(GtkWidget *menu)
1202
1165
{
1249
1212
show_popup_menu(GtkWidget *my_widget, GdkEventButton *event, SFLPhoneClient *client)
1250
1213
{
1251
1214
    // TODO update the selection to make sure the call under the mouse is the call selected
1252
 
    gboolean pickup = FALSE, hangup = FALSE, hold = FALSE, copy = FALSE, record = FALSE, im = FALSE, mute = FALSE;
 
1215
    gboolean pickup = FALSE, hangup = FALSE, hold = FALSE, copy = FALSE, record = FALSE, im = FALSE;
1253
1216
    gboolean accounts = FALSE;
1254
1217
 
1255
1218
    // conference type boolean
1287
1250
                    hold = TRUE;
1288
1251
                    record = TRUE;
1289
1252
                    im = TRUE;
1290
 
                    mute = TRUE;
1291
1253
                    break;
1292
1254
                case CALL_STATE_BUSY:
1293
1255
                case CALL_STATE_FAILURE:
1396
1358
            gtk_widget_show(menu_items);
1397
1359
        }
1398
1360
 
1399
 
        if (mute) {
1400
 
            GtkWidget *menu_items = gtk_image_menu_item_new_with_mnemonic(_("_Mute"));
1401
 
            GtkWidget *image = gtk_image_new_from_stock(GTK_STOCK_MEDIA_RECORD,
1402
 
                               GTK_ICON_SIZE_MENU);
1403
 
            gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menu_items), image);
1404
 
            gtk_menu_shell_append(GTK_MENU_SHELL(menu), menu_items);
1405
 
            g_signal_connect(G_OBJECT(menu_items), "activate",
1406
 
                             G_CALLBACK(call_mute),
1407
 
                             NULL);
1408
 
            gtk_widget_show(menu_items);
1409
 
        }
1410
 
 
1411
1361
        if (im) {
1412
1362
            // do not display message if instant messaging is disabled
1413
1363
            const gboolean instant_messaging_enabled = g_settings_get_boolean(client->settings, "instant-messaging-enabled");
1423
1373
                gtk_menu_shell_append(GTK_MENU_SHELL(menu), menu_items);
1424
1374
                g_signal_connect(G_OBJECT(menu_items), "activate",
1425
1375
                                 G_CALLBACK(call_im),
1426
 
                                 client);
 
1376
                                 selectedCall);
1427
1377
                gtk_widget_show(menu_items);
1428
1378
            }
1429
1379
        }
1430
 
 
1431
1380
    } else {
1432
1381
        g_debug("Build conf menus");
1433
1382
 
1486
1435
        gtk_widget_show(menu_items);
1487
1436
    }
1488
1437
 
 
1438
#ifdef SFL_PRESENCE
 
1439
    if (selectedCall) {
 
1440
        GtkWidget *menu_items = gtk_image_menu_item_new_with_mnemonic(_("Follow status"));
 
1441
        gtk_menu_shell_append(GTK_MENU_SHELL(menu), menu_items);
 
1442
        if(!presence_buddy_list_get())
 
1443
            gtk_widget_set_sensitive(menu_items, FALSE);
 
1444
        g_signal_connect(G_OBJECT(menu_items), "activate", G_CALLBACK(add_presence_subscription_cb), history_tab);
 
1445
        gtk_widget_show(menu_items);
 
1446
    }
 
1447
#endif
 
1448
 
1489
1449
    GtkWidget *separator = gtk_separator_menu_item_new();
1490
1450
    gtk_menu_shell_append(GTK_MENU_SHELL(menu), separator);
1491
1451
    gtk_widget_show(separator);
1535
1495
        g_signal_connect(new_call, "activate", G_CALLBACK(call_back), client);
1536
1496
        gtk_widget_show(new_call);
1537
1497
 
 
1498
#ifdef SFL_PRESENCE
 
1499
        GtkWidget *presence = gtk_image_menu_item_new_with_mnemonic(_("Follow status"));
 
1500
        gtk_menu_shell_append(GTK_MENU_SHELL(menu), presence);
 
1501
 
 
1502
        if(!presence_buddy_list_get())
 
1503
            gtk_widget_set_sensitive(presence, FALSE);
 
1504
 
 
1505
        g_signal_connect(G_OBJECT(presence), "activate", G_CALLBACK(add_presence_subscription_cb), contacts_tab);
 
1506
        gtk_widget_show(presence);
 
1507
#endif
 
1508
 
1538
1509
        GtkWidget *edit = gtk_image_menu_item_new_from_stock(GTK_STOCK_EDIT,
1539
1510
                          get_accel_group());
1540
1511
        gtk_menu_shell_append(GTK_MENU_SHELL(menu), edit);
1667
1638
    hangUpAction_ = get_action(ui, "/MenuBar/CallMenu/HangUp");
1668
1639
    holdMenu_ = get_widget(ui, "/MenuBar/CallMenu/OnHoldMenu");
1669
1640
    recordAction_ = get_action(ui, "/MenuBar/CallMenu/Record");
1670
 
    muteAction_ = get_action(ui, "/MenuBar/CallMenu/Mute");
1671
1641
    imAction_ = get_action(ui, "/MenuBar/CallMenu/InstantMessaging");
1672
1642
    copyAction_ = get_action(ui, "/MenuBar/EditMenu/Copy");
1673
1643
    pasteAction_ = get_action(ui, "/MenuBar/EditMenu/Paste");
1675
1645
    // Set the toggle buttons
1676
1646
    gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(get_action(ui, "/MenuBar/ViewMenu/Dialpad")), g_settings_get_boolean(client->settings, "show-dialpad"));
1677
1647
    gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(volumeToggle_), must_show_volume(client));
1678
 
    gtk_action_set_sensitive(volumeToggle_, must_show_alsa_conf());
 
1648
    gtk_action_set_sensitive(volumeToggle_, TRUE);
1679
1649
    gtk_action_set_sensitive(get_action(ui, "/MenuBar/ViewMenu/Toolbar"), FALSE);
1680
1650
 
 
1651
#ifdef SFL_PRESENCE
 
1652
    gtk_action_set_sensitive(get_action(ui, "/MenuBar/ViewMenu/Buddies"), TRUE);
 
1653
#endif
 
1654
 
1681
1655
    /* Add the loading icon at the right of the toolbar. It is used for addressbook searches. */
1682
1656
    waitingLayer = create_waiting_icon();
1683
1657
    gtk_menu_shell_append(GTK_MENU_SHELL(menu_bar), waitingLayer);
1697
1671
    pickUpWidget_ = get_widget(ui, "/ToolbarActions/PickUpToolbar");
1698
1672
    hangUpWidget_ = get_widget(ui, "/ToolbarActions/HangUpToolbar");
1699
1673
    recordWidget_ = get_widget(ui, "/ToolbarActions/RecordToolbar");
1700
 
    muteWidget_ = get_widget(ui, "/ToolbarActions/MuteToolbar");
1701
1674
    imToolbar_ = get_widget(ui, "/ToolbarActions/InstantMessagingToolbar");
1702
1675
    historyButton_ = get_widget(ui, "/ToolbarActions/HistoryToolbar");
1703
1676
    if (addrbook)