Обсуждение: Weird Popup Menus - pgAdmin 1.8.4

Поиск
Список
Период
Сортировка

Weird Popup Menus - pgAdmin 1.8.4

От
Christos Vasilakis
Дата:
Hi there,

I have just compiled and installed pgadmin 1.8.4 under Ubuntu Hardy 
8.04. I used the defaults and just

configure; make; make install

and installed under /usr/local/pgadmin3

Although the application runs fine without any problems, the menus in 
the popups are garbaged with the _ character. I believe its used to 
characterize the shortcut character in the keyboard. For example if i 
right click in a table i get this

Re_fresh
_Count
...
_Reports
_Maintenance

etc.

In the top level menus File Edit View.. it is displayed correctly.

The output of the configure script is the following:

-------
PostgreSQL directory:            /usr
PostgreSQL pg_config binary:        /usr/bin/pg_config
PostgreSQL version:            PostgreSQL 8.3.1
PostgreSQL SSL support:                 Present

wxWidgets directory:            /usr
wxWidgets wx-config binary:        /usr/bin/wx-config
wxWidgets version:            wxWidgets 2.8.7

libxml2 directory:            /usr
libxml2 xml2-config binary:        /usr/bin/xml2-config
libxml2 version:            libxml2 2.6.31

libxslt directory:            /usr
libxslt xslt-config binary:        /usr/bin/xslt-config
libxslt version:            libxslt 1.1.22

Building a debug version of pgAdmin:    No
Statically linking pgAdmin:        No
Building a Mac OS X appbundle:        No

-------

Both postgres and wxwidgets are installed from the Hardy default 
repositories.

The timezone is set to Europe/Athens but I am using the English version 
of Hardy

Let me know if you want more information.

Regards,
Christos

PS Keep up the good work for this excellent postgres tool! :)




Re: Weird Popup Menus - pgAdmin 1.8.4

От
Guillaume Lelarge
Дата:
Christos Vasilakis a écrit :
> [...]
> Although the application runs fine without any problems, the menus in 
> the popups are garbaged with the _ character. I believe its used to 
> characterize the shortcut character in the keyboard. For example if i 
> right click in a table i get this
> 
> Re_fresh
> _Count
> ...
> _Reports
> _Maintenance
> 
> etc.
> 
> In the top level menus File Edit View.. it is displayed correctly.
> 

Actually, I do have the same issue (on the same distro). But I thought 
*I* was doing something wrong :)

So, I need to take a serious look at this.


-- 
Guillaume. http://www.postgresqlfr.org http://dalibo.com


Re: Weird Popup Menus - pgAdmin 1.8.4

От
"Dave Page"
Дата:
On Sat, Jun 7, 2008 at 8:55 AM, Guillaume Lelarge
<guillaume@lelarge.info> wrote:
>
> Actually, I do have the same issue (on the same distro). But I thought *I*
> was doing something wrong :)
>
> So, I need to take a serious look at this.

It's also been noted by our quality management team. I believe it's a
wxWidgets bug but I suspect we may not see a 2.8.8 version so may have
to work round this ourselves*. When we add options to the content
menu, perhaps we should just strip out the &'s (they prefix char that
should be underlined) on GTK - the bug isn't there on Windows/Mac.

* The next major version of wxWidgets is apparently going to be 3.0.0
which will be very different from what I hear, so we may not upgrade
immediately.

-- 
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com


Re: Weird Popup Menus - pgAdmin 1.8.4

От
Guillaume Lelarge
Дата:
Dave Page a écrit :
> On Sat, Jun 7, 2008 at 8:55 AM, Guillaume Lelarge
> <guillaume@lelarge.info> wrote:
>> Actually, I do have the same issue (on the same distro). But I thought *I*
>> was doing something wrong :)
>>
>> So, I need to take a serious look at this.
> 
> It's also been noted by our quality management team. I believe it's a
> wxWidgets bug but I suspect we may not see a 2.8.8 version so may have
> to work round this ourselves*. When we add options to the content
> menu, perhaps we should just strip out the &'s (they prefix char that
> should be underlined) on GTK - the bug isn't there on Windows/Mac.
> 

I'm not sure about the wxWidgets bug. I also use poedit and it doesn't 
seem to be affected.

