[gitg] Fix gitg window title to match other GNOME applications
- From: Sindhu S <sindhus src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gitg] Fix gitg window title to match other GNOME applications
- Date: Fri, 3 May 2013 17:51:20 +0000 (UTC)
commit 5104c62bc1adfa6f1c5cd7afbc82dfbac23f4820
Author: Sindhu S <sindhus live in>
Date: Fri May 3 19:43:38 2013 +0530
Fix gitg window title to match other GNOME applications
Gitg windows now show title of the format:
repository-name (preceding with ~ if from $USER directory or
/path/to/parent/directory) - program-name
gitg/gitg-window.vala | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/gitg/gitg-window.vala b/gitg/gitg-window.vala
index 6e57ddf..12e526a 100644
--- a/gitg/gitg-window.vala
+++ b/gitg/gitg-window.vala
@@ -119,7 +119,14 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable, Gtk.
File? workdir = d_repository.get_workdir();
if (workdir != null)
{
- title = "(%s) - gitg".printf(workdir.get_parse_name());
+ string parent_path = workdir.get_parent().get_path();
+ bool contains_home_dir = parent_path.has_prefix(Environment.get_home_dir());
+
+ if (contains_home_dir)
+ {
+ parent_path = parent_path.replace(Environment.get_home_dir(), "~");
+ }
+ title = @"$(d_repository.name) ($parent_path) - gitg";
}
d_header_bar.set_title(d_repository.name);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]