summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3e74817)
raw | patch | inline | side by side (parent: 3e74817)
author | Sebastian Harl <sh@tokkee.org> | |
Fri, 21 Oct 2011 13:07:45 +0000 (15:07 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Fri, 21 Oct 2011 13:07:45 +0000 (15:07 +0200) |
… applying basename() to the filename specified on the command-line.
src/tpdfview.c | patch | blob | history |
diff --git a/src/tpdfview.c b/src/tpdfview.c
index d46aef030a44a977ebd72a4ed0d5b0f1aa40ca27..b92d5440799e212cf3314c8be6da87d544b0ade4 100644 (file)
--- a/src/tpdfview.c
+++ b/src/tpdfview.c
GtkWidget *win = NULL;
GtkWidget *tpdfv = NULL;
+ char win_title[1024];
+
GdkColor bg_color;
+ char *filename;
+
gtk_init(&argc, &argv);
while (42) {
exit_usage(argv[0], 1);
}
- tpdfv = gtk_tpdfv_new(argv[optind]);
+ filename = argv[optind];
+
+ tpdfv = gtk_tpdfv_new(filename);
if (! tpdfv)
return 1;
if (! win)
return 1;
+ snprintf(win_title, sizeof(win_title), "tpdfview: %s",
+ basename(filename));
+ gtk_window_set_title(GTK_WINDOW(win), win_title);
+
gtk_container_add(GTK_CONTAINER(win), tpdfv);
g_signal_connect(G_OBJECT(win), "destroy",