*/
#include "config.h"
-
-#include <string.h>
+#include "empathy-debug-window.h"
#include <glib/gi18n.h>
-#include <gtk/gtk.h>
-#include <gio/gio.h>
-#include <gdk/gdkkeysyms.h>
#include <libsoup/soup.h>
+#include <tp-account-widgets/tpaw-utils.h>
+#include <telepathy-glib/telepathy-glib-dbus.h>
-#define DEBUG_FLAG EMPATHY_DEBUG_OTHER
-#include <libempathy/empathy-debug.h>
-#include <libempathy/empathy-utils.h>
-
-#include <libempathy-gtk/empathy-account-chooser.h>
-#include <libempathy-gtk/empathy-geometry.h>
-#include <libempathy-gtk/empathy-ui-utils.h>
-
-#include <telepathy-glib/dbus.h>
-#include <telepathy-glib/interfaces.h>
-#include <telepathy-glib/util.h>
-#include <telepathy-glib/proxy-subclass.h>
-#include <telepathy-glib/account-manager.h>
-
-#include "extensions/extensions.h"
+#include "empathy-geometry.h"
+#include "empathy-ui-utils.h"
+#include "empathy-utils.h"
-#include "empathy-debug-window.h"
+#define DEBUG_FLAG EMPATHY_DEBUG_OTHER
+#include "empathy-debug.h"
G_DEFINE_TYPE (EmpathyDebugWindow, empathy_debug_window,
GTK_TYPE_WINDOW)
messages = tp_debug_client_get_messages_finish (debug, result, &error);
if (messages == NULL)
{
- DEBUG ("Failed to get debug messsages: %s", error->message);
+ DEBUG ("Failed to get debug messages: %s", error->message);
g_error_free (error);
/* We want to set the window sensitivity to false only when proxy for the
COL_PROXY, debug,
-1);
}
+ g_ptr_array_unref (messages);
g_free (proxy_service_name);
GList *accounts, *ptr;
char *retval;
- accounts = tp_account_manager_get_valid_accounts (self->priv->am);
+ accounts = tp_account_manager_dup_valid_accounts (self->priv->am);
for (ptr = accounts; ptr != NULL; ptr = ptr->next)
{
TpAccount *account = TP_ACCOUNT (ptr->data);
- if (!tp_strdiff (tp_account_get_connection_manager (account), cm_name))
+ if (!tp_strdiff (tp_account_get_cm_name (account), cm_name))
{
g_hash_table_insert (protocols,
- (char *) tp_account_get_protocol (account),
+ (char *) tp_account_get_protocol_name (account),
GUINT_TO_POINTER (TRUE));
}
}
- g_list_free (accounts);
+ g_list_free_full (accounts, g_object_unref);
if (g_hash_table_size (protocols) > 0)
{
fill_service_chooser_data_free (data);
}
-static void
-debug_window_list_connection_names_cb (const gchar * const *names,
- gsize n,
- const gchar * const *cms,
- const gchar * const *protocols,
- const GError *error,
- gpointer user_data,
- GObject *weak_object)
-{
- EmpathyDebugWindow *self = user_data;
- guint i;
- TpDBusDaemon *dbus;
- GError *error2 = NULL;
-
- if (error != NULL)
- {
- DEBUG ("list_connection_names failed: %s", error->message);
- return;
- }
-
- dbus = tp_dbus_daemon_dup (&error2);
-
- if (error2 != NULL)
- {
- DEBUG ("Failed to dup TpDBusDaemon.");
- g_error_free (error2);
- return;
- }
-
- for (i = 0; cms[i] != NULL; i++)
- {
- FillServiceChooserData *data = fill_service_chooser_data_new (
- self, cms[i], SERVICE_TYPE_CM);
-
- tp_cli_dbus_daemon_call_get_name_owner (dbus, -1,
- names[i], debug_window_get_name_owner_cb,
- data, NULL, NULL);
-
- self->priv->services_detected ++;
- }
-
- g_object_unref (dbus);
-}
-
static void
debug_window_name_owner_changed_cb (TpDBusDaemon *proxy,
const gchar *arg0,
return;
}
- if (EMP_STR_EMPTY (arg1) && !EMP_STR_EMPTY (arg2))
+ if (TPAW_STR_EMPTY (arg1) && !TPAW_STR_EMPTY (arg2))
{
GtkTreeIter *found_at_iter = NULL;
gchar *display_name;
g_free (display_name);
}
- else if (!EMP_STR_EMPTY (arg1) && EMP_STR_EMPTY (arg2))
+ else if (!TPAW_STR_EMPTY (arg1) && TPAW_STR_EMPTY (arg2))
{
/* A service died */
GtkTreeIter *iter = NULL;
}
static void
-add_client (EmpathyDebugWindow *self,
- const gchar *name)
+add_service (EmpathyDebugWindow *self,
+ const gchar *bus_name,
+ const gchar *display_name,
+ ServiceType type)
{
- const gchar *suffix;
FillServiceChooserData *data;
- suffix = name + strlen (TP_CLIENT_BUS_NAME_BASE);
-
- data = fill_service_chooser_data_new (self, suffix, SERVICE_TYPE_CLIENT);
+ data = fill_service_chooser_data_new (self, display_name, type);
tp_cli_dbus_daemon_call_get_name_owner (self->priv->dbus, -1,
- name, debug_window_get_name_owner_cb, data, NULL, NULL);
+ bus_name, debug_window_get_name_owner_cb, data, NULL, NULL);
self->priv->services_detected ++;
}
{
if (g_str_has_prefix (names[i], TP_CLIENT_BUS_NAME_BASE))
{
- add_client (self, names[i]);
+ add_service (self, names[i],
+ names[i] + strlen (TP_CLIENT_BUS_NAME_BASE), SERVICE_TYPE_CLIENT);
+ }
+ else if (g_str_has_prefix (names[i], TP_CM_BUS_NAME_BASE))
+ {
+ add_service (self, names[i],
+ names[i] + strlen (TP_CM_BUS_NAME_BASE), SERVICE_TYPE_CM);
}
}
}
self->priv->services_detected = 0;
self->priv->name_owner_cb_count = 0;
- /* Add CMs to list */
- tp_list_connection_names (self->priv->dbus,
- debug_window_list_connection_names_cb, self, NULL, NULL);
-
/* add Mission Control */
active_buffer= new_list_store_for_service ();
pause_buffer = new_list_store_for_service ();
message = tp_debug_message_get_message (msg);
- if (EMP_STR_EMPTY (message))
+ if (TPAW_STR_EMPTY (message))
{
DEBUG ("Log message is empty");
return;
GtkListStore *level_store;
GtkTreeIter iter;
GError *error = NULL;
+ GtkWidget *infobar, *content;
if (!tp_proxy_prepare_finish (am, res, &error))
{
g_clear_error (&error);
}
+ empathy_set_css_provider (GTK_WIDGET (object));
+
gtk_window_set_title (GTK_WINDOW (object), _("Debug Window"));
- gtk_window_set_default_size (GTK_WINDOW (object), 800, 400);
+ gtk_widget_set_size_request (GTK_WIDGET (object), 600, 300);
empathy_geometry_bind (GTK_WINDOW (object), "debug-window");
g_signal_connect (object, "key-press-event",
g_signal_connect (self->priv->level_filter, "changed",
G_CALLBACK (debug_window_filter_changed_cb), object);
+ /* Info bar */
+ infobar = gtk_info_bar_new ();
+ gtk_info_bar_set_message_type (GTK_INFO_BAR (infobar), GTK_MESSAGE_INFO);
+
+ label = gtk_label_new (
+ _("Even if they don't display passwords, logs can contain sensitive "
+ "information such as your list of contacts or the messages you "
+ "recently sent or received.\nIf you don't want to see such "
+ "information available in a public bug report, you "
+ "can choose to limit the visibility of your bug to "
+ "Empathy developers when reporting it by displaying "
+ "the advanced fields in the "
+ "<a href=\"https://bugzilla.gnome.org/enter_bug.cgi?product=empathy\">"
+ "bug report</a>."));
+ gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
+ gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+ gtk_style_context_add_class (gtk_widget_get_style_context (label),
+ GTK_STYLE_CLASS_DIM_LABEL);
+
+ content = gtk_info_bar_get_content_area (GTK_INFO_BAR (infobar));
+ gtk_box_pack_start (GTK_BOX (content), label, FALSE, FALSE, 0);
+
+ gtk_widget_show (infobar);
+ gtk_widget_show (label);
+ gtk_box_pack_start (GTK_BOX (vbox), infobar, FALSE, FALSE, 0);
+
/* Debug treeview */
self->priv->view = gtk_tree_view_new ();
gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (self->priv->view), TRUE);
G_CALLBACK (debug_window_button_press_event_cb), object);
renderer = gtk_cell_renderer_text_new ();
- g_object_set (renderer, "yalign", 0, NULL);
+ g_object_set (renderer, "yalign", (gfloat) 0, NULL);
gtk_tree_view_insert_column_with_data_func (GTK_TREE_VIEW (self->priv->view),
-1, _("Time"), renderer,
(GtkTreeCellDataFunc) debug_window_level_formatter, NULL, NULL);
renderer = gtk_cell_renderer_text_new ();
- g_object_set (renderer, "family", "Monospace", NULL);
+
+ g_object_set (renderer,
+ "family", "Monospace",
+ "ellipsize", PANGO_ELLIPSIZE_END,
+ NULL);
+
gtk_tree_view_insert_column_with_data_func (GTK_TREE_VIEW (self->priv->view),
-1, _("Message"), renderer,
(GtkTreeCellDataFunc) debug_window_message_formatter, NULL, NULL);