~ubuntu-branches/ubuntu/vivid/ekiga/vivid-proposed

« back to all changes in this revision

Viewing changes to src/gui/assistant.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Kilian Krause
  • Date: 2011-07-17 00:24:50 UTC
  • mfrom: (5.1.5 upstream) (7.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20110717002450-ytg3wsrc1ptd3153
Tags: 3.3.1-1
* New upstream release.
 - Required libpt-dev 2.10 and libopal-dev 3.10
* Fix debian/watch to catch new version
* Remove libnotify0.7.patch - included upstream
* Add libboost-dev and libboost-signals-dev to Build-Depends
* debian/rules: Don't install *.la files for new internal shared libs
* Fix Vcs URIs to point to correct desktop/experimental/ekiga tree

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
 
2
2
/* Ekiga -- A VoIP and Video-Conferencing application
3
 
 * Copyright (C) 2000-2006 Damien Sandras
 
3
 * Copyright (C) 2000-2009 Damien Sandras <dsandras@seconix.com>
4
4
 *
5
5
 * This program is free software; you can redistribute it and/or modify
6
6
 * it under the terms of the GNU General Public License as published by
33
33
 *   copyright            : (C) 2000-2008 by Damien Sandras
34
34
 *                          (C) 2008 by Steve Frécinaux
35
35
 *   description          : This file contains all the functions needed to
36
 
 *                          build the druid.
 
36
 *                          build the assistant.
37
37
 */
38
38
 
39
 
#include "config.h"
 
39
#include <glib/gi18n.h>
40
40
 
41
41
#include "framework/services.h"
42
42
#include "account-core.h"
44
44
 
45
45
#include "ekiga.h"
46
46
#include "gmconf.h"
47
 
#include "misc.h"
48
47
#include "toolbox/toolbox.h"
49
48
#include "assistant.h"
 
49
#include "default_devices.h"
50
50
 
51
51
#include "opal-bank.h"
52
52
#include "videoinput-core.h"
59
59
struct _EkigaAssistantPrivate
60
60
{
61
61
  Ekiga::ServiceCore *core;
 
62
  boost::shared_ptr<Ekiga::VideoInputCore> videoinput_core;
 
63
  boost::shared_ptr<Ekiga::AudioInputCore> audioinput_core;
 
64
  boost::shared_ptr<Ekiga::AudioOutputCore> audiooutput_core;
 
65
  boost::shared_ptr<Opal::Bank> bank;
62
66
  GdkPixbuf *icon;
63
67
 
64
68
  GtkWidget *welcome_page;
88
92
 
89
93
  GtkWidget *video_device;
90
94
 
 
95
  gint last_active_page;
 
96
 
91
97
  GtkListStore *summary_model;
92
 
  std::vector<sigc::connection> connections;
 
98
  std::vector<boost::signals::connection> connections;
93
99
};
94
100
 
95
 
/* presenting the network connectoin type to the user */
 
101
/* presenting the network connection type to the user */
96
102
enum {
97
103
  CNX_LABEL_COLUMN,
98
104
  CNX_CODE_COLUMN
139
145
  gtk_assistant_set_page_complete (assistant, current_page, complete);
140
146
}
141
147
 
142
 
void 
143
 
get_audiooutput_devices_list (Ekiga::ServiceCore *core,
144
 
                                        std::vector<std::string> & device_list);
145
 
void 
146
 
get_audioinput_devices_list (Ekiga::ServiceCore *core,
147
 
                                        std::vector<std::string> & device_list);
148
 
void 
149
 
get_videoinput_devices_list (Ekiga::ServiceCore *core,
150
 
                                        std::vector<std::string> & device_list);
 
148
static void get_audiooutput_devices_list (boost::shared_ptr<Ekiga::AudioOutputCore> audiooutput_core,
 
149
                                          std::vector<std::string> & device_list);
 
150
static void get_audioinput_devices_list (boost::shared_ptr<Ekiga::AudioInputCore> audioinput_core,
 
151
                                         std::vector<std::string> & device_list);
 
152
static void get_videoinput_devices_list (boost::shared_ptr<Ekiga::VideoInputCore> videoinput_core,
 
153
                                         std::vector<std::string> & device_list);
151
154
 
152
 
gchar**
 
155
static gchar**
153
156
convert_string_list (const std::vector<std::string> & list);
154
157
 
155
158
static void
176
179
    gtk_list_store_append (GTK_LIST_STORE (model), &iter);
177
180
    gtk_list_store_set (GTK_LIST_STORE (model), &iter,
178
181
                        0, options [i],
179
 
                        1, true, 
 
182
                        1, true,
180
183
                        -1);
181
184
  }
182
185
 
190
193
  GtkTreeModel *model = NULL;
191
194
  GtkTreeIter iter;
192
195
 
193
 
  gchar *option_string = NULL;
194
196
  gboolean found = FALSE;
195
 
  
 
197
 
196
198
  if (!option)
197
199
    return;
198
200
 
199
201
  model = gtk_combo_box_get_model (combo_box);
200
 
  option_string = g_locale_to_utf8 (option, -1, NULL, NULL, NULL);
201
202
 