I'm not sure about a specific Ubuntu wxWidgets bug. I compiled 
wxWidgets 2.8.7 release from scratch and I still had the issue. Didn't 
try an earlier release though... I'll do it right now.

> * The next major version of wxWidgets is apparently going to be 3.0.0
> which will be very different from what I hear, so we may not upgrade
> immediately.
> 

Interesting. I'm not following much of the wxWidgets development work.


-- 
Guillaume. http://www.postgresqlfr.org http://dalibo.com


Re: Weird Popup Menus - pgAdmin 1.8.4

От
"Dave Page"
Дата:
On Wed, Jun 11, 2008 at 9:11 AM, Guillaume Lelarge
<guillaume@lelarge.info> wrote:
> I'm not sure about the wxWidgets bug. I also use poedit and it doesn't seem
> to be affected.

Can you see in the code what they are doing differently? Do they even
use & to underline shortcut keys?

The reason I believe it's a wxWidgets problem is that this code has
worked until the last couple of wxWidgets releases, and continues to
do so on Windows and Mac. Even if it's not strictly a bug (ie. we're
doing something wrong), I still believe it to be a change in
behaviour.

> I'm not sure about a specific Ubuntu wxWidgets bug. I compiled wxWidgets
> 2.8.7 release from scratch and I still had the issue. Didn't try an earlier
> release though... I'll do it right now.

2.8.3 or so was unaffected if memory serves.

>> * The next major version of wxWidgets is apparently going to be 3.0.0
>> which will be very different from what I hear, so we may not upgrade
>> immediately.
>>
>
> Interesting. I'm not following much of the wxWidgets development work.

No, nor I - I just read recently that the next version will be 3.0 as
they're giving it a major overhaul.


-- 
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com


Re: Weird Popup Menus - pgAdmin 1.8.4

От
Guillaume Lelarge
Дата:
Dave Page a écrit :
> On Wed, Jun 11, 2008 at 9:11 AM, Guillaume Lelarge
> <guillaume@lelarge.info> wrote:
>> I'm not sure about the wxWidgets bug. I also use poedit and it doesn't seem
>> to be affected.
> 
> Can you see in the code what they are doing differently? Do they even
> use & to underline shortcut keys?
> 

No, they use underscores in their .xrc files (I didn't find any menus in 
their .cpp code). I tried on our sources but it doesn't fix the issue. 
In fact, it makes it worst because I now have two underscores instead of 
the shortcut. & seems the way to go, at least when we call the Append 
method.

> The reason I believe it's a wxWidgets problem is that this code has
> worked until the last couple of wxWidgets releases, and continues to
> do so on Windows and Mac. Even if it's not strictly a bug (ie. we're
> doing something wrong), I still believe it to be a change in
> behaviour.
> 

Yep.

>> I'm not sure about a specific Ubuntu wxWidgets bug. I compiled wxWidgets
>> 2.8.7 release from scratch and I still had the issue. Didn't try an earlier
>> release though... I'll do it right now.
> 
> 2.8.3 or so was unaffected if memory serves.
> 

Yes, it was. I tried 2.8.3, 2.8.4, 2.8.5... this last one is wrong. I 
checked the differences between 2.8.4 and 2.8.5, and found that the 
culprit seems to be src/gtk/menu.cpp. I copied this file from 2.8.4 to 
2.8.5 and, tadammm, 2.8.5 now works :) The same goes for 2.8.7.

AFAICS, this is the changeset that breaks our shortcut handling:
http://trac.wxwidgets.org/changeset/48053/wxWidgets/branches/WX_2_8_BRANCH/src/gtk/menu.cpp

And it's the last changeset on this branch. trunk seems completely changed.

I'm not sure about what we should do. Perhaps stripping the underscore 
for the GTK platform. Not an ideal solution though.


-- 
Guillaume. http://www.postgresqlfr.org http://dalibo.com


Re: Weird Popup Menus - pgAdmin 1.8.4

От
"Dave Page"
Дата:
On Wed, Jun 11, 2008 at 2:33 PM, Guillaume Lelarge
<guillaume@lelarge.info> wrote:
> Yes, it was. I tried 2.8.3, 2.8.4, 2.8.5... this last one is wrong. I
> checked the differences between 2.8.4 and 2.8.5, and found that the culprit
> seems to be src/gtk/menu.cpp. I copied this file from 2.8.4 to 2.8.5 and,
> tadammm, 2.8.5 now works :) The same goes for 2.8.7.
>
> AFAICS, this is the changeset that breaks our shortcut handling:
> http://trac.wxwidgets.org/changeset/48053/wxWidgets/branches/WX_2_8_BRANCH/src/gtk/menu.cpp
>
> And it's the last changeset on this branch. trunk seems completely changed.

