[gnome-keysign: 9/15] ui: also use password error from glade file




commit 1da8df267acc8078b8325b6a0ab1c677d885a8e8
Author: Tobias Mueller <muelli cryptobitch de>
Date:   Fri Apr 8 13:46:16 2022 +0200

    ui: also use password error from glade file

 keysign/send.py |  9 +++++----
 keysign/send.ui | 23 +++++++++++++++++++----
 2 files changed, 24 insertions(+), 8 deletions(-)
---
diff --git a/keysign/send.py b/keysign/send.py
index 815b451..65d09a8 100644
--- a/keysign/send.py
+++ b/keysign/send.py
@@ -102,6 +102,7 @@ class SendApp:
         self.key = None
         self.result_label = builder.get_object("result_label")
         self.success_label = builder.get_object("success_label")
+        self.password_error_label = builder.get_object("password_error_label")
         self.notify = None
         self.internet_option = False
 
@@ -280,16 +281,16 @@ class SendApp:
         if success:
             self.result_label.hide()
             self.success_label.show()
+            self.password_error_label.hide()
             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"))
+                self.result_label.hide()
+                self.password_error_label.show()
             else:
                 self.success_label.hide()
+                self.password_error_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 0519715..8fc28c5 100644
--- a/keysign/send.ui
+++ b/keysign/send.ui
@@ -717,7 +717,8 @@ FDFB F70A 0290 6C30 1813</property>
                 <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>
+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="selectable">True</property>
                 <attributes>
@@ -734,9 +735,7 @@ You should receive an email with the signature soon.</property>
               <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="label" translatable="yes">An unexpected error occurred.</property>
                 <property name="justify">center</property>
                 <property name="wrap">True</property>
                 <property name="wrap-mode">char</property>
@@ -751,6 +750,22 @@ You can drag and drop the email here to import your certification.</property>
                 <property name="position">1</property>
               </packing>
             </child>
+            <child>
+              <object class="GtkLabel" id="password_error_label">
+                <property name="can-focus">False</property>
+                <property name="label" translatable="yes">Could not establish a secure connection.
+Either your partner has entered a wrong code or someone tried to intercept your connection.</property>
+                <property name="justify">center</property>
+                <attributes>
+                  <attribute name="weight" value="heavy"/>
+                </attributes>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
           </object>
           <packing>
             <property name="name">page2</property>


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