202
203
  if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (model), &iter)) {
203
204
 
207
208
      gtk_tree_model_get_value (GTK_TREE_MODEL (model), &iter, 0, &value);
208
209
      value_string = (gchar *) g_value_get_string (&value);
209
210
      if (g_ascii_strcasecmp  (value_string, option) == 0) {
210
 
        gtk_list_store_set (GTK_LIST_STORE (model), &iter, 
 
211
        gtk_list_store_set (GTK_LIST_STORE (model), &iter,
211
212
                            1, TRUE,
212
213
                            -1);
213
214
        g_value_unset(&value);
221
222
 
222
223
  if (!found) {
223
224
    gtk_list_store_append (GTK_LIST_STORE (model), &iter);
224
 
    gtk_list_store_set (GTK_LIST_STORE (model), &iter, 
 
225
    gtk_list_store_set (GTK_LIST_STORE (model), &iter,
225
226
                        0, option,
226
227
                        1, TRUE,
227
228
                        -1);
228
229
  }
229
 
 
230
 
  g_free (option_string);
231
230
}
232
231
 
233
232
static void
253
252
      if (g_ascii_strcasecmp  (value_string, option) == 0) {
254
253
 
255
254
        if (cpt == active) {
256
 
          gtk_list_store_set (GTK_LIST_STORE (model), &iter, 
 
255
          gtk_list_store_set (GTK_LIST_STORE (model), &iter,
257
256
                              1, FALSE,
258
257
                              -1);
259
258
        }
270
269
  }
271
270
}
272
271
 
273
 
void on_videoinput_device_added_cb (const Ekiga::VideoInputDevice & device, bool, EkigaAssistant *assistant)
 
272
static void
 
273
on_videoinput_device_added_cb (const Ekiga::VideoInputDevice& device,
 
274
                               bool,
 
275
                               EkigaAssistant* assistant)
274
276
{
275
277
  std::string device_string = device.GetString();
276
278
  add_combo_box (GTK_COMBO_BOX (assistant->priv->video_device), device_string.c_str());
277
279
}
278
280
 
279
 
void on_videoinput_device_removed_cb (const Ekiga::VideoInputDevice & device, bool,  EkigaAssistant *assistant)
 
281
static void
 
282
on_videoinput_device_removed_cb (const Ekiga::VideoInputDevice& device,
 
283
                                 bool,
 
284
                                 EkigaAssistant* assistant)
280
285
{
281
286
  std::string device_string = device.GetString();
282
287
  remove_combo_box (GTK_COMBO_BOX (assistant->priv->video_device),  device_string.c_str());
283
288
}
284
289
 
285
 
void on_audioinput_device_added_cb (const Ekiga::AudioInputDevice & device, bool, EkigaAssistant *assistant)
 
290
static void
 
291
on_audioinput_device_added_cb (const Ekiga::AudioInputDevice& device,
 
292
                               bool,
 
293
                               EkigaAssistant* assistant)
286
294
{
287
295
  std::string device_string = device.GetString();
288
296
  add_combo_box (GTK_COMBO_BOX (assistant->priv->audio_recorder), device_string.c_str());
289
297
}
290
298
 
291
 
void on_audioinput_device_removed_cb (const Ekiga::AudioInputDevice & device, bool, EkigaAssistant *assistant)
 
299
static void
 
300
on_audioinput_device_removed_cb (const Ekiga::AudioInputDevice& device,
 
301
                                 bool,
 
302
                                 EkigaAssistant* assistant)
292
303
{
293
304
  std::string device_string = device.GetString();
294
305
  remove_combo_box (GTK_COMBO_BOX (assistant->priv->audio_recorder),  device_string.c_str());
295
306
}
296
307
 
297
 
void on_audiooutput_device_added_cb (const Ekiga::AudioOutputDevice & device, bool, EkigaAssistant *assistant)
 
308
static void
 
309
on_audiooutput_device_added_cb (const Ekiga::AudioOutputDevice& device,
 
310
                                bool,
 
311
                                EkigaAssistant *assistant)
298
312
{
299
313
  std::string device_string = device.GetString();
300
314
  add_combo_box (GTK_COMBO_BOX (assistant->priv->audio_player), device_string.c_str());
301
315
  add_combo_box (GTK_COMBO_BOX (assistant->priv->audio_ringer), device_string.c_str());
302
316
}
303
317
 
304
 
void on_audiooutput_device_removed_cb (const Ekiga::AudioOutputDevice & device, bool, EkigaAssistant *assistant)
 
318
static void
 
319
on_audiooutput_device_removed_cb (const Ekiga::AudioOutputDevice& device,
 
320
                                  bool,
 
321
                                  EkigaAssistant* assistant)
305
322
{
306
323
  std::string device_string = device.GetString();
307
324
  remove_combo_box (GTK_COMBO_BOX (assistant->priv->audio_player),  device_string.c_str());
308
325
  remove_combo_box (GTK_COMBO_BOX (assistant->priv->audio_ringer),  device_string.c_str());
309
326
}
310
327
 
 
328
static void
 
329
kind_of_net_changed_nt (G_GNUC_UNUSED gpointer id,
 
330
                        GmConfEntry *,
 
331
                        gpointer)
 
332
{
 
333
  gm_conf_set_int (GENERAL_KEY "kind_of_net", NET_CUSTOM);
 
334
}
311
335
 
312
336
static void
313
337
create_welcome_page (EkigaAssistant *assistant)
322
346
  gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
323
347
  gtk_widget_show (label);
324
348
  gtk_assistant_append_page (GTK_ASSISTANT (assistant), label);
325
 
  gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), label, _("Welcome in Ekiga"));
 
349
  gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), label, _("Welcome to Ekiga"));
326
350
  gtk_assistant_set_page_type (GTK_ASSISTANT (assistant), label, GTK_ASSISTANT_PAGE_INTRO);
327
351
  gtk_assistant_set_page_header_image (GTK_ASSISTANT (assistant), label, assistant->priv->icon);
328
352
  gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant), label, TRUE);
335
359
name_changed_cb (GtkEntry     *entry,
336
360
                 GtkAssistant *assistant)
337
361
{
338
 
  gchar **couple;
339
 
  gboolean complete;
340
 
 
341
 
  couple = g_strsplit (gtk_entry_get_text (entry), " ", 2);
342
 
 
343
 
  complete = couple && couple[0] && couple[1]
344
 
          && !PString (couple[0]).Trim ().IsEmpty ()
345
 
          && !PString (couple[1]).Trim ().IsEmpty ();
346
 
  set_current_page_complete (assistant, complete);
347
 
 
348
 
  g_strfreev (couple);
 
362
  set_current_page_complete (assistant, (gtk_entry_get_text (entry))[0] != '\0');
349
363
}
350
364
 
351
365
 
377
391
  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
378
392
  gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, TRUE, 0);
379
393
 
380
 
  g_signal_connect (G_OBJECT (assistant->priv->name), "changed",
 
394
  g_signal_connect (assistant->priv->name, "changed",
381
395
                    G_CALLBACK (name_changed_cb), assistant);
382
396
 
383
397
  assistant->priv->personal_data_page = vbox;
388
402
static void
389
403
prepare_personal_data_page (EkigaAssistant *assistant)
390
404
{
391
 
  gchar *full_name;
392
 
 
393
 
  full_name = gm_conf_get_string (PERSONAL_DATA_KEY "full_name");
394
 
 
395
 
  if (full_name)
396
 
    gtk_entry_set_text (GTK_ENTRY (assistant->priv->name), full_name);
 
405
  gchar* full_name = gm_conf_get_string (PERSONAL_DATA_KEY "full_name");
 
406
 
 
407
  if (full_name == NULL || strlen (full_name) == 0) {
 
408
 
 
409
    g_free (full_name);
 
410
    full_name = g_strdup (g_get_real_name ());
 
411
  }
 
412
 
 
413
  gtk_entry_set_text (GTK_ENTRY (assistant->priv->name), full_name);
397
414
 
398
415
  g_free (full_name);
399
416
}
434
451
 
435
452
  if (account == NULL || password == NULL)
436
453
    return; /* no account configured yet */
437
 
  
 
454
 
438
455
  gm_open_uri ("https://www.diamondcard.us/exec/voip-login?act=sgn&spo=ekiga");
439
456
}
440
457
 
