]> git.0d.be Git - empathy.git/blobdiff - src/empathy-debug-window.c
Merge branch 'gnome-3-8'
[empathy.git] / src / empathy-debug-window.c
index 57549f4fc9fe5d897d410b525cade6cfb971f8cc..e4f5e21d646b2f00b41abb7289445604267d299d 100644 (file)
 */
 
 #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>
 
-#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 "empathy-geometry.h"
+#include "empathy-ui-utils.h"
+#include "empathy-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-debug-window.h"
+#define DEBUG_FLAG EMPATHY_DEBUG_OTHER
+#include "empathy-debug.h"
 
 G_DEFINE_TYPE (EmpathyDebugWindow, empathy_debug_window,
     GTK_TYPE_WINDOW)
@@ -390,7 +376,7 @@ debug_window_get_messages_cb (GObject *object,
   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
@@ -424,6 +410,7 @@ debug_window_get_messages_cb (GObject *object,
           COL_PROXY, debug,
           -1);
     }
+  g_ptr_array_unref (messages);
 
   g_free (proxy_service_name);
 
@@ -795,21 +782,21 @@ get_cm_display_name (EmpathyDebugWindow *self,
   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)
     {
@@ -1019,7 +1006,7 @@ debug_window_name_owner_changed_cb (TpDBusDaemon *proxy,
       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;
@@ -1099,7 +1086,7 @@ debug_window_name_owner_changed_cb (TpDBusDaemon *proxy,
 
       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;
@@ -1311,7 +1298,7 @@ debug_window_menu_copy_activate_cb (GtkMenuItem *menu_item,
 
   message = tp_debug_message_get_message (msg);
 
-  if (EMP_STR_EMPTY (message))
+  if (TPAW_STR_EMPTY (message))
     {
       DEBUG ("Log message is empty");
       return;
@@ -1848,6 +1835,7 @@ am_prepared_cb (GObject *am,
   GtkListStore *level_store;
   GtkTreeIter iter;
   GError *error = NULL;
+  GtkWidget *infobar, *content;
 
   if (!tp_proxy_prepare_finish (am, res, &error))
     {
@@ -1855,6 +1843,8 @@ am_prepared_cb (GObject *am,
       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);
   empathy_geometry_bind (GTK_WINDOW (object), "debug-window");
@@ -2023,6 +2013,32 @@ am_prepared_cb (GObject *am,
   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);
@@ -2031,7 +2047,7 @@ am_prepared_cb (GObject *am,
       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,
@@ -2047,7 +2063,12 @@ am_prepared_cb (GObject *am,
       (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);