GTK File Chooser filter not working in 1.4.0 (and my fix)

Report bugs, bug fixes and workarounds here.
Topic author
jnthn
Posts: 26
Joined: 02.01.2006
With us: 18 years 8 months

GTK File Chooser filter not working in 1.4.0 (and my fix)

Post #1by jnthn » 08.01.2006, 22:06

I recently installed the latest (1.4.0) version on Celestia and found, to my dismay, that no files appeared in the file chooser when attempting to open a script from the "Open Script" dialog. Same with the "Capture Image" dialog... even if there were png's in the "save in" directory, nothing showed in the list. However, after doing Ctrl-L (or right click, open location) and typing the beginning of a known filename, then selecting one from the dropdown, the *.cel files magically appeared in the directory listing.

To illustrate, bfore I modified src/celestia/gtk/actions.cpp, the file chooser looked like this when I browsed my celestia scripts directory:

    Image

After my modification, the scripts I know are there appear:

    Image


Celestia is locally compiled against gtk+-2.8.9, which is also home-built. The configure optiuons I use are:

Code: Select all

--prefix=/opt/celestia-1.4.0 \
--disable-nls \
--with-lua \
--with-gtk


I even tried reverting to gtk+-2.6.10 and recompiling Celestia. No joy... file chooser remained empty.

I had meant to file a bug report, but put it off until I got frustrated enough to try and find a fix, myself. I am *not* a programmer. I have no idea if this is "The Right Thing" but the patch I include below works for me.

In actions.cpp, at line 119, instead of (filter, "*.cel *.celx"), I simply added each desired filetype on a line of its own, (and the same thing for image types) and now the file chooser shows *.cel *.clx and *.celx. (The error dialog that compains when an "incorrect" filetype is chosen, asks for ".cel .clx or .celx" so I added .clx, too.) I'm sure there's a regex to make it a neat one liner. I tried a few, but didn't hit the magic combination.

Anyhow... here's the diff I used...

Code: Select all

--- src/celestia/gtk/actions.cpp.orig   2005-12-15 19:57:05.000000000 -0500
+++ src/celestia/gtk/actions.cpp   2006-01-08 15:24:09.000000000 -0500
@@ -116,7 +116,9 @@
    gtk_file_filter_set_name(filter, "Celestia Scripts");
    
    #ifdef CELX
-   gtk_file_filter_add_pattern(filter, "*.cel *.celx");
+   gtk_file_filter_add_pattern(filter, "*.cel");
+   gtk_file_filter_add_pattern(filter, "*.clx");
+   gtk_file_filter_add_pattern(filter, "*.celx");
    #else
    gtk_file_filter_add_pattern(filter, "*.cel");
    #endif /* CELX */
@@ -146,7 +148,9 @@
 
    GtkFileFilter* filter = gtk_file_filter_new();
    gtk_file_filter_set_name(filter, "PNG and JPEG Images");
-   gtk_file_filter_add_pattern(filter, "*.jpeg *.jpg *.png");
+   gtk_file_filter_add_pattern(filter, "*.jpeg");
+   gtk_file_filter_add_pattern(filter, "*.jpg");
+   gtk_file_filter_add_pattern(filter, "*.png");
    gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(fs), filter);
 
    #if GTK_CHECK_VERSION(2, 7, 0)


Outside of this one annoyance, I find that the gtk UI is greatly improved over celestia 1.3.2. Thanks for all the hard work, folks.

ciao,
Jonathan


CPU: AMD AthlonXP-M 2600+ (Barton)
RAM: 1024 MB DDR400
Mobo: Abit NF7-S Rev. 2.0/w Nvidia Nforce2 Ultra-400 Chipset

Video: Celestica Radeon 9800-Pro 128MB
ATI Video Driver fglrx_6_8_0-8.18.6-i386-1

Linux 2.4.31 (Slackware 10.2)
Glibc 2.3.5
gcc 3.3.6
X11R6.8.2 (X.org source; home built; optimized for Athlon-XP)
windowmaker-0.92.0

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 5 months
Location: Hamburg, Germany

Post #2by t00fri » 09.01.2006, 00:00

I can reproduce this bug. I have notified the celestia-gtk developer, Pat Suwalski.

Bye Fridger

suwalski
Developer
Posts: 62
Joined: 03.12.2003
With us: 20 years 9 months
Contact:

Post #3by suwalski » 09.01.2006, 00:40

jnthn wrote:Outside of this one annoyance, I find that the gtk UI is greatly improved over celestia 1.3.2. Thanks for all the hard work, folks.

