Re: Add some conversion checks to GtkFileSelection (bug 50298)



Alexander Larsson <alla lysator liu se> writes:

> On 5 Mar 2001, Owen Taylor wrote:
> 
> > Look like basically the right patch, in any case. I think it just needs
> > to be somewhat more comprehensive in what it checks, and perhaps the
> > error messages can be improved a bit.
> 
> How about this one?
> 
> I'm not sure about the warning for entering non-convertable text in the
> entry though.

I think that popping up dialogs in response to a user editing
text in an entry is something you want to avoid. It's a very jarring 
sudden switch of modes.

I really think that simply not allowing not-allowed filename characters
to be entered is the best solution (perhaps with a gdk_beep() 
for supplemental feeback.)

The main problem I see with this is that if the user cut-and-pastes a
long string containing some not-allowed characters, nothing happens.

Two more possibilities:

 - Export g_filename_encoding() and use g_convert_with_fallback() to
   convert not-allowed characters into underscores or something in
   ::insert_Text. Might be a little confusing, but it gives more
   feedback and handles the paste case better.

 - Pack an label under the entry, and when the text can't be converted,
   put text in there:

    "The filename contains characters that can't be saved."

   This is basically like your current code, except that it avoids
   popping up dialogs.

Regards,
                                        Owen




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]