Skip to content
Snippets Groups Projects
Commit 1a307971 authored by Tristan Matthews's avatar Tristan Matthews
Browse files

* #6902: migrate to Gtk+3

Changes backported from video_preview
parent 7a59d9c6
Branches
Tags
No related merge requests found
Showing
with 222 additions and 348 deletions
...@@ -25,13 +25,15 @@ AC_DEFINE_UNQUOTED(SFLPHONE_UIDIR_UNINSTALLED, "`pwd`/src/", ...@@ -25,13 +25,15 @@ AC_DEFINE_UNQUOTED(SFLPHONE_UIDIR_UNINSTALLED, "`pwd`/src/",
[path to uninstalled SFLphone UI dir]) [path to uninstalled SFLphone UI dir])
PKG_CHECK_MODULES(DBUSGLIB, dbus-glib-1 >= 0.75, HAVE_DBUS_G_PROXY_SET_DEFAULT_TIMEOUT=true, HAVE_DBUS_G_PROXY_SET_DEFAULT_TIMEOUT=false); PKG_CHECK_MODULES(DBUSGLIB, dbus-glib-1 >= 0.75, HAVE_DBUS_G_PROXY_SET_DEFAULT_TIMEOUT=true, HAVE_DBUS_G_PROXY_SET_DEFAULT_TIMEOUT=false);
PKG_CHECK_MODULES([LIBNOTIFY], [libnotify >= 0.7.2], [AC_DEFINE([LIBNOTIFY_VERSION_0_7_2],[],[Using libnotify-0.7.2 or higher])],[PKG_CHECK_MODULES([LIBNOTIFY], [libnotify >= 0.4])]) PKG_CHECK_MODULES([LIBNOTIFY], [libnotify >= 0.7.2])
PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.20) if echo "$LIBNOTIFY_LIBS" | grep -q gtk+-x11-2.0; then
AC_MSG_ERROR([Your libnotify is linked with GTK+2 ! Install libnotify4-dev])
exit 1
fi
PKG_CHECK_MODULES(GTK, gtk+-3.0)
PKG_CHECK_MODULES(GCONF, gconf-2.0)
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.24) PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.24)
PKG_CHECK_MODULES(WEBKIT, webkit-1.0) PKG_CHECK_MODULES(WEBKIT, webkitgtk-3.0)
PKG_CHECK_MODULES(LIBGNOMEUI, libgnomeui-2.0)
PKG_CHECK_MODULES(GNOMEDOCUTILS, gnome-doc-utils)
# This macro is defined in check.m4 and tests if check.h and # This macro is defined in check.m4 and tests if check.h and
# libcheck.a are installed in your system. It sets CHECK_CFLAGS and # libcheck.a are installed in your system. It sets CHECK_CFLAGS and
......
...@@ -26,8 +26,8 @@ sflphone_client_gnome_SOURCES = \ ...@@ -26,8 +26,8 @@ sflphone_client_gnome_SOURCES = \
statusicon.c \ statusicon.c \
codeclist.c \ codeclist.c \
reqaccount.c \ reqaccount.c \
shortcuts.c \ eel-gconf-extensions.c \
eel-gconf-extensions.c shortcuts.c
noinst_HEADERS = actions.h sflnotify.h mainwindow.h dialpad.h codeclist.h \ noinst_HEADERS = actions.h sflnotify.h mainwindow.h dialpad.h codeclist.h \
reqaccount.h sflphone_const.h uimanager.h \ reqaccount.h sflphone_const.h uimanager.h \
...@@ -35,10 +35,10 @@ noinst_HEADERS = actions.h sflnotify.h mainwindow.h dialpad.h codeclist.h \ ...@@ -35,10 +35,10 @@ noinst_HEADERS = actions.h sflnotify.h mainwindow.h dialpad.h codeclist.h \
shortcuts.h eel-gconf-extensions.h logger.h imwindow.h unused.h shortcuts.h eel-gconf-extensions.h logger.h imwindow.h unused.h
sflphone_client_gnome_LDADD = $(DBUSGLIB_LIBS) $(LIBNOTIFY_LIBS) $(NOTIFY_LIBS) $(SFLPHONEGTK_LIBS) $(X11_LIBS) \ sflphone_client_gnome_LDADD = $(DBUSGLIB_LIBS) $(LIBNOTIFY_LIBS) $(NOTIFY_LIBS) $(SFLPHONEGTK_LIBS) $(X11_LIBS) \
$(GTK_LIBS) $(GLIB_LIBS) $(WEBKIT_LIBS) $(LIBGNOMEUI_LIBS) $(GNOMEDOCUTILS_LIBS) $(LD_LIBS) $(GTK_LIBS) $(GLIB_LIBS) $(WEBKIT_LIBS) $(LD_LIBS) $(GCONF_LIBS)
sflphone_client_gnome_CFLAGS = $(DBUSGLIB_CFLAGS) $(LIBNOTIFY_CFLAGS) $(NOTIFY_CFLAGS) $(SFLPHONEGTK_CFLAGS) $(X11_CFLAGS) \ sflphone_client_gnome_CFLAGS = $(DBUSGLIB_CFLAGS) $(LIBNOTIFY_CFLAGS) $(NOTIFY_CFLAGS) $(GTK_CFLAGS) $(X11_CFLAGS) \
$(GTK_CFLAGS) $(GLIB_CFLAGS) $(WEBKIT_CFLAGS) $(LIBGNOMEUI_CFLAGS) $(GNOMEDOCUTILS_CFLAGS) $(GLIB_CFLAGS) $(WEBKIT_CFLAGS) $(GCONF_CFLAGS)
# add symbolic link # add symbolic link
install-exec-local: install-exec-local:
......
...@@ -26,14 +26,11 @@ libconfig_la_SOURCES = \ ...@@ -26,14 +26,11 @@ libconfig_la_SOURCES = \
utils.h \ utils.h \
zrtpadvanceddialog.h zrtpadvanceddialog.h
libconfig_la_LDFLAGS = $(DBUSGLIB_LDFLAGS) $(LIBNOTIFY_LDFLAGS) \ libconfig_la_LDFLAGS = $(DBUSGLIB_LDFLAGS) $(LIBNOTIFY_LDFLAGS) $(GCONF_LDFLAGS) \
$(GTK_LDFLAGS) $(GLIB_LDFLAGS) $(WEBKIT_LDFLAGS) $(LIBGNOMEUI_LDFLAGS) \ $(GTK_LDFLAGS) $(GLIB_LDFLAGS) $(WEBKIT_LDFLAGS)
$(GNOMEDOCUTILS_LDFLAGS)
libconfig_la_LIBADD = $(DBUSGLIB_LIBS) $(LIBNOTIFY_LIBSI) \ libconfig_la_LIBADD = $(DBUSGLIB_LIBS) $(LIBNOTIFY_LIBS) $(GCONF_LIBS) \
$(GTK_LIBS) $(GLIB_LIBS) $(WEBKIT_LIBS) $(LIBGNOMEUI_LIBS) \ $(GTK_LIBS) $(GLIB_LIBS) $(WEBKIT_LIBS)
$(GNOMEDOCUTILS_LIBS)
libconfig_la_CFLAGS = $(DBUSGLIB_CFLAGS) $(LIBNOTIFY_CFLAGS) \ libconfig_la_CFLAGS = $(DBUSGLIB_CFLAGS) $(LIBNOTIFY_CFLAGS) $(GCONF_CFLAGS) \
$(GTK_CFLAGS) $(GLIB_CFLAGS) $(WEBKIT_CFLAGS) $(LIBGNOMEUI_CFLAGS) \ $(GTK_CFLAGS) $(GLIB_CFLAGS) $(WEBKIT_CFLAGS)
$(GNOMEDOCUTILS_CFLAGS)
...@@ -47,7 +47,6 @@ ...@@ -47,7 +47,6 @@
#include "accountconfigdialog.h" #include "accountconfigdialog.h"
#include "zrtpadvanceddialog.h" #include "zrtpadvanceddialog.h"
#include "tlsadvanceddialog.h" #include "tlsadvanceddialog.h"
#include "audioconf.h"
#include "dbus/dbus.h" #include "dbus/dbus.h"
#include "utils.h" #include "utils.h"
#include "unused.h" #include "unused.h"
...@@ -130,7 +129,7 @@ static void show_password_cb(GtkWidget *widget UNUSED, gpointer data) ...@@ -130,7 +129,7 @@ static void show_password_cb(GtkWidget *widget UNUSED, gpointer data)
/* Signal to protocolComboBox 'changed' */ /* Signal to protocolComboBox 'changed' */
void change_protocol_cb(account_t *currentAccount UNUSED) void change_protocol_cb(account_t *currentAccount UNUSED)
{ {
gchar *protocol = gtk_combo_box_get_active_text(GTK_COMBO_BOX(protocolComboBox)); gchar *protocol = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(protocolComboBox));
// Only if tabs are not NULL // Only if tabs are not NULL
if (security_tab && advanced_tab) { if (security_tab && advanced_tab) {
...@@ -202,7 +201,6 @@ static void update_credential_cb(GtkWidget *widget, gpointer data UNUSED) ...@@ -202,7 +201,6 @@ static void update_credential_cb(GtkWidget *widget, gpointer data UNUSED)
static GtkWidget* create_basic_tab(account_t *currentAccount) static GtkWidget* create_basic_tab(account_t *currentAccount)
{ {
g_assert(currentAccount); g_assert(currentAccount);
DEBUG("Config: Create basic account tab");
// Load from SIP/IAX/Unknown ? // Load from SIP/IAX/Unknown ?
gchar *curAccountType = g_hash_table_lookup(currentAccount->properties, ACCOUNT_TYPE); gchar *curAccountType = g_hash_table_lookup(currentAccount->properties, ACCOUNT_TYPE);
...@@ -258,12 +256,12 @@ static GtkWidget* create_basic_tab(account_t *currentAccount) ...@@ -258,12 +256,12 @@ static GtkWidget* create_basic_tab(account_t *currentAccount)
label = gtk_label_new_with_mnemonic(_("_Protocol")); label = gtk_label_new_with_mnemonic(_("_Protocol"));
gtk_table_attach(GTK_TABLE(table), label, 0, 1, row, row+1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); gtk_table_attach(GTK_TABLE(table), label, 0, 1, row, row+1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
protocolComboBox = gtk_combo_box_new_text(); protocolComboBox = gtk_combo_box_text_new();
gtk_label_set_mnemonic_widget(GTK_LABEL(label), protocolComboBox); gtk_label_set_mnemonic_widget(GTK_LABEL(label), protocolComboBox);
gtk_combo_box_append_text(GTK_COMBO_BOX(protocolComboBox), "SIP"); gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(protocolComboBox), "SIP");
if (dbus_is_iax2_enabled()) if (dbus_is_iax2_enabled())
gtk_combo_box_append_text(GTK_COMBO_BOX(protocolComboBox), "IAX"); gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(protocolComboBox), "IAX");
if (g_strcmp0(curAccountType, "SIP") == 0) if (g_strcmp0(curAccountType, "SIP") == 0)
gtk_combo_box_set_active(GTK_COMBO_BOX(protocolComboBox),0); gtk_combo_box_set_active(GTK_COMBO_BOX(protocolComboBox),0);
...@@ -272,7 +270,7 @@ static GtkWidget* create_basic_tab(account_t *currentAccount) ...@@ -272,7 +270,7 @@ static GtkWidget* create_basic_tab(account_t *currentAccount)
else { else {
DEBUG("Config: Error: Account protocol not valid"); DEBUG("Config: Error: Account protocol not valid");
/* Should never come here, add debug message. */ /* Should never come here, add debug message. */
gtk_combo_box_append_text(GTK_COMBO_BOX(protocolComboBox), _("Unknown")); gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(protocolComboBox), _("Unknown"));
gtk_combo_box_set_active(GTK_COMBO_BOX(protocolComboBox), 2); gtk_combo_box_set_active(GTK_COMBO_BOX(protocolComboBox), 2);
} }
...@@ -459,7 +457,7 @@ static void editing_started_cb(GtkCellRenderer *cell UNUSED, GtkCellEditable * e ...@@ -459,7 +457,7 @@ static void editing_started_cb(GtkCellRenderer *cell UNUSED, GtkCellEditable * e
static void show_advanced_zrtp_options_cb(GtkWidget *widget UNUSED, gpointer data) static void show_advanced_zrtp_options_cb(GtkWidget *widget UNUSED, gpointer data)
{ {
gchar *proto = gtk_combo_box_get_active_text(GTK_COMBO_BOX(keyExchangeCombo)); gchar *proto = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(keyExchangeCombo));
if (g_strcasecmp(proto, "ZRTP") == 0) if (g_strcasecmp(proto, "ZRTP") == 0)
show_advanced_zrtp_options((GHashTable *) data); show_advanced_zrtp_options((GHashTable *) data);
...@@ -477,7 +475,7 @@ static void show_advanced_tls_options_cb(GtkWidget *widget UNUSED, gpointer data ...@@ -477,7 +475,7 @@ static void show_advanced_tls_options_cb(GtkWidget *widget UNUSED, gpointer data
static void key_exchange_changed_cb(GtkWidget *widget UNUSED, gpointer data UNUSED) static void key_exchange_changed_cb(GtkWidget *widget UNUSED, gpointer data UNUSED)
{ {
gchar *active_text = gtk_combo_box_get_active_text(GTK_COMBO_BOX(keyExchangeCombo)); gchar *active_text = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(keyExchangeCombo));
DEBUG("Key exchange changed %s", active_text); DEBUG("Key exchange changed %s", active_text);
gboolean set_sensitive = FALSE; gboolean set_sensitive = FALSE;
...@@ -569,7 +567,7 @@ get_interface_addr_from_name(const gchar * const iface_name) ...@@ -569,7 +567,7 @@ get_interface_addr_from_name(const gchar * const iface_name)
static void local_interface_changed_cb(GtkWidget * widget UNUSED, gpointer data UNUSED) static void local_interface_changed_cb(GtkWidget * widget UNUSED, gpointer data UNUSED)
{ {
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(sameAsLocalRadioButton))) { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(sameAsLocalRadioButton))) {
gchar *local_iface_name = gtk_combo_box_get_active_text(GTK_COMBO_BOX(localAddressCombo)); gchar *local_iface_name = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(localAddressCombo));
gchar *local_iface_addr = get_interface_addr_from_name(local_iface_name); gchar *local_iface_addr = get_interface_addr_from_name(local_iface_name);
gtk_entry_set_text(GTK_ENTRY(localAddressEntry), local_iface_addr); gtk_entry_set_text(GTK_ENTRY(localAddressEntry), local_iface_addr);
...@@ -631,7 +629,7 @@ static void use_stun_cb(GtkWidget *widget, gpointer data UNUSED) ...@@ -631,7 +629,7 @@ static void use_stun_cb(GtkWidget *widget, gpointer data UNUSED)
static void same_as_local_cb(GtkWidget * widget, gpointer data UNUSED) static void same_as_local_cb(GtkWidget * widget, gpointer data UNUSED)
{ {
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) {
gchar *local_interface = gtk_combo_box_get_active_text(GTK_COMBO_BOX(localAddressCombo)); gchar *local_interface = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(localAddressCombo));
gchar *local_address = dbus_get_address_from_interface_name(local_interface); gchar *local_address = dbus_get_address_from_interface_name(local_interface);
gtk_entry_set_text(GTK_ENTRY(publishedAddressEntry), local_address); gtk_entry_set_text(GTK_ENTRY(publishedAddressEntry), local_address);
...@@ -743,22 +741,19 @@ GtkWidget* create_security_widget(account_t *a) ...@@ -743,22 +741,19 @@ GtkWidget* create_security_widget(account_t *a)
if (a) { if (a) {
curKeyExchange = g_hash_table_lookup(a->properties, ACCOUNT_KEY_EXCHANGE); curKeyExchange = g_hash_table_lookup(a->properties, ACCOUNT_KEY_EXCHANGE);
if (curKeyExchange == NULL) { if (curKeyExchange == NULL)
curKeyExchange = "none"; curKeyExchange = "none";
}
curSRTPEnabled = g_hash_table_lookup(a->properties, ACCOUNT_SRTP_ENABLED); curSRTPEnabled = g_hash_table_lookup(a->properties, ACCOUNT_SRTP_ENABLED);
if (curSRTPEnabled == NULL) { if (curSRTPEnabled == NULL)
curSRTPEnabled = "false"; curSRTPEnabled = "false";
}
curTLSEnabled = g_hash_table_lookup(a->properties, TLS_ENABLE); curTLSEnabled = g_hash_table_lookup(a->properties, TLS_ENABLE);
if (curTLSEnabled == NULL) { if (curTLSEnabled == NULL)
curTLSEnabled = "false"; curTLSEnabled = "false";
} }
}
gnome_main_section_new_with_table(_("Security"), &frame, &table, 2, 3); gnome_main_section_new_with_table(_("Security"), &frame, &table, 2, 3);
gtk_container_set_border_width(GTK_CONTAINER(table), 10); gtk_container_set_border_width(GTK_CONTAINER(table), 10);
...@@ -779,11 +774,11 @@ GtkWidget* create_security_widget(account_t *a) ...@@ -779,11 +774,11 @@ GtkWidget* create_security_widget(account_t *a)
/* ZRTP subsection */ /* ZRTP subsection */
label = gtk_label_new_with_mnemonic(_("SRTP key exchange")); label = gtk_label_new_with_mnemonic(_("SRTP key exchange"));
gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
keyExchangeCombo = gtk_combo_box_new_text(); keyExchangeCombo = gtk_combo_box_text_new();
gtk_label_set_mnemonic_widget(GTK_LABEL(label), keyExchangeCombo); gtk_label_set_mnemonic_widget(GTK_LABEL(label), keyExchangeCombo);
gtk_combo_box_append_text(GTK_COMBO_BOX(keyExchangeCombo), "ZRTP"); gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(keyExchangeCombo), "ZRTP");
gtk_combo_box_append_text(GTK_COMBO_BOX(keyExchangeCombo), "SDES"); gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(keyExchangeCombo), "SDES");
gtk_combo_box_append_text(GTK_COMBO_BOX(keyExchangeCombo), _("Disabled")); gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(keyExchangeCombo), _("Disabled"));
advancedZrtpButton = gtk_button_new_from_stock(GTK_STOCK_PREFERENCES); advancedZrtpButton = gtk_button_new_from_stock(GTK_STOCK_PREFERENCES);
g_signal_connect(G_OBJECT(advancedZrtpButton), "clicked", G_CALLBACK(show_advanced_zrtp_options_cb),a->properties); g_signal_connect(G_OBJECT(advancedZrtpButton), "clicked", G_CALLBACK(show_advanced_zrtp_options_cb),a->properties);
...@@ -792,11 +787,11 @@ GtkWidget* create_security_widget(account_t *a) ...@@ -792,11 +787,11 @@ GtkWidget* create_security_widget(account_t *a)
gtk_combo_box_set_active(GTK_COMBO_BOX(keyExchangeCombo), 2); gtk_combo_box_set_active(GTK_COMBO_BOX(keyExchangeCombo), 2);
gtk_widget_set_sensitive(advancedZrtpButton, FALSE); gtk_widget_set_sensitive(advancedZrtpButton, FALSE);
} else { } else {
if (g_strcmp0(curKeyExchange, ZRTP) == 0) { if (g_strcmp0(curKeyExchange, ZRTP) == 0)
gtk_combo_box_set_active(GTK_COMBO_BOX(keyExchangeCombo),0); gtk_combo_box_set_active(GTK_COMBO_BOX(keyExchangeCombo),0);
} else if (g_strcmp0(curKeyExchange, SDES) == 0) { else if (g_strcmp0(curKeyExchange, SDES) == 0)
gtk_combo_box_set_active(GTK_COMBO_BOX(keyExchangeCombo),1); gtk_combo_box_set_active(GTK_COMBO_BOX(keyExchangeCombo),1);
} else { else {
gtk_combo_box_set_active(GTK_COMBO_BOX(keyExchangeCombo), 2); gtk_combo_box_set_active(GTK_COMBO_BOX(keyExchangeCombo), 2);
gtk_widget_set_sensitive(advancedZrtpButton, FALSE); gtk_widget_set_sensitive(advancedZrtpButton, FALSE);
} }
...@@ -888,62 +883,32 @@ GtkWidget* create_network(account_t *a) ...@@ -888,62 +883,32 @@ GtkWidget* create_network(account_t *a)
* Retreive the list of IP interface from the * Retreive the list of IP interface from the
* the daemon and build the combo box. * the daemon and build the combo box.
*/ */
localAddressCombo = gtk_combo_box_text_new();
GtkListStore * ipInterfaceListStore;
GtkTreeIter iter;
ipInterfaceListStore = gtk_list_store_new(1, G_TYPE_STRING);
label = gtk_label_new_with_mnemonic(_("Local address")); label = gtk_label_new_with_mnemonic(_("Local address"));
gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
GtkTreeIter current_local_iface_iter = iter; gchar **iface_list = dbus_get_all_ip_interface_by_name();
gchar ** iface_list = NULL;
// iface_list =(gchar**) dbus_get_all_ip_interface();
iface_list =(gchar**) dbus_get_all_ip_interface_by_name();
gchar ** iface = NULL;
// flag to determine if local_address is found
gboolean iface_found = FALSE;
if (iface_list != NULL) { int idx = 0;
// fill the iterface combo box for (gchar **iface = iface_list; iface && *iface; iface++, idx++) {
for (iface = iface_list; *iface; iface++) {
DEBUG("Interface %s", *iface);
gtk_list_store_append(ipInterfaceListStore, &iter);
gtk_list_store_set(ipInterfaceListStore, &iter, 0, *iface, -1);
// set the current local address gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(localAddressCombo), NULL, *iface);
if (!iface_found &&(g_strcmp0(*iface, local_interface) == 0)) { if (g_strcmp0(*iface, local_interface) == 0)
DEBUG("Setting active local address combo box"); gtk_combo_box_set_active(GTK_COMBO_BOX(localAddressCombo), idx);
current_local_iface_iter = iter;
iface_found = TRUE;
}
} }
if (!local_interface)
gtk_combo_box_set_active(GTK_COMBO_BOX(localAddressCombo), 0);
if (!iface_found) {
DEBUG("Did not find local ip address, take fisrt in the list");
gtk_tree_model_get_iter_first(GTK_TREE_MODEL(ipInterfaceListStore), &current_local_iface_iter);
}
}
localAddressCombo = gtk_combo_box_new_with_model(GTK_TREE_MODEL(ipInterfaceListStore));
gtk_label_set_mnemonic_widget(GTK_LABEL(label), localAddressCombo); gtk_label_set_mnemonic_widget(GTK_LABEL(label), localAddressCombo);
gtk_table_attach(GTK_TABLE(table), localAddressCombo, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); gtk_table_attach(GTK_TABLE(table), localAddressCombo, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
g_object_unref(G_OBJECT(ipInterfaceListStore));
GtkCellRenderer * ipInterfaceCellRenderer;
ipInterfaceCellRenderer = gtk_cell_renderer_text_new();
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(localAddressCombo), ipInterfaceCellRenderer, TRUE);
gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(localAddressCombo), ipInterfaceCellRenderer, "text", 0, NULL);
gtk_combo_box_set_active_iter(GTK_COMBO_BOX(localAddressCombo), &current_local_iface_iter);
// Fill the text entry with the ip address of local interface selected // Fill the text entry with the ip address of local interface selected
localAddressEntry = gtk_entry_new(); localAddressEntry = gtk_entry_new();
gchar *local_iface_name = gtk_combo_box_get_active_text(GTK_COMBO_BOX(localAddressCombo)); gchar *local_iface_name = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(localAddressCombo));
gchar *local_iface_addr = get_interface_addr_from_name(local_iface_name); gchar *local_iface_addr = get_interface_addr_from_name(local_iface_name);
g_free(local_iface_name); g_free(local_iface_name);
gtk_entry_set_text(GTK_ENTRY(localAddressEntry), local_iface_addr); gtk_entry_set_text(GTK_ENTRY(localAddressEntry), local_iface_addr);
...@@ -1065,27 +1030,27 @@ GtkWidget* create_advanced_tab(account_t *a) ...@@ -1065,27 +1030,27 @@ GtkWidget* create_advanced_tab(account_t *a)
// Build the advanced tab, to appear on the account configuration panel // Build the advanced tab, to appear on the account configuration panel
DEBUG("Config: Build advanced tab"); DEBUG("Config: Build advanced tab");
GtkWidget *ret, *frame; GtkWidget *vbox, *frame;
ret = gtk_vbox_new(FALSE, 10); vbox = gtk_vbox_new(FALSE, 10);
gtk_container_set_border_width(GTK_CONTAINER(ret), 10); gtk_container_set_border_width(GTK_CONTAINER(vbox), 10);
frame = create_registration_expire(a); frame = create_registration_expire(a);
gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0);
frame = create_network(a); frame = create_network(a);
gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0);
frame = create_published_address(a); frame = create_published_address(a);
gtk_box_pack_start(GTK_BOX(ret), frame, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0);
gtk_widget_show_all(ret); gtk_widget_show_all(vbox);
use_stun_cb(useStunCheckBox, NULL); use_stun_cb(useStunCheckBox, NULL);
set_published_addr_manually_cb(publishedAddrRadioButton, NULL); set_published_addr_manually_cb(publishedAddrRadioButton, NULL);
return ret; return vbox;
} }
void ringtone_enabled(GtkWidget *widget UNUSED, gpointer data, const gchar *accountID UNUSED) void ringtone_enabled(GtkWidget *widget UNUSED, gpointer data, const gchar *accountID UNUSED)
...@@ -1164,9 +1129,9 @@ static GtkWidget* create_audiocodecs_configuration(account_t *currentAccount) ...@@ -1164,9 +1129,9 @@ static GtkWidget* create_audiocodecs_configuration(account_t *currentAccount)
gtk_file_filter_add_pattern(filter, "*.wav"); gtk_file_filter_add_pattern(filter, "*.wav");
gtk_file_filter_add_pattern(filter, "*.ul"); gtk_file_filter_add_pattern(filter, "*.ul");
gtk_file_filter_add_pattern(filter, "*.au"); gtk_file_filter_add_pattern(filter, "*.au");
gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(fileChooser) , filter); gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(fileChooser) , filter);
gtk_table_attach(GTK_TABLE(table), fileChooser, 0, 1, 1, 2, GTK_EXPAND | gtk_table_attach(GTK_TABLE(table), fileChooser, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
gtk_widget_show_all(vbox); gtk_widget_show_all(vbox);
...@@ -1250,7 +1215,7 @@ void show_account_window(account_t * currentAccount) ...@@ -1250,7 +1215,7 @@ void show_account_window(account_t * currentAccount)
gchar *currentProtocol; gchar *currentProtocol;
if (protocolComboBox) if (protocolComboBox)
currentProtocol = gtk_combo_box_get_active_text(GTK_COMBO_BOX(protocolComboBox)); currentProtocol = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(protocolComboBox));
else else
currentProtocol = g_strdup("SIP"); currentProtocol = g_strdup("SIP");
...@@ -1289,7 +1254,7 @@ void show_account_window(account_t * currentAccount) ...@@ -1289,7 +1254,7 @@ void show_account_window(account_t * currentAccount)
gchar *proto; gchar *proto;
if (protocolComboBox) if (protocolComboBox)
proto = gtk_combo_box_get_active_text(GTK_COMBO_BOX(protocolComboBox)); proto = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(protocolComboBox));
else else
proto = g_strdup("SIP"); proto = g_strdup("SIP");
...@@ -1365,7 +1330,7 @@ void show_account_window(account_t * currentAccount) ...@@ -1365,7 +1330,7 @@ void show_account_window(account_t * currentAccount)
g_hash_table_replace(currentAccount->properties, g_hash_table_replace(currentAccount->properties,
g_strdup(PUBLISHED_PORT), g_strdup(PUBLISHED_PORT),
g_strdup((gchar *) gtk_entry_get_text(GTK_ENTRY(localPortSpinBox)))); g_strdup((gchar *) gtk_entry_get_text(GTK_ENTRY(localPortSpinBox))));
gchar *local_interface = gtk_combo_box_get_active_text(GTK_COMBO_BOX(localAddressCombo)); gchar *local_interface = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(localAddressCombo));
gchar *published_address = dbus_get_address_from_interface_name(local_interface); gchar *published_address = dbus_get_address_from_interface_name(local_interface);
g_free(local_interface); g_free(local_interface);
...@@ -1384,7 +1349,7 @@ void show_account_window(account_t * currentAccount) ...@@ -1384,7 +1349,7 @@ void show_account_window(account_t * currentAccount)
g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_DTMF_TYPE), g_strdup(SIPINFO)); g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_DTMF_TYPE), g_strdup(SIPINFO));
} }
gchar* keyExchange = gtk_combo_box_get_active_text(GTK_COMBO_BOX(keyExchangeCombo)); gchar* keyExchange = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(keyExchangeCombo));
if (g_strcasecmp(keyExchange, "ZRTP") == 0) { if (g_strcasecmp(keyExchange, "ZRTP") == 0) {
g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_SRTP_ENABLED), g_strdup("true")); g_hash_table_replace(currentAccount->properties, g_strdup(ACCOUNT_SRTP_ENABLED), g_strdup("true"));
...@@ -1413,7 +1378,7 @@ void show_account_window(account_t * currentAccount) ...@@ -1413,7 +1378,7 @@ void show_account_window(account_t * currentAccount)
g_hash_table_replace(currentAccount->properties, g_hash_table_replace(currentAccount->properties,
g_strdup(LOCAL_INTERFACE), g_strdup(LOCAL_INTERFACE),
gtk_combo_box_get_active_text(GTK_COMBO_BOX(localAddressCombo))); gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(localAddressCombo)));
g_hash_table_replace(currentAccount->properties, g_hash_table_replace(currentAccount->properties,
g_strdup(LOCAL_PORT), g_strdup(LOCAL_PORT),
......
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
#include "unused.h" #include "unused.h"
#include "logger.h" #include "logger.h"
#include <string.h> #include <string.h>
#include <libgnome/gnome-help.h>
static const int CONTEXT_ID_REGISTRATION = 0; static const int CONTEXT_ID_REGISTRATION = 0;
...@@ -367,12 +366,9 @@ help_contents_cb(GtkWidget * widget UNUSED, ...@@ -367,12 +366,9 @@ help_contents_cb(GtkWidget * widget UNUSED,
gpointer data UNUSED) gpointer data UNUSED)
{ {
GError *error = NULL; GError *error = NULL;
gtk_show_uri(NULL, "ghelp:sflphone?accounts", GDK_CURRENT_TIME, &error);
gnome_help_display("sflphone.xml", "accounts", &error);
if (error != NULL) { if (error != NULL) {
g_warning("%s", error->message); g_warning("%s", error->message);
g_error_free(error); g_error_free(error);
} }
} }
...@@ -603,10 +599,8 @@ show_account_list_config_dialog(void) ...@@ -603,10 +599,8 @@ show_account_list_config_dialog(void)
/* Status bar for the account list */ /* Status bar for the account list */
status_bar = gtk_statusbar_new(); status_bar = gtk_statusbar_new();
gtk_statusbar_set_has_resize_grip(GTK_STATUSBAR(status_bar), FALSE);
gtk_widget_show (status_bar); gtk_widget_show (status_bar);
gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(accountListDialog)), gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area(accountListDialog)), status_bar, TRUE, TRUE, 0);
status_bar, TRUE, TRUE, 0);
int number_accounts = account_list_get_registered_accounts(); int number_accounts = account_list_get_registered_accounts();
......
...@@ -761,7 +761,6 @@ static void record_path_changed(GtkFileChooser *chooser , GtkLabel *label UNUSED ...@@ -761,7 +761,6 @@ static void record_path_changed(GtkFileChooser *chooser , GtkLabel *label UNUSED
{ {
gchar* path; gchar* path;
path = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(chooser)); path = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(chooser));
DEBUG("path2 %s", path);
dbus_set_record_path(path); dbus_set_record_path(path);
} }
......
...@@ -36,6 +36,8 @@ ...@@ -36,6 +36,8 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <assert.h>
#include "eel-gconf-extensions.h" #include "eel-gconf-extensions.h"
#include "dbus.h" #include "dbus.h"
#include "logger.h" #include "logger.h"
...@@ -44,7 +46,6 @@ ...@@ -44,7 +46,6 @@
#include "preferencesdialog.h" #include "preferencesdialog.h"
#include "addressbook-config.h" #include "addressbook-config.h"
#include "shortcuts-config.h" #include "shortcuts-config.h"
#include "audioconf.h"
#include "hooks-config.h" #include "hooks-config.h"
#include "audioconf.h" #include "audioconf.h"
#include "uimanager.h" #include "uimanager.h"
...@@ -54,24 +55,16 @@ ...@@ -54,24 +55,16 @@
/** /**
* Local variables * Local variables
*/ */
gboolean accDialogOpen = FALSE; static gboolean dialogOpen = FALSE;
gboolean dialogOpen = FALSE;
gboolean ringtoneEnabled = TRUE;
GtkWidget * status; static GtkWidget * history_value;
GtkWidget * history_value;
GtkWidget *starthidden; static GtkWidget *starthidden;
GtkWidget *popupwindow; static GtkWidget *popupwindow;
GtkWidget *neverpopupwindow; static GtkWidget *neverpopupwindow;
GtkWidget *treeView; static GtkWidget *iconview;
GtkWidget *iconview; static GtkWidget * notebook;
GtkCellRenderer *renderer;
GtkTreeViewColumn *column;
GtkTreeSelection *selection;
GtkWidget * notebook;
enum { enum {
...@@ -80,12 +73,6 @@ enum { ...@@ -80,12 +73,6 @@ enum {
PAGE_NUMBER PAGE_NUMBER
}; };
typedef struct {
gchar* icon_descr;
gchar* icon_name;
gint page_number;
} browser_t;
// history preference parameters // history preference parameters
static int history_limit; static int history_limit;
static gboolean history_enabled = TRUE; static gboolean history_enabled = TRUE;
...@@ -105,10 +92,9 @@ set_popup_mode(GtkWidget *widget, gpointer *userdata UNUSED) ...@@ -105,10 +92,9 @@ set_popup_mode(GtkWidget *widget, gpointer *userdata UNUSED)
{ {
gboolean currentstate = eel_gconf_get_integer(POPUP_ON_CALL); gboolean currentstate = eel_gconf_get_integer(POPUP_ON_CALL);
if (currentstate || gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) { if (currentstate || gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)))
eel_gconf_set_integer(POPUP_ON_CALL, !currentstate); eel_gconf_set_integer(POPUP_ON_CALL, !currentstate);
} }
}
void void
set_notif_level() set_notif_level()
...@@ -137,7 +123,6 @@ static void ...@@ -137,7 +123,6 @@ static void
instant_messaging_enabled_cb(GtkWidget *widget) instant_messaging_enabled_cb(GtkWidget *widget)
{ {
instant_messaging_enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); instant_messaging_enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
eel_gconf_set_integer(INSTANT_MESSAGING_ENABLED, !eel_gconf_get_integer(INSTANT_MESSAGING_ENABLED)); eel_gconf_set_integer(INSTANT_MESSAGING_ENABLED, !eel_gconf_get_integer(INSTANT_MESSAGING_ENABLED));
} }
...@@ -167,7 +152,6 @@ void showstatusicon_cb(GtkWidget *widget, gpointer data UNUSED) ...@@ -167,7 +152,6 @@ void showstatusicon_cb(GtkWidget *widget, gpointer data UNUSED)
GtkWidget* GtkWidget*
create_general_settings() create_general_settings()
{ {
GtkWidget *ret, *notifAll, *frame, *checkBoxWidget, *label, *table, *showstatusicon; GtkWidget *ret, *notifAll, *frame, *checkBoxWidget, *label, *table, *showstatusicon;
gboolean statusicon; gboolean statusicon;
...@@ -285,10 +269,8 @@ create_general_settings() ...@@ -285,10 +269,8 @@ create_general_settings()
void void
save_configuration_parameters(void) save_configuration_parameters(void)
{ {
if (addrbook) { if (addrbook)
// Address book config
addressbook_config_save_parameters(); addressbook_config_save_parameters();
}
hooks_save_parameters(); hooks_save_parameters();
...@@ -308,14 +290,12 @@ void ...@@ -308,14 +290,12 @@ void
instant_messaging_load_configuration() instant_messaging_load_configuration()
{ {
instant_messaging_enabled = eel_gconf_get_integer(INSTANT_MESSAGING_ENABLED); instant_messaging_enabled = eel_gconf_get_integer(INSTANT_MESSAGING_ENABLED);
} }
void void
selection_changed_cb(GtkIconView *view, gpointer user_data UNUSED) selection_changed_cb(GtkIconView *view, gpointer user_data UNUSED)
{ {
GtkTreeModel *model; GtkTreeModel *model;
GtkTreeIter iter; GtkTreeIter iter;
GList *list; GList *list;
...@@ -338,6 +318,53 @@ selection_changed_cb(GtkIconView *view, gpointer user_data UNUSED) ...@@ -338,6 +318,53 @@ selection_changed_cb(GtkIconView *view, gpointer user_data UNUSED)
g_list_free(list); g_list_free(list);
} }
/*
* Get an 48x48 icon from the default theme or fallback to an application icon.
*/
static GdkPixbuf *get_icon(const gchar *name, GtkWidget *widget)
{
GtkIconTheme *theme = gtk_icon_theme_get_default();
GdkPixbuf *pixbuf = gtk_icon_theme_load_icon(theme, name, 48, 0, NULL);
if (!pixbuf)
pixbuf = gtk_widget_render_icon(widget, name, GTK_ICON_SIZE_DIALOG, NULL);
return pixbuf;
}
static GtkTreeModel* create_model(GtkWidget *widget)
{
static const struct {
gchar* icon_descr;
gchar* icon_name;
gint page_number;
} browser_entries_full[] = {
{"General", GTK_STOCK_PREFERENCES, 0},
{"Audio", GTK_STOCK_AUDIO_CARD, 1},
{"Hooks", "applications-development", 2},
{"Shortcuts", "preferences-desktop-keyboard", 3},
{"Address Book", GTK_STOCK_ADDRESSBOOK, 4},
};
GdkPixbuf *pixbuf;
GtkTreeIter iter;
gint i, nb_entries;
GtkListStore *store = gtk_list_store_new(3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_INT);
nb_entries = sizeof(browser_entries_full) / sizeof(browser_entries_full[0]);
for (i = 0; i < nb_entries; i++) {
gtk_list_store_append (store, &iter);
pixbuf = get_icon(browser_entries_full[i].icon_name, widget);
gtk_list_store_set(store, &iter,
PIXBUF_COL, pixbuf,
TEXT_COL, _(browser_entries_full[i].icon_descr),
PAGE_NUMBER, browser_entries_full[i].page_number,
-1);
if (pixbuf)
gdk_pixbuf_unref(pixbuf);
}
return GTK_TREE_MODEL(store);
}
/** /**
...@@ -346,14 +373,8 @@ selection_changed_cb(GtkIconView *view, gpointer user_data UNUSED) ...@@ -346,14 +373,8 @@ selection_changed_cb(GtkIconView *view, gpointer user_data UNUSED)
guint guint
show_preferences_dialog() show_preferences_dialog()
{ {
GtkDialog * dialog;
GtkWidget * hbox;
GtkWidget * tab;
guint result;
dialogOpen = TRUE; dialogOpen = TRUE;
GtkDialog *dialog = GTK_DIALOG(gtk_dialog_new_with_buttons(_("Preferences"),
dialog = GTK_DIALOG(gtk_dialog_new_with_buttons(_("Preferences"),
GTK_WINDOW(get_main_window()), GTK_WINDOW(get_main_window()),
GTK_DIALOG_DESTROY_WITH_PARENT, GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_STOCK_CLOSE, GTK_STOCK_CLOSE,
...@@ -364,10 +385,10 @@ show_preferences_dialog() ...@@ -364,10 +385,10 @@ show_preferences_dialog()
gtk_window_set_default_size(GTK_WINDOW(dialog), 600, 400); gtk_window_set_default_size(GTK_WINDOW(dialog), 600, 400);
gtk_container_set_border_width(GTK_CONTAINER(dialog), 0); gtk_container_set_border_width(GTK_CONTAINER(dialog), 0);
hbox = gtk_hbox_new(FALSE, 10); GtkWidget *hbox = gtk_hbox_new(FALSE, 10);
// Create tree view // Create tree view
iconview = gtk_icon_view_new_with_model(createModel()); iconview = gtk_icon_view_new_with_model(create_model(hbox));
g_object_set (iconview, g_object_set (iconview,
"selection-mode", GTK_SELECTION_BROWSE, "selection-mode", GTK_SELECTION_BROWSE,
"text-column", TEXT_COL, "text-column", TEXT_COL,
...@@ -375,6 +396,7 @@ show_preferences_dialog() ...@@ -375,6 +396,7 @@ show_preferences_dialog()
"columns", 1, "columns", 1,
"margin", 10, "margin", 10,
NULL); NULL);
// Connect the callback when clicking on an item // Connect the callback when clicking on an item
g_signal_connect(G_OBJECT(iconview), "selection-changed", G_CALLBACK(selection_changed_cb), NULL); g_signal_connect(G_OBJECT(iconview), "selection-changed", G_CALLBACK(selection_changed_cb), NULL);
gtk_box_pack_start(GTK_BOX(hbox), iconview, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(hbox), iconview, TRUE, TRUE, 0);
...@@ -390,12 +412,13 @@ show_preferences_dialog() ...@@ -390,12 +412,13 @@ show_preferences_dialog()
gtk_widget_show(notebook); gtk_widget_show(notebook);
// General settings tab // General settings tab
tab = create_general_settings(); GtkWidget *tab = create_general_settings();
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), tab, gtk_label_new(_("General"))); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), tab, gtk_label_new(_("General")));
gtk_notebook_page_num(GTK_NOTEBOOK(notebook), tab); gtk_notebook_page_num(GTK_NOTEBOOK(notebook), tab);
// Audio tab // Audio tab
tab = create_audio_configuration(); tab = create_audio_configuration();
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), tab, gtk_label_new(_("Audio"))); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), tab, gtk_label_new(_("Audio")));
gtk_notebook_page_num(GTK_NOTEBOOK(notebook), tab); gtk_notebook_page_num(GTK_NOTEBOOK(notebook), tab);
...@@ -421,7 +444,7 @@ show_preferences_dialog() ...@@ -421,7 +444,7 @@ show_preferences_dialog()
// Highlight the corresponding icon // Highlight the corresponding icon
gtk_icon_view_select_path(GTK_ICON_VIEW(iconview), gtk_tree_path_new_first()); gtk_icon_view_select_path(GTK_ICON_VIEW(iconview), gtk_tree_path_new_first());
result = gtk_dialog_run(dialog); guint result = gtk_dialog_run(dialog);
save_configuration_parameters(); save_configuration_parameters();
update_actions(); update_actions();
...@@ -431,50 +454,3 @@ show_preferences_dialog() ...@@ -431,50 +454,3 @@ show_preferences_dialog()
gtk_widget_destroy(GTK_WIDGET(dialog)); gtk_widget_destroy(GTK_WIDGET(dialog));
return result; return result;
} }
#define NB_MAX_ENTRIES 5
GtkTreeModel* createModel()
{
browser_t browser_entries_full[NB_MAX_ENTRIES] = {
{_("General"), "preferences-system", 0},
{_("Audio"), "multimedia-volume-control", 1},
{_("Hooks"), "gnome-globe", 2},
{_("Shortcuts"), "preferences-desktop-keyboard", 3},
{_("Address Book"), "address-book-new", 4},
};
GdkPixbuf *pixbuf;
GtkTreeIter iter;
GtkListStore *store;
GError *error = NULL;
gint i, nb_entries;
nb_entries = addrbook ? 5 : 4;
store = gtk_list_store_new(3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_INT);
GtkIconTheme* theme = gtk_icon_theme_get_default();
for (i = 0; i < nb_entries; i++) {
gtk_list_store_append(store, &iter);
pixbuf = gtk_icon_theme_load_icon(theme, browser_entries_full[i].icon_name, 48, 0, &error);
gtk_list_store_set(store, &iter,
PIXBUF_COL, pixbuf,
TEXT_COL, browser_entries_full[i].icon_descr,
PAGE_NUMBER, browser_entries_full[i].page_number,
-1);
if (pixbuf != NULL) {
gdk_pixbuf_unref(pixbuf);
} else {
DEBUG("Couldn't load icon: %s", error->message);
g_clear_error(&error);
}
}
return GTK_TREE_MODEL(store);
}
...@@ -28,12 +28,12 @@ ...@@ -28,12 +28,12 @@
* as that of the covered work. * as that of the covered work.
*/ */
#include <gdk/gdk.h>
#include "shortcuts-config.h" #include "shortcuts-config.h"
#include "shortcuts.h" #include "shortcuts.h"
#include "unused.h" #include "unused.h"
#include "logger.h" #include "logger.h"
#include <gdk/gdkx.h>
static void static void
accel_cleared(GtkCellRendererAccel *renderer UNUSED, gchar *path, accel_cleared(GtkCellRendererAccel *renderer UNUSED, gchar *path,
...@@ -61,10 +61,8 @@ accel_edited(GtkCellRendererAccel *renderer UNUSED, gchar *path, guint accel_key ...@@ -61,10 +61,8 @@ accel_edited(GtkCellRendererAccel *renderer UNUSED, gchar *path, guint accel_key
gtk_tree_model_get_iter_first(model, &iter); gtk_tree_model_get_iter_first(model, &iter);
Accelerator* list = shortcuts_get_list(); Accelerator* list = shortcuts_get_list();
const guint code = XKeysymToKeycode(GDK_DISPLAY(), accel_key); const guint code = XKeysymToKeycode(GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), accel_key);
guint i = 0; for (guint i = 0; list[i].action != NULL; ++i) {
while (list[i].action != NULL) {
if (list[i].key == code && list[i].mask == mask) { if (list[i].key == code && list[i].mask == mask) {
gtk_list_store_set(GTK_LIST_STORE(model), &iter, MASK, 0, VALUE, 0, gtk_list_store_set(GTK_LIST_STORE(model), &iter, MASK, 0, VALUE, 0,
-1); -1);
...@@ -72,7 +70,6 @@ accel_edited(GtkCellRendererAccel *renderer UNUSED, gchar *path, guint accel_key ...@@ -72,7 +70,6 @@ accel_edited(GtkCellRendererAccel *renderer UNUSED, gchar *path, guint accel_key
} }
gtk_tree_model_iter_next(model, &iter); gtk_tree_model_iter_next(model, &iter);
i++;
} }
// Update treeview // Update treeview
...@@ -127,15 +124,12 @@ create_shortcuts_settings() ...@@ -127,15 +124,12 @@ create_shortcuts_settings()
Accelerator* list = shortcuts_get_list(); Accelerator* list = shortcuts_get_list();
guint i = 0; for (guint i = 0; list[i].action != NULL; ++i) {
while (list[i].action != NULL) {
GtkTreeIter iter; GtkTreeIter iter;
gtk_list_store_append(store, &iter); gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter, ACTION, _(list[i].action), MASK, gtk_list_store_set(store, &iter, ACTION, _(list[i].action), MASK,
(gint) list[i].mask, VALUE, (gint) list[i].mask, VALUE,
XKeycodeToKeysym(GDK_DISPLAY(), list[i].key, 0), -1); XKeycodeToKeysym(GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), list[i].key, 0), -1);
i++;
} }
gtk_tree_view_set_model(GTK_TREE_VIEW(treeview), GTK_TREE_MODEL(store)); gtk_tree_view_set_model(GTK_TREE_VIEW(treeview), GTK_TREE_MODEL(store));
......
...@@ -191,8 +191,8 @@ void show_advanced_tls_options(GHashTable * properties) ...@@ -191,8 +191,8 @@ void show_advanced_tls_options(GHashTable * properties)
gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
gchar** supported_tls_method = dbus_get_supported_tls_method(); gchar** supported_tls_method = dbus_get_supported_tls_method();
GtkTreeIter supported_tls_method_iter = iter;
GtkTreeIter supported_tls_method_iter;
for (char **supported_tls_method_ptr = supported_tls_method; supported_tls_method_ptr && *supported_tls_method_ptr; supported_tls_method_ptr++) { for (char **supported_tls_method_ptr = supported_tls_method; supported_tls_method_ptr && *supported_tls_method_ptr; supported_tls_method_ptr++) {
gtk_list_store_append(tlsProtocolMethodListStore, &iter); gtk_list_store_append(tlsProtocolMethodListStore, &iter);
gtk_list_store_set(tlsProtocolMethodListStore, &iter, 0, *supported_tls_method_ptr, -1); gtk_list_store_set(tlsProtocolMethodListStore, &iter, 0, *supported_tls_method_ptr, -1);
...@@ -268,7 +268,6 @@ void show_advanced_tls_options(GHashTable * properties) ...@@ -268,7 +268,6 @@ void show_advanced_tls_options(GHashTable * properties)
gtk_widget_show_all(ret); gtk_widget_show_all(ret);
if (gtk_dialog_run(GTK_DIALOG(tlsDialog)) == GTK_RESPONSE_ACCEPT) { if (gtk_dialog_run(GTK_DIALOG(tlsDialog)) == GTK_RESPONSE_ACCEPT) {
g_hash_table_replace(properties, g_hash_table_replace(properties,
g_strdup(TLS_LISTENER_PORT), g_strdup(TLS_LISTENER_PORT),
g_strdup((gchar *) gtk_entry_get_text(GTK_ENTRY(tlsListenerPort)))); g_strdup((gchar *) gtk_entry_get_text(GTK_ENTRY(tlsListenerPort))));
...@@ -287,7 +286,7 @@ void show_advanced_tls_options(GHashTable * properties) ...@@ -287,7 +286,7 @@ void show_advanced_tls_options(GHashTable * properties)
g_hash_table_replace(properties, g_hash_table_replace(properties,
g_strdup(TLS_METHOD), g_strdup(TLS_METHOD),
g_strdup((gchar *) gtk_combo_box_get_active_text(GTK_COMBO_BOX(tlsProtocolMethodCombo)))); g_strdup((gchar *) gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(tlsProtocolMethodCombo))));
g_hash_table_replace(properties, g_hash_table_replace(properties,
g_strdup(TLS_CIPHERS), g_strdup(TLS_CIPHERS),
......
...@@ -20,9 +20,7 @@ libcontacts_la_SOURCES = \ ...@@ -20,9 +20,7 @@ libcontacts_la_SOURCES = \
searchbar.h searchbar.h
libcontacts_la_LDFLAGS = $(DBUSGLIB_LDFLAGS) $(LIBNOTIFY_LDFLAGS) \ libcontacts_la_LDFLAGS = $(DBUSGLIB_LDFLAGS) $(LIBNOTIFY_LDFLAGS) \
$(GTK_LDFLAGS) $(GLIB_LDFLAGS) $(WEBKIT_LDFLAGS) $(LIBGNOMEUI_LDFLAGS) \ $(GTK_LDFLAGS) $(GLIB_LDFLAGS) $(WEBKIT_LDFLAGS)
$(GNOMEDOCUTILS_LDFLAGS)
libcontacts_la_CFLAGS = $(DBUSGLIB_CFLAGS) $(LIBNOTIFY_CFLAGS) \ libcontacts_la_CFLAGS = $(DBUSGLIB_CFLAGS) $(LIBNOTIFY_CFLAGS) \
$(GTK_CFLAGS) $(GLIB_CFLAGS) $(WEBKIT_CFLAGS) $(LIBGNOMEUI_CFLAGS) \ $(GTK_CFLAGS) $(GLIB_CFLAGS) $(WEBKIT_CFLAGS) $(GCONF_CFLAGS)
$(GNOMEDOCUTILS_CFLAGS)
...@@ -76,7 +76,7 @@ static void cbox_changed_cb(GtkWidget *widget, gpointer user_data UNUSED) ...@@ -76,7 +76,7 @@ static void cbox_changed_cb(GtkWidget *widget, gpointer user_data UNUSED)
if (!addrbook) if (!addrbook)
return; return;
addrbook->set_current_book(gtk_combo_box_get_active_text(GTK_COMBO_BOX(widget))); addrbook->set_current_book(gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(widget)));
AddressBook_Config *addressbook_config = addressbook_config_load_parameters(); AddressBook_Config *addressbook_config = addressbook_config_load_parameters();
addrbook->search(addrbook->search_cb, GTK_ENTRY(addressbookentry), addressbook_config); addrbook->search(addrbook->search_cb, GTK_ENTRY(addressbookentry), addressbook_config);
} }
...@@ -89,7 +89,6 @@ void set_focus_on_addressbook_searchbar() ...@@ -89,7 +89,6 @@ void set_focus_on_addressbook_searchbar()
void update_searchbar_addressbook_list() void update_searchbar_addressbook_list()
{ {
GtkTreeIter iter, activeIter; GtkTreeIter iter, activeIter;
gchar *activeText;
GSList *book_list_iterator; GSList *book_list_iterator;
book_data_t *book_data; book_data_t *book_data;
GSList *books_data = NULL; GSList *books_data = NULL;
...@@ -104,16 +103,14 @@ void update_searchbar_addressbook_list() ...@@ -104,16 +103,14 @@ void update_searchbar_addressbook_list()
DEBUG("Searchbar: Update addressbook list"); DEBUG("Searchbar: Update addressbook list");
// we must disconnect signal from teh cbox while updating its content // we must disconnect signal from the cbox while updating its content
gtk_signal_disconnect(cbox, cboxSignalId); g_signal_handler_disconnect(cbox, cboxSignalId);
// store the current active text // store the current active text
activeText = g_strdup(gtk_combo_box_get_active_text(GTK_COMBO_BOX(cbox))); gchar *activeText = g_strdup(gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(cbox)));
if (activeText == NULL) {
if (activeText == NULL)
activeText = g_strdup(""); activeText = g_strdup("");
}
gtk_list_store_clear(liststore); gtk_list_store_clear(liststore);
...@@ -143,19 +140,17 @@ void update_searchbar_addressbook_list() ...@@ -143,19 +140,17 @@ void update_searchbar_addressbook_list()
addrbook->set_current_book(activeText); addrbook->set_current_book(activeText);
} else { } else {
gtk_combo_box_set_active(GTK_COMBO_BOX(cbox), 0); gtk_combo_box_set_active(GTK_COMBO_BOX(cbox), 0);
gtk_combo_box_get_active_text(GTK_COMBO_BOX(cbox)); addrbook->set_current_book(gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(cbox)));
addrbook->set_current_book(gtk_combo_box_get_active_text(GTK_COMBO_BOX(cbox)));
} }
} }
g_free(activeText); g_free(activeText);
cboxSignalId = gtk_signal_connect(GTK_OBJECT(cbox), "changed", G_CALLBACK(cbox_changed_cb), NULL); cboxSignalId = g_signal_connect(G_OBJECT(cbox), "changed", G_CALLBACK(cbox_changed_cb), NULL);
} }
static void select_search_type(GtkWidget *item, GtkEntry *entry UNUSED) static void select_search_type(GtkWidget *item, GtkEntry *entry UNUSED)
{ {
if (addrbook) { if (addrbook) {
DEBUG("Searchbar: %s", gtk_menu_item_get_label(GTK_MENU_ITEM(item))); DEBUG("Searchbar: %s", gtk_menu_item_get_label(GTK_MENU_ITEM(item)));
...@@ -175,6 +170,8 @@ static void select_search_type(GtkWidget *item, GtkEntry *entry UNUSED) ...@@ -175,6 +170,8 @@ static void select_search_type(GtkWidget *item, GtkEntry *entry UNUSED)
addrbook->search(addrbook->search_cb, GTK_ENTRY(addressbookentry), addressbook_config); addrbook->search(addrbook->search_cb, GTK_ENTRY(addressbookentry), addressbook_config);
} }
AddressBook_Config *addressbook_config = addressbook_config_load_parameters();
addrbook->search (addrbook->search_cb, GTK_ENTRY (addressbookentry), addressbook_config);
} }
static void search_all(GtkWidget *item UNUSED, GtkEntry *entry) static void search_all(GtkWidget *item UNUSED, GtkEntry *entry)
...@@ -343,10 +340,9 @@ GtkWidget* history_searchbar_new(void) ...@@ -343,10 +340,9 @@ GtkWidget* history_searchbar_new(void)
GtkWidget* contacts_searchbar_new() GtkWidget* contacts_searchbar_new()
{ {
GtkWidget *ret; GtkWidget *ret;
GtkWidget *align; GtkWidget *align;
int count, cbox_height, cbox_width; int count;
GtkTreeIter iter, activeIter; GtkTreeIter iter, activeIter;
GtkCellRenderer *cell; GtkCellRenderer *cell;
gchar **book_list; gchar **book_list;
...@@ -408,11 +404,11 @@ GtkWidget* contacts_searchbar_new() ...@@ -408,11 +404,11 @@ GtkWidget* contacts_searchbar_new()
gtk_alignment_set_padding(GTK_ALIGNMENT(align), 0, 2, 6, 6); gtk_alignment_set_padding(GTK_ALIGNMENT(align), 0, 2, 6, 6);
gtk_container_add(GTK_CONTAINER(align), cbox); gtk_container_add(GTK_CONTAINER(align), cbox);
gint cbox_width, cbox_height;
gtk_widget_get_size_request(GTK_WIDGET(cbox), &cbox_width, &cbox_height); gtk_widget_get_size_request(GTK_WIDGET(cbox), &cbox_width, &cbox_height);
gtk_widget_set_size_request(GTK_WIDGET(cbox), cbox_width, 26); gtk_widget_set_size_request(GTK_WIDGET(cbox), cbox_width, 26);
cboxSignalId = gtk_signal_connect(GTK_OBJECT(cbox), "changed", G_CALLBACK(cbox_changed_cb), NULL); cboxSignalId = g_signal_connect(G_OBJECT(cbox), "changed", G_CALLBACK(cbox_changed_cb), NULL);
// cbox_changed_cb (GTK_WIDGET (cbox), NULL);
cell = gtk_cell_renderer_text_new(); cell = gtk_cell_renderer_text_new();
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(cbox), cell, TRUE); gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(cbox), cell, TRUE);
...@@ -430,7 +426,6 @@ GtkWidget* contacts_searchbar_new() ...@@ -430,7 +426,6 @@ GtkWidget* contacts_searchbar_new()
gtk_entry_set_icon_tooltip_text(GTK_ENTRY(addressbookentry), GTK_ENTRY_ICON_PRIMARY, gtk_entry_set_icon_tooltip_text(GTK_ENTRY(addressbookentry), GTK_ENTRY_ICON_PRIMARY,
tooltip_text); tooltip_text);
// Set the clean insensitive // Set the clean insensitive
text_changed_cb(GTK_ENTRY(addressbookentry), NULL); text_changed_cb(GTK_ENTRY(addressbookentry), NULL);
...@@ -454,22 +449,9 @@ GtkWidget* contacts_searchbar_new() ...@@ -454,22 +449,9 @@ GtkWidget* contacts_searchbar_new()
g_free(tooltip_text); g_free(tooltip_text);
g_strfreev(book_list); g_strfreev(book_list);
// current_addressbook = gtk_combo_box_get_active_text (GTK_COMBO_BOX (cbox));
// set_current_addressbook (current_addressbook);
return ret; return ret;
} }
void activateWaitingLayer()
{
gtk_widget_show(waitingLayer);
}
void deactivateWaitingLayer()
{
gtk_widget_hide(waitingLayer);
}
SearchType get_current_history_search_type (void) SearchType get_current_history_search_type (void)
{ {
return HistorySearchType; return HistorySearchType;
......
...@@ -26,15 +26,13 @@ libdbus_la_SOURCES= \ ...@@ -26,15 +26,13 @@ libdbus_la_SOURCES= \
$(BUILT_SOURCES) $(BUILT_SOURCES)
libdbus_la_LDFLAGS= $(DBUSGLIB_LDFLAGS) $(LIBNOTIFY_LDFLAGS) \ libdbus_la_LDFLAGS= $(DBUSGLIB_LDFLAGS) $(LIBNOTIFY_LDFLAGS) \
$(GTK_LDFLAGS) $(GLIB_LDFLAGS) $(WEBKIT_LDFLAGS) $(LIBGNOMEUI_LDFLAGS) \ $(GTK_LDFLAGS) $(GLIB_LDFLAGS) $(WEBKIT_LDFLAGS) \
$(GNOMEDOCUTILS_LDFLAGS) $(GCONF_LDFLAGS)
libdbus_la_CFLAGS= $(DBUSGLIB_CFLAGS) $(LIBNOTIFY_CFLAGS) \ libdbus_la_CFLAGS= $(DBUSGLIB_CFLAGS) $(LIBNOTIFY_CFLAGS) \
$(GTK_CFLAGS) $(GLIB_CFLAGS) $(WEBKIT_CFLAGS) $(LIBGNOMEUI_CFLAGS) \ $(GTK_CFLAGS) $(GLIB_CFLAGS) $(WEBKIT_CFLAGS) \
$(GNOMEDOCUTILS_CFLAGS) $(GCONF_CFLAGS)
EXTRA_DIST= \ EXTRA_DIST= marshaller.list
marshaller.list
CLEANFILES= \ CLEANFILES= $(BUILT_SOURCES)
$(BUILT_SOURCES)
...@@ -23,13 +23,13 @@ ...@@ -23,13 +23,13 @@
*/ */
#include <stdlib.h> #include <stdlib.h>
#include <config.h> #include "config.h"
#include "eel-gconf-extensions.h" #include "eel-gconf-extensions.h"
#include <gconf/gconf-client.h> #include <gconf/gconf-client.h>
#include <gconf/gconf.h> #include <gconf/gconf.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <libgnome/gnome-i18n.h> #include <glib/gi18n.h>
static GConfClient *global_gconf_client = NULL; static GConfClient *global_gconf_client = NULL;
......
...@@ -7,9 +7,7 @@ libicons_la_SOURCES = icon_factory.c \ ...@@ -7,9 +7,7 @@ libicons_la_SOURCES = icon_factory.c \
pixmap_data.h pixmap_data.h
libicons_la_LDFLAGS = $(DBUSGLIB_LDFLAGS) $(LIBNOTIFY_LDFLAGS) \ libicons_la_LDFLAGS = $(DBUSGLIB_LDFLAGS) $(LIBNOTIFY_LDFLAGS) \
$(GTK_LDFLAGS) $(GLIB_LDFLAGS) $(WEBKIT_LDFLAGS) $(LIBGNOMEUI_LDFLAGS) \ $(GTK_LDFLAGS) $(GLIB_LDFLAGS) $(WEBKIT_LDFLAGS)
$(GNOMEDOCUTILS_LDFLAGS)
libicons_la_CFLAGS = $(DBUSGLIB_CFLAGS) $(LIBNOTIFY_CFLAGS) \ libicons_la_CFLAGS = $(DBUSGLIB_CFLAGS) $(LIBNOTIFY_CFLAGS) \
$(GTK_CFLAGS) $(GLIB_CFLAGS) $(WEBKIT_CFLAGS) $(LIBGNOMEUI_CFLAGS) \ $(GTK_CFLAGS) $(GLIB_CFLAGS) $(WEBKIT_CFLAGS)
$(GNOMEDOCUTILS_CFLAGS)
...@@ -39,15 +39,11 @@ static GtkIconFactory *icon_factory = NULL; ...@@ -39,15 +39,11 @@ static GtkIconFactory *icon_factory = NULL;
void add_icon(GtkIconFactory *factory, const gchar *stock_id, const guint8 *icon_data, GtkIconSize size) void add_icon(GtkIconFactory *factory, const gchar *stock_id, const guint8 *icon_data, GtkIconSize size)
{ {
GtkIconSet *icons; GtkIconSet *icons = gtk_icon_factory_lookup(factory, stock_id);
GtkIconSource *source;
GdkPixbuf *pixbuf;
icons = gtk_icon_factory_lookup(factory, stock_id);
if (!icons) { if (!icons) {
pixbuf = gdk_pixbuf_new_from_inline(-1, icon_data, FALSE, NULL); GdkPixbuf *pixbuf = gdk_pixbuf_new_from_inline(-1, icon_data, FALSE, NULL);
source = gtk_icon_source_new(); GtkIconSource *source = gtk_icon_source_new();
gtk_icon_source_set_pixbuf(source, pixbuf); gtk_icon_source_set_pixbuf(source, pixbuf);
gtk_icon_source_set_size(source, size); gtk_icon_source_set_size(source, size);
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#define GTK_STOCK_SFLPHONE "gnome-stock-sflphone" #define GTK_STOCK_SFLPHONE "gnome-stock-sflphone"
#define GTK_STOCK_FAIL "gnome-stock-fail" #define GTK_STOCK_FAIL "gnome-stock-fail"
#define GTK_STOCK_USER "gnome-stock-user" #define GTK_STOCK_USER "gnome-stock-user"
#define GTK_STOCK_AUDIO_CARD "audio-card"
void init_icon_factory (void); void init_icon_factory (void);
......
...@@ -81,7 +81,7 @@ on_delete(GtkWidget * widget UNUSED, gpointer data UNUSED) ...@@ -81,7 +81,7 @@ on_delete(GtkWidget * widget UNUSED, gpointer data UNUSED)
} }
static void static void
on_switch_page(GtkNotebook *notebook, GtkNotebookPage *page UNUSED, guint page_num, gpointer userdata UNUSED) on_switch_page(GtkNotebook *notebook, gpointer page UNUSED, guint page_num, gpointer userdata UNUSED)
{ {
GtkWidget *tab = gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook), page_num); GtkWidget *tab = gtk_notebook_get_nth_page(GTK_NOTEBOOK(notebook), page_num);
......
...@@ -28,17 +28,14 @@ ...@@ -28,17 +28,14 @@
* as that of the covered work. * as that of the covered work.
*/ */
#include <actions.h> #include "actions.h"
#include <calllist.h> #include "calllist.h"
#include <config.h> #include "config.h"
#include <logger.h> #include "logger.h"
#include <dbus/dbus.h> #include "dbus/dbus.h"
#include <mainwindow.h> #include "mainwindow.h"
#include <statusicon.h> #include "statusicon.h"
#include <libgnome/libgnome.h> #include "eel-gconf-extensions.h"
#include <libgnomeui/libgnomeui.h>
#include <eel-gconf-extensions.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -85,11 +82,6 @@ main(int argc, char *argv[]) ...@@ -85,11 +82,6 @@ main(int argc, char *argv[])
bindtextdomain("sflphone-client-gnome", LOCALEDIR); bindtextdomain("sflphone-client-gnome", LOCALEDIR);
textdomain("sflphone-client-gnome"); textdomain("sflphone-client-gnome");
// Initialises the GNOME libraries
gnome_program_init("sflphone", VERSION, LIBGNOMEUI_MODULE, argc, argv,
GNOME_PROGRAM_STANDARD_PROPERTIES,
NULL) ;
if (!sflphone_init(&error)) { if (!sflphone_init(&error)) {
ERROR(error->message); ERROR(error->message);
GtkWidget *dialog = gtk_message_dialog_new( GtkWidget *dialog = gtk_message_dialog_new(
......
...@@ -43,23 +43,17 @@ ...@@ -43,23 +43,17 @@
#include "contacts/searchbar.h" #include "contacts/searchbar.h"
#include "statusicon.h" /* for set_minimized */ #include "statusicon.h" /* for set_minimized */
#include "assistant.h" #include "assistant.h"
#include "widget/gtkscrollbook.h"
#include "widget/minidialog.h" #include "widget/minidialog.h"
#include "uimanager.h" #include "uimanager.h"
#include "unused.h" #include "unused.h"
#include "config/audioconf.h" #include "config/audioconf.h"
#include "eel-gconf-extensions.h"
#include <sys/stat.h> #include <sys/stat.h>
#include <gtk/gtk.h> #include <gtk/gtk.h>
/* Backward compatibility for gtk < 2.22.0 */
#if GTK_CHECK_VERSION(2,22,0)
#include <gdk/gdkkeysyms-compat.h>
#else
#include <gdk/gdkkeysyms.h> #include <gdk/gdkkeysyms.h>
#endif
#include <eel-gconf-extensions.h>
/** Local variables */ /** Local variables */
static GtkUIManager *ui_manager; static GtkUIManager *ui_manager;
...@@ -71,7 +65,6 @@ static GtkWidget *dialpad; ...@@ -71,7 +65,6 @@ static GtkWidget *dialpad;
static GtkWidget *speaker_control; static GtkWidget *speaker_control;
static GtkWidget *mic_control; static GtkWidget *mic_control;
static GtkWidget *statusBar; static GtkWidget *statusBar;
static PidginScrollBook *embedded_error_notebook;
static gchar *status_current_message; static gchar *status_current_message;
static GMutex *gmutex; static GMutex *gmutex;
...@@ -152,7 +145,7 @@ on_key_released(GtkWidget *widget UNUSED, GdkEventKey *event, gpointer user_data ...@@ -152,7 +145,7 @@ on_key_released(GtkWidget *widget UNUSED, GdkEventKey *event, gpointer user_data
if (focus_is_on_searchbar) if (focus_is_on_searchbar)
return TRUE; return TRUE;
if (event->keyval == GDK_Return) { if (event->keyval == GDK_KEY_Return) {
if (active_calltree_tab == current_calls_tab) { if (active_calltree_tab == current_calls_tab) {
sflphone_keypad(event->keyval, event->string); sflphone_keypad(event->keyval, event->string);
return TRUE; return TRUE;
...@@ -165,13 +158,13 @@ on_key_released(GtkWidget *widget UNUSED, GdkEventKey *event, gpointer user_data ...@@ -165,13 +158,13 @@ on_key_released(GtkWidget *widget UNUSED, GdkEventKey *event, gpointer user_data
event->keyval == '<' || event->keyval == '<' ||
event->keyval == '>' || event->keyval == '>' ||
event->keyval == '\"'|| event->keyval == '\"'||
event->keyval == GDK_Tab || event->keyval == GDK_KEY_Tab ||
event->keyval == GDK_Return || event->keyval == GDK_KEY_Return ||
event->keyval == GDK_Left || event->keyval == GDK_KEY_Left ||
event->keyval == GDK_Up || event->keyval == GDK_KEY_Up ||
event->keyval == GDK_Right || event->keyval == GDK_KEY_Right ||
event->keyval == GDK_Down || event->keyval == GDK_KEY_Down ||
(event->keyval >= GDK_F1 && event->keyval <= GDK_F12) || (event->keyval >= GDK_KEY_F1 && event->keyval <= GDK_KEY_F12) ||
event->keyval == ' ') event->keyval == ' ')
return FALSE; return FALSE;
else else
...@@ -252,10 +245,6 @@ create_main_window() ...@@ -252,10 +245,6 @@ create_main_window()
gtk_box_pack_start(GTK_BOX(vbox), subvbox, FALSE /*expand*/, gtk_box_pack_start(GTK_BOX(vbox), subvbox, FALSE /*expand*/,
FALSE /*fill*/, 0 /*padding*/); FALSE /*fill*/, 0 /*padding*/);
embedded_error_notebook = PIDGIN_SCROLL_BOOK(pidgin_scroll_book_new());
gtk_box_pack_start(GTK_BOX(subvbox), GTK_WIDGET(embedded_error_notebook),
FALSE, FALSE, 0);
if (SHOW_VOLUME) { if (SHOW_VOLUME) {
speaker_control = create_slider("speaker"); speaker_control = create_slider("speaker");
gtk_box_pack_end(GTK_BOX(subvbox), speaker_control, FALSE /*expand*/, gtk_box_pack_end(GTK_BOX(subvbox), speaker_control, FALSE /*expand*/,
...@@ -392,17 +381,22 @@ statusbar_update_clock(const gchar * const msg) ...@@ -392,17 +381,22 @@ statusbar_update_clock(const gchar * const msg)
g_free(message); g_free(message);
} }
static void static void
add_error_dialog(GtkWidget *dialog, callable_obj_t * call) destroy_error_dialog_cb(GtkWidget *dialog UNUSED, GtkWidget *win)
{ {
gtk_container_add(GTK_CONTAINER(embedded_error_notebook), dialog); gtk_widget_destroy(win);
call_add_error(call, dialog);
} }
static void static void
destroy_error_dialog_cb(GtkObject *dialog, callable_obj_t * call) add_error_dialog(GtkWidget *dialog)
{ {
call_remove_error(call, dialog); GtkWidget *win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_container_add(GTK_CONTAINER(win), dialog);
g_signal_connect_after(dialog, "destroy", (GCallback)destroy_error_dialog_cb, win);
gtk_widget_show(win);
} }
void void
...@@ -420,7 +414,7 @@ main_window_zrtp_not_supported(callable_obj_t * c) ...@@ -420,7 +414,7 @@ main_window_zrtp_not_supported(callable_obj_t * c)
DEBUG("Account is null callID %s", c->_callID); DEBUG("Account is null callID %s", c->_callID);
GHashTable * properties = sflphone_get_ip2ip_properties(); GHashTable * properties = sflphone_get_ip2ip_properties();
if (properties != NULL) if (properties)
warning_enabled = g_hash_table_lookup (properties, warning_enabled = g_hash_table_lookup (properties,
ACCOUNT_ZRTP_NOT_SUPP_WARNING); ACCOUNT_ZRTP_NOT_SUPP_WARNING);
} }
...@@ -437,9 +431,7 @@ main_window_zrtp_not_supported(callable_obj_t * c) ...@@ -437,9 +431,7 @@ main_window_zrtp_not_supported(callable_obj_t * c)
pidgin_mini_dialog_add_button(mini_dialog, _("Stop Call"), pidgin_mini_dialog_add_button(mini_dialog, _("Stop Call"),
sflphone_hang_up, NULL); sflphone_hang_up, NULL);
g_signal_connect_after(mini_dialog, "destroy", (GCallback)destroy_error_dialog_cb, c); add_error_dialog(GTK_WIDGET(mini_dialog));
add_error_dialog(GTK_WIDGET(mini_dialog), c);
} }
} }
...@@ -465,8 +457,7 @@ main_window_zrtp_negotiation_failed(const gchar* const callID, const gchar* cons ...@@ -465,8 +457,7 @@ main_window_zrtp_negotiation_failed(const gchar* const callID, const gchar* cons
pidgin_mini_dialog_add_button(mini_dialog, _("Stop Call"), sflphone_hang_up, pidgin_mini_dialog_add_button(mini_dialog, _("Stop Call"), sflphone_hang_up,
NULL); NULL);
g_signal_connect_after(mini_dialog, "destroy",(GCallback) destroy_error_dialog_cb, c); add_error_dialog(GTK_WIDGET(mini_dialog));
add_error_dialog(GTK_WIDGET(mini_dialog), c);
} }
void void
...@@ -483,5 +474,5 @@ main_window_confirm_go_clear(callable_obj_t * c) ...@@ -483,5 +474,5 @@ main_window_confirm_go_clear(callable_obj_t * c)
pidgin_mini_dialog_add_button(mini_dialog, _("Stop Call"), sflphone_hang_up, pidgin_mini_dialog_add_button(mini_dialog, _("Stop Call"), sflphone_hang_up,
NULL); NULL);
add_error_dialog(GTK_WIDGET(mini_dialog), c); add_error_dialog(GTK_WIDGET(mini_dialog));
} }
...@@ -27,9 +27,9 @@ ...@@ -27,9 +27,9 @@
* shall include the source code for the parts of OpenSSL used as well * shall include the source code for the parts of OpenSSL used as well
* as that of the covered work. * as that of the covered work.
*/ */
#include "eel-gconf-extensions.h"
#include "config.h" #include "config.h"
#include "eel-gconf-extensions.h"
#include "sflnotify.h" #include "sflnotify.h"
#include "logger.h" #include "logger.h"
...@@ -49,16 +49,8 @@ create_new_gnome_notification(gchar *title, gchar *body, NotifyUrgency urgency, ...@@ -49,16 +49,8 @@ create_new_gnome_notification(gchar *title, gchar *body, NotifyUrgency urgency,
notify_init("SFLphone"); notify_init("SFLphone");
// Set struct fields // Set struct fields
#ifdef LIBNOTIFY_VERSION_0_7_2
notif.notification = notify_notification_new(title, body, NULL); notif.notification = notify_notification_new(title, body, NULL);
#else
notif.notification = notify_notification_new(title, body, NULL, NULL);
#endif
notif.icon = gdk_pixbuf_new_from_file(LOGO_SMALL, NULL); notif.icon = gdk_pixbuf_new_from_file(LOGO_SMALL, NULL);
#ifdef LIBNOTIFY_VERSION_0_7_2
#else
notify_notification_attach_to_status_icon(notif.notification , get_status_icon());
#endif
notify_notification_set_urgency(notif.notification, urgency); notify_notification_set_urgency(notif.notification, urgency);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment