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



commit 2ceeead05af1393bb5841f791d38e6422b86d9cf
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 07254de..3d6b49a 100644
--- a/src/terminal-screen.c
+++ b/src/terminal-screen.c
@@ -1621,6 +1621,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 (!priv->override_command &&
       !g_settings_get_boolean (priv->profile, TERMINAL_PROFILE_USE_CUSTOM_COMMAND_KEY) &&
       priv->shell &&
@@ -1652,6 +1654,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
@@ -1667,6 +1670,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]