[seahorse/wip/nielsdg/cleanup-keyproperties-email: 4/4] pgp: KeyProperties: put key type in the title
- From: Niels De Graef <nielsdg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [seahorse/wip/nielsdg/cleanup-keyproperties-email: 4/4] pgp: KeyProperties: put key type in the title
- Date: Sun, 13 Jan 2019 10:59:56 +0000 (UTC)
commit d894a1690737f4c2670d7001c95f4ba3a21741fb
Author: Niels De Graef <nielsdegraef gmail com>
Date: Sat Jan 12 10:29:04 2019 +0100
pgp: KeyProperties: put key type in the title
This gives easier access to that info on the other tabs (which is useful
to distinguish why some functions are different).
pgp/seahorse-pgp-key-properties.c | 13 +++++++++++--
pgp/seahorse-pgp-private-key-properties.ui | 30 ++---------------------------
pgp/seahorse-pgp-public-key-properties.ui | 31 ++----------------------------
3 files changed, 15 insertions(+), 59 deletions(-)
---
diff --git a/pgp/seahorse-pgp-key-properties.c b/pgp/seahorse-pgp-key-properties.c
index cc57949c..b504fd01 100644
--- a/pgp/seahorse-pgp-key-properties.c
+++ b/pgp/seahorse-pgp-key-properties.c
@@ -911,6 +911,7 @@ do_owner (SeahorseWidget *swidget)
uids = seahorse_pgp_key_get_uids (pkey);
show_gtkbuilder_widget (swidget, "uids-area", uids != NULL);
if (uids != NULL) {
+ g_autofree gchar *title = NULL;
g_autofree gchar *email_escaped = NULL;
g_autofree gchar *email_label = NULL;
SeahorsePgpUid *uid;
@@ -920,8 +921,16 @@ do_owner (SeahorseWidget *swidget)
label = seahorse_pgp_uid_get_name (uid);
widget = GTK_WIDGET (seahorse_widget_get_widget (swidget, "owner-name-label"));
gtk_label_set_text (GTK_LABEL (widget), label);
- widget = GTK_WIDGET (seahorse_widget_get_widget (swidget, swidget->name));
- gtk_window_set_title (GTK_WINDOW (widget), label);
+
+ widget = GTK_WIDGET (seahorse_widget_get_widget (swidget, swidget->name));
+ if (seahorse_object_get_usage (object) != SEAHORSE_USAGE_PRIVATE_KEY) {
+ /* Translators: the 1st part of the title is the owner's name */
+ title = g_strdup_printf (_("%s ‒ Public key"), label);
+ } else {
+ /* Translators: the 1st part of the title is the owner's name */
+ title = g_strdup_printf (_("%s ‒ Private key"), label);
+ }
+ gtk_window_set_title (GTK_WINDOW (widget), title);
label = seahorse_pgp_uid_get_email (uid);
if (label && *label) {
diff --git a/pgp/seahorse-pgp-private-key-properties.ui b/pgp/seahorse-pgp-private-key-properties.ui
index a5a96adc..1bb644a4 100644
--- a/pgp/seahorse-pgp-private-key-properties.ui
+++ b/pgp/seahorse-pgp-private-key-properties.ui
@@ -338,32 +338,6 @@
<property name="left_attach">1</property>
</packing>
</child>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">1</property>
- <property name="label" translatable="yes">Type</property>
- <style>
- <class name="dim-label"/>
- </style>
- </object>
- <packing>
- <property name="top_attach">2</property>
- <property name="left_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Private PGP Key</property>
- </object>
- <packing>
- <property name="top_attach">2</property>
- <property name="left_attach">1</property>
- </packing>
- </child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
@@ -375,7 +349,7 @@
</style>
</object>
<packing>
- <property name="top_attach">3</property>
+ <property name="top_attach">2</property>
<property name="left_attach">0</property>
</packing>
</child>
@@ -387,7 +361,7 @@
<property name="selectable">True</property>
</object>
<packing>
- <property name="top_attach">3</property>
+ <property name="top_attach">2</property>
<property name="left_attach">1</property>
</packing>
</child>
diff --git a/pgp/seahorse-pgp-public-key-properties.ui b/pgp/seahorse-pgp-public-key-properties.ui
index eec3e3eb..d9590569 100644
--- a/pgp/seahorse-pgp-public-key-properties.ui
+++ b/pgp/seahorse-pgp-public-key-properties.ui
@@ -277,33 +277,6 @@
<property name="left_attach">1</property>
</packing>
</child>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">1</property>
- <property name="label" translatable="yes">Type</property>
- <style>
- <class name="dim-label"/>
- </style>
- </object>
- <packing>
- <property name="top_attach">2</property>
- <property name="left_attach">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Public PGP Key</property>
- </object>
- <packing>
- <property name="top_attach">2</property>
- <property name="left_attach">1</property>
- </packing>
- </child>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
@@ -316,7 +289,7 @@
</style>
</object>
<packing>
- <property name="top_attach">3</property>
+ <property name="top_attach">2</property>
<property name="left_attach">0</property>
</packing>
</child>
@@ -328,7 +301,7 @@
<property name="selectable">True</property>
</object>
<packing>
- <property name="top_attach">3</property>
+ <property name="top_attach">2</property>
<property name="left_attach">1</property>
</packing>
</child>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]