457
474
 
458
475
  if (account == NULL || password == NULL)
459
476
    return; /* no account configured yet */
460
 
  
 
477
 
461
478
  url = g_strdup_printf ("https://www.diamondcard.us/exec/voip-login?accId=%s&pinCode=%s&act=rch&spo=ekiga", account, password);
462
479
  gm_open_uri (url);
463
480
  g_free (url);
482
499
 
483
500
  if (account == NULL || password == NULL)
484
501
    return; /* no account configured yet */
485
 
  
 
502
 
486
503
  url = g_strdup_printf ("https://www.diamondcard.us/exec/voip-login?accId=%s&pinCode=%s&act=bh&spo=ekiga", account, password);
487
504
  gm_open_uri (url);
488
505
  g_free (url);
507
524
 
508
525
  if (account == NULL || password == NULL)
509
526
    return; /* no account configured yet */
510
 
  
 
527
 
511
528
  url = g_strdup_printf ("https://www.diamondcard.us/exec/voip-login?accId=%s&pinCode=%s&act=ch&spo=ekiga", account, password);
512
529
  gm_open_uri (url);
513
530
  g_free (url);
605
622
  g_signal_connect (button, "clicked",
606
623
                    G_CALLBACK (ekiga_net_button_clicked_cb), NULL);
607
624
 
608
 
  assistant->priv->skip_ekiga_net = gtk_check_button_new ();
609
 
  label = gtk_label_new (_("I do not want to sign up for the ekiga.net free service"));
610
 
  gtk_container_add (GTK_CONTAINER (assistant->priv->skip_ekiga_net), label);
 
625
  assistant->priv->skip_ekiga_net = gtk_check_button_new_with_label (_("I do not want to sign up for the ekiga.net free service"));
611
626
  align = gtk_alignment_new (0, 1.0, 0, 0);
612
627
  gtk_container_add (GTK_CONTAINER (align), assistant->priv->skip_ekiga_net);
613
628
  gtk_box_pack_start (GTK_BOX (vbox), align, TRUE, TRUE, 0);
627
642
static void
628
643
prepare_ekiga_net_page (EkigaAssistant *assistant)
629
644
{
630
 
  Ekiga::AccountCore *account_core = dynamic_cast<Ekiga::AccountCore *> (assistant->priv->core->get ("account-core"));
631
 
  Ekiga::Account *account = account_core->find_account ("ekiga.net");
 
645
  Opal::AccountPtr account = assistant->priv->bank->find_account ("ekiga.net");
632
646
 
633
647
  if (account && !account->get_username ().empty ())
634
648
    gtk_entry_set_text (GTK_ENTRY (assistant->priv->username), account->get_username ().c_str ());
644
658
static void
645
659
apply_ekiga_net_page (EkigaAssistant *assistant)
646
660
{
647
 
  Ekiga::AccountCore *account_core = dynamic_cast<Ekiga::AccountCore *> (assistant->priv->core->get ("account-core"));
648
 
 
649
 
  /* Some specific Opal stuff for the Ekiga.net account */
650
 
  Opal::Bank *opal_bank = dynamic_cast<Opal::Bank *> (assistant->priv->core->get ("opal-account-store"));
651
 
  Opal::Account *account = dynamic_cast<Opal::Account *> (account_core->find_account ("ekiga.net"));
652
 
 
653
 
  bool new_account = (account == NULL);
 
661
  Opal::AccountPtr account = assistant->priv->bank->find_account ("ekiga.net");
 
662
  bool new_account = !account;
654
663
 
655
664
  if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (assistant->priv->skip_ekiga_net))) {
656
665
        if (new_account)
657
 
          opal_bank->new_account (Opal::Account::Ekiga,
658
 
                                                          gtk_entry_get_text (GTK_ENTRY (assistant->priv->username)),
659
 
                                                          gtk_entry_get_text (GTK_ENTRY (assistant->priv->password)));
 
666
          assistant->priv->bank->new_account (Opal::Account::Ekiga,
 
667
                                              gtk_entry_get_text (GTK_ENTRY (assistant->priv->username)),
 
668
                                              gtk_entry_get_text (GTK_ENTRY (assistant->priv->password)));
660
669
        else
661
670
          account->set_authentication_settings (gtk_entry_get_text (GTK_ENTRY (assistant->priv->username)),
662
 
                                                                                        gtk_entry_get_text (GTK_ENTRY (assistant->priv->password)));
 
671
                                                gtk_entry_get_text (GTK_ENTRY (assistant->priv->password)));
663
672
  }
664
673
}
665
674
 
694
703
 
695
704
  label = gtk_label_new (NULL);
696
705
  text = g_strdup_printf ("<i>%s</i>",
697
 
                          _("You can make calls to regular phones and cell numbers worldwide using Ekiga.\n\n"
698
 
                            "To enable this, you need to do three things:\n"
 
706
                          _("You can make calls to regular phones and cell numbers worldwide using Ekiga. "
 
707
                            "To enable this, you need to do two things:\n"
699
708
                            "- First buy an account at the URL below.\n"
700
709
                            "- Then enter your account ID and PIN code.\n"
701
710
                            "The service will work only if your account is created using the URL in this dialog.\n"));
744
753
  button = gtk_button_new ();
745
754
  label = gtk_label_new (NULL);
746
755
  text = g_strdup_printf ("<span foreground=\"blue\"><u>%s</u></span>",
747
 
                         _("Consult the calls history"));
 
756
                         _("Consult the call history"));
748
757
  gtk_label_set_markup (GTK_LABEL (label), text);
749
758
  g_free (text);
750
759
  gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
