Commit 03a617b2 authored by pierre-luc's avatar pierre-luc

[#811] ZRTP options now configurable back again from the Gtk UI. IP2IP

profile also configurable.
parent 61ff2745
......@@ -33,6 +33,7 @@
#include <unistd.h>
guint voice_mails;
GHashTable * ip2ip_profile=NULL;
void
sflphone_notify_voice_mail ( const gchar* accountID , guint count )
......@@ -274,6 +275,9 @@ gboolean sflphone_init()
// Fetch the configured accounts
sflphone_fill_account_list(FALSE);
// Fetch the ip2ip profile
sflphone_fill_ip2ip_profile();
// Fetch the audio codecs
sflphone_fill_codec_list();
......@@ -281,6 +285,16 @@ gboolean sflphone_init()
}
}
void sflphone_fill_ip2ip_profile(void)
{
ip2ip_profile = (GHashTable *) dbus_get_ip2_ip_details();
}
GHashTable * sflphone_get_ip2ip_properties(void)
{
return ip2ip_profile;
}
void
sflphone_hang_up()
{
......
......@@ -148,6 +148,18 @@ void sflphone_keypad ( guint keyval, gchar * key);
*/
void sflphone_place_call ( callable_obj_t * c );
/**
* Fetch the ip2ip profile through dbus and fill
* the internal hash table.
*/
void sflphone_fill_ip2ip_profile(void);
/**
* @return The internal hash table representing
* the settings for the ip2ip profile.
*/
GHashTable * sflphone_get_ip2ip_properties(void);
/**
* Initialize the accounts data structure
*/
......
......@@ -5,10 +5,12 @@ noinst_LTLIBRARIES = libconfig.la
libconfig_la_SOURCES = \
addressbook-config.c \
configwindow.c \
zrtpadvanceddialog.c \
ip2ipdialog.c \
accountwindow.c \
hooks-config.c \
audioconf.c \
utils.c
utils.c
libconfig_la_LDFLAGS = @DEPS_LDFLAGS@
......
......@@ -23,6 +23,7 @@
#include <mainwindow.h>
#include <accountlist.h>
#include <accountwindow.h>
#include <zrtpadvanceddialog.h>
// From version 2.16, gtk provides the functionalities libsexy used to provide
#if GTK_CHECK_VERSION(2,16,0)
......@@ -35,6 +36,7 @@
#include <config.h>
#include <gtk/gtk.h>
/** Local variables */
GtkDialog * dialog;
GtkWidget * hbox;
......@@ -53,7 +55,9 @@ GtkListStore * credentialStore;
GtkWidget * deleteCredButton;
GtkWidget * treeViewCredential;
GtkWidget * scrolledWindowCredential;
GtkWidget * advancedZrtpButton;
GtkWidget * keyExchangeCombo;
// Credentials
enum {
COLUMN_CREDENTIAL_REALM,
......@@ -261,10 +265,16 @@ static void fill_treeview_with_credential(GtkListStore * credentialStore, accoun
gtk_list_store_append (credentialStore, &iter);
/* This is the default, undeletable credential */
if(g_strcmp0(g_hash_table_lookup(account->properties, ACCOUNT_AUTHENTICATION_USERNAME), "") == 0) {
gchar * authentication_name = g_hash_table_lookup(account->properties, ACCOUNT_AUTHENTICATION_USERNAME);
gchar * realm = g_hash_table_lookup(account->properties, ACCOUNT_REALM);
if (realm == NULL || (g_strcmp0(realm, "") == 0)) {
realm = g_strdup("*");
}
if((authentication_name == NULL) || (g_strcmp0(authentication_name, "") == 0)) {
DEBUG("DEFAULT");
gtk_list_store_set(credentialStore, &iter,
COLUMN_CREDENTIAL_REALM, g_hash_table_lookup(account->properties, ACCOUNT_REALM),
COLUMN_CREDENTIAL_REALM, realm,
COLUMN_CREDENTIAL_USERNAME, gtk_entry_get_text(GTK_ENTRY(entryUsername)),
COLUMN_CREDENTIAL_PASSWORD, gtk_entry_get_text(GTK_ENTRY(entryPassword)),
COLUMN_CREDENTIAL_DATA, account,
......@@ -383,10 +393,29 @@ static void editing_started_cb (GtkCellRenderer *cell, GtkCellEditable * editabl
gtk_entry_set_visibility(GTK_ENTRY(editable), FALSE);
}
static void show_advanced_zrtp_options_cb(GtkWidget *widget UNUSED, gpointer data)
{
DEBUG("Advanced options for ZRTP");
show_advanced_zrtp_options((GHashTable *) data);
}
static void key_exchange_changed_cb(GtkWidget *widget, gpointer data)
{
DEBUG("Key exchange changed");
if (g_strcasecmp(gtk_combo_box_get_active_text(GTK_COMBO_BOX(keyExchangeCombo)), (gchar *) "ZRTP") == 0) {
gtk_widget_set_sensitive(GTK_WIDGET(advancedZrtpButton), TRUE);
} else {
gtk_widget_set_sensitive(GTK_WIDGET(advancedZrtpButton), FALSE);
}
}
GtkWidget * create_advanced_tab(account_t **a)
{
GtkWidget * frame;
GtkWidget * table;
GtkWidget * label;
GtkWidget * ret;
GtkWidget * hbox;
GtkWidget * editButton;
......@@ -402,34 +431,50 @@ GtkWidget * create_advanced_tab(account_t **a)
gtk_container_set_border_width(GTK_CONTAINER(ret), 10);
account_t * currentAccount;
// Default settings
gchar * curAccountResolveOnce = "FALSE";
gchar * curAccountExpire = "600";
currentAccount = *a;
gchar * curSRTPEnabled = NULL;
gchar * curKeyExchange = NULL;
gchar * curAccountResolveOnce = NULL;
gchar * curAccountExpire = NULL;
// Load from SIP/IAX/Unknown ?
if(currentAccount) {
curAccountResolveOnce = g_hash_table_lookup(currentAccount->properties, ACCOUNT_RESOLVE_ONCE);
if (curAccountResolveOnce == NULL) {
curAccountResolveOnce = "FALSE";
}
curAccountExpire = g_hash_table_lookup(currentAccount->properties, ACCOUNT_REGISTRATION_EXPIRE);
if (curAccountExpire == NULL) {
curAccountExpire = "600";
}
curKeyExchange = g_hash_table_lookup(currentAccount->properties, ACCOUNT_KEY_EXCHANGE);
if (curKeyExchange == NULL) {
curKeyExchange = "none";
}
curSRTPEnabled = g_hash_table_lookup(currentAccount->properties, ACCOUNT_SRTP_ENABLED);
if (curSRTPEnabled == NULL) {
curSRTPEnabled == "FALSE";
}
}
gnome_main_section_new_with_table (_("Registration Options"), &frame, &table, 2, 3);
gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0);
label = gtk_label_new_with_mnemonic (_("Registration _expire"));
gtk_table_attach ( GTK_TABLE( table ), label, 0, 1, 0, 1, GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
gtk_table_attach_defaults( GTK_TABLE( table ), label, 0, 1, 0, 1);
gtk_misc_set_alignment(GTK_MISC (label), 0, 0.5);
entryExpire = gtk_entry_new();
gtk_label_set_mnemonic_widget (GTK_LABEL (label), entryExpire);
gtk_entry_set_text(GTK_ENTRY(entryExpire), curAccountExpire);
gtk_table_attach ( GTK_TABLE( table ), entryExpire, 1, 2, 0, 1, GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
gtk_table_attach_defaults( GTK_TABLE( table ), entryExpire, 1, 2, 0, 1);
entryResolveNameOnlyOnce = gtk_check_button_new_with_mnemonic(_("_Conform to RFC 3263"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(entryResolveNameOnlyOnce),
g_strcasecmp(curAccountResolveOnce,"FALSE") == 0 ? TRUE: FALSE);
gtk_table_attach ( GTK_TABLE( table ), entryResolveNameOnlyOnce, 0, 2, 1, 2, GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
gtk_table_attach_defaults( GTK_TABLE( table ), entryResolveNameOnlyOnce, 0, 2, 1, 2);
gtk_widget_set_sensitive( GTK_WIDGET( entryResolveNameOnlyOnce ) , TRUE );
gtk_widget_show_all( table );
......@@ -440,13 +485,13 @@ GtkWidget * create_advanced_tab(account_t **a)
/* Credentials tree view */
gnome_main_section_new_with_table (_("Credential informations"), &frame, &table, 1, 1);
gtk_container_set_border_width (GTK_CONTAINER(table), 10);
gtk_table_set_row_spacings (GTK_TABLE(table), 10);
gtk_table_set_row_spacings(GTK_TABLE(table), 10);
gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0);
scrolledWindowCredential = gtk_scrolled_window_new(NULL, NULL);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledWindowCredential), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolledWindowCredential), GTK_SHADOW_IN);
gtk_table_attach (GTK_TABLE(table), scrolledWindowCredential, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_table_attach_defaults (GTK_TABLE(table), scrolledWindowCredential, 0, 1, 0, 1);
credentialStore = gtk_list_store_new(COLUMN_CREDENTIAL_COUNT,
G_TYPE_STRING, // Realm
......@@ -500,7 +545,7 @@ GtkWidget * create_advanced_tab(account_t **a)
/* Credential Buttons */
hbox = gtk_hbox_new(FALSE, 10);
gtk_table_attach (GTK_TABLE(table), hbox, 0, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_table_attach_defaults(GTK_TABLE(table), hbox, 0, 2, 1, 2);
addButton = gtk_button_new_from_stock (GTK_STOCK_ADD);
g_signal_connect (addButton, "clicked", G_CALLBACK (add_credential_cb), credentialStore);
......@@ -509,12 +554,48 @@ GtkWidget * create_advanced_tab(account_t **a)
deleteCredButton = gtk_button_new_from_stock (GTK_STOCK_REMOVE);
g_signal_connect (deleteCredButton, "clicked", G_CALLBACK (delete_credential_cb), treeViewCredential);
gtk_box_pack_start(GTK_BOX(hbox), deleteCredButton, FALSE, FALSE, 0);
/* SRTP Section */
gnome_main_section_new_with_table (_("Security"), &frame, &table, 1, 3);
gtk_container_set_border_width (GTK_CONTAINER(table), 10);
gtk_table_set_row_spacings (GTK_TABLE(table), 10);
gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0);
label = gtk_label_new_with_mnemonic (_("SRTP key exchange"));
keyExchangeCombo = gtk_combo_box_new_text();
gtk_label_set_mnemonic_widget (GTK_LABEL (label), keyExchangeCombo);
gtk_combo_box_append_text(GTK_COMBO_BOX(keyExchangeCombo), "ZRTP");
//gtk_combo_box_append_text(GTK_COMBO_BOX(keyExchangeCombo), "SDES");
gtk_combo_box_append_text(GTK_COMBO_BOX(keyExchangeCombo), _("Disabled"));
advancedZrtpButton = gtk_button_new_with_label(_("Advanced options"));
g_signal_connect(G_OBJECT(advancedZrtpButton), "clicked", G_CALLBACK(show_advanced_zrtp_options_cb), currentAccount->properties);
if (g_strcasecmp(curSRTPEnabled, "FALSE") == 0)
{
gtk_combo_box_set_active(GTK_COMBO_BOX(keyExchangeCombo), 1);
gtk_widget_set_sensitive(GTK_WIDGET(advancedZrtpButton), FALSE);
} else {
if (strcmp(curKeyExchange, ZRTP) == 0) {
gtk_combo_box_set_active(GTK_COMBO_BOX(keyExchangeCombo),0);
} else {
gtk_combo_box_set_active(GTK_COMBO_BOX(keyExchangeCombo), 1);
gtk_widget_set_sensitive(GTK_WIDGET(advancedZrtpButton), FALSE);
}
}
g_signal_connect (G_OBJECT (GTK_COMBO_BOX(keyExchangeCombo)), "changed", G_CALLBACK (key_exchange_changed_cb), currentAccount);
gtk_table_attach_defaults( GTK_TABLE(table), label, 0, 1, 0, 1);
gtk_table_attach_defaults (GTK_TABLE(table), keyExchangeCombo, 1, 2, 0, 1);
gtk_table_attach_defaults(GTK_TABLE(table), advancedZrtpButton, 2, 3, 0, 1);
gtk_widget_show_all(ret);
return ret;
}
static GPtrArray * getNewCredential(account_t * account)
static GPtrArray * getNewCredential(GHashTable * properties)
{
GtkTreeIter iter;
gboolean valid;
......@@ -535,9 +616,9 @@ static GPtrArray * getNewCredential(account_t * account)
COLUMN_CREDENTIAL_PASSWORD, &password,
-1);
g_hash_table_insert(account->properties, g_strdup(ACCOUNT_REALM), realm);
g_hash_table_insert(account->properties, g_strdup(ACCOUNT_AUTHENTICATION_USERNAME), username);
g_hash_table_insert(account->properties, g_strdup(ACCOUNT_PASSWORD), password);
g_hash_table_insert(properties, g_strdup(ACCOUNT_REALM), realm);
g_hash_table_insert(properties, g_strdup(ACCOUNT_AUTHENTICATION_USERNAME), username);
g_hash_table_insert(properties, g_strdup(ACCOUNT_PASSWORD), password);
valid = gtk_tree_model_iter_next (GTK_TREE_MODEL(credentialStore), &iter);
......@@ -597,12 +678,12 @@ show_account_window (account_t * a)
tab = create_account_tab(&currentAccount);
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), tab, gtk_label_new(_("Basic")));
gtk_notebook_page_num(GTK_NOTEBOOK(notebook), tab);
/* Advanced */
tab = create_advanced_tab(&currentAccount);
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), tab, gtk_label_new(_("Advanced")));
gtk_notebook_page_num(GTK_NOTEBOOK(notebook), tab);
gtk_notebook_set_current_page( GTK_NOTEBOOK( notebook) , 0);
response = gtk_dialog_run (GTK_DIALOG (dialog));
......@@ -669,7 +750,14 @@ show_account_window (account_t * a)
g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_SIP_STUN_SERVER), (gchar*)"");
g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_SIP_STUN_ENABLED), "FALSE");
}
gchar* keyExchange = (gchar *)gtk_combo_box_get_active_text(GTK_COMBO_BOX(keyExchangeCombo));
if (g_strcasecmp(keyExchange, "ZRTP") == 0) {
g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_SRTP_ENABLED), g_strdup("TRUE"));
} else {
g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_SRTP_ENABLED), g_strdup("FALSE"));
}
config_window_set_stun_visible();
}
......@@ -684,7 +772,7 @@ show_account_window (account_t * a)
*/
dbus_delete_all_credential(currentAccount);
GPtrArray * credential = getNewCredential(a);
GPtrArray * credential = getNewCredential(currentAccount->properties);
currentAccount->credential_information = credential;
if(currentAccount->credential_information != NULL) {
int i;
......
......@@ -32,6 +32,7 @@
#include <addressbook-config.h>
#include <hooks-config.h>
#include <utils.h>
#include <ip2ipdialog.h>
#include <stdlib.h>
#include <stdio.h>
......@@ -46,6 +47,7 @@ gboolean dialogOpen = FALSE;
gboolean ringtoneEnabled = TRUE;
GtkListStore *accountStore;
// instead of keeping selected codec as a variable
GtkWidget *addButton;
GtkWidget *editButton;
......@@ -94,6 +96,17 @@ config_window_fill_account_list()
GtkTreeIter iter;
gtk_list_store_clear(accountStore);
gtk_list_store_append (accountStore, &iter);
gtk_list_store_set(accountStore, &iter,
COLUMN_ACCOUNT_ALIAS, (gchar *) _("Direct calls account"),
COLUMN_ACCOUNT_TYPE, (gchar *) _("SIP"), // Protocol
COLUMN_ACCOUNT_STATUS, (gchar *) _("Active"), // Status
COLUMN_ACCOUNT_ACTIVE, TRUE, // Enable/Disable
COLUMN_ACCOUNT_DATA, NULL, // Pointer
-1);
unsigned int i;
for(i = 0; i < account_list_get_size(); i++) {
account_t * a = account_list_get_nth (i);
......@@ -101,6 +114,8 @@ config_window_fill_account_list()
if (a) {
gtk_list_store_append (accountStore, &iter);
DEBUG("Filling accounts: Account is enabled :%s\n", g_hash_table_lookup(a->properties, ACCOUNT_ENABLED));
gtk_list_store_set(accountStore, &iter,
COLUMN_ACCOUNT_ALIAS, g_hash_table_lookup(a->properties, ACCOUNT_ALIAS), // Name
COLUMN_ACCOUNT_TYPE, g_hash_table_lookup(a->properties, ACCOUNT_TYPE), // Protocol
......@@ -140,9 +155,26 @@ edit_account(GtkWidget *widget UNUSED, gpointer data UNUSED)
if(selectedAccount)
{
show_account_window(selectedAccount);
} else {
GHashTable * properties = NULL;
properties = sflphone_get_ip2ip_properties();
if (properties != NULL) {
show_ip2ip_dialog(properties);
}
}
}
static void edit_ip2ip_profile(GtkWidget * widget UNUSED, gpointer data UNUSED)
{
DEBUG("Advanced options for ZRTP and ip2ip profile");
GHashTable * properties = NULL;
properties = sflphone_get_ip2ip_properties();
if (properties != NULL) {
show_advanced_zrtp_options(properties);
}
show_advanced_zrtp_options((GHashTable *) data);
}
/**
* Add an account
*/
......@@ -222,6 +254,17 @@ select_account(GtkTreeSelection *selection, GtkTreeModel *model)
GtkTreeIter iter;
GValue val;
GtkTreePath *path;
if(gtk_tree_selection_get_selected (selection, NULL, &iter)) {
path = gtk_tree_model_get_path (model, &iter);
if(gtk_tree_path_get_indices (path)[0] == 0) {
gtk_widget_set_sensitive(GTK_WIDGET(editButton), TRUE);
gtk_widget_set_sensitive(GTK_WIDGET(deleteButton), FALSE);
gtk_widget_set_sensitive(GTK_WIDGET(accountMoveUpButton), FALSE);
gtk_widget_set_sensitive(GTK_WIDGET(accountMoveDownButton), FALSE);
}
}
memset (&val, 0, sizeof(val));
if (!gtk_tree_selection_get_selected(selection, &model, &iter))
{
......@@ -260,25 +303,28 @@ enable_account(GtkCellRendererToggle *rend UNUSED, gchar* path, gpointer data )
treePath = gtk_tree_path_new_from_string(path);
model = gtk_tree_view_get_model(GTK_TREE_VIEW(data));
gtk_tree_model_get_iter(model, &iter, treePath);
// Get pointer on object
gtk_tree_model_get(model, &iter,
COLUMN_ACCOUNT_ACTIVE, &enable,
COLUMN_ACCOUNT_DATA, &acc,
-1);
enable = !enable;
// Store value
gtk_list_store_set(GTK_LIST_STORE(model), &iter,
COLUMN_ACCOUNT_ACTIVE, enable,
-1);
gtk_tree_path_free(treePath);
// Modify account state
g_hash_table_replace( acc->properties , g_strdup(ACCOUNT_ENABLED) , g_strdup((enable == 1)? "TRUE":"FALSE"));
dbus_send_register( acc->accountID , enable );
if (gtk_tree_path_get_indices (treePath)[0] != 0) {
// Get pointer on object
gtk_tree_model_get(model, &iter,
COLUMN_ACCOUNT_ACTIVE, &enable,
COLUMN_ACCOUNT_DATA, &acc,
-1);
enable = !enable;
DEBUG("Account is %d enabled\n", enable);
// Store value
gtk_list_store_set(GTK_LIST_STORE(model), &iter,
COLUMN_ACCOUNT_ACTIVE, enable,
-1);
gtk_tree_path_free(treePath);
// Modify account state
g_hash_table_replace( acc->properties , g_strdup(ACCOUNT_ENABLED) , g_strdup((enable == 1)? "TRUE":"FALSE"));
dbus_send_register( acc->accountID , enable );
}
}
/**
......@@ -373,9 +419,9 @@ create_accounts_tab(GtkDialog * dialog)
{
GtkWidget *table;
GtkWidget *scrolledWindow;
GtkWidget *treeView;
GtkWidget *buttonBox;
GtkCellRenderer *renderer;
GtkTreeView * treeView;
GtkTreeViewColumn *treeViewColumn;
GtkTreeSelection *treeSelection;
GtkRequisition requisition;
......
/*
* Copyright (C) 2009 Savoir-Faire Linux inc.
* Author: Pierre-Luc Bacon <pierre-luc.bacon@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <zrtpadvanceddialog.h>
#include <sflphone_const.h>
#include <utils.h>
#include <gtk/gtk.h>
static void key_exchange_changed_cb(GtkWidget *widget, gpointer data)
{
DEBUG("Key exchange changed");
if (g_strcasecmp(gtk_combo_box_get_active_text(GTK_COMBO_BOX(widget)), (gchar *) "ZRTP") == 0) {
gtk_widget_set_sensitive(GTK_WIDGET(data), TRUE);
} else {
gtk_widget_set_sensitive(GTK_WIDGET(data), FALSE);
}
}
static void show_advanced_zrtp_options_cb(GtkWidget *widget UNUSED, gpointer data)
{
DEBUG("Advanced options for ZRTP");
show_advanced_zrtp_options((GHashTable *) data);
}
void show_ip2ip_dialog(GHashTable * properties)
{
GtkDialog * ip2ipDialog;
GtkWidget * frame;
GtkWidget * table;
GtkWidget * label;
GtkWidget * enableHelloHash;
GtkWidget * enableSASConfirm;
GtkWidget * enableZrtpNotSuppOther;
GtkWidget * displaySasOnce;
GtkWidget * advancedOptions;
GtkWidget * keyExchangeCombo;
gchar * curSasConfirm = "TRUE";
gchar * curHelloEnabled = "TRUE";
gchar * curZrtpNotSuppOther = "TRUE";
gchar * curDisplaySasOnce = "FALSE";
gchar * curSRTPEnabled = "FALSE";
gchar * curKeyExchange = "0";
gchar * description;
if(properties != NULL) {
curSRTPEnabled = g_hash_table_lookup(properties, ACCOUNT_ZRTP_HELLO_HASH);
curKeyExchange = g_hash_table_lookup(properties, ACCOUNT_KEY_EXCHANGE);
curHelloEnabled = g_hash_table_lookup(properties, ACCOUNT_ZRTP_HELLO_HASH);
curSasConfirm = g_hash_table_lookup(properties, ACCOUNT_ZRTP_DISPLAY_SAS);
curZrtpNotSuppOther = g_hash_table_lookup(properties, ACCOUNT_ZRTP_NOT_SUPP_WARNING);
curDisplaySasOnce = g_hash_table_lookup(properties, ACCOUNT_DISPLAY_SAS_ONCE);
}
ip2ipDialog = GTK_DIALOG(gtk_dialog_new_with_buttons (_("Direct peer to peer calls"),
GTK_WINDOW(get_main_window()),
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_HELP,
GTK_RESPONSE_HELP,
GTK_STOCK_CANCEL,
GTK_RESPONSE_CANCEL,
GTK_STOCK_SAVE,
GTK_RESPONSE_ACCEPT,
NULL));
gtk_window_set_policy( GTK_WINDOW(ip2ipDialog), FALSE, FALSE, FALSE );
gtk_dialog_set_has_separator(ip2ipDialog, TRUE);
gtk_container_set_border_width (GTK_CONTAINER(ip2ipDialog), 0);
GtkWidget * vbox = gtk_vbox_new(FALSE, 10);
gtk_container_set_border_width(GTK_CONTAINER(vbox), 10);
gtk_box_pack_start(GTK_BOX(ip2ipDialog->vbox), vbox, FALSE, FALSE, 0);
description = g_markup_printf_escaped(_("This profile is used when you want to reach a remote peer\nby simply typing sip:remotepeer without having to go throught\nan external server. The settings here defined will also apply\nin case no account could be matched to the incoming or\noutgoing call."));
label = gtk_label_new(NULL);
gtk_label_set_markup(GTK_LABEL(label), description);
gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_FILL);
gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
/* SRTP Section */
gnome_main_section_new_with_table (_("Security"), &frame, &table, 1, 3);
gtk_container_set_border_width (GTK_CONTAINER(table), 10);
gtk_table_set_row_spacings (GTK_TABLE(table), 10);
gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0);
label = gtk_label_new_with_mnemonic (_("SRTP key exchange"));
keyExchangeCombo = gtk_combo_box_new_text();
gtk_label_set_mnemonic_widget (GTK_LABEL (label), keyExchangeCombo);
gtk_combo_box_append_text(GTK_COMBO_BOX(keyExchangeCombo), "ZRTP");
//gtk_combo_box_append_text(GTK_COMBO_BOX(keyExchangeCombo), "SDES");
gtk_combo_box_append_text(GTK_COMBO_BOX(keyExchangeCombo), _("Disabled"));
advancedOptions = gtk_button_new_with_label(_("Advanced options"));
g_signal_connect(G_OBJECT(advancedOptions), "clicked", G_CALLBACK(show_advanced_zrtp_options_cb), properties);
if (g_strcasecmp(curSRTPEnabled, "FALSE") == 0)
{
gtk_combo_box_set_active(GTK_COMBO_BOX(keyExchangeCombo), 1);
gtk_widget_set_sensitive(GTK_WIDGET(advancedOptions), FALSE);
} else {
if (strcmp(curKeyExchange, ZRTP) == 0) {
gtk_combo_box_set_active(GTK_COMBO_BOX(keyExchangeCombo),0);
} else {