[gnome-keysign: 8/15] ui: use label from Glade file rather than the code




commit 48304adfa59ba123850ba2d7e6296acf9884275c
Author: Tobias Mueller <muelli cryptobitch de>
Date:   Fri Apr 8 13:41:40 2022 +0200

    ui: use label from Glade file rather than the code
    
    Hopefully, this makes editing the UI a bit simpler, because one doesn't
    need to dig through the code to change the text.

 keysign/send.py |  9 +++++++--
 keysign/send.ui | 23 +++++++++++++++++++++--
 2 files changed, 28 insertions(+), 4 deletions(-)
---
diff --git a/keysign/send.py b/keysign/send.py
index 78e8192..815b451 100644
--- a/keysign/send.py
+++ b/keysign/send.py
@@ -101,6 +101,7 @@ class SendApp:
         self.stack.remove(self.rb)
         self.key = None
         self.result_label = builder.get_object("result_label")
+        self.success_label = builder.get_object("success_label")
         self.notify = None
         self.internet_option = False
 
@@ -277,15 +278,19 @@ class SendApp:
         self.kpw = None
 
         if success:
-            self.result_label.set_label(_("Key successfully sent.\n"
-                                          "You should receive an email with the signature soon."))
+            self.result_label.hide()
+            self.success_label.show()
             self.stack.set_visible_child(self.rb)
         else:
             if type(message) == WrongPasswordError:
+                self.success_label.hide()
+                self.result_label.show()
                 self.result_label.set_label(_("Could not establish a secure connection.\n"
                                               "Either your partner has entered a wrong code or "
                                               "someone tried to intercept your connection"))
             else:
+                self.success_label.hide()
+                self.result_label.show()
                 self.result_label.set_label(_("An unexpected error occurred:\n%s" % message))
             self.stack.set_visible_child(self.rb)
 
diff --git a/keysign/send.ui b/keysign/send.ui
index 63da20b..0519715 100644
--- a/keysign/send.ui
+++ b/keysign/send.ui
@@ -713,11 +713,30 @@ FDFB F70A 0290 6C30 1813</property>
             <property name="orientation">vertical</property>
             <property name="spacing">6</property>
             <child>
-              <object class="GtkLabel" id="result_label">
+              <object class="GtkLabel" id="success_label">
                 <property name="visible">True</property>
                 <property name="can-focus">False</property>
                 <property name="label" translatable="yes">Key successfully sent.
 You should receive an email with the signature soon.</property>
+                <property name="justify">center</property>
+                <property name="selectable">True</property>
+                <attributes>
+                  <attribute name="weight" value="heavy"/>
+                </attributes>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="result_label">
+                <property name="visible">True</property>
+                <property name="can-focus">False</property>
+                <property name="label" translatable="yes">Key successfully sent.
+You should receive an email with the signature soon.
+You can drag and drop the email here to import your certification.</property>
                 <property name="justify">center</property>
                 <property name="wrap">True</property>
                 <property name="wrap-mode">char</property>
@@ -729,7 +748,7 @@ You should receive an email with the signature soon.</property>
               <packing>
                 <property name="expand">False</property>
                 <property name="fill">True</property>
-                <property name="position">0</property>
+                <property name="position">1</property>
               </packing>
             </child>
           </object>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]