753
762
  g_signal_connect (button, "clicked",
754
763
                    G_CALLBACK (ekiga_out_history_calls_clicked_cb), assistant);
755
764
 
756
 
  assistant->priv->skip_ekiga_out = gtk_check_button_new ();
757
 
  label = gtk_label_new (_("I do not want to sign up for the Ekiga Call Out service"));
758
 
  gtk_container_add (GTK_CONTAINER (assistant->priv->skip_ekiga_out), label);
 
765
  assistant->priv->skip_ekiga_out = gtk_check_button_new_with_label (_("I do not want to sign up for the Ekiga Call Out service"));
759
766
  align = gtk_alignment_new (0, 1.0, 0, 0);
760
767
  gtk_container_add (GTK_CONTAINER (align), assistant->priv->skip_ekiga_out);
761
768
  gtk_box_pack_start (GTK_BOX (vbox), align, TRUE, TRUE, 0);
775
782
static void
776
783
prepare_ekiga_out_page (EkigaAssistant *assistant)
777
784
{
778
 
  Ekiga::AccountCore *account_core = dynamic_cast<Ekiga::AccountCore *> (assistant->priv->core->get ("account-core"));
779
 
  Ekiga::Account *account = account_core->find_account ("sip.diamondcard.us");
 
785
  Opal::AccountPtr account = assistant->priv->bank->find_account ("sip.diamondcard.us");
780
786
 
781
787
  if (account && !account->get_username ().empty ())
782
788
    gtk_entry_set_text (GTK_ENTRY (assistant->priv->dusername), account->get_username ().c_str ());
792
798
static void
793
799
apply_ekiga_out_page (EkigaAssistant *assistant)
794
800
{
795
 
  Ekiga::AccountCore *account_core = dynamic_cast<Ekiga::AccountCore *> (assistant->priv->core->get ("account-core"));
796
 
 
797
801
  /* Some specific Opal stuff for the Ekiga.net account */
798
 
  Opal::Bank *opal_bank = dynamic_cast<Opal::Bank *> (assistant->priv->core->get ("opal-account-store"));
799
 
  Opal::Account *account = dynamic_cast<Opal::Account *> (account_core->find_account ("sip.diamondcard.us"));
800
 
 
801
 
  bool new_account = (account == NULL);
 
802
  Opal::AccountPtr account = assistant->priv->bank->find_account ("sip.diamondcard.us");
 
803
  bool new_account = !account;
802
804
 
803
805
  if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (assistant->priv->skip_ekiga_out))) {
804
806
        if (new_account)
805
 
          opal_bank->new_account (Opal::Account::DiamondCard,
806
 
                                                          gtk_entry_get_text (GTK_ENTRY (assistant->priv->dusername)),
807
 
                                                          gtk_entry_get_text (GTK_ENTRY (assistant->priv->dpassword)));
 
807
          assistant->priv->bank->new_account (Opal::Account::DiamondCard,
 
808
                                              gtk_entry_get_text (GTK_ENTRY (assistant->priv->dusername)),
 
809
                                              gtk_entry_get_text (GTK_ENTRY (assistant->priv->dpassword)));
808
810
        else
809
811
          account->set_authentication_settings (gtk_entry_get_text (GTK_ENTRY (assistant->priv->dusername)),
810
 
                                                                                        gtk_entry_get_text (GTK_ENTRY (assistant->priv->dpassword)));
 
812
                                                gtk_entry_get_text (GTK_ENTRY (assistant->priv->dpassword)));
811
813
  }
812
814
}
813
815
 
922
924
  /* Set the connection quality settings */
923
925
  switch (connection_type) {
924
926
    case NET_PSTN:
925
 
      gm_conf_set_bool (VIDEO_CODECS_KEY "enable_video", FALSE);
926
 
      break;
927
 
 
928
927
    case NET_ISDN:
929
 
      gm_conf_set_bool (VIDEO_CODECS_KEY "enable_video", FALSE);
 
928
      gm_conf_set_int (VIDEO_DEVICES_KEY "size", 0); //QCIF
 
929
      gm_conf_set_int (VIDEO_CODECS_KEY "maximum_video_tx_bitrate", 32);
930
930
      break;
931
931
 
932
932
    case NET_DSL128:
933
933
      gm_conf_set_int (VIDEO_DEVICES_KEY "size", 0); //QCIF
934
934
      gm_conf_set_int (VIDEO_CODECS_KEY "maximum_video_tx_bitrate", 64);
935
 
      gm_conf_set_bool (VIDEO_CODECS_KEY "enable_video", TRUE);
936
935
      break;
937
936
 
938
937
    case NET_DSL512:
939
938
      gm_conf_set_int (VIDEO_DEVICES_KEY "size", 3); // 320x240
940
939
      gm_conf_set_int (VIDEO_CODECS_KEY "maximum_video_tx_bitrate", 384);
941
 
      gm_conf_set_bool (VIDEO_CODECS_KEY "enable_video", TRUE);
942
940
      break;
943
941
 
944
942
    case NET_LAN:
945
943
      gm_conf_set_int (VIDEO_DEVICES_KEY "size", 3); // 320x240
946
944
      gm_conf_set_int (VIDEO_CODECS_KEY "maximum_video_tx_bitrate", 1024);
947
 
      gm_conf_set_bool (VIDEO_CODECS_KEY "enable_video", TRUE);
948
945
      break;
949
946
 
950
947
    case NET_CUSTOM:
964
961
  GtkWidget *label;
965
962
 
966
963
  GtkCellRenderer *renderer;
967
 
  
 
964
 
968
965
  gchar *text;
969
966
 
970
967
  vbox = create_page (assistant, _("Audio Devices"), GTK_ASSISTANT_PAGE_CONTENT);
981
978
                                  "text", 0,
982
979
                                  "sensitive", 1,
983
980
                                  NULL);
984
 
  g_object_set (G_OBJECT (renderer), 
985
 
                "ellipsize-set", TRUE, 
 
981
  g_object_set (G_OBJECT (renderer),
 
982
                "ellipsize-set", TRUE,
986
983
                "ellipsize", PANGO_ELLIPSIZE_END, 
987
984
                "width-chars", 45, NULL);
988
985
  gtk_label_set_mnemonic_widget (GTK_LABEL (label), assistant->priv->audio_ringer);
1012
1009
                                  "text", 0,
1013
1010
                                  "sensitive", 1,
1014
1011
                                  NULL);
