[Xfce-bugs] [Bug 16542] New: Add a new widget for filename input

bugzilla-daemon at xfce.org bugzilla-daemon at xfce.org
Thu Mar 12 19:03:58 CET 2020


https://bugzilla.xfce.org/show_bug.cgi?id=16542

            Bug ID: 16542
           Summary: Add a new widget for filename input
    Classification: Xfce Core
           Product: Libxfce4ui
           Version: git
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: Medium
         Component: General
          Assignee: xfce-bugs at xfce.org
          Reporter: reubengreen73 at gmail.com
  Target Milestone: 4.14

Created attachment 9586
  --> https://bugzilla.xfce.org/attachment.cgi?id=9586&action=edit
patch to add new widget

I propose that we add a new widget to libxfce4ui which provides a version of
the GtkEntry widget especially for entering filenames for renaming or creating
files, with as-you-type checking for errors such as a filename being too long
or containing directory separator characters. The attached patch implements
this feature, and a demonstrator program for this new widget is attached to the
next comment.

The widget displays an error if the entered filename is longer than the given
maximum value or contains the directory separator. It warns the user if the
given filename starts or ends with whitespace.

The reason for adding this feature comes from trying to fix bug #13720 in
Thunar. While investigating this, I realised that there are several places in
the Thunar code where the user is asked for a filename for a new file or a new
name for an existing file, and these do not behave the same. Thus the best
option seemed to be a new widget featuring as-you-type checking of the
filename, and alexxcons suggested that this new widget should be in libxfce4ui
to allow reuse. If this widget is added to libxfce4ui, then I will patch Thunar
to use it.

Now this is the first time I have tried to implement a new GObject class, and I
have done my best to get all of the magical GObject hocus-pocus right - I have
had a careful look at existing code in libxfce4ui and elsewhere in Xfce, and
done lots of googling and reading of documents. The patch compiles and runs
without errors or warnings on my system. However, it is still likely that I
have messed things up or done something dumb. If anyone who knows about this
stuff has time to have a quick look at my code, that would be great!

Comments and criticisms are most welcome!

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Xfce-bugs mailing list