Ahh - well diagnosed.

> I'm not sure about what we should do. Perhaps stripping the underscore for
> the GTK platform. Not an ideal solution though.

I would suggest asking on the wxWidgets mailing list (no, I'm not on
it either :-p ). If they don't agree it's a bug, we should probably
strip it in code.

If you're feeling adventurous, you could also give SVN trunk a whirl
and see what 3.0.0 might look like :-)

-- 
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com


Re: Weird Popup Menus - pgAdmin 1.8.4

От
Christos Vasilakis
Дата:
Guillaume Lelarge wrote:
> Dave Page a écrit :
>> On Wed, Jun 11, 2008 at 9:11 AM, Guillaume Lelarge
>> <guillaume@lelarge.info> wrote:
>>> I'm not sure about the wxWidgets bug. I also use poedit and it 
>>> doesn't seem
>>> to be affected.
>>
>> Can you see in the code what they are doing differently? Do they even
>> use & to underline shortcut keys?
>>
> 
> No, they use underscores in their .xrc files (I didn't find any menus in 
> their .cpp code). I tried on our sources but it doesn't fix the issue. 
> In fact, it makes it worst because I now have two underscores instead of 
> the shortcut. & seems the way to go, at least when we call the Append 
> method.
> 
>> The reason I believe it's a wxWidgets problem is that this code has
>> worked until the last couple of wxWidgets releases, and continues to
>> do so on Windows and Mac. Even if it's not strictly a bug (ie. we're
>> doing something wrong), I still believe it to be a change in
>> behaviour.
>>
> 
> Yep.
> 
>>> I'm not sure about a specific Ubuntu wxWidgets bug. I compiled wxWidgets
>>> 2.8.7 release from scratch and I still had the issue. Didn't try an 
>>> earlier
>>> release though... I'll do it right now.
>>
>> 2.8.3 or so was unaffected if memory serves.
>>
> 
> Yes, it was. I tried 2.8.3, 2.8.4, 2.8.5... this last one is wrong. I 
> checked the differences between 2.8.4 and 2.8.5, and found that the 
> culprit seems to be src/gtk/menu.cpp. I copied this file from 2.8.4 to 
> 2.8.5 and, tadammm, 2.8.5 now works :) The same goes for 2.8.7.
> 
> AFAICS, this is the changeset that breaks our shortcut handling:
> http://trac.wxwidgets.org/changeset/48053/wxWidgets/branches/WX_2_8_BRANCH/src/gtk/menu.cpp 
> 
> 
> And it's the last changeset on this branch. trunk seems completely changed.
> 
> I'm not sure about what we should do. Perhaps stripping the underscore 
> for the GTK platform. Not an ideal solution though.
> 
> 

Excellent job Guillaume! :)

Please let us know of the outcome if you decide to take it further.

Regards,
Christos


Re: Weird Popup Menus - pgAdmin 1.8.4

От
Guillaume Lelarge
Дата:
Dave Page a écrit :
> On Wed, Jun 11, 2008 at 2:33 PM, Guillaume Lelarge
> <guillaume@lelarge.info> wrote:
>> Yes, it was. I tried 2.8.3, 2.8.4, 2.8.5... this last one is wrong. I
>> checked the differences between 2.8.4 and 2.8.5, and found that the culprit
>> seems to be src/gtk/menu.cpp. I copied this file from 2.8.4 to 2.8.5 and,
>> tadammm, 2.8.5 now works :) The same goes for 2.8.7.
>>
>> AFAICS, this is the changeset that breaks our shortcut handling:
>> http://trac.wxwidgets.org/changeset/48053/wxWidgets/branches/WX_2_8_BRANCH/src/gtk/menu.cpp
>>
>> And it's the last changeset on this branch. trunk seems completely changed.
> 
> Ahh - well diagnosed.
> 
>> I'm not sure about what we should do. Perhaps stripping the underscore for
>> the GTK platform. Not an ideal solution though.
> 
> I would suggest asking on the wxWidgets mailing list (no, I'm not on
> it either :-p ). If they don't agree it's a bug, we should probably
> strip it in code.
> 

