[gnome-keysign: 7/16] send: create a new infobar for import result
- From: Tobias Mueller <tobiasmue src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-keysign: 7/16] send: create a new infobar for import result
- Date: Wed, 7 Aug 2019 09:49:33 +0000 (UTC)
commit 99ded1809f99110c320eda00564e3298ac01a4b7
Author: RyuzakiKK <aasonykk gmail com>
Date: Tue Mar 12 15:33:28 2019 +0100
send: create a new infobar for import result
keysign/keylistwidget.py | 12 +++--
keysign/send.py | 37 ++++++-------
keysign/send.ui | 131 +++++++++++++++++++++++------------------------
3 files changed, 92 insertions(+), 88 deletions(-)
---
diff --git a/keysign/keylistwidget.py b/keysign/keylistwidget.py
index 86a8719..186add1 100755
--- a/keysign/keylistwidget.py
+++ b/keysign/keylistwidget.py
@@ -136,10 +136,14 @@ class KeyListWidget(Gtk.HBox):
self.listbox = builder.get_object("keys_listbox")
self.code_spinner = builder.get_object("code_spinner")
- self.ib = builder.get_object('infobar_internet')
- fix_infobar(self.ib)
- self.label_ib = builder.get_object('label_internet')
- self.image_ib = builder.get_object('image_ib')
+ self.ib_internet = builder.get_object('infobar_internet')
+ fix_infobar(self.ib_internet)
+ self.label_ib_internet = builder.get_object('label_internet')
+
+ self.ib_import = builder.get_object('infobar_import')
+ fix_infobar(self.ib_import)
+ self.label_ib_import = builder.get_object('label_import')
+ self.image_ib_import = builder.get_object('image_import')
if len(list(keys)) <= 0:
infobar = builder.get_object("infobar")
diff --git a/keysign/send.py b/keysign/send.py
index 90b5c2f..dd1307e 100644
--- a/keysign/send.py
+++ b/keysign/send.py
@@ -112,7 +112,6 @@ class SendApp:
log.debug("We are trying to send a key, no imports at this stage")
return
- self.klw.ib.hide()
filename = data.get_text()
# If we don't have a filename it means that the user maybe dropped
# an attachment or an entire email.
@@ -139,7 +138,7 @@ class SendApp:
# Deactivate any old connection attempt
self._deactivate_timer()
self.deactivate()
- self.klw.ib.hide()
+ self.klw.ib_internet.hide()
self.key = key
log.info("Activated key %r", key)
####
@@ -194,30 +193,32 @@ class SendApp:
else:
self.show_result(success, message)
+ def on_ib_closed(self, widget, data):
+ if Gtk.ResponseType.CLOSE == data:
+ widget.hide()
+
def slow_connection(self):
- self.klw.image_ib.set_from_icon_name(Gtk.STOCK_DIALOG_WARNING, Gtk.IconSize.BUTTON)
- self.klw.label_ib.set_label(_("Still trying to get a connection to the Internet. "
- "It appears to be slow or unavailable."))
- self.klw.ib.show()
+ self.klw.label_ib_internet.set_label(_("Still trying to get a connection to the Internet. "
+ "It appears to be slow or unavailable."))
+ self.klw.ib_internet.show()
log.info("Slow Internet connection")
def no_connection(self):
- self.klw.image_ib.set_from_icon_name(Gtk.STOCK_DIALOG_WARNING, Gtk.IconSize.BUTTON)
- self.klw.label_ib.set_label(_("There isn't an Internet connection!"))
- self.klw.ib.show()
+ self.klw.label_ib_internet.set_label(_("There isn't an Internet connection!"))
+ self.klw.ib_internet.show()
log.info("No Internet connection")
def signature_imported(self):
- self.klw.image_ib.set_from_icon_name(Gtk.STOCK_OK, Gtk.IconSize.BUTTON)
- self.klw.label_ib.set_label(_("The signature has been successfully imported!"))
- self.klw.ib.show()
+ self.klw.image_ib_import.set_from_icon_name(Gtk.STOCK_OK, Gtk.IconSize.BUTTON)
+ self.klw.label_ib_import.set_label(_("The signature has been successfully imported!"))
+ self.klw.ib_import.show()
log.info("Signature imported")
def signature_import_error(self):
- self.klw.image_ib.set_from_icon_name(Gtk.STOCK_DIALOG_ERROR, Gtk.IconSize.BUTTON)
- self.klw.label_ib.set_label(_("An error occurred while trying to import the signature.\n"
- "Please double check the correctness of the chosen signature."))
- self.klw.ib.show()
+ self.klw.image_ib_import.set_from_icon_name(Gtk.STOCK_DIALOG_ERROR, Gtk.IconSize.BUTTON)
+ self.klw.label_ib_import.set_label(_("An error occurred while trying to import the signature.\n"
+ "Please double check the correctness of the chosen signature."))
+ self.klw.ib_import.show()
log.info("Signature import error")
def create_keypresent(self, discovery_code, discovery_data):
@@ -233,7 +234,7 @@ class SendApp:
self.stack_saved_visible_child = self.stack.get_visible_child()
self.stack.set_visible_child(self.kpw)
log.debug('Setting kpw: %r', self.kpw)
- self.klw.ib.hide()
+ self.klw.ib_internet.hide()
self.klw.code_spinner.stop()
def show_result(self, success, message):
@@ -274,7 +275,7 @@ class SendApp:
def set_internet_option(self, value):
self._deactivate_timer()
self.deactivate()
- self.klw.ib.hide()
+ self.klw.ib_internet.hide()
self.klw.code_spinner.stop()
self.internet_option = value
diff --git a/keysign/send.ui b/keysign/send.ui
index 7610c0d..9316fd7 100644
--- a/keysign/send.ui
+++ b/keysign/send.ui
@@ -1,10 +1,73 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.20.0 -->
+<!-- Generated with glade 3.22.1 -->
<interface>
<requires lib="gtk+" version="3.16"/>
<object class="GtkApplicationWindow" id="appwindow">
<property name="can_focus">False</property>
<property name="title" translatable="yes">Select and send key</property>
+ <child type="titlebar">
+ <object class="GtkHeaderBar" id="headerbar">
+ <property name="name">headerbar</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="title" translatable="yes">Select and Send key</property>
+ <property name="subtitle">Keylist</property>
+ <property name="show_close_button">True</property>
+ <child>
+ <object class="GtkButton" id="headerbutton">
+ <property name="label">gtk-go-back</property>
+ <property name="visible">True</property>
+ <property name="sensitive">False</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ <property name="always_show_image">True</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkToggleButton" id="internet_toggle">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="always_show_image">True</property>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkImage">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-network</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_left">5</property>
+ <property name="label" translatable="yes">Internet</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
<child>
<object class="GtkStack" id="send_stack">
<property name="visible">True</property>
@@ -264,7 +327,7 @@ Please use, e.g. Seahorse to create one.</property>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">2</property>
+ <property name="position">3</property>
</packing>
</child>
</object>
@@ -568,69 +631,5 @@ You should receive soon an email with the signature.</property>
</child>
</object>
</child>
- <child type="titlebar">
- <object class="GtkHeaderBar" id="headerbar">
- <property name="name">headerbar</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="title" translatable="yes">Select and Send key</property>
- <property name="subtitle">Keylist</property>
- <property name="show_close_button">True</property>
- <child>
- <object class="GtkButton" id="headerbutton">
- <property name="label">gtk-go-back</property>
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_stock">True</property>
- <property name="always_show_image">True</property>
- </object>
- </child>
- <child>
- <object class="GtkToggleButton" id="internet_toggle">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="tooltip_text" translatable="yes">Uses the Internet to transport the key rather
than the local network and Bluetooth (if available)</property>
- <property name="always_show_image">True</property>
- <child>
- <object class="GtkBox">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkImage">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="stock">gtk-network</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin_left">5</property>
- <property name="label" translatable="yes">Internet</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- </child>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- </child>
</object>
</interface>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]