[gnome-terminal/wip/rishi/command-notify: 4/4] Sprinkle debug messages for notifications



commit 45a237633a4a6ac771604f75919a1e0820fd45f7
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu Jan 29 11:47:21 2015 +0100

    Sprinkle debug messages for notifications
    
    This can be useful for finding out whether the escape sequence wasn't
    emitted or the filtering was faulty.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=711059

 src/terminal-debug.c  |    1 +
 src/terminal-debug.h  |    3 ++-
 src/terminal-screen.c |    4 ++++
 3 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/terminal-debug.c b/src/terminal-debug.c
index 0ff321f..dac79c3 100644
--- a/src/terminal-debug.c
+++ b/src/terminal-debug.c
@@ -38,6 +38,7 @@ _terminal_debug_init(void)
     { "settings-list", TERMINAL_DEBUG_SETTINGS_LIST },
     { "appmenu",       TERMINAL_DEBUG_APPMENU       },
     { "search",        TERMINAL_DEBUG_SEARCH        },
+    { "notifications", TERMINAL_DEBUG_NOTIFICATIONS },
   };
 
   _terminal_debug_flags = g_parse_debug_string (g_getenv ("GNOME_TERMINAL_DEBUG"),
diff --git a/src/terminal-debug.h b/src/terminal-debug.h
index 5dc3ca4..7499ebe 100644
--- a/src/terminal-debug.h
+++ b/src/terminal-debug.h
@@ -34,7 +34,8 @@ typedef enum {
   TERMINAL_DEBUG_PROFILE       = 1 << 6,
   TERMINAL_DEBUG_SETTINGS_LIST = 1 << 7,
   TERMINAL_DEBUG_APPMENU       = 1 << 8,
-  TERMINAL_DEBUG_SEARCH        = 1 << 9
+  TERMINAL_DEBUG_SEARCH        = 1 << 9,
+  TERMINAL_DEBUG_NOTIFICATIONS = 1 << 10
 } TerminalDebugFlags;
 
 void _terminal_debug_init(void);
diff --git a/src/terminal-screen.c b/src/terminal-screen.c
index f7e0213..8111c34 100644
--- a/src/terminal-screen.c
+++ b/src/terminal-screen.c
@@ -1614,6 +1614,8 @@ terminal_screen_notification_received (VteTerminal *terminal,
   TerminalScreenPrivate *priv = screen->priv;
   TerminalWindow *window;
 
+  _terminal_debug_print (TERMINAL_DEBUG_NOTIFICATIONS, "Notification received: [%s]: %s\n", summary, body);
+
   if (G_UNLIKELY (!priv->shell_prompt_shown))
     {
       priv->shell_prompt_shown = TRUE;
@@ -1645,6 +1647,7 @@ terminal_screen_notification_received (VteTerminal *terminal,
           tab_label = gtk_notebook_get_tab_label (GTK_NOTEBOOK (mdi_container), GTK_WIDGET 
(screen_container));
           terminal_tab_label_set_bold (TERMINAL_TAB_LABEL (tab_label), TRUE);
           terminal_tab_label_set_icon (TERMINAL_TAB_LABEL (tab_label), "dialog-information-symbolic", 
summary);
+          _terminal_debug_print (TERMINAL_DEBUG_NOTIFICATIONS, "Notify tab\n");
         }
     }
   else
@@ -1660,6 +1663,7 @@ terminal_screen_notification_received (VteTerminal *terminal,
 
       app = terminal_app_get ();
       g_application_send_notification (G_APPLICATION (app), priv->uuid, notification);
+      _terminal_debug_print (TERMINAL_DEBUG_NOTIFICATIONS, "Notify desktop\n");
     }
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]