Search and Replace dialog shows buttons with underscore instead of underline

Bug #421312 reported by Andres Rodriguez
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Gobby
Fix Released
Unknown
gobby (Ubuntu)
Fix Released
Undecided
Martin Pitt

Bug Description

Binary package hint: gobby

In the "Search and Replace" dialog there are a couple of buttons showing an underscore instead of a underline, which also breaks the accelerator. I'm attaching and image which shows this.

Related branches

Revision history for this message
Andres Rodriguez (andreserl) wrote :
Changed in gobby (Ubuntu):
assignee: nobody → Andres E. Rodriguez Lazo (andreserl)
status: New → In Progress
Revision history for this message
Andres Rodriguez (andreserl) wrote :

Attaching debdiff.

Changed in gobby (Ubuntu):
status: In Progress → Confirmed
assignee: Andres E. Rodriguez Lazo (andreserl) → nobody
Changed in gobby (Ubuntu):
status: Confirmed → New
Revision history for this message
Philipp Kern (pkern) wrote : Re: [Bug 421312] Re: Search and Replace dialog shows buttons with underscore instead of underline

On Sun, Aug 30, 2009 at 02:24:24AM -0000, Andres E. Rodriguez Lazo wrote:
> ** Attachment added: "gobby_0.4.9-2ubuntu1.debdiff"
> http://launchpadlibrarian.net/30996754/gobby_0.4.9-2ubuntu1.debdiff

Did Gtk change a default here? I also encountered this problem on Debian in
another app.

Ciao,
Philipp Kern

Revision history for this message
Martin Pitt (pitti) wrote :

Can you please send this change upstream as well? Did you look into the pygtk docs why this change is necessary now? Perhaps it's a bug in pygtk itself?

Revision history for this message
Andres Rodriguez (andreserl) wrote :

Hello guys,

According to documentation in http://www.pygtk.org/docs/pygtk/class-gtkbutton.html#constructor-gtkbutton :

"Creates a new button widget with the content depending on the parameters: label, stock and use_underline. The default values for stock and label are None and, in PyGTK 2.4 and above, use_underline is available and defaults to True.
[..]
If label is specified the "label" property will be set with the text of the label, the "use_underline" property will be set to True and any characters that are preceded by an underscore are underlined [...] In PyGTK 2.4 and above the "use-underline" property can be set by using the optional use_underline parameter."

I'm not a python nor gtk developer, but for what I understand from the documentation, default should be to set the underline instead of underscore, so this might be indeed a bug in pygtk. Anyways, I'm attaching another debdiff which includes a better patch setting the optional use_underline parameter instead of using the "set_use_underline" function.

Cheers,

Andres.

Revision history for this message
Andres Rodriguez (andreserl) wrote :
Revision history for this message
Philipp Kern (pkern) wrote :

Huh, you do realize this is written in C++ using Gtkmm, right? ;-)

I beg to differ on the proper fix:

diff --git a/src/finddialog.cpp b/src/finddialog.cpp
index d322395..3433b86 100644
--- a/src/finddialog.cpp
+++ b/src/finddialog.cpp
@@ -49,8 +49,8 @@ Gobby::FindDialog::FindDialog(Gobby::Window& parent):
        m_radio_up(m_group_direction, _("_Up"), true),
        m_radio_down(m_group_direction, _("_Down"), true),
        m_btn_find(Gtk::Stock::FIND),
- m_btn_replace(_("_Replace") ),
- m_btn_replace_all(_("Replace _all") ),
+ m_btn_replace(_("_Replace"), true),
+ m_btn_replace_all(_("Replace _all"), true),
        m_btn_close(Gtk::Stock::CLOSE),
        m_regex("")
 {

Rationale: The button creation misses the mnemonic=true flag, which boils down to the same as your patch but is much cleaner. As you see for m_radio_{up,down}: it does the same. I'll commit this upstream shortly.

Revision history for this message
Philipp Kern (pkern) wrote :

Ok, sorry, I only looked at the first patch and now I see you came to the same conclusion while looking at the upstream bugtracker. ;-)

Revision history for this message
Andres Rodriguez (andreserl) wrote :

I actually was the one who reported it at the upstream bugtracker, I just did it under anonymous! :) And yes, I do realize that the code is C++ with Gtkmm :).

Revision history for this message
Martin Pitt (pitti) wrote :

Will sponsor, thanks!

Changed in gobby (Ubuntu):
assignee: nobody → Martin Pitt (pitti)
status: New → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gobby - 0.4.9-2ubuntu1

---------------
gobby (0.4.9-2ubuntu1) karmic; urgency=low

  * debian/patches/fix_underscore_search_and_replace_dialog.patch: Fixes
    underscore instead of underline in 'Search and Replace' dialog
    buttons. (LP: #421312)
  * debian/control: Set Maintainer to Ubuntu Developers.

 -- Andres Rodriguez <email address hidden> Mon, 31 Aug 2009 13:01:11 -0400

Changed in gobby (Ubuntu):
status: In Progress → Fix Released
Changed in gobby:
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.