1015
 
  g_object_set (G_OBJECT (renderer), 
1016
 
                "ellipsize-set", TRUE, 
1017
 
                "ellipsize", PANGO_ELLIPSIZE_END, 
 
1012
  g_object_set (G_OBJECT (renderer),
 
1013
                "ellipsize-set", TRUE,
 
1014
                "ellipsize", PANGO_ELLIPSIZE_END,
1018
1015
                "width-chars", 45, NULL);
1019
1016
  gtk_label_set_mnemonic_widget (GTK_LABEL (label), assistant->priv->audio_player);
1020
1017
  gtk_box_pack_start (GTK_BOX (vbox), assistant->priv->audio_player, FALSE, FALSE, 0);
1043
1040
                                  "text", 0,
1044
1041
                                  "sensitive", 1,
1045
1042
                                  NULL);
1046
 
  g_object_set (G_OBJECT (renderer), 
1047
 
                "ellipsize-set", TRUE, 
1048
 
                "ellipsize", PANGO_ELLIPSIZE_END, 
 
1043
  g_object_set (G_OBJECT (renderer),
 
1044
                "ellipsize-set", TRUE,
 
1045
                "ellipsize", PANGO_ELLIPSIZE_END,
1049
1046
                "width-chars", 45, NULL);
1050
1047
  gtk_label_set_mnemonic_widget (GTK_LABEL (label), assistant->priv->audio_recorder);
1051
1048
  gtk_box_pack_start (GTK_BOX (vbox), assistant->priv->audio_recorder, FALSE, FALSE, 0);
1077
1074
  char **array;
1078
1075
 
1079
1076
  ringer = gm_conf_get_string (SOUND_EVENTS_KEY "output_device");
 
1077
  if (ringer == NULL || !ringer[0])
 
1078
    ringer = g_strdup (DEFAULT_AUDIO_DEVICE_NAME);
 
1079
 
1080
1080
  player = gm_conf_get_string (AUDIO_DEVICES_KEY "output_device");
 
1081
  if (player == NULL || !player[0])
 
1082
    player = g_strdup (DEFAULT_AUDIO_DEVICE_NAME);
 
1083
 
1081
1084
  recorder = gm_conf_get_string (AUDIO_DEVICES_KEY "input_device");
 
1085
  if (recorder == NULL || !recorder[0])
 
1086
    recorder = g_strdup (DEFAULT_AUDIO_DEVICE_NAME);
1082
1087
 
1083
1088
  /* FIXME: We should use DetectDevices, however DetectDevices
1084
1089
   * works only for the currently selected audio and video plugins,
1086
1091
   */
1087
1092
  std::vector <std::string> device_list;
1088
1093
 
1089
 
  get_audiooutput_devices_list (assistant->priv->core, device_list);
 
1094
  get_audiooutput_devices_list (assistant->priv->audiooutput_core, device_list);
1090
1095
  array = convert_string_list(device_list);
1091
1096
  update_combo_box (GTK_COMBO_BOX (assistant->priv->audio_ringer), array, ringer);
1092
1097
  update_combo_box (GTK_COMBO_BOX (assistant->priv->audio_player), array, player);
1093
1098
  g_free (array);
1094
1099
 
1095
1100
 
1096
 
  get_audioinput_devices_list (assistant->priv->core, device_list);
 
1101
  get_audioinput_devices_list (assistant->priv->audioinput_core, device_list);
1097
1102
  array = convert_string_list(device_list);
1098
1103
  update_combo_box (GTK_COMBO_BOX (assistant->priv->audio_recorder), array, recorder);
1099
1104
  g_free (array);
1107
1112
static void
1108
1113
apply_audio_devices_page (EkigaAssistant *assistant)
1109
1114
{
1110
 
  GtkComboBox *combo_box;
1111
1115
  gchar *device;
1112
 
 
1113
 
  combo_box = GTK_COMBO_BOX (assistant->priv->audio_ringer);
1114
 
  device = gtk_combo_box_get_active_text (combo_box);
1115
 
  if (device) {
1116
 
    gm_conf_set_string (SOUND_EVENTS_KEY "output_device", device);
1117
 
    g_free (device);
1118
 
  }
1119
 
 
1120
 
  combo_box = GTK_COMBO_BOX (assistant->priv->audio_player);
1121
 
  device = gtk_combo_box_get_active_text (combo_box);
1122
 
  if (device) {
1123
 
    gm_conf_set_string (AUDIO_DEVICES_KEY "output_device", device);
1124
 
    g_free (device);
1125
 
  }
1126
 
 
1127
 
  combo_box = GTK_COMBO_BOX (assistant->priv->audio_recorder);
1128
 
  device = gtk_combo_box_get_active_text (combo_box);
1129
 
  if (device) {
1130
 
    gm_conf_set_string (AUDIO_DEVICES_KEY "input_device", device);
1131
 
    g_free (device);
1132
 
  }
1133
 
 
 
1116
  GtkTreeIter citer;
 
1117
 
 
1118
  if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (assistant->priv->audio_ringer), &citer))
 
1119
    g_warn_if_reached ();
 
1120
  gtk_tree_model_get (gtk_combo_box_get_model (GTK_COMBO_BOX (assistant->priv->audio_ringer)), &citer, 0, &device, -1);
 
1121
  gm_conf_set_string (SOUND_EVENTS_KEY "output_device", device);
 
1122
  g_free (device);
 
1123
 
 
1124
  if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (assistant->priv->audio_player), &citer))
 
1125
    g_warn_if_reached ();
 
1126
  gtk_tree_model_get (gtk_combo_box_get_model (GTK_COMBO_BOX (assistant->priv->audio_player)), &citer, 0, &device, -1);
 
1127
  gm_conf_set_string (AUDIO_DEVICES_KEY "output_device", device);
 
1128
  g_free (device);
 
1129
 
 
1130
  if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (assistant->priv->audio_recorder), &citer))
 
1131
    g_warn_if_reached ();
 
1132
  gtk_tree_model_get (gtk_combo_box_get_model (GTK_COMBO_BOX (assistant->priv->audio_recorder)), &citer, 0, &device, -1);
 
1133
  gm_conf_set_string (AUDIO_DEVICES_KEY "input_device", device);
 
1134
  g_free (device);
1134
1135
}
1135
1136
 
1136
1137
 
1143
1144
  GtkWidget *label;
1144
1145
  gchar *text;
