M himitsu_gtk/ui/main.glade => himitsu_gtk/ui/main.glade +270 -229
@@ 31,138 31,170 @@
<property name="default-height">600</property>
<signal name="destroy" handler="on_main_window_destroy" swapped="no"/>
<child>
- <object class="GtkStack" id="statusstack">
+ <object class="GtkOverlay">
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
- <object class="GtkBox">
+ <object class="GtkStack" id="statusstack">
<property name="visible">True</property>
<property name="can-focus">False</property>
- <property name="orientation">vertical</property>
<child>
- <object class="HdyLeaflet" id="leaflet">
+ <object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
- <signal name="notify::folded" handler="on_leaflet_change" swapped="no"/>
- <signal name="notify::visible-child" handler="on_leaflet_change" swapped="no"/>
+ <property name="orientation">vertical</property>
<child>
- <object class="GtkBox" id="keys">
+ <object class="HdyLeaflet" id="leaflet">
<property name="visible">True</property>
<property name="can-focus">False</property>
- <property name="hexpand">True</property>
- <property name="orientation">vertical</property>
+ <signal name="notify::folded" handler="on_leaflet_change" swapped="no"/>
+ <signal name="notify::visible-child" handler="on_leaflet_change" swapped="no"/>
<child>
- <object class="GtkSearchEntry" id="search">
+ <object class="GtkBox" id="keys">
<property name="visible">True</property>
- <property name="can-focus">True</property>
- <property name="margin-start">8</property>
- <property name="margin-end">8</property>
- <property name="margin-top">8</property>
- <property name="margin-bottom">8</property>
- <property name="primary-icon-name">edit-find-symbolic</property>
- <property name="primary-icon-activatable">False</property>
- <property name="primary-icon-sensitive">False</property>
- <signal name="search-changed" handler="on_search_changed" swapped="no"/>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkScrolledWindow">
- <property name="visible">True</property>
- <property name="can-focus">True</property>
- <property name="min-content-width">300</property>
+ <property name="can-focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="orientation">vertical</property>
<child>
- <object class="GtkViewport">
+ <object class="GtkSearchEntry" id="search">
<property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="shadow-type">none</property>
+ <property name="can-focus">True</property>
+ <property name="margin-start">8</property>
+ <property name="margin-end">8</property>
+ <property name="margin-top">8</property>
+ <property name="margin-bottom">8</property>
+ <property name="primary-icon-name">edit-find-symbolic</property>
+ <property name="primary-icon-activatable">False</property>
+ <property name="primary-icon-sensitive">False</property>
+ <signal name="search-changed" handler="on_search_changed" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow">
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="min-content-width">300</property>
<child>
- <object class="GtkListBox" id="keylist">
+ <object class="GtkViewport">
<property name="visible">True</property>
<property name="can-focus">False</property>
- <signal name="row-activated" handler="on_keyrow_activated" swapped="no"/>
+ <property name="shadow-type">none</property>
+ <child>
+ <object class="GtkListBox" id="keylist">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <signal name="row-activated" handler="on_keyrow_activated" swapped="no"/>
+ </object>
+ </child>
</object>
</child>
</object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
</child>
</object>
<packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
+ <property name="name">sidebar</property>
</packing>
</child>
- </object>
- <packing>
- <property name="name">sidebar</property>
- </packing>
- </child>
- <child>
- <object class="GtkSeparator">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="orientation">vertical</property>
- <style>
- <class name="sidebar"/>
- </style>
- </object>
- </child>
- <child>
- <object class="GtkStack" id="mainstack">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="hexpand">True</property>
<child>
- <object class="HdyStatusPage">
+ <object class="GtkSeparator">
<property name="visible">True</property>
<property name="can-focus">False</property>
- <property name="icon-name">nl.brixit.Keyring</property>
- <property name="title" translatable="yes">Keyring</property>
- <property name="description" translatable="yes">Select a key on the left for key information</property>
- <child>
- <placeholder/>
- </child>
+ <property name="orientation">vertical</property>
+ <style>
+ <class name="sidebar"/>
+ </style>
</object>
- <packing>
- <property name="name">nokey</property>
- <property name="title" translatable="yes">No key</property>
- </packing>
</child>
<child>
- <object class="GtkScrolledWindow">
+ <object class="GtkStack" id="mainstack">
<property name="visible">True</property>
- <property name="can-focus">True</property>
- <property name="min-content-width">300</property>
+ <property name="can-focus">False</property>
+ <property name="hexpand">True</property>
<child>
- <object class="GtkViewport">
+ <object class="HdyStatusPage">
<property name="visible">True</property>
<property name="can-focus">False</property>
- <property name="shadow-type">none</property>
+ <property name="icon-name">nl.brixit.Keyring</property>
+ <property name="title" translatable="yes">Keyring</property>
+ <property name="description" translatable="yes">Select a key on the left for key information</property>
<child>
- <object class="GtkBox">
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="name">nokey</property>
+ <property name="title" translatable="yes">No key</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow">
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="min-content-width">300</property>
+ <child>
+ <object class="GtkViewport">
<property name="visible">True</property>
<property name="can-focus">False</property>
- <property name="orientation">vertical</property>
+ <property name="shadow-type">none</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
- <property name="margin-start">12</property>
- <property name="margin-end">12</property>
- <property name="margin-top">12</property>
- <property name="margin-bottom">12</property>
- <property name="hexpand">True</property>
+ <property name="orientation">vertical</property>
<child>
- <object class="GtkButton" id="decrypt">
- <property name="label" translatable="yes">Decrypt</property>
+ <object class="GtkBox">
<property name="visible">True</property>
- <property name="can-focus">True</property>
- <property name="receives-default">True</property>
- <signal name="clicked" handler="on_decrypt_clicked" swapped="no"/>
+ <property name="can-focus">False</property>
+ <property name="margin-start">12</property>
+ <property name="margin-end">12</property>
+ <property name="margin-top">12</property>
+ <property name="margin-bottom">12</property>
+ <property name="hexpand">True</property>
+ <child>
+ <object class="GtkButton" id="decrypt">
+ <property name="label" translatable="yes">Decrypt</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <signal name="clicked" handler="on_decrypt_clicked" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <object class="GtkButton" id="delete">
+ <property name="label" translatable="yes">Delete</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <signal name="clicked" handler="on_delete_clicked" swapped="no"/>
+ <style>
+ <class name="destructive-action"/>
+ </style>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack-type">end</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">False</property>
@@ 171,218 203,227 @@
</packing>
</child>
<child>
- <placeholder/>
+ <object class="GtkListBox" id="keyinfo">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="margin-start">12</property>
+ <property name="margin-end">12</property>
+ <property name="margin-top">12</property>
+ <property name="margin-bottom">12</property>
+ <property name="selection-mode">none</property>
+ <property name="activate-on-single-click">False</property>
+ <signal name="row-activated" handler="on_key_row_activate" swapped="no"/>
+ <style>
+ <class name="content"/>
+ </style>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
</child>
<child>
- <object class="GtkButton" id="delete">
- <property name="label" translatable="yes">Delete</property>
+ <object class="GtkLabel">
<property name="visible">True</property>
- <property name="can-focus">True</property>
- <property name="receives-default">True</property>
- <signal name="clicked" handler="on_delete_clicked" swapped="no"/>
+ <property name="can-focus">False</property>
+ <property name="halign">start</property>
+ <property name="margin-start">12</property>
+ <property name="margin-end">12</property>
+ <property name="margin-top">12</property>
+ <property name="margin-bottom">12</property>
+ <property name="label" translatable="yes">Double click on a row to copy the value to the clipboard</property>
+ <property name="wrap">True</property>
<style>
- <class name="destructive-action"/>
+ <class name="dim-label"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="pack-type">end</property>
<property name="position">2</property>
</packing>
</child>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkListBox" id="keyinfo">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="margin-start">12</property>
- <property name="margin-end">12</property>
- <property name="margin-top">12</property>
- <property name="margin-bottom">12</property>
- <property name="selection-mode">none</property>
- <property name="activate-on-single-click">False</property>
- <signal name="row-activated" handler="on_key_row_activate" swapped="no"/>
- <style>
- <class name="content"/>
- </style>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="halign">start</property>
- <property name="margin-start">12</property>
- <property name="margin-end">12</property>
- <property name="margin-top">12</property>
- <property name="margin-bottom">12</property>
- <property name="label" translatable="yes">Double click on a row to copy the value to the clipboard</property>
- <property name="wrap">True</property>
- <style>
- <class name="dim-label"/>
- </style>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
</child>
</object>
</child>
</object>
+ <packing>
+ <property name="name">keyinfo</property>
+ <property name="title" translatable="yes">page0</property>
+ <property name="position">1</property>
+ </packing>
</child>
- </object>
- <packing>
- <property name="name">keyinfo</property>
- <property name="title" translatable="yes">page0</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkScrolledWindow">
- <property name="visible">True</property>
- <property name="can-focus">True</property>
- <property name="min-content-width">300</property>
<child>
- <object class="GtkViewport">
+ <object class="GtkScrolledWindow">
<property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="shadow-type">none</property>
+ <property name="can-focus">True</property>
+ <property name="min-content-width">300</property>
<child>
- <object class="GtkBox">
+ <object class="GtkViewport">
<property name="visible">True</property>
<property name="can-focus">False</property>
- <property name="margin-start">12</property>
- <property name="margin-end">12</property>
- <property name="margin-top">12</property>
- <property name="margin-bottom">12</property>
- <property name="orientation">vertical</property>
- <property name="spacing">12</property>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="label" translatable="yes">Add new key</property>
- <style>
- <class name="heading"/>
- </style>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkListBox" id="addkey">
- <property name="visible">True</property>
- <property name="can-focus">False</property>
- <property name="selection-mode">none</property>
- <property name="activate-on-single-click">False</property>
- <style>
- <class name="content"/>
- </style>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
+ <property name="shadow-type">none</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
- <property name="spacing">8</property>
+ <property name="margin-start">12</property>
+ <property name="margin-end">12</property>
+ <property name="margin-top">12</property>
+ <property name="margin-bottom">12</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
<child>
- <object class="GtkButton" id="add_key_save">
- <property name="label" translatable="yes">Save</property>
+ <object class="GtkLabel">
<property name="visible">True</property>
- <property name="can-focus">True</property>
- <property name="receives-default">True</property>
- <signal name="clicked" handler="on_save_clicked" swapped="no"/>
+ <property name="can-focus">False</property>
+ <property name="label" translatable="yes">Add new key</property>
<style>
- <class name="suggested-action"/>
+ <class name="heading"/>
</style>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="pack-type">end</property>
<property name="position">0</property>
</packing>
</child>
<child>
- <placeholder/>
+ <object class="GtkListBox" id="addkey">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="selection-mode">none</property>
+ <property name="activate-on-single-click">False</property>
+ <style>
+ <class name="content"/>
+ </style>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
</child>
<child>
- <placeholder/>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="spacing">8</property>
+ <child>
+ <object class="GtkButton" id="add_key_save">
+ <property name="label" translatable="yes">Save</property>
+ <property name="visible">True</property>
+ <property name="can-focus">True</property>
+ <property name="receives-default">True</property>
+ <signal name="clicked" handler="on_save_clicked" swapped="no"/>
+ <style>
+ <class name="suggested-action"/>
+ </style>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack-type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
</child>
</object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
</child>
</object>
</child>
</object>
+ <packing>
+ <property name="name">add</property>
+ <property name="title" translatable="yes">Add key</property>
+ <property name="position">2</property>
+ </packing>
</child>
</object>
<packing>
- <property name="name">add</property>
- <property name="title" translatable="yes">Add key</property>
- <property name="position">2</property>
+ <property name="name">main</property>
</packing>
</child>
</object>
<packing>
- <property name="name">main</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
</packing>
</child>
</object>
<packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
+ <property name="name">connected</property>
+ <property name="title" translatable="yes">page0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="HdyStatusPage">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="icon-name">nl.brixit.Keyring</property>
+ <property name="title" translatable="yes">Cannot connect</property>
+ <property name="description" translatable="yes">The Himitsu keyring daemon is not available</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="name">error</property>
+ <property name="title" translatable="yes">page1</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
- <property name="name">connected</property>
- <property name="title" translatable="yes">page0</property>
+ <property name="index">-1</property>
</packing>
</child>
- <child>
- <object class="HdyStatusPage">
+ <child type="overlay">
+ <object class="GtkRevealer" id="toastrevealer">
<property name="visible">True</property>
<property name="can-focus">False</property>
- <property name="icon-name">nl.brixit.Keyring</property>
- <property name="title" translatable="yes">Cannot connect</property>
- <property name="description" translatable="yes">The Himitsu keyring daemon is not available</property>
+ <property name="halign">center</property>
+ <property name="valign">start</property>
<child>
- <placeholder/>
+ <object class="GtkBox" id="toast">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="valign">start</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">4</property>
+ <child>
+ <object class="GtkLabel" id="toastlabel">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="label" translatable="yes">Key copied to the clipboard</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <style>
+ <class name="app-notification"/>
+ </style>
+ </object>
</child>
</object>
- <packing>
- <property name="name">error</property>
- <property name="title" translatable="yes">page1</property>
- <property name="position">1</property>
- </packing>
</child>
</object>
</child>
M himitsu_gtk/window.py => himitsu_gtk/window.py +8 -0
@@ 41,6 41,7 @@ class KeyringWindow:
self.keylist = builder.get_object("keylist")
self.keyinfo = builder.get_object("keyinfo")
self.addkey = builder.get_object("addkey")
+ self.toastrevealer = builder.get_object("toastrevealer")
searchbox = builder.get_object('search')
searchbox.grab_focus()
@@ 249,6 250,13 @@ class KeyringWindow:
clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
clipboard.set_text(value, -1)
+ self.toastrevealer.set_reveal_child(True)
+ GLib.timeout_add_seconds(1.4, self.hide_toast)
+
+ def hide_toast(self, *args):
+ self.toastrevealer.set_reveal_child(False)
+ return False
+
def addkey_add_placeholder(self, name=None, value=None):
row = Gtk.ListBoxRow()
box = Gtk.Box(spacing=6)