Close Bookmark Window with ESC

This commit is contained in:
Philipp Hörist 2017-02-06 22:46:12 +01:00
parent 05566a635c
commit 91bb0183ee
2 changed files with 12 additions and 7 deletions

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 -->
<!-- Generated with glade 3.20.0 -->
<interface>
<requires lib="gtk+" version="3.12"/>
<object class="GtkListStore" id="liststore1">
@ -15,6 +15,7 @@
<property name="default_width">550</property>
<property name="default_height">300</property>
<property name="type_hint">dialog</property>
<signal name="key-press-event" handler="on_key_press_event" swapped="no"/>
<child>
<object class="GtkBox" id="vbox86">
<property name="visible">True</property>
@ -116,9 +117,9 @@
<object class="GtkLabel" id="label325">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Title:</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
@ -129,9 +130,9 @@
<object class="GtkLabel" id="label315">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Nickname:</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
@ -142,9 +143,9 @@
<object class="GtkLabel" id="label316">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Roo_m:</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
@ -155,9 +156,9 @@
<object class="GtkLabel" id="label317">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Server:</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
@ -168,9 +169,9 @@
<object class="GtkLabel" id="label318">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Password:</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
@ -231,9 +232,9 @@
<object class="GtkLabel" id="label326">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Pr_int status:</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>

View File

@ -3256,6 +3256,10 @@ class ManageBookmarksWindow:
# select root iter
self.selection.select_iter(self.treestore.get_iter_first())
def on_key_press_event(self, widget, event):
if event.keyval == Gdk.KEY_Escape:
self.window.destroy()
def on_add_bookmark_button_clicked(self, widget):
"""
Add a new bookmark