Re: Location entry in GtkFileChooser
Hi, You were right, gtk_file_chooser_get_uri () gives me correctly the contents in the Location GtkEntry. Sort off: If I write http://www.app.org/, I get the same. However, if I write http://www.app.org (without the final slash) I get: http%3A%2F%2Fwww.app.org Other problems still remain. When I write, say, ftp://ftp.my_site.org/my_path/my_file.xml too clever GTK immediately prompts a dialog of his own, asking me for a user/password combination, or a click for anonymous... even when I explicitly said, to disable Gtk network code: gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (filechooser), TRUE); I don't want that dialog at all, the anonymous ftp is chosen automatically (as in any browser...) the question is, how can I disable it? GTk is obviously connecting the GtkEntry "changed" signal... but how can I accees it? :-( Other question, GTK always, show at least to me, a default file, (the first one) in the File List and as a consequence, in the Location Entry, which in my opinion is wrong. This seems related with the equivalent issue I reported weeks ago about GtkTreeView: a default is always shown, even when it makes no sense. I still think the best solution for most problems, not all :-(, I have with Gtkfilechooser is to get acess to the Location GtkEntry... How can I do that? Actually this is a matter of principle: as a GTK user, I should be able to access ALL the relevant, visble widgets in ANY Gtk dialog... let's say I want to change the base color of that Entry, light yellow, to signal some "secure connection". How can I possibly do that, if I have no access to the GtkEntry in the first place? Thank you very much, for your interest in this matter Carlos >> The reason is, in my app, I accept local and remote addresses as >> well. It works >> > I've never used this function, so I may be wrong, but you may try > gtk_file_chooser_get_uri() instead of gtk_file_chooser_get_filename() > to retrieve the entry value. > > Damien ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Location entry in GtkFileChooser
Hello, Le 15/04/2008, Carlos Pereira <[EMAIL PROTECTED]> a écrit : > The reason is, in my app, I accept local and remote addresses as > well. It works I've never used this function, so I may be wrong, but you may try gtk_file_chooser_get_uri() instead of gtk_file_chooser_get_filename() to retrieve the entry value. Damien. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Location entry in GtkFileChooser
Luis Menina wrote: > Hi Carlos. > > Well, I'm not familiar with GtkFileChooser, but I think you should > retrieve the full filename, and then use g_path_get_basename to get > the short filename. > Thanks, that is a good suggestion, unfortunately it fails in my case. I really need to have access to the GtkEntry next to Location, to get the information in there. The reason is, in my app, I accept local and remote addresses as well. It works like this: If the user writes: http://www.my_site.org/my_path/my_file.xml my app tries to fetch that file by HTTP (and ignores the GTK fullname). If the users writes: ftp://ftp.my_site.org/my_path/my_file.xml my app tries to fetch that file by anonymous FTP (and ignores the GTK fullname). Otherwise, my app will consider the file as an ordinary file, and then normal procedure applies: get the GTK fullname, etc... Unfortunatly GTK tries to parse the GtkEntry before sending it to me, and gtk_file_chooser_get_filename returns NULL when the shortname starts with http:// or ftp:// which in turn makes it impossible to use g_path_get_basename :-( So I really must have access to the Location GtkEntry, Carlos > Cheers, > > Luis > > Carlos Pereira a écrit : >> Hullo, >> >> In a GTkFilechooser, how can I acess the information >> on the Location entry? I only find functions to get >> the full filename and uri but not the actual short >> filename... >> >> Carlos >> ___ >> gtk-app-devel-list mailing list >> gtk-app-devel-list@gnome.org >> http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list >> > ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Location entry in GtkFileChooser
Martin (OPENGeoMap) wrote: > >> Hullo, >> >> In a GTkFilechooser, how can I acess the information >> on the Location entry? I only find functions to get >> the full filename and uri but not the actual short >> filename... >> >> >> > I don´t understand well?? > > are you talking about filters??? > No, I am talking about the GtkEntry that is next to the GtkLabel that says "Location:", the place where the file shortname is written. So if I write foo.xml, I want to get that shortname back, not just the fullname, Carlos > Something like this?? > > GtkFileFilter *filter; > filter = gtk_file_filter_new (); > gtk_file_filter_add_pattern (filter, "*.doc"); > gtk_file_filter_set_name(filter, "microsoft word"); > gtk_file_chooser_add_filter (dialog,filter); > > > > ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: Location entry in GtkFileChooser
Hi Carlos. Well, I'm not familiar with GtkFileChooser, but I think you should retrieve the full filename, and then use g_path_get_basename to get the short filename. Cheers, Luis Carlos Pereira a écrit : > Hullo, > > In a GTkFilechooser, how can I acess the information > on the Location entry? I only find functions to get > the full filename and uri but not the actual short > filename... > > Carlos > ___ > gtk-app-devel-list mailing list > gtk-app-devel-list@gnome.org > http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list > ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list