I'll ask them.

> If you're feeling adventurous, you could also give SVN trunk a whirl
> and see what 3.0.0 might look like :-)
> 

I did try: 1. there's no contrib directory 2. First compilation error is on wx/ogl/ogl.h which does not exist 3. of
course,there's no wxOGLInitialize function 4. if i comment these, I have a bunch of messages about overloaded
ambiguousmethods.
 

So, I quite quickly gave up on using trunk sources.


-- 
Guillaume. http://www.postgresqlfr.org http://dalibo.com


Re: Weird Popup Menus - pgAdmin 1.8.4

От
"Dave Page"
Дата:
On Wed, Jun 11, 2008 at 5:55 PM, Guillaume Lelarge
<guillaume@lelarge.info> wrote:
> Dave Page a écrit :
>>
>> I would suggest asking on the wxWidgets mailing list (no, I'm not on
>> it either :-p ). If they don't agree it's a bug, we should probably
>> strip it in code.
>>
>
> I'll ask them.

Thanks.

>> If you're feeling adventurous, you could also give SVN trunk a whirl
>> and see what 3.0.0 might look like :-)
>>
>
> I did try:
>  1. there's no contrib directory

Ah, yes - I heard that. They've merged the various modules into the
core product now....

>  2. First compilation error is on wx/ogl/ogl.h which does not exist
>  3. of course, there's no wxOGLInitialize function
>  4. if i comment these, I have a bunch of messages about overloaded
>    ambiguous methods.

...except OGL which they moved out about a year ago (that came up with
last year's GSoC project). I believe it's gone to the wxWidgets
equivalent of pgFoundry.

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com


Re: Weird Popup Menus - pgAdmin 1.8.4

От
Guillaume Lelarge
Дата:
Dave Page a écrit :
> On Wed, Jun 11, 2008 at 5:55 PM, Guillaume Lelarge
> <guillaume@lelarge.info> wrote:
>> Dave Page a écrit :
>>> I would suggest asking on the wxWidgets mailing list (no, I'm not on
>>> it either :-p ). If they don't agree it's a bug, we should probably
>>> strip it in code.
>>>
>> I'll ask them.
> 
> Thanks.
> 

If one wants to follow the discussion there, you should look in the archive:
http://lists.wxwidgets.org/pipermail/wx-users/2008-June/108081.html

There's only my mail right now but I hope an answer will arrive soon.

I took a better a look at this source code. The real culprit is in the 
method wxMenuItemBase::GetLabelFromText:

wxString wxMenuItemBase::GetLabelFromText(const wxString& text)
{    // The argument to this function will now always be in wxWidgets 
standard label    // format, not GTK+ format, so we do what the other ports do.
    return wxStripMenuCodes(text);

#if 0
...
#endif

If you comment the return before the #if and if you enable the code 
between #if 0 and #endif, it simply works.

I don't quite understand why they do this. I hope I'll have some answers 
from the wx-users mailing list.

>>> If you're feeling adventurous, you could also give SVN trunk a whirl
>>> and see what 3.0.0 might look like :-)
>>>
>> I did try:
>>  1. there's no contrib directory
> 
> Ah, yes - I heard that. They've merged the various modules into the
> core product now....
> 

OK.

>>  2. First compilation error is on wx/ogl/ogl.h which does not exist
>>  3. of course, there's no wxOGLInitialize function
>>  4. if i comment these, I have a bunch of messages about overloaded
>>    ambiguous methods.
> 
> ...except OGL which they moved out about a year ago (that came up with
> last year's GSoC project). I believe it's gone to the wxWidgets
> equivalent of pgFoundry.
>

It seems to me it will be real hard to get on the 3.0 branch.


-- 
Guillaume. http://www.postgresqlfr.org http://dalibo.com


Re: Weird Popup Menus - pgAdmin 1.8.4

От
"Dave Page"
Дата:
On Thu, Jun 12, 2008 at 12:03 AM, Guillaume Lelarge
<guillaume@lelarge.info> wrote:
> Dave Page a écrit :
>>
> If one wants to follow the discussion there, you should look in the archive:
>  http://lists.wxwidgets.org/pipermail/wx-users/2008-June/108081.html
>
> There's only my mail right now but I hope an answer will arrive soon.

Hopefully :-)

> It seems to me it will be real hard to get on the 3.0 branch.

I suspect it looks far worse than it is. Some tweaking of the build
system will probably kick it back into shape.

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com


Re: Weird Popup Menus - pgAdmin 1.8.4

От
Guillaume Lelarge
Дата:
Dave Page a écrit :
> On Thu, Jun 12, 2008 at 12:03 AM, Guillaume Lelarge
> <guillaume@lelarge.info> wrote:
>> Dave Page a écrit :
>> If one wants to follow the discussion there, you should look in the archive:
>>  http://lists.wxwidgets.org/pipermail/wx-users/2008-June/108081.html
>>
>> There's only my mail right now but I hope an answer will arrive soon.
> 
> Hopefully :-)
> 