1145
1146
 
1146
 
  vbox = create_page (assistant, _("Video input device"), GTK_ASSISTANT_PAGE_CONTENT);
 
1147
  vbox = create_page (assistant, _("Video Input Device"), GTK_ASSISTANT_PAGE_CONTENT);
1147
1148
 
1148
1149
  label = gtk_label_new (_("Please choose your video input device:"));
1149
1150
  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
1157
1158
                                  "text", 0,
1158
1159
                                  "sensitive", 1,
1159
1160
                                  NULL);
1160
 
  g_object_set (G_OBJECT (renderer), 
1161
 
                "ellipsize-set", TRUE, 
1162
 
                "ellipsize", PANGO_ELLIPSIZE_END, 
 
1161
  g_object_set (G_OBJECT (renderer),
 
1162
                "ellipsize-set", TRUE,
 
1163
                "ellipsize", PANGO_ELLIPSIZE_END,
1163
1164
                "width-chars", 45, NULL);
1164
1165
  gtk_label_set_mnemonic_widget (GTK_LABEL (label), assistant->priv->video_device);
1165
1166
  gtk_box_pack_start (GTK_BOX (vbox), assistant->priv->video_device, FALSE, FALSE, 0);
1184
1185
  gchar** array;
1185
1186
  gchar* current_plugin;
1186
1187
 
1187
 
  get_videoinput_devices_list (assistant->priv->core, device_list);
 
1188
  get_videoinput_devices_list (assistant->priv->videoinput_core, device_list);
1188
1189
  array = convert_string_list (device_list);
1189
1190
  current_plugin = gm_conf_get_string (VIDEO_DEVICES_KEY "input_device");
 
1191
  if (current_plugin == NULL || !current_plugin[0]) {
 
1192
    g_free (current_plugin);
 
1193
    current_plugin = g_strdup (get_default_video_device_name (array));
 
1194
  }
1190
1195
  update_combo_box (GTK_COMBO_BOX (assistant->priv->video_device),
1191
1196
                    array, current_plugin);
1192
1197
  g_free (array);
 
1198
  g_free (current_plugin);
1193
1199
}
1194
1200
 
1195
1201
static void
1196
1202
apply_video_devices_page (EkigaAssistant *assistant)
1197
1203
{
1198
 
 
1199
 
  GtkComboBox *combo_box;
1200
 
  gchar *video_device;
1201
 
 
1202
 
  combo_box = GTK_COMBO_BOX (assistant->priv->video_device);
1203
 
  video_device = gtk_combo_box_get_active_text (combo_box);
1204
 
 
1205
 
  if (video_device) {
1206
 
    gm_conf_set_string (VIDEO_DEVICES_KEY "input_device", video_device);
1207
 
    g_free (video_device);
1208
 
  }
 
1204
  gchar *device;
 
1205
  GtkTreeIter citer;
 
1206
 
 
1207
  if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (assistant->priv->video_device), &citer))
 
1208
    g_warn_if_reached ();
 
1209
  gtk_tree_model_get (gtk_combo_box_get_model (GTK_COMBO_BOX (assistant->priv->video_device)), &citer, 0, &device, -1);
 
1210
  gm_conf_set_string (VIDEO_DEVICES_KEY "input_device", device);
 
1211
  g_free (device);
1209
1212
}
1210
1213
 
1211
1214
 
1212
1215
// FIXME: duplicate to gm_prefs_window_get_video_devices_list
1213
 
void 
1214
 
get_audiooutput_devices_list (Ekiga::ServiceCore *core,
1215
 
                                        std::vector<std::string> & device_list)
 
1216
static void
 
1217
get_audiooutput_devices_list (boost::shared_ptr<Ekiga::AudioOutputCore> audiooutput_core,
 
1218
                              std::vector<std::string> & device_list)
