aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2010-01-12 00:40:43 -0500
committerSteven Rostedt <rostedt@goodmis.org>2010-01-12 00:40:43 -0500
commitc5422273b98f9bf2cfa5c7db3f83565718062e2a (patch)
tree68bd8cc8901fed2fdf7e7320ba67c65be769afea
parent9b744741a3070f535cf93f8d56022bde6b2e36aa (diff)
kernel-shark: Show file name in title bar
Display the currently loaded file in the title bar. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--kernel-shark.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/kernel-shark.c b/kernel-shark.c
index 669b8f9..5917029 100644
--- a/kernel-shark.c
+++ b/kernel-shark.c
@@ -120,8 +120,21 @@ static void free_info(struct shark_info *info)
120 free(info); 120 free(info);
121} 121}
122 122
123/* Callback for the clicked signal of the Load button */ 123static void update_title(GtkWidget *window, const gchar *file)
124{
125 GString *gstr;
126 gchar *str;
127
128 gstr = g_string_new("kernelshark");
129 g_string_append_printf(gstr, "(%s)", basename(file));
130 str = g_string_free(gstr, FALSE);
131
132 gtk_window_set_title(GTK_WINDOW(window), str);
133 g_free(str);
134}
135
124static void 136static void
137/* Callback for the clicked signal of the Load button */
125load_clicked (gpointer data) 138load_clicked (gpointer data)
126{ 139{
127 struct shark_info *info = data; 140 struct shark_info *info = data;
@@ -143,6 +156,7 @@ load_clicked (gpointer data)
143 info->handle = handle; 156 info->handle = handle;
144 trace_graph_load_handle(info->ginfo, handle); 157 trace_graph_load_handle(info->ginfo, handle);
145 trace_view_reload(info->treeview, handle, info->spin); 158 trace_view_reload(info->treeview, handle, info->spin);
159 update_title(info->window, filename);
146 } 160 }
147 g_free(filename); 161 g_free(filename);
148 } 162 }
@@ -592,6 +606,9 @@ void kernel_shark(int argc, char **argv)
592 window = gtk_window_new(GTK_WINDOW_TOPLEVEL); 606 window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
593 info->window = window; 607 info->window = window;
594 608
609 if (input_file)
610 update_title(window, input_file);
611
595 /* --- Top Level Vbox --- */ 612 /* --- Top Level Vbox --- */
596 613
597 vbox = gtk_vbox_new(FALSE, 0); 614 vbox = gtk_vbox_new(FALSE, 0);