m4_define([empathy_major_version], [3])
m4_define([empathy_minor_version], [1])
-m4_define([empathy_micro_version], [3])
+m4_define([empathy_micro_version], [5])
m4_define([empathy_nano_version], [0])
dnl Display the nano_version only if it's not '0'
m4_define(empathy_version, empathy_full_version[]empathy_maybe_datestamp)
-AC_INIT(Empathy, empathy_version, http://bugzilla.gnome.org/browse.cgi?product=empathy)
+AC_INIT([Empathy],
+ [empathy_version],
+ [http://bugzilla.gnome.org/browse.cgi?product=empathy],
+ [empathy],
+ [https://live.gnome.org/Empathy])
-
-AC_PREREQ(2.59)
+AC_PREREQ([2.64])
AC_COPYRIGHT([
Copyright (C) 2003-2007 Imendio AB
Copyright (C) 2007-2010 Collabora Ltd.
# Minimal version required
# Hardp deps
-FOLKS_REQUIRED=0.5.1
+FOLKS_REQUIRED=0.6.0
GLIB_REQUIRED=2.28.0
GNUTLS_REQUIRED=2.8.5
GTK_REQUIRED=3.0.2
TELEPATHY_FARSIGHT_REQUIRED=0.0.14
TELEPATHY_GLIB_REQUIRED=0.15.3
TELEPATHY_LOGGER=0.2.10
+ WEBKIT_REQUIRED=1.3.13
# Optional deps
CLUTTER_GTK_REQUIRED=0.90.3
LIBCHAMPLAIN_REQUIRED=0.9
NAUTILUS_SENDTO_REQUIRED=2.90.0
NETWORK_MANAGER_REQUIRED=0.7.0
- WEBKIT_REQUIRED=1.3.13
GNOME_CONTROL_CENTER_REQUIRED=2.31.4
# Use --enable-maintainer-mode to disable deprecated symbols,
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_AUX_DIR(.)
-GNOME_COMMON_INIT
-
-AM_INIT_AUTOMAKE(1.9 dist-bzip2 no-define -Wno-portability)
+AM_INIT_AUTOMAKE([1.11 no-define -Wno-portability tar-ustar no-dist-gzip dist-xz])
-# Support silent build rules, requires at least automake-1.11. Disable
+# Support silent build rules. Disable
# by either passing --disable-silent-rules to configure or passing V=1
# to make
-m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+AM_SILENT_RULES([yes])
-AC_ISC_POSIX
+# Check for programs
AC_PROG_CC
AC_HEADER_STDC
-AM_PROG_LIBTOOL
AM_PROG_MKDIR_P
AM_PATH_GLIB_2_0
AC_PATH_XTRA
-IT_PROG_INTLTOOL([0.35.0])
+
+# Initialize libtool
+LT_PREREQ([2.2])
+LT_INIT
+
GNOME_DOC_INIT([0.17.3])
AC_PATH_PROG(DBUS_BINDING_TOOL, dbus-binding-tool)
GLIB_GSETTINGS
AS_COMPILER_FLAG(-Werror, werror=yes, werror=no)
AC_ARG_ENABLE(Werror,
- AC_HELP_STRING([--disable-Werror],[compile without -Werror (normally enabled in development builds)]),
+ AS_HELP_STRING([--disable-Werror],
+ [compile without -Werror (normally enabled in development builds)]),
werror=$enableval, :)
AS_COMPILER_FLAG(-Wextra, wextra=yes, wextra=no)
libcanberra-gtk3 >= $LIBCANBERRA_GTK_REQUIRED
libnotify >= $LIBNOTIFY_REQUIRED
gcr-3 >= $GCR_REQUIRED
+ libpulse
+ libpulse-mainloop-glib
+ webkitgtk-3.0 >= $WEBKIT_REQUIRED
])
PKG_CHECK_MODULES(YELL, [telepathy-yell])
# -----------------------------------------------------------
# Call interface
# -----------------------------------------------------------
-AC_ARG_WITH(call,
- AC_HELP_STRING([--enable-call=@<:@no/yes/auto@:>@],
+AC_ARG_ENABLE(call,
+ AS_HELP_STRING([--enable-call=@<:@no/yes/auto@:>@],
[build with Call interface support]),,
- [with_call=auto])
-if test "x$with_call" != "xno" ; then
+ [enable_call=auto])
+if test "x$enable_call" != "xno" ; then
PKG_CHECK_MODULES(EMPATHY_CALL,
[
farsight2-0.10
have_call=no
fi
-if test "x$with_call" = "xyes" -a "x$have_call" != "xyes"; then
+if test "x$enable_call" = "xyes" -a "x$have_call" != "xyes"; then
AC_MSG_ERROR([Could not find Call handler dependencies.])
fi
AM_CONDITIONAL(HAVE_CALL, test "x$have_call" = "xyes")
# -----------------------------------------------------------
# Call support in tp-logger
# -----------------------------------------------------------
-AC_ARG_WITH(call-logs,
- AC_HELP_STRING([--enable-call-logs=@<:@no/yes/auto@:>@],
+AC_ARG_ENABLE(call-logs,
+ AS_HELP_STRING([--enable-call-logs=@<:@no/yes/auto@:>@],
[build with call logs support]),,
- [with_call_logs=auto])
-if test "x$with_call_logs" != "xno" ; then
+ [enable_call_logs=auto])
+if test "x$enable_call_logs" != "xno" ; then
SAVE_CFLAGS=$CFLAGS
SAVE_CPPFLAGS=$CPPFLAGS
CFLAGS="$CFLAGS $EMPATHY_CFLAGS"
have_call_logs=no
fi
-if test "x$with_call_logs" = "xyes" -a "x$have_call_logs" != "xyes"; then
+if test "x$enable_call_logs" = "xyes" -a "x$have_call_logs" != "xyes"; then
AC_MSG_ERROR([Call logs support requested but telepathy-logger wasn't
built with --enable-call])
fi
# evolution-data-server (about-me)
# -----------------------------------------------------------
AC_ARG_WITH(eds,
- AC_HELP_STRING([--with-eds], [build with evolution-data-server support]),,
+ AS_HELP_STRING([--with-eds],
+ [build with evolution-data-server support]),,
[with_eds=yes])
if test x"$with_eds" = x"yes" ; then
PKG_CHECK_MODULES(EDS, [libebook-1.2])
# -----------------------------------------------------------
AC_ARG_ENABLE(debug,
- AC_HELP_STRING([--disable-debug],[compile without debug code]),
+ AS_HELP_STRING([--disable-debug],
+ [compile without debug code]),
enable_debug=$enableval, enable_debug=yes )
if test x$enable_debug = xyes; then
# -----------------------------------------------------------
# Language Support
# -----------------------------------------------------------
+IT_PROG_INTLTOOL([0.40.0])
+
+AM_GNU_GETTEXT_VERSION([0.17])
+AM_GNU_GETTEXT([external])
GETTEXT_PACKAGE=empathy
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[Gettext package name])
-AM_GLIB_GNU_GETTEXT
-
# -----------------------------------------------------------
# Connectivity integration
# -----------------------------------------------------------
AM_CONDITIONAL(HAVE_NM, test "x$have_nm" = "xyes")
AM_CONDITIONAL(HAVE_CONNMAN, test "x$have_connman" = "xyes")
- # -----------------------------------------------------------
- # Webkit
- # -----------------------------------------------------------
- AC_ARG_ENABLE(webkit,
- AS_HELP_STRING([--enable-webkit=@<:@no/yes/auto@:>@],
- [build with webkit support]), ,
- enable_webkit=auto)
-
- if test "x$enable_webkit" != "xno"; then
- PKG_CHECK_MODULES(WEBKIT, [webkitgtk-3.0 >= $WEBKIT_REQUIRED],
- have_webkit="yes", have_webkit="no")
-
- if test "x$have_webkit" = "xyes"; then
- AC_DEFINE(HAVE_WEBKIT, 1, [Define if you have libwebkitgtk])
- fi
- else
- have_webkit=no
- fi
-
- if test "x$enable_webkit" = "xyes" -a "x$have_webkit" != "xyes"; then
- AC_MSG_ERROR([Could not find webkit dependencies.])
- fi
- AM_CONDITIONAL(HAVE_WEBKIT, test "x$have_webkit" = "xyes")
-
# -----------------------------------------------------------
# gudev
# -----------------------------------------------------------
# Optional dependency for avatar selection
AC_ARG_WITH([cheese],
- AS_HELP_STRING([--with-cheese], [enable cheese webcam support]),,
+ AS_HELP_STRING([--with-cheese],
+ [enable cheese webcam support]),,
with_cheese=auto)
if test x"$with_cheese" != x"no" ; then
# Coding style checks
# -----------------------------------------------------------
AC_ARG_ENABLE(coding-style-checks,
- AC_HELP_STRING([--disable-coding-style-checks],
+ AS_HELP_STRING([--disable-coding-style-checks],
[do not check coding style using grep]),
- [ENABLE_CODING_STYLE_CHECKS=$enableval], [ENABLE_CODING_STYLE_CHECKS=yes])
+ [ENABLE_CODING_STYLE_CHECKS=$enableval],
+ [ENABLE_CODING_STYLE_CHECKS=yes])
AC_SUBST([ENABLE_CODING_STYLE_CHECKS])
# -----------------------------------------------------------
-AC_OUTPUT([
+AC_CONFIG_FILES([
Makefile
data/Makefile
data/empathy.desktop.in
tests/xml/Makefile
tools/Makefile
])
+AC_OUTPUT
echo "
Configure summary:
Display maps (libchamplain).: ${have_libchamplain}
Location awareness (Geoclue): ${have_geoclue}
Geocode support (Geoclue)...: ${have_geocode}
- Adium themes (Webkit).......: ${have_webkit}
Meego widgets...............: ${have_meego}
Control center embedding....: ${have_control_center_embedding}
Cheese webcam support ......: ${have_cheese}
--- /dev/null
-
+ <?xml version="1.0">
+ <html
+ xmlns="http://www.w3.org/TR/html4/"
+ xmlns:empathy="http://live.gnome.org/Empathy">
+ <head>
+ <style type="text/css">
+ html, body, div, p {
+ padding: 0;
+ margin: 1px;
+ }
+
+ body {
+ margin-left: -1em;
+ }
+
+ div.row {
+ margin-left: 1em;
+ clear: both;
+ }
+
+ div.row p {
+ display: inline;
+ white-space: pre-wrap;
+ }
+
+ span.open:after {
+ content: "\25BE";
+ margin-right: 2px;
+ }
+
+ span.closed:after {
+ content: "\25B8";
+ margin-right: 2px;
+ }
+
+ span.date {
+ float: right;
+ color: gray;
+ }
+
+ img.icon {
+ vertical-align: middle;
+ padding-right: 1px;
+ }
+ </style>
+ <script type="text/javascript">
+ var EMPATHY_NS='http://live.gnome.org/Empathy';
+
+ function filterNodes (node, tagName)
+ {
+ var out = new Array();
+
+ for (var i = 0; i < node.childNodes.length; i++)
+ {
+ var elem = node.childNodes[i];
+
+ if (elem.tagName == tagName)
+ out.push(elem);
+ }
+
+ return out;
+ }
+
+ function getNodes(node)
+ {
+ return filterNodes(node, 'DIV');
+ }
+
+ function getContent(node)
+ {
+ return filterNodes(node, 'P')[0];
+ }
+
+ function getToggle(node)
+ {
+ return filterNodes(node, 'SPAN')[0];
+ }
+
+ function setExpander(node, open)
+ {
+ var toggle = getToggle(node);
+ var display;
+ var nodes;
+
+ if (open)
+ {
+ toggle.setAttribute('class', 'open');
+ display = 'block';
+ }
+ else
+ {
+ toggle.setAttribute('class', 'closed');
+ display = 'none';
+ }
+
+ nodes = getNodes(node);
+
+ for (var i = 0; i < nodes.length; i++)
+ nodes[i].style.display = display;
+ }
+
+ function expandAll()
+ {
+ function expandAllRecurse(node)
+ {
+ var nodes = getNodes(node);
+
+ for (var i = 0; i < nodes.length; i++)
+ {
+ setExpander(nodes[i], true);
+
+ expandAllRecurse(nodes[i]);
+ }
+ }
+
+ var treeview = document.getElementById('treeview');
+
+ expandAllRecurse(treeview);
+ }
+
+ function setContent (contents, text, icon, date_)
+ {
+ contents.innerHTML = "";
+
+ if (icon != "")
+ {
+ contents.innerHTML += '<img class="icon" src="' + icon + '"/>';
+ }
+
+ contents.innerHTML += text;
+ contents.innerHTML += '<span class="date">' + date_ + '</span>';
+ }
+
+ function insertRow (path, text, icon, date_)
+ {
+ var treeview = document.getElementById('treeview');
+ var parentnode = treeview;
+ var i;
+
+ // walk the tree
+ for (i = 0; i < path.length - 1; i++)
+ parentnode = getNodes(parentnode)[path[i]];
+
+ // create a new node
+ var newnode = document.createElement('div');
+ newnode.setAttribute('class', 'row');
+
+ // insert the new node into the tree
+ var nodes = getNodes(parentnode);
+
+ if (path[i] >= nodes.length)
+ parentnode.appendChild(newnode);
+ else
+ parentnode.insertBefore(newnode, nodes[path[i]]);
+
+ // set the path
+ newnode.setAttributeNS(EMPATHY_NS, 'path', path.join(':'));
+
+ // add an expander
+ var toggle = document.createElement('span');
+ newnode.appendChild(toggle);
+ toggle.setAttribute('class', 'closed');
+ toggle.style.display = 'none';
+
+ var contents = document.createElement('p');
+ newnode.appendChild(contents);
+ setContent(contents, text, icon, date_);
+
+ function toggleExpander (e)
+ {
+ if (toggle.getAttribute('class') == 'closed')
+ setExpander(newnode, true);
+ else
+ setExpander(newnode, false);
+ };
++
+ toggle.onclick = toggleExpander;
+ contents.ondblclick = toggleExpander;
+
+ // if the node is not a top-level node, hide it
+ if (parentnode != treeview)
+ newnode.style.display = 'none';
+ }
+
+ function changeRow (path, text, icon, date_)
+ {
+ var treeview = document.getElementById('treeview');
+ var node = treeview;
+
+ // walk the tree
+ for (var i = 0; i < path.length; i++)
+ node = getNodes(node)[path[i]];
+
+ // set the contents
+ var contents = getContent(node);
+ setContent(contents, text, icon, date_);
+ }
+
+ function deleteRow (path)
+ {
+ var treeview = document.getElementById('treeview');
+ var node = treeview;
+
+ // walk the tree
+ for (var i = 0; i < path.length; i++)
+ node = getNodes(node)[path[i]];
+
+ node.parentNode.removeChild(node);
+ }
+
+ function reorderRows (path, new_order)
+ {
+ var treeview = document.getElementById('treeview');
+ var node = treeview;
+
+ // walk the tree
+ for (var i = 0; i < path.length; i++)
+ node = getNodes(node)[path[i]];
+
+ var nodes = getNodes(node);
+
+ // remove all the nodes from the DOM
+ for (var i = 0; i < nodes.length; i++)
+ node.removeChild(nodes[i]);
+
+ // put them back in the new order
+ // For reference: new_order[new_pos] = old_pos
+ for (var i = 0; i < nodes.length; i++)
+ node.appendChild(nodes[new_order[i]]);
+
+ // recursively update the path
+ function updatePaths(path, node)
+ {
+ var nodes = getNodes(node);
+
+ for (var i = 0; i < nodes.length; i++)
+ {
+ var newpath = path.concat([i]);
+
+ nodes[i].setAttributeNS(EMPATHY_NS, 'path', newpath.join(':'));
+ updatePaths(newpath, nodes[i]);
+ }
+ }
+
+ updatePaths(path, node);
+ }
+
+ function hasChildRows (path, has_children)
+ {
+ var treeview = document.getElementById('treeview');
+ var node = treeview;
+
+ // walk the tree
+ for (var i = 0; i < path.length; i++)
+ node = getNodes(node)[path[i]];
+
+ var toggle = getToggle(node);
+
+ if (has_children)
+ toggle.style.display = 'inline';
+ else
+ toggle.style.display = 'none';
+ }
+
+ function getOffset (node)
+ {
+ var y = 0;
+
+ while (node != null && !isNaN(node.offsetTop))
+ {
+ y += node.offsetTop - node.scrollTop;
+ node = node.offsetParent;
+ }
+
+ return y;
+ }
+
+ function scrollToRow (path)
+ {
+ var treeview = document.getElementById('treeview');
+ var node = treeview;
+
+ // walk the tree
+ for (var i = 0; i < path.length; i++)
+ node = getNodes(node)[path[i]];
+
+ window.scrollTo(0, getOffset(node));
+ }
+ </script>
+ </head>
+
+ <body>
+ <div id="treeview">
+ </div>
+ </body>
+ </html>
$(GEOCLUE_CFLAGS) \
$(GEOCODE_CFLAGS) \
$(MEEGO_CFLAGS) \
- $(WEBKIT_CFLAGS) \
$(CHEESE_CFLAGS) \
$(WARN_CFLAGS) \
$(DISABLE_DEPRECATED)
empathy-chat.c \
empathy-contact-blocking-dialog.c \
empathy-contact-dialogs.c \
+ empathy-contact-chooser.c \
empathy-contact-list-store.c \
empathy-contact-list-view.c \
empathy-contact-menu.c \
empathy-theme-irc.c \
empathy-theme-manager.c \
empathy-tls-dialog.c \
- empathy-ui-utils.c
+ empathy-ui-utils.c \
+ empathy-plist.c \
+ empathy-theme-adium.c \
+ empathy-webkit-utils.c \
+ $(NULL)
libempathy_gtk_headers = \
empathy-account-chooser.h \
empathy-chat.h \
empathy-contact-blocking-dialog.h \
empathy-contact-dialogs.h \
+ empathy-contact-chooser.h \
empathy-contact-list-store.h \
empathy-contact-list-view.h \
empathy-contact-menu.h \
empathy-theme-irc.h \
empathy-theme-manager.h \
empathy-tls-dialog.h \
- empathy-ui-utils.h
+ empathy-ui-utils.h \
+ empathy-plist.h \
+ empathy-theme-adium.h \
+ empathy-webkit-utils.h \
+ $(NULL)
+
libempathy_gtk_la_SOURCES = \
$(libempathy_gtk_handwritten_source) \
$(GEOCODE_LIBS) \
$(GCR_LIBS) \
$(MEEGO_LIBS) \
- $(WEBKIT_LIBS) \
$(CHEESE_LIBS) \
$(top_builddir)/libempathy/libempathy.la
empathy-location-manager.h
endif
- if HAVE_WEBKIT
- libempathy_gtk_handwritten_source += \
- empathy-plist.c \
- empathy-theme-adium.c
- libempathy_gtk_headers += \
- empathy-plist.h \
- empathy-theme-adium.h
- else
- EXTRA_DIST += \
- empathy-plist.c \
- empathy-plist.h \
- empathy-theme-adium.c \
- empathy-theme-adium.h
- endif
-
CLEANFILES = \
$(BUILT_SOURCES) \
stamp-empathy-gtk-enum-types.h
#include <glib/gi18n-lib.h>
#include <gtk/gtk.h>
+ #include <webkit/webkit.h>
#include <telepathy-glib/telepathy-glib.h>
#include <telepathy-glib/proxy-subclass.h>
#include <libempathy/empathy-camera-monitor.h>
#include <libempathy/empathy-chatroom-manager.h>
#include <libempathy/empathy-chatroom.h>
+ #include <libempathy/empathy-gsettings.h>
#include <libempathy/empathy-message.h>
#include <libempathy/empathy-request-util.h>
#include <libempathy/empathy-utils.h>
#include "empathy-images.h"
#include "empathy-theme-manager.h"
#include "empathy-ui-utils.h"
+ #include "empathy-webkit-utils.h"
#define DEBUG_FLAG EMPATHY_DEBUG_OTHER
#include <libempathy/empathy-debug.h>
+ #define EMPATHY_NS "http://live.gnome.org/Empathy"
+
G_DEFINE_TYPE (EmpathyLogWindow, empathy_log_window, GTK_TYPE_WINDOW);
struct _EmpathyLogWindowPriv
GtkWidget *treeview_who;
GtkWidget *treeview_what;
GtkWidget *treeview_when;
- GtkWidget *treeview_events;
+ GtkWidget *webview;
GtkTreeStore *store_events;
TpBaseClient *observer;
EmpathyContact *selected_contact;
+ EmpathyContact *events_contact;
EmpathyCameraMonitor *camera_monitor;
GBinding *button_video_binding;
TpAccount *selected_account;
gchar *selected_chat_id;
gboolean selected_is_chatroom;
+
+ GSettings *gsettings_chat;
+ GSettings *gsettings_desktop;
};
static void log_window_search_entry_changed_cb (GtkWidget *entry,
static void start_spinner (void);
static void log_window_create_observer (EmpathyLogWindow *window);
+ static gboolean log_window_events_button_press_event (GtkWidget *webview,
+ GdkEventButton *event, EmpathyLogWindow *self);
+ static void log_window_update_buttons_sensitivity (EmpathyLogWindow *self);
static void
empathy_account_chooser_filter_has_logs (TpAccount *account,
TRUE, video, gtk_get_current_event_time ());
}
+ static void
+ insert_or_change_row (EmpathyLogWindow *self,
+ const char *method,
+ GtkTreeModel *model,
+ GtkTreePath *path,
+ GtkTreeIter *iter)
+ {
+ char *str = gtk_tree_path_to_string (path);
+ char *script, *text, *date, *stock_icon;
+ char *icon = NULL;
+
+ gtk_tree_model_get (model, iter,
+ COL_EVENTS_TEXT, &text,
+ COL_EVENTS_PRETTY_DATE, &date,
+ COL_EVENTS_ICON, &stock_icon,
+ -1);
+
+ if (!tp_str_empty (stock_icon))
+ {
+ GtkIconInfo *icon_info = gtk_icon_theme_lookup_icon (
+ gtk_icon_theme_get_default (),
+ stock_icon,
+ GTK_ICON_SIZE_MENU, 0);
+
+ if (icon_info != NULL)
+ icon = g_strdup (gtk_icon_info_get_filename (icon_info));
+
+ gtk_icon_info_free (icon_info);
+ }
+
+ script = g_strdup_printf ("javascript:%s([%s], '%s', '%s', '%s');",
+ method,
+ g_strdelimit (str, ":", ','),
+ text,
+ icon != NULL ? icon : "",
+ date);
+
+ webkit_web_view_execute_script (WEBKIT_WEB_VIEW (self->priv->webview),
+ script);
+
+ g_free (str);
+ g_free (text);
+ g_free (date);
+ g_free (stock_icon);
+ g_free (icon);
+ g_free (script);
+ }
+
+ static void
+ store_events_row_inserted (GtkTreeModel *model,
+ GtkTreePath *path,
+ GtkTreeIter *iter,
+ EmpathyLogWindow *self)
+ {
+ insert_or_change_row (self, "insertRow", model, path, iter);
+ }
+
+ static void
+ store_events_row_changed (GtkTreeModel *model,
+ GtkTreePath *path,
+ GtkTreeIter *iter,
+ EmpathyLogWindow *self)
+ {
+ insert_or_change_row (self, "changeRow", model, path, iter);
+ }
+
+ static void
+ store_events_row_deleted (GtkTreeModel *model,
+ GtkTreePath *path,
+ EmpathyLogWindow *self)
+ {
+ char *str = gtk_tree_path_to_string (path);
+ char *script;
+
+ script = g_strdup_printf ("javascript:deleteRow([%s]);",
+ g_strdelimit (str, ":", ','));
+
+ webkit_web_view_execute_script (WEBKIT_WEB_VIEW (self->priv->webview),
+ script);
+
+ g_free (str);
+ g_free (script);
+ }
+
+ static void
+ store_events_has_child_rows (GtkTreeModel *model,
+ GtkTreePath *path,
+ GtkTreeIter *iter,
+ EmpathyLogWindow *self)
+ {
+ char *str = gtk_tree_path_to_string (path);
+ char *script;
+
+ script = g_strdup_printf ("javascript:hasChildRows([%s], %u);",
+ g_strdelimit (str, ":", ','),
+ gtk_tree_model_iter_has_child (model, iter));
+
+ webkit_web_view_execute_script (WEBKIT_WEB_VIEW (self->priv->webview),
+ script);
+
+ g_free (str);
+ g_free (script);
+ }
+
+ static void
+ store_events_rows_reordered (GtkTreeModel *model,
+ GtkTreePath *path,
+ GtkTreeIter *iter,
+ int *new_order,
+ EmpathyLogWindow *self)
+ {
+ char *str = gtk_tree_path_to_string (path);
+ int i, children = gtk_tree_model_iter_n_children (model, iter);
+ char **new_order_strv, *new_order_s;
+ char *script;
+
+ new_order_strv = g_new0 (char *, children + 1);
+
+ for (i = 0; i < children; i++)
+ new_order_strv[i] = g_strdup_printf ("%i", new_order[i]);
+
+ new_order_s = g_strjoinv (",", new_order_strv);
+
+ script = g_strdup_printf ("javascript:reorderRows([%s], [%s]);",
+ str == NULL ? "" : g_strdelimit (str, ":", ','),
+ new_order_s);
+
+ webkit_web_view_execute_script (WEBKIT_WEB_VIEW (self->priv->webview),
+ script);
+
+ g_free (str);
+ g_free (script);
+ g_free (new_order_s);
+ g_strfreev (new_order_strv);
+ }
+
+ static gboolean
+ events_webview_handle_navigation (WebKitWebView *webview,
+ WebKitWebFrame *frame,
+ WebKitNetworkRequest *request,
+ WebKitWebNavigationAction *navigation_action,
+ WebKitWebPolicyDecision *policy_decision,
+ EmpathyLogWindow *window)
+ {
+ empathy_url_show (GTK_WIDGET (webview),
+ webkit_network_request_get_uri (request));
+
+ webkit_web_policy_decision_ignore (policy_decision);
+ return TRUE;
+ }
+
static GObject *
empathy_log_window_constructor (GType type,
guint n_props,
tp_clear_object (&self->priv->log_manager);
tp_clear_object (&self->priv->selected_account);
tp_clear_object (&self->priv->selected_contact);
+ tp_clear_object (&self->priv->events_contact);
tp_clear_object (&self->priv->camera_monitor);
+ tp_clear_object (&self->priv->gsettings_chat);
+ tp_clear_object (&self->priv->gsettings_desktop);
+
+ tp_clear_object (&self->priv->store_events);
+
G_OBJECT_CLASS (empathy_log_window_parent_class)->dispose (object);
}
EmpathyAccountChooser *account_chooser;
GtkBuilder *gui;
gchar *filename;
+ GFile *gfile;
GtkWidget *vbox, *accounts, *search, *label, *quit;
+ GtkWidget *scrolledwindow_events;
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
EMPATHY_TYPE_LOG_WINDOW, EmpathyLogWindowPriv);
self->priv->log_manager = tpl_log_manager_dup_singleton ();
+ self->priv->gsettings_chat = g_settings_new (EMPATHY_PREFS_CHAT_SCHEMA);
+ self->priv->gsettings_desktop = g_settings_new (
+ EMPATHY_PREFS_DESKTOP_INTERFACE_SCHEMA);
+
gtk_window_set_title (GTK_WINDOW (self), _("History"));
gtk_widget_set_can_focus (GTK_WIDGET (self), FALSE);
gtk_window_set_default_size (GTK_WINDOW (self), 800, 600);
"treeview_who", &self->priv->treeview_who,
"treeview_what", &self->priv->treeview_what,
"treeview_when", &self->priv->treeview_when,
- "treeview_events", &self->priv->treeview_events,
+ "scrolledwindow_events", &scrolledwindow_events,
"notebook", &self->priv->notebook,
"spinner", &self->priv->spinner,
NULL);
log_window_who_populate (self);
+ /* events */
+ self->priv->webview = webkit_web_view_new ();
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow_events),
+ GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
+ gtk_container_add (GTK_CONTAINER (scrolledwindow_events),
+ self->priv->webview);
+ gtk_widget_show (self->priv->webview);
+
+ empathy_webkit_bind_font_setting (WEBKIT_WEB_VIEW (self->priv->webview),
+ self->priv->gsettings_desktop,
+ EMPATHY_PREFS_DESKTOP_INTERFACE_FONT_NAME);
+
+ filename = empathy_file_lookup ("empathy-log-window.html", "data");
+ gfile = g_file_new_for_path (filename);
+ g_free (filename);
+
+ webkit_web_view_load_uri (WEBKIT_WEB_VIEW (self->priv->webview),
+ g_file_get_uri (gfile));
+ g_object_unref (gfile);
+
+ /* handle all navigation externally */
+ g_signal_connect (self->priv->webview, "navigation-policy-decision-requested",
+ G_CALLBACK (events_webview_handle_navigation), self);
+
+ /* listen to changes to the treemodel */
+ g_signal_connect (self->priv->store_events, "row-inserted",
+ G_CALLBACK (store_events_row_inserted), self);
+ g_signal_connect (self->priv->store_events, "row-changed",
+ G_CALLBACK (store_events_row_changed), self);
+ g_signal_connect (self->priv->store_events, "row-deleted",
+ G_CALLBACK (store_events_row_deleted), self);
+ g_signal_connect (self->priv->store_events, "rows-reordered",
+ G_CALLBACK (store_events_rows_reordered), self);
+ g_signal_connect (self->priv->store_events, "row-has-child-toggled",
+ G_CALLBACK (store_events_has_child_rows), self);
+
+ /* track clicked row */
+ g_signal_connect (self->priv->webview, "button-press-event",
+ G_CALLBACK (log_window_events_button_press_event), self);
+
+ log_window_update_buttons_sensitivity (self);
gtk_widget_show (GTK_WIDGET (self));
}
{
GtkTreeStore *store = log_window->priv->store_events;
GtkTreeIter iter, parent;
- gchar *pretty_date, *alias, *body, *msg;
+ gchar *pretty_date, *alias, *body;
GDateTime *date;
+ EmpathyStringParser *parsers;
+ GString *msg;
date = g_date_time_new_from_unix_utc (
tpl_event_get_timestamp (event));
get_parent_iter_for_message (event, message, &parent);
- msg = g_markup_escape_text (empathy_message_get_body (message), -1);
alias = g_markup_escape_text (
tpl_entity_get_alias (tpl_event_get_sender (event)), -1);
- /* If the user is searching, highlight the matched text */
- if (!EMP_STR_EMPTY (log_window->priv->last_find))
- {
- gchar *str = g_regex_escape_string (log_window->priv->last_find, -1);
- gchar *replacement = g_markup_printf_escaped (
- "<span background=\"yellow\">%s</span>",
- log_window->priv->last_find);
- GError *error = NULL;
- GRegex *regex = g_regex_new (str, 0, 0, &error);
-
- if (regex == NULL)
- {
- DEBUG ("Could not create regex: %s", error->message);
- g_error_free (error);
- }
- else
- {
- gchar *new_msg = g_regex_replace_literal (regex,
- empathy_message_get_body (message), -1, 0, replacement,
- 0, &error);
-
- if (new_msg != NULL)
- {
- /* We pass ownership of new_msg to msg, which is freed later */
- g_free (msg);
- msg = new_msg;
- }
- else
- {
- DEBUG ("Error while performing string substitution: %s",
- error->message);
- g_error_free (error);
- }
- }
-
- g_free (str);
- g_free (replacement);
+ /* escape the text */
+ parsers = empathy_webkit_get_string_parser (
+ g_settings_get_boolean (log_window->priv->gsettings_chat,
+ EMPATHY_PREFS_CHAT_SHOW_SMILEYS));
+ msg = g_string_new ("");
- tp_clear_pointer (®ex, g_regex_unref);
- }
+ empathy_string_parser_substr (empathy_message_get_body (message), -1,
+ parsers, msg);
if (tpl_text_event_get_message_type (TPL_TEXT_EVENT (event))
== TP_CHANNEL_TEXT_MESSAGE_TYPE_ACTION)
{
/* Translators: this is an emote: '* Danielle waves' */
- body = g_strdup_printf (_("<i>* %s %s</i>"), alias, msg);
+ body = g_strdup_printf (_("<i>* %s %s</i>"), alias, msg->str);
}
else
{
/* Translators: this is a message: 'Danielle: hello'
* The string in bold is the sender's name */
- body = g_strdup_printf (_("<b>%s:</b> %s"), alias, msg);
+ body = g_strdup_printf (_("<b>%s:</b> %s"), alias, msg->str);
}
gtk_tree_store_append (store, &iter, &parent);
COL_EVENTS_EVENT, event,
-1);
- g_free (msg);
+ g_string_free (msg, TRUE);
g_free (body);
g_free (alias);
g_free (pretty_date);
if (EMP_STR_EMPTY (search_criteria))
{
tp_clear_pointer (&self->priv->hits, tpl_log_manager_search_free);
+ webkit_web_view_set_highlight_text_matches (
+ WEBKIT_WEB_VIEW (self->priv->webview), FALSE);
log_window_who_populate (self);
return;
}
log_window_when_changed_cb,
self);
+ /* highlight the search text */
+ webkit_web_view_mark_text_matches (WEBKIT_WEB_VIEW (self->priv->webview),
+ search_criteria, FALSE, 0);
+
tpl_log_manager_search_async (self->priv->log_manager,
search_criteria, TPL_EVENT_MASK_ANY,
log_manager_searched_new_cb, NULL);
GtkTreePath *path;
gboolean profile, chat, call, video;
- tp_clear_object (&self->priv->selected_contact);
+ profile = chat = call = video = FALSE;
+
tp_clear_object (&self->priv->button_video_binding);
+ tp_clear_object (&self->priv->selected_contact);
view = GTK_TREE_VIEW (self->priv->treeview_who);
model = gtk_tree_view_get_model (view);
/* If the Who pane doesn't contain a contact (e.g. it has many
* selected, or has 'Anyone', let's try to get the contact from
* the selected event. */
- view = GTK_TREE_VIEW (self->priv->treeview_events);
- model = gtk_tree_view_get_model (view);
- selection = gtk_tree_view_get_selection (view);
- if (gtk_tree_selection_count_selected_rows (selection) != 1)
- goto out;
-
- if (!gtk_tree_selection_get_selected (selection, NULL, &iter))
+ if (self->priv->events_contact != NULL)
+ self->priv->selected_contact = g_object_ref (self->priv->events_contact);
+ else
goto out;
- gtk_tree_model_get (model, &iter,
- COL_EVENTS_ACCOUNT, &account,
- COL_EVENTS_TARGET, &target,
- -1);
-
- self->priv->selected_contact = empathy_contact_from_tpl_contact (account,
- target);
-
- g_object_unref (account);
- g_object_unref (target);
-
capabilities = empathy_contact_get_capabilities (self->priv->selected_contact);
profile = chat = TRUE;
}
static void
- log_window_events_changed_cb (GtkTreeSelection *selection,
- EmpathyLogWindow *self)
+ log_window_find_row (EmpathyLogWindow *self,
+ GdkEventButton *event)
{
- DEBUG ("log_window_events_changed_cb");
+ WebKitHitTestResult *hit = webkit_web_view_get_hit_test_result (
+ WEBKIT_WEB_VIEW (self->priv->webview), event);
+ WebKitDOMNode *inner_node;
+
+ tp_clear_object (&self->priv->events_contact);
+
+ g_object_get (hit,
+ "inner-node", &inner_node,
+ NULL);
+
+ if (inner_node != NULL)
+ {
+ GtkTreeModel *model = GTK_TREE_MODEL (self->priv->store_events);
+ WebKitDOMNode *node;
+ const char *path = NULL;
+ GtkTreeIter iter;
+
+ /* walk back up the DOM tree looking for a node with empathy:path set */
+ for (node = inner_node; node != NULL;
+ node = webkit_dom_node_get_parent_node (node))
+ {
+ if (!WEBKIT_DOM_IS_ELEMENT (node))
+ continue;
+
+ path = webkit_dom_element_get_attribute_ns (
+ WEBKIT_DOM_ELEMENT (node), EMPATHY_NS, "path");
+
+ if (!tp_str_empty (path))
+ break;
+ }
+
+ /* look up the contact for this path */
+ if (!tp_str_empty (path) &&
+ gtk_tree_model_get_iter_from_string (model, &iter, path))
+ {
+ TpAccount *account;
+ TplEntity *target;
+
+ gtk_tree_model_get (model, &iter,
+ COL_EVENTS_ACCOUNT, &account,
+ COL_EVENTS_TARGET, &target,
+ -1);
+
+ self->priv->events_contact = empathy_contact_from_tpl_contact (
+ account, target);
+
+ g_object_unref (account);
+ g_object_unref (target);
+ }
+
+ g_object_unref (inner_node);
+ }
+
+ g_object_unref (hit);
log_window_update_buttons_sensitivity (self);
}
- static void
- log_window_events_row_activated_cb (GtkTreeView *view,
- GtkTreePath *path,
- GtkTreeViewColumn *column,
+ static gboolean
+ log_window_events_button_press_event (GtkWidget *webview,
+ GdkEventButton *event,
EmpathyLogWindow *self)
{
- if (gtk_tree_view_row_expanded (view, path))
- gtk_tree_view_collapse_row (view, path);
- else
- gtk_tree_view_expand_row (view, path, FALSE);
+ switch (event->button)
+ {
+ case 1:
+ log_window_find_row (self, event);
+ break;
+
+ case 3:
+ empathy_webkit_context_menu_for_event (
+ WEBKIT_WEB_VIEW (webview), event, 0);
+ return TRUE;
+
+ default:
+ break;
+ }
+
+ return FALSE;
}
static void
log_window_events_setup (EmpathyLogWindow *self)
{
- GtkTreeView *view;
- GtkTreeModel *model;
- GtkTreeSelection *selection;
GtkTreeSortable *sortable;
- GtkTreeViewColumn *column;
GtkTreeStore *store;
- GtkCellRenderer *cell;
-
- view = GTK_TREE_VIEW (self->priv->treeview_events);
- selection = gtk_tree_view_get_selection (view);
/* new store */
self->priv->store_events = store = gtk_tree_store_new (COL_EVENTS_COUNT,
TPL_TYPE_ENTITY, /* target */
TPL_TYPE_EVENT); /* event */
- model = GTK_TREE_MODEL (store);
sortable = GTK_TREE_SORTABLE (store);
- gtk_tree_view_set_model (view, model);
-
- /* new column */
- column = gtk_tree_view_column_new ();
-
- cell = gtk_cell_renderer_pixbuf_new ();
- gtk_tree_view_column_pack_start (column, cell, FALSE);
- gtk_tree_view_column_add_attribute (column, cell,
- "icon-name", COL_EVENTS_ICON);
-
- cell = gtk_cell_renderer_text_new ();
- gtk_tree_view_column_pack_start (column, cell, TRUE);
- gtk_tree_view_column_add_attribute (column, cell,
- "markup", COL_EVENTS_TEXT);
-
- cell = gtk_cell_renderer_text_new ();
- g_object_set (cell, "xalign", 1.0, NULL);
- gtk_tree_view_column_pack_end (column, cell, FALSE);
- gtk_tree_view_column_add_attribute (column, cell,
- "text", COL_EVENTS_PRETTY_DATE);
-
- gtk_tree_view_append_column (view, column);
-
- /* set up treeview properties */
- gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE);
- gtk_tree_view_set_headers_visible (view, FALSE);
-
gtk_tree_sortable_set_sort_column_id (sortable,
COL_EVENTS_TS,
GTK_SORT_ASCENDING);
-
- gtk_tree_view_set_enable_search (view, FALSE);
-
- /* set up signals */
- g_signal_connect (selection, "changed",
- G_CALLBACK (log_window_events_changed_cb),
- self);
-
- g_signal_connect (view, "row-activated",
- G_CALLBACK (log_window_events_row_activated_cb),
- self);
-
- g_object_unref (store);
}
static void
COL_WHEN_TEXT, &when,
-1);
- ret = g_str_equal (when, "separator");
+ ret = !tp_strdiff (when, "separator");
g_free (when);
return ret;
}
static void
log_window_maybe_expand_events (void)
{
- GtkTreeView *view;
- GtkTreeModel *model;
-
- view = GTK_TREE_VIEW (log_window->priv->treeview_events);
- model = gtk_tree_view_get_model (view);
+ GtkTreeModel *model = GTK_TREE_MODEL (log_window->priv->store_events);
/* If there's only one result, expand it */
if (gtk_tree_model_iter_n_children (model, NULL) == 1)
- gtk_tree_view_expand_all (view);
+ webkit_web_view_execute_script (
+ WEBKIT_WEB_VIEW (log_window->priv->webview),
+ "javascript:expandAll()");
}
static gboolean
gpointer user_data)
{
Ctx *ctx = user_data;
- GtkTreeView *view;
GtkTreeModel *model;
GtkTreeIter iter;
GList *events;
}
g_list_free (events);
- view = GTK_TREE_VIEW (log_window->priv->treeview_events);
- model = gtk_tree_view_get_model (view);
+ model = GTK_TREE_MODEL (log_window->priv->store_events);
n = gtk_tree_model_iter_n_children (model, NULL) - 1;
if (n >= 0 && gtk_tree_model_iter_nth_child (model, &iter, NULL, n))
{
GtkTreePath *path;
+ char *str, *script;
path = gtk_tree_model_get_path (model, &iter);
- gtk_tree_view_scroll_to_cell (view, path, NULL, FALSE, 0, 0);
+ str = gtk_tree_path_to_string (path);
+
+ script = g_strdup_printf ("javascript:scrollToRow([%s]);",
+ g_strdelimit (str, ":", ','));
+
+ webkit_web_view_execute_script (
+ WEBKIT_WEB_VIEW (log_window->priv->webview),
+ script);
+
gtk_tree_path_free (path);
+ g_free (str);
+ g_free (script);
}
out:
#define EMPATHY_PREFS_SOUNDS_CONTACT_LOGIN "sounds-contact-login"
#define EMPATHY_PREFS_SOUNDS_CONTACT_LOGOUT "sounds-contact-logout"
+#define EMPATHY_PREFS_CALL_SCHEMA EMPATHY_PREFS_SCHEMA ".call"
+#define EMPATHY_PREFS_CALL_SOUND_VOLUME "volume"
+#define EMPATHY_PREFS_CALL_CAMERA_DEVICE "camera-device"
+#define EMPATHY_PREFS_CALL_ECHO_CANCELLATION "echo-cancellation"
+
#define EMPATHY_PREFS_CHAT_SCHEMA EMPATHY_PREFS_SCHEMA ".conversation"
#define EMPATHY_PREFS_CHAT_SHOW_SMILEYS "graphical-smileys"
#define EMPATHY_PREFS_CHAT_SHOW_CONTACTS_IN_ROOMS "show-contacts-in-rooms"
#define EMPATHY_PREFS_DESKTOP_INTERFACE_SCHEMA "org.gnome.desktop.interface"
#define EMPATHY_PREFS_DESKTOP_INTERFACE_DOCUMENT_FONT_NAME "document-font-name"
+ #define EMPATHY_PREFS_DESKTOP_INTERFACE_FONT_NAME "font-name"
G_END_DECLS
AM_CPPFLAGS = \
$(CPPFLAGS_COMMON) \
$(LIBCHAMPLAIN_CFLAGS) \
- $(WEBKIT_CFLAGS) \
$(NULL)
LDADD = \
$(EMPATHY_LIBS) \
$(YELL_LIBS) \
$(LIBCHAMPLAIN_LIBS) \
- $(WEBKIT_LIBS)
+ $(NULL)
noinst_LTLIBRARIES = libempathy-accounts-common.la
$(EDS_LIBS) \
$(EMPATHY_LIBS) \
$(LIBCHAMPLAIN_LIBS) \
- $(WEBKIT_LIBS) \
$(NULL)
if HAVE_CONTROL_CENTER_EMBEDDING
empathy-call-window.h \
empathy-call-window-fullscreen.c \
empathy-call-window-fullscreen.h \
+ empathy-about-dialog.c \
+ empathy-about-dialog.h \
empathy-audio-sink.c \
empathy-audio-sink.h \
empathy-audio-src.c \
empathy-video-src.h \
empathy-video-widget.c \
empathy-video-widget.h \
+ empathy-preferences.c \
+ empathy-preferences.h \
ev-sidebar.c \
- ev-sidebar.h
+ ev-sidebar.h \
+ empathy-camera-menu.c \
+ empathy-camera-menu.h \
+ empathy-mic-menu.c \
+ empathy-mic-menu.h \
+ empathy-rounded-actor.c \
+ empathy-rounded-actor.h
nodist_empathy_call_SOURCES = $(BUILT_SOURCES)
$(top_builddir)/extensions/libemp-extensions.la \
$(EMPATHY_LIBS) \
$(LIBCHAMPLAIN_LIBS) \
- $(WEBKIT_LIBS) \
$(NULL)
nodist_empathy_SOURCES = $(BUILT_SOURCES)
empathy.1 \
empathy-accounts.1
-src-marshal.list: $(empathy_SOURCES) Makefile.am
+src-marshal.list: $(empathy_SOURCES) $(empathy_call_SOURCES) Makefile.am
$(AM_V_GEN)( cd $(srcdir) && \
sed -n -e 's/.*src_marshal_\([[:upper:][:digit:]]*__[[:upper:][:digit:]_]*\).*/\1/p' \
- $(empathy_SOURCES) $(empathy_av_SOURCES) ) \
+ $(empathy_SOURCES) $(empathy_av_SOURCES) $(empathy_call_SOURCES) ) \
| sed -e 's/__/:/' -e 'y/_/,/' | sort -u > $@.tmp
@if cmp -s $@.tmp $@; then \
rm $@.tmp; \
#include <libempathy-gtk/empathy-spell.h>
#include <libempathy-gtk/empathy-contact-list-store.h>
#include <libempathy-gtk/empathy-gtk-enum-types.h>
-
- #ifdef HAVE_WEBKIT
#include <libempathy-gtk/empathy-theme-adium.h>
- #endif
#include "empathy-preferences.h"
#define GET_PRIV(self) ((EmpathyPreferencesPriv *)((EmpathyPreferences *) self)->priv)
+static const gchar * empathy_preferences_tabs[] =
+{
+ "general",
+ "notifications",
+ "sounds",
+ "calls",
+ "location",
+ "spell",
+ "themes",
+};
+
struct _EmpathyPreferencesPriv {
GtkWidget *notebook;
GtkWidget *checkbutton_notifications_contact_signin;
GtkWidget *checkbutton_notifications_contact_signout;
+ GtkWidget *scale_call_volume;
+ GtkWidget *adj_call_volume;
+ GtkWidget *echo_cancellation;
+
GtkWidget *treeview_spell_checker;
GtkWidget *checkbutton_location_publish;
GSettings *gsettings;
GSettings *gsettings_chat;
+ GSettings *gsettings_call;
GSettings *gsettings_loc;
GSettings *gsettings_notify;
GSettings *gsettings_sound;
"active",
G_SETTINGS_BIND_DEFAULT);
+ g_settings_bind (priv->gsettings_call,
+ EMPATHY_PREFS_CALL_SOUND_VOLUME,
+ priv->adj_call_volume,
+ "value",
+ G_SETTINGS_BIND_DEFAULT);
+
+ g_settings_bind (priv->gsettings_call,
+ EMPATHY_PREFS_CALL_ECHO_CANCELLATION,
+ priv->echo_cancellation,
+ "active",
+ G_SETTINGS_BIND_DEFAULT);
+
g_settings_bind (priv->gsettings,
EMPATHY_PREFS_AUTOCONNECT,
priv->checkbutton_autoconnect,
EmpathyPreferencesPriv *priv = GET_PRIV (preferences);
GtkTreeModel *model;
GtkListStore *store;
- #ifdef HAVE_WEBKIT
GPtrArray *variants;
const gchar *default_variant;
guint i;
- #endif /* HAVE_WEBKIT */
model = gtk_combo_box_get_model (GTK_COMBO_BOX (priv->combobox_chat_theme_variant));
store = GTK_LIST_STORE (model);
gtk_list_store_clear (store);
- #ifdef HAVE_WEBKIT
variants = empathy_adium_info_get_available_variants (info);
default_variant = empathy_adium_info_get_default_variant (info);
for (i = 0; i < variants->len; i++) {
COL_VARIANT_DEFAULT, !tp_strdiff (name, default_variant),
-1);
}
- #endif /* HAVE_WEBKIT */
/* Select the variant from the GSetting key */
preferences_theme_variant_notify_cb (priv->gsettings_chat,
preferences);
}
+static gchar *
+preferences_call_format_volume_cb (GtkScale *scale,
+ gdouble value)
+{
+ return g_strdup_printf ("%g%%", value);
+}
+
static void
empathy_preferences_response (GtkDialog *widget,
gint response)
g_object_unref (priv->gsettings);
g_object_unref (priv->gsettings_chat);
+ g_object_unref (priv->gsettings_call);
g_object_unref (priv->gsettings_loc);
g_object_unref (priv->gsettings_notify);
g_object_unref (priv->gsettings_sound);
GtkBuilder *gui;
gchar *filename;
GtkWidget *page;
+ GtkWidget *call_volume_scale_box;
+ GtkWidget *call_volume_bar_box;
priv = preferences->priv = G_TYPE_INSTANCE_GET_PRIVATE (preferences,
EMPATHY_TYPE_PREFERENCES, EmpathyPreferencesPriv);
"checkbutton_location_resource_network", &priv->checkbutton_location_resource_network,
"checkbutton_location_resource_cell", &priv->checkbutton_location_resource_cell,
"checkbutton_location_resource_gps", &priv->checkbutton_location_resource_gps,
+ "call_volume_scale_box", &call_volume_scale_box,
+ "call_volume_bar_box", &call_volume_bar_box,
+ "call_volume_scale", &priv->scale_call_volume,
+ "call_volume_adjustment", &priv->adj_call_volume,
+ "call_echo_cancellation", &priv->echo_cancellation,
NULL);
g_free (filename);
priv->gsettings = g_settings_new (EMPATHY_PREFS_SCHEMA);
priv->gsettings_chat = g_settings_new (EMPATHY_PREFS_CHAT_SCHEMA);
+ priv->gsettings_call = g_settings_new (EMPATHY_PREFS_CALL_SCHEMA);
priv->gsettings_loc = g_settings_new (EMPATHY_PREFS_LOCATION_SCHEMA);
priv->gsettings_notify = g_settings_new (EMPATHY_PREFS_NOTIFICATIONS_SCHEMA);
priv->gsettings_sound = g_settings_new (EMPATHY_PREFS_SOUNDS_SCHEMA);
preferences, 0);
preferences_preview_theme_changed_cb (priv->theme_manager, preferences);
+ g_signal_connect (priv->scale_call_volume, "format-value",
+ G_CALLBACK (preferences_call_format_volume_cb),
+ preferences);
+
+#ifndef HAVE_CALL
+ gtk_widget_hide (call_volume_scale_box);
+ gtk_widget_hide (call_volume_bar_box);
+#endif
+
preferences_themes_setup (preferences);
preferences_setup_widgets (preferences);
preferences_sound_load (preferences);
if (empathy_spell_supported ()) {
- page = gtk_notebook_get_nth_page (GTK_NOTEBOOK (priv->notebook), 2);
+ page = gtk_notebook_get_nth_page (GTK_NOTEBOOK (priv->notebook), EMPATHY_PREFERENCES_TAB_SPELL);
gtk_widget_show (page);
}
- page = gtk_notebook_get_nth_page (GTK_NOTEBOOK (priv->notebook), 3);
+ page = gtk_notebook_get_nth_page (GTK_NOTEBOOK (priv->notebook), EMPATHY_PREFERENCES_TAB_LOCATION);
#ifdef HAVE_GEOCLUE
gtk_widget_show (page);
#else
#endif
}
+static EmpathyPreferencesTab
+empathy_preferences_tab_from_string (const gchar *str)
+{
+ guint i;
+
+ for (i = 0; i < G_N_ELEMENTS (empathy_preferences_tabs); i++)
+ {
+ if (!tp_strdiff (str, empathy_preferences_tabs[i]))
+ return i;
+ }
+
+ g_warn_if_reached ();
+ return -1;
+}
+
+const gchar *
+empathy_preferences_tab_to_string (EmpathyPreferencesTab tab)
+{
+ g_return_val_if_fail (tab < G_N_ELEMENTS (empathy_preferences_tabs), NULL);
+
+ return empathy_preferences_tabs[tab];
+}
+
GtkWidget *
empathy_preferences_new (GtkWindow *parent)
{
return self;
}
+
+void
+empathy_preferences_show_tab (EmpathyPreferences *self,
+ const gchar *page)
+{
+ EmpathyPreferencesPriv *priv = GET_PRIV (self);
+
+ gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->notebook),
+ empathy_preferences_tab_from_string (page));
+}