1216
1219
{
1217
 
  Ekiga::AudioOutputCore *audiooutput_core = dynamic_cast<Ekiga::AudioOutputCore *> (core->get ("audiooutput-core"));
1218
1220
  std::vector <Ekiga::AudioOutputDevice> devices;
1219
1221
 
1220
1222
  device_list.clear();
1221
 
  audiooutput_core->get_devices(devices);
 
1223
  audiooutput_core->get_devices (devices);
1222
1224
 
1223
1225
  for (std::vector<Ekiga::AudioOutputDevice>::iterator iter = devices.begin ();
1224
1226
       iter != devices.end ();
1233
1235
}
1234
1236
 
1235
1237
 
1236
 
void 
1237
 
get_audioinput_devices_list (Ekiga::ServiceCore *core,
1238
 
                                        std::vector<std::string> & device_list)
 
1238
static void
 
1239
get_audioinput_devices_list (boost::shared_ptr<Ekiga::AudioInputCore> audioinput_core,
 
1240
                             std::vector<std::string> & device_list)
1239
1241
{
1240
 
  Ekiga::AudioInputCore *audioinput_core = dynamic_cast<Ekiga::AudioInputCore *> (core->get ("audioinput-core"));
1241
1242
  std::vector <Ekiga::AudioInputDevice> devices;
1242
1243
 
1243
1244
  device_list.clear();
1244
 
  audioinput_core->get_devices(devices);
 
1245
  audioinput_core->get_devices (devices);
1245
1246
 
1246
1247
  for (std::vector<Ekiga::AudioInputDevice>::iterator iter = devices.begin ();
1247
1248
       iter != devices.end ();
1256
1257
}
1257
1258
 
1258
1259
 
1259
 
void 
1260
 
get_videoinput_devices_list (Ekiga::ServiceCore *core,
1261
 
                                        std::vector<std::string> & device_list)
 
1260
static void
 
1261
get_videoinput_devices_list (boost::shared_ptr<Ekiga::VideoInputCore> videoinput_core,
 
1262
                             std::vector<std::string> & device_list)
1262
1263
{
1263
 
  Ekiga::VideoInputCore *videoinput_core = dynamic_cast<Ekiga::VideoInputCore *> (core->get ("videoinput-core"));
1264
1264
  std::vector<Ekiga::VideoInputDevice> devices;
1265
1265
 
1266
1266
  device_list.clear();
1267
 
  videoinput_core->get_devices(devices);
 
1267
  videoinput_core->get_devices (devices);
1268
1268
 
1269
1269
  for (std::vector<Ekiga::VideoInputDevice>::iterator iter = devices.begin ();
1270
1270
       iter != devices.end ();
1280
1280
 
1281
1281
 
1282
1282
// FIXME: duplicate to gm_prefs_window_convert_string_list
1283
 
gchar**
 
1283
static gchar**
1284
1284
convert_string_list (const std::vector<std::string> & list)
1285
1285
{
1286
1286
  gchar **array = NULL;
1287
1287
  unsigned i;
1288
1288
 
1289
 
  array = (gchar**) malloc (sizeof(gchar*) * (list.size() + 1));
 
1289
  array = (gchar**) g_malloc (sizeof(gchar*) * (list.size() + 1));
1290
1290
  for (i = 0; i < list.size(); i++)
1291
1291
    array[i] = (gchar*) list[i].c_str();
1292
1292
  array[i] = NULL;
1350
1350
}
1351
1351
 
1352
1352
 
1353
 
static void 
 
1353
static void
1354
1354
prepare_summary_page (EkigaAssistant *assistant)
1355
1355
{
1356
1356
  GtkListStore *model = assistant->priv->summary_model;
1382
1382
 
1383
1383
  /* The audio ringing device */
1384
1384
  gtk_list_store_append (model, &iter);
1385
 
  value = gtk_combo_box_get_active_text (GTK_COMBO_BOX (assistant->priv->audio_ringer));
 
1385
  if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (assistant->priv->audio_ringer), &citer))
 
1386
    g_warn_if_reached ();
 
1387
  gtk_tree_model_get (gtk_combo_box_get_model (GTK_COMBO_BOX (assistant->priv->audio_ringer)), &citer, 0, &value, -1);
1386
1388
  gtk_list_store_set (model, &iter,
1387
1389
                      SUMMARY_KEY_COLUMN, _("Audio Ringing Device"),
1388
1390
                      SUMMARY_VALUE_COLUMN, value,
1391
1393
 
1392
1394
  /* The audio playing device */
1393
1395
  gtk_list_store_append (model, &iter);
1394
 
  value = gtk_combo_box_get_active_text (GTK_COMBO_BOX (assistant->priv->audio_player));
 
1396
  if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (assistant->priv->audio_player), &citer))
 
1397
    g_warn_if_reached ();
 
1398
  gtk_tree_model_get (gtk_combo_box_get_model (GTK_COMBO_BOX (assistant->priv->audio_player)), &citer, 0, &value, -1);
1395
1399
  gtk_list_store_set (model, &iter,
1396
1400
                      SUMMARY_KEY_COLUMN, _("Audio Output Device"),
1397
1401
                      SUMMARY_VALUE_COLUMN, value,
1400
1404
 
1401
1405
  /* The audio recording device */
1402
1406
  gtk_list_store_append (model, &iter);
1403
 
  value = gtk_combo_box_get_active_text (GTK_COMBO_BOX (assistant->priv->audio_recorder));
 
1407
  if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (assistant->priv->audio_recorder), &citer))
 
1408
    g_warn_if_reached ();
 
1409
  gtk_tree_model_get (gtk_combo_box_get_model (GTK_COMBO_BOX (assistant->priv->audio_recorder)), &citer, 0, &value, -1);
1404
1410
  gtk_list_store_set (model, &iter,
1405
1411
                      SUMMARY_KEY_COLUMN, _("Audio Input Device"),
1406
1412
                      SUMMARY_VALUE_COLUMN, value,
1409
1415
 
1410
1416
  /* The video manager */
1411
1417
  gtk_list_store_append (model, &iter);
1412
 
  value = gtk_combo_box_get_active_text (GTK_COMBO_BOX (assistant->priv->video_device));
 
1418
  if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (assistant->priv->video_device), &citer))
 
1419
    g_warn_if_reached ();
 
1420
  gtk_tree_model_get (gtk_combo_box_get_model (GTK_COMBO_BOX (assistant->priv->video_device)), &citer, 0, &value, -1);
1413
1421
  gtk_list_store_set (model, &iter,
1414
1422
                      SUMMARY_KEY_COLUMN, _("Video Input Device"),
1415
1423
                      SUMMARY_VALUE_COLUMN, value,
1453
1461
  gtk_window_set_position (GTK_WINDOW (assistant), GTK_WIN_POS_CENTER);
1454
1462
  gtk_container_set_border_width (GTK_CONTAINER (assistant), 12);
1455
1463
 
 
1464
  assistant->priv->last_active_page = 0;
1456
1465
  assistant->priv->icon = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (),
1457
 
                                                    "ekiga", 48,
 
1466
                                                    PACKAGE_NAME, 48,
1458
1467
                                                    (GtkIconLookupFlags) 0, NULL);
1459
1468
 
1460
1469
  create_welcome_page (assistant);
1476
1485
                         GtkWidget    *page)
