After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 581151 - Ability to close note window with Escape key
Ability to close note window with Escape key
Status: RESOLVED NOTABUG
Product: gnote
Classification: Applications
Component: main
git master
Other All
: Normal enhancement
: ---
Assigned To: gnote-maint
gnote-maint
Depends on:
Blocks:
 
 
Reported: 2009-05-03 03:56 UTC by Yves Junqueira
Modified: 2009-05-04 06:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed fix (1.45 KB, patch)
2009-05-03 03:58 UTC, Yves Junqueira
none Details | Review

Description Yves Junqueira 2009-05-03 03:56:19 UTC
Currently it's not possible to close the notes window with the Escape key.

This is not only an interesting feature, but it was mentioned by Corbet on LWN.net[1] as one of his minor annoyances with gnotes, so it would be nice to have it fixed ;-).

[1] http://lwn.net/Articles/331187/
Comment 1 Yves Junqueira 2009-05-03 03:58:41 UTC
Created attachment 133837 [details] [review]
proposed fix

Disclaimer: I've never coded in C++ before, I'm sorry in advance if it's bogus - but at least it seems to work.
Comment 2 Yves Junqueira 2009-05-03 04:24:16 UTC
Comment on attachment 133837 [details] [review]
proposed fix

>From 9571c61c640d4fb376b92898bf6eda5335c61589 Mon Sep 17 00:00:00 2001
>From: Yves Junqueira <yves@cetico.org>
>Date: Sun, 3 May 2009 05:52:29 +0200
>Subject: [PATCH] option dialog for closing on Escape
>
>---
> src/preferencesdialog.cpp |    9 ++++++++-
> 1 files changed, 8 insertions(+), 1 deletions(-)
>
>diff --git a/src/preferencesdialog.cpp b/src/preferencesdialog.cpp
>index 1c6a257..43ac020 100644
>--- a/src/preferencesdialog.cpp
>+++ b/src/preferencesdialog.cpp
>@@ -167,7 +167,7 @@ namespace gnote {
>       Gtk::Label *label;
>       Gtk::CheckButton *check;
>       Gtk::Alignment *align;
>-      sharp::PropertyEditorBool *peditor, *font_peditor,* bullet_peditor;
>+      sharp::PropertyEditorBool *peditor, *font_peditor, *bullet_peditor, *escape_peditor;
> 
>       Gtk::VBox *options_list = manage(new Gtk::VBox(false, 12));
>       options_list->set_border_width(12);
>@@ -217,6 +217,13 @@ namespace gnote {
>                                                        *check);
>       bullet_peditor->setup();
> 
>+      // Close on Escape
>+      check = manage(make_check_button (_("Escape key closes the note window.")));
>+      options_list->pack_start (*check, false, false, 0);
>+      escape_peditor = new sharp::PropertyEditorBool(Preferences::ENABLE_CLOSE_NOTE_ON_ESCAPE,
>+                                                       *check);
>+      escape_peditor->setup();
>+
>       // Custom font...
> 
>       check = manage(make_check_button (_("Use custom _font")));
>-- 
>1.6.0.4
>
Comment 3 Yves Junqueira 2009-05-03 04:26:37 UTC
Changed the option caption a bit in the patch ("Escape key closes the note window.")
Comment 4 Rahul Sundaram 2009-05-03 18:22:09 UTC
Gnote 0.3.0 already does the right thing. Corbet is running a earlier version from Rawhide. I have built the latest version but it is not in the repo yet due to the development freeze. 

Anyway, I don't think a preference setting is really needed for this.
Comment 5 Yves Junqueira 2009-05-03 20:47:46 UTC
Sorry for the confusion then, but I was almost sure this didn't work for me right away.

Maybe the gconf option was set to disabled by default when I tried it? I used 0.3.0 by the way.
Comment 6 Hubert Figuiere (:hub) 2009-05-04 02:24:27 UTC
If you installed the gconf schema it should on by default. If you didn't install the gconf schemas then that is your bug.
Comment 7 Hubert Figuiere (:hub) 2009-05-04 06:54:17 UTC
works for me. see comment #6