There were a bunch of answers. It seems my idea was right. Julian Smart 
will probably revert part of the patch that breaks our shortcuts handling.

>> It seems to me it will be real hard to get on the 3.0 branch.
> 
> I suspect it looks far worse than it is. Some tweaking of the build
> system will probably kick it back into shape.
> 


-- 
Guillaume. http://www.postgresqlfr.org http://dalibo.com


Re: Weird Popup Menus - pgAdmin 1.8.4

От
"Dave Page"
Дата:
On Fri, Jun 13, 2008 at 11:56 PM, Guillaume Lelarge
<guillaume@lelarge.info> wrote:

> There were a bunch of answers. It seems my idea was right. Julian Smart will
> probably revert part of the patch that breaks our shortcuts handling.

Oh, cool. How was your first foray into the wxWidgets community?
Hopefully it didn't feel too strange and alien :-)

-- 
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com


Re: Weird Popup Menus - pgAdmin 1.8.4

От
Guillaume Lelarge
Дата:
Dave Page a écrit :
> On Fri, Jun 13, 2008 at 11:56 PM, Guillaume Lelarge
> <guillaume@lelarge.info> wrote:
> 
>> There were a bunch of answers. It seems my idea was right. Julian Smart will
>> probably revert part of the patch that breaks our shortcuts handling.
> 
> Oh, cool. How was your first foray into the wxWidgets community?
> Hopefully it didn't feel too strange and alien :-)
> 

:)

Strictly speaking, I'm not a wxWidgets fan. I would definitely prefer qt.

Anyways, they were friendly and quick to answer. I'm now subscribed to 
their wx-users list, and some messages are interesting. It gives me a 
better idea of this widgets' toolkit.


-- 
Guillaume. http://www.postgresqlfr.org http://dalibo.com


Re: Weird Popup Menus - pgAdmin 1.8.4

От
Guillaume Lelarge
Дата:
Guillaume Lelarge a écrit :
> Dave Page a écrit :
>> On Thu, Jun 12, 2008 at 12:03 AM, Guillaume Lelarge
>> <guillaume@lelarge.info> wrote:
>>> Dave Page a écrit :
>>> If one wants to follow the discussion there, you should look in the 
>>> archive:
>>>  http://lists.wxwidgets.org/pipermail/wx-users/2008-June/108081.html
>>>
>>> There's only my mail right now but I hope an answer will arrive soon.
>>
>> Hopefully :-)
>>
> 
> There were a bunch of answers. It seems my idea was right. Julian Smart 
> will probably revert part of the patch that breaks our shortcuts handling.
> 

He did it :)

http://svn.wxwidgets.org/viewvc/wx/wxWidgets/branches/WX_2_8_BRANCH/src/gtk/menu.cpp?r1=54064&r2=54173

It'll be available on the 2.8.8 (to be released really soon).


-- 
Guillaume. http://www.postgresqlfr.org http://dalibo.com


Re: Weird Popup Menus - pgAdmin 1.8.4

От
"Dave Page"
Дата:
On Mon, Jun 16, 2008 at 10:37 PM, Guillaume Lelarge
<guillaume@lelarge.info> wrote:
> He did it :)
>
> http://svn.wxwidgets.org/viewvc/wx/wxWidgets/branches/WX_2_8_BRANCH/src/gtk/menu.cpp?r1=54064&r2=54173
>
> It'll be available on the 2.8.8 (to be released really soon).

Oh good. There will be a Mac fix in there for us too.

-- 
Dave Page
EnterpriseDB UK:   http://www.enterprisedb.com