Thanks a lot. I really mean it. The fix will be in the imminent 1.4.1 release.

t00fri wrote:I can reproduce this bug. I have notified the celestia-gtk developer, Pat Suwalski.


Thanks for bringing it to my attention. I visit the forums at least twice a week, but I may not have noticed before 1.4.1 comes out.

Topic author
jnthn
Posts: 26
Joined: 02.01.2006
With us: 18 years 8 months

Post #4by jnthn » 09.01.2006, 02:47

suwalski wrote:
jnthn wrote:Outside of this one annoyance, I find that the gtk UI is greatly improved over celestia 1.3.2. Thanks for all the hard work, folks.

Thanks a lot. I really mean it. The fix will be in the imminent 1.4.1 release.


Wow... talk about response time for a bug report. Smokin'. 8)

You're welcome a lot. While much of the improvement, IMO, is in the overall look and feel with the new GTK file chooser widgets, etc, I sure won't give GTK all the credit. Copying/Loading URL's from the UI is nice and, finally, at long last, no more menu bar in full screen! My monitor can be a window into space, now. It may seem like a small thing but, to me at least, it makes a big difference having that menu bar gone.

Now, if we only had a nice bookmark list in GTK like the KDE version has, I'd think I'd done died an' gone to heaven. ;)

cya,
Jonathan

suwalski
Developer
Posts: 62
Joined: 03.12.2003
With us: 20 years 9 months
Contact:

Post #5by suwalski » 09.01.2006, 03:47

jnthn wrote:You're welcome a lot. While much of the improvement, IMO, is in the overall look and feel with the new GTK file chooser widgets, etc, I sure won't give GTK all the credit. Copying/Loading URL's from the UI is nice and, finally, at long last, no more menu bar in full screen! My monitor can be a window into space, now. It may seem like a small thing but, to me at least, it makes a big difference having that menu bar gone.

One thing I want to do in whatever the next version is is to put in a little "caret" in one of the corners that pulls up the menu, in case people get stuck. I was thinking along the lines of a small transparent widget like in MS Powerpoint presentation mode, but less conspicuous.

jnthn wrote:Now, if we only had a nice bookmark list in GTK like the KDE version has, I'd think I'd done died an' gone to heaven. ;)


I have two things on the list for right after 1.4.1:

- Move to automake1.9
- Add bookmarks menu

So there ya go. It'll be in CVS before the month is out, if the 1.4.1 release goes as planned.

Topic author
jnthn
Posts: 26
Joined: 02.01.2006
With us: 18 years 8 months

Post #6by jnthn » 09.01.2006, 04:47

suwalski wrote:
jnthn wrote:at long last, no more menu bar in full screen!
One thing I want to do in whatever the next version is is to put in a little "caret" in one of the corners that pulls up the menu, in case people get stuck. I was thinking along the lines of a small transparent widget like in MS Powerpoint presentation mode, but less conspicuous.
Way back in the olden days, when I was using Win95, I played my first 3d PC game... Mechwarrior 2. The "Rage 3d" edition, which showed off the power of my shiny new 2MB (Wow!) 3d graphics adapter. While in the full-screen configuration "rooms", the game had a dropdown menu bar, which appeared when you moved the mouse pointer all the way to the top edge of the screen, and disappeared when you removed the mouse pointer. Something like the autohide setting on the Windows taskbar. I don't know how "friendly" that would be to a "stuck" user, but I think something like that would be pretty slick.

suwalski wrote:
jnthn wrote:Now, if we only had a nice bookmark list in GTK like the KDE version has, I'd think I'd done died an' gone to heaven. ;)
I have two things on the list for right after 1.4.1:

- Move to automake1.9
- Add bookmarks menu


Whoohoo! It'll be Christmas all over again!

Thanks,
Jonathan

Topic author
jnthn
Posts: 26
Joined: 02.01.2006
With us: 18 years 8 months

Post #7by jnthn » 09.01.2006, 05:09

t00fri wrote:I can reproduce this bug. I have notified the celestia-gtk developer, Pat Suwalski.

Bye Fridger

Sorry... I got sidetracked by the discussion, and I forgot to say thanks for giving him the heads up.

Thanks. 8)

Jonathan

Avatar
John Van Vliet
Posts: 2941
Joined: 28.08.2002
With us: 22 years

re

Post #8by John Van Vliet » 12.01.2006, 22:30

as to gtk
using gnome build dose not reproduce the gtk build error , on my sys
fedora4 / gnome and kde installed with gtk 2.6.10 built from source for gimp 2.3.5


Return to “Bugs”