1477
1486
{
1478
1487
  EkigaAssistant *assistant = EKIGA_ASSISTANT (gtkassistant);
1479
 
  gchar *title;
 
1488
  gchar *title = NULL;
 
1489
  bool forward = false;
1480
1490
 
1481
1491
  title = g_strdup_printf (_("Ekiga Configuration Assistant (%d of %d)"),
1482
1492
                           gtk_assistant_get_current_page (gtkassistant) + 1,
1485
1495
  gtk_window_set_title (GTK_WINDOW (assistant), title);
1486
1496
  g_free (title);
1487
1497
 
 
1498
  if (assistant->priv->last_active_page < gtk_assistant_get_current_page (gtkassistant))
 
1499
    forward = true;
 
1500
  assistant->priv->last_active_page = gtk_assistant_get_current_page (gtkassistant);
 
1501
 
 
1502
  if (!forward)
 
1503
    return;
 
1504
 
1488
1505
  if (page == assistant->priv->personal_data_page) {
1489
1506
    prepare_personal_data_page (assistant);
1490
1507
    return;
1527
1544
{
1528
1545
  EkigaAssistant *assistant = EKIGA_ASSISTANT (gtkassistant);
1529
1546
 
1530
 
  GtkWidget *main_window;
1531
 
 
1532
 
  const int schema_version = MAJOR_VERSION * 1000
1533
 
                           + MINOR_VERSION * 10
1534
 
                           + BUILD_NUMBER;
1535
 
 
1536
1547
  apply_personal_data_page (assistant);
1537
1548
  apply_ekiga_net_page (assistant);
1538
1549
  apply_ekiga_out_page (assistant);
1540
1551
  apply_audio_devices_page (assistant);
1541
1552
  apply_video_devices_page (assistant);
1542
1553
 
1543
 
  main_window = GnomeMeeting::Process ()->GetMainWindow ();
1544
 
 
1545
 
  /* Hide the druid and show the main Ekiga window */
 
1554
  /* Hide the assistant and show the main Ekiga window */
1546
1555
  gtk_widget_hide (GTK_WIDGET (assistant));
1547
1556
  gtk_assistant_set_current_page (gtkassistant, 0);
1548
 
  gtk_widget_show (main_window);
1549
 
 
1550
 
  /* Update the version number */
1551
 
  gm_conf_set_int (GENERAL_KEY "version", schema_version);
 
1557
  gtk_widget_show (GnomeMeeting::Process ()->GetMainWindow ());
1552
1558
}
1553
1559
 
1554
1560
 
1555
1561
static void
1556
1562
ekiga_assistant_cancel (GtkAssistant *gtkassistant)
1557
1563
{
1558
 
  GtkWidget *main_window;
1559
 
 
1560
 
  main_window = GnomeMeeting::Process ()->GetMainWindow ();
1561
 
 
 
1564
  gtk_assistant_set_current_page (gtkassistant, 0);
1562
1565
  gtk_widget_hide (GTK_WIDGET (gtkassistant));
1563
 
  gtk_assistant_set_current_page (gtkassistant, 0);
1564
 
  gtk_widget_show (main_window);
 
1566
  gtk_widget_show (GnomeMeeting::Process ()->GetMainWindow ());
1565
1567
}
1566
1568
 
1567
1569
 
1616
1618
  assistant->priv->core = core;
1617
1619
 
1618
1620
  /* FIXME: move this into the caller */
1619
 
  g_signal_connect (assistant, "cancel",
1620
 
                    G_CALLBACK (gtk_widget_hide), NULL);
1621
1621
  g_signal_connect (assistant, "key-press-event",
1622
1622
                    G_CALLBACK (ekiga_assistant_key_press_cb), NULL);
1623
1623
 
1624
 
  sigc::connection conn;
1625
 
  Ekiga::VideoInputCore *videoinput_core = dynamic_cast<Ekiga::VideoInputCore *> (core->get ("videoinput-core"));
1626
 
  Ekiga::AudioInputCore *audioinput_core = dynamic_cast<Ekiga::AudioInputCore *> (core->get ("audioinput-core"));
1627
 
  Ekiga::AudioOutputCore *audiooutput_core = dynamic_cast<Ekiga::AudioOutputCore *> (core->get ("audiooutput-core"));
1628
 
 
1629
 
  conn = videoinput_core->device_added.connect (sigc::bind (sigc::ptr_fun (on_videoinput_device_added_cb), assistant));
1630
 
  assistant->priv->connections.push_back (conn);
1631
 
  conn = videoinput_core->device_removed.connect (sigc::bind (sigc::ptr_fun (on_videoinput_device_removed_cb), assistant));
1632
 
  assistant->priv->connections.push_back (conn);
1633
 
 
1634
 
  conn = audioinput_core->device_added.connect (sigc::bind (sigc::ptr_fun (on_audioinput_device_added_cb), assistant));
1635
 
  assistant->priv->connections.push_back (conn);
1636
 
  conn = audioinput_core->device_removed.connect (sigc::bind (sigc::ptr_fun (on_audioinput_device_removed_cb), assistant));
1637
 
  assistant->priv->connections.push_back (conn);
1638
 
 
1639
 
  conn = audiooutput_core->device_added.connect (sigc::bind (sigc::ptr_fun (on_audiooutput_device_added_cb), assistant));
1640
 
  assistant->priv->connections.push_back (conn);
1641
 
  conn = audiooutput_core->device_removed.connect (sigc::bind (sigc::ptr_fun (on_audiooutput_device_removed_cb), assistant));
1642
 
  assistant->priv->connections.push_back (conn);
 
1624
  boost::signals::connection conn;
 
1625
  assistant->priv->videoinput_core = core->get<Ekiga::VideoInputCore> ("videoinput-core");
 
1626
  assistant->priv->audioinput_core = core->get<Ekiga::AudioInputCore> ("audioinput-core");
 
1627
  assistant->priv->audiooutput_core = core->get<Ekiga::AudioOutputCore> ("audiooutput-core");
 
1628
  assistant->priv->bank = core->get<Opal::Bank> ("opal-account-store");
 
1629
 
 
1630
  conn = assistant->priv->videoinput_core->device_added.connect (boost::bind (&on_videoinput_device_added_cb, _1, _2, assistant));
 
1631
  assistant->priv->connections.push_back (conn);
 
1632
  conn = assistant->priv->videoinput_core->device_removed.connect (boost::bind (&on_videoinput_device_removed_cb, _1, _2, assistant));
 
1633
  assistant->priv->connections.push_back (conn);
 
1634
 
 
1635
  conn = assistant->priv->audioinput_core->device_added.connect (boost::bind (&on_audioinput_device_added_cb, _1, _2, assistant));
 
1636
  assistant->priv->connections.push_back (conn);
 
1637
  conn =assistant->priv-> audioinput_core->device_removed.connect (boost::bind (&on_audioinput_device_removed_cb, _1, _2, assistant));
 
1638
  assistant->priv->connections.push_back (conn);
 
1639
 
 
1640
  conn = assistant->priv->audiooutput_core->device_added.connect (boost::bind (&on_audiooutput_device_added_cb, _1, _2, assistant));
 
1641
  assistant->priv->connections.push_back (conn);
 
1642
  conn = assistant->priv->audiooutput_core->device_removed.connect (boost::bind (&on_audiooutput_device_removed_cb, _1, _2, assistant));
 
1643
  assistant->priv->connections.push_back (conn);
 
1644
 
 
1645
  /* Notifiers for the VIDEO_CODECS_KEY keys */
 
1646
  gm_conf_notifier_add (VIDEO_CODECS_KEY "maximum_video_tx_bitrate",
 
1647
                        kind_of_net_changed_nt, NULL);
 
1648
  gm_conf_notifier_add (VIDEO_CODECS_KEY "temporal_spatial_tradeoff",
 
1649
                        kind_of_net_changed_nt, NULL);
1643
1650
 
1644
1651
  return GTK_WIDGET (assistant);
1645
1652
}