A challenge

In System Settings / Regional / Date & Time we allow users to customise the Date and Time fomats used throughout KDE, a handy feature.  Problem is the configuration is not very user-friendly, have a look at what I mean:

System Settings Date and Time

So we have some editable combo's allowing the user to either select from a few standard layouts or to type in their own layout.  But what are the valid componants of a layout that the user can type in?  It's not immediately obvious, and there's no help available I can find.  I had to go look at the source code to find out.  OK, we could fix that with some tool-tips and help doco, but it's a process still prone to error, the user is allowed to type in anything no matter how invalid or incomplete and it just gets treated as display text.  It's how Windows still does it, surely we can come up with something simpler and more usable?

Well, as you might guess, Apple did.  Have a look at their Date format 'editor':

OSX Config GUI

All you do is drag some Elements around (those blue 'bubbles'), type any text you want in between and you're done, no knowledge of format codes required.  They have something similar for time formats.

I would love to have a generic widget that does this in KDE for use in the Date and Time formats in System Settings and in the panel clock settings.  Where else could we use something like this, any ideas?  Problem is, I haven't a clue how to do the gui for this, I'm a plumber, not a painter, if you catch my drift.  So anyone want to have a crack, or at least give me some pointers where to start?  Anyone know of an existing widget I could adapt?  We already have the KWin buttons editor which does something similar, but it lacks the line edit functionality.

The generic widget would combine a special Line Edit widget and a Pallette widget.  The Line Edit would allow any text to be entered and edited and validated exactly as a standard KLineEdit.  The Line Edit could also be a combo if we wanted standard formats available for easy selection.  Element 'Bubbles' can be dragged from the Pallette onto the Line Edit and dropped in position, or dragged off to remove them.  Once in place in the Line Edit, the Element Bubble would be treated exactly as any other glyph, i.e the cursor moves around them and they can be deleted or backspaced to remove them.  API would allow the client to add Elements to the Pallette as required, setting the Element Label text, Element Example text (as goes in the Bubble), and Element Format text.  Calling text() would return the contents of the Line Edit with the Element Bubbles replaced by their Element Format text equivalent.  Accessability would require that either each Element has a key shortcut to insert it in-line, or that typing in the Element Format magically changes it into the Element Bubble.  This makes me think that what the Line Edit requires is code to recognise when a particular text substring has been entered and replace that textual display with a graphical 'Bubble', and an API to give it the Example and Format text pairs.  The drag-and-drop action would then be simply to insert the required format text and the Line Edit would convert it itself.  I'm guessing the hard part is displaying the Bubble in place of the text and getting the cursor to treat it has a single entity. 

In System Settings and the Clock widget, we could then simply have the current format displayed read-only with a little Wizard button next to it to launch the widget, keeping the config guis nice and clean and simple too.

Any suggestions / volunteers?

Or can someone come up with an even more user-friendly way than Apple?

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

existing widget

Amarok has a similar widget to edit the way it parse tags from path
you can access it using:
Edit Tags -> Guess Tags from Filename -> Basic...

agreed

I was going to post the same thing

Amarok has a nice widget, you can probably borrow some ideas there !

Ah!  I did have a nagging

Ah!  I did have a nagging feeling I'd seen something like it somewhere...  Hmm, close, but not quite, it's either full graphical or full text and I'd like a mixed mode.  Audex does something similar.  I'll have a look at the code and see whats possible.

Please don't force drag'n'drop

If possible, please don't force drag'n'drop. I hate it. It's slow and I have to use the mouse. I prefer to keep my hands on the keyboard...

Full ack, which is why I

Full ack, which is why I made the point in the post about accesability and being able to type text in instead of drag-and-drop.

Shorter Formats?

I think this is a good idea. Does Apple allow the user to switch to a "bubble" to its shorter format, e.g., "Saturday" -> "Sat" or "05" -> "5"?

Shorter Formats?

yes it's possible to set short formats [url=http://skitch.com/seanmateus/ndhrq/bildschirmfoto-2009-10-20-um-11.07.54][img]http://img.skitch.com/20091020-cjkyummkdtb2643khrnx48sp2t.preview.jpg[/img][/url][url=http://skitch.com/seanmateus/ndhrq/bildschirmfoto-2009-10-20-um-11.07.54]Click for full size[/url] - [color=#A7A7A7]Uploaded with [url=http://plasq.com]plasq[/url]'s [url=http://skitch.com]Skitch[/url][/color]  you can do that better in MHO ; but they solved it quite well!

Other possible uses

This could be useful in a find and replace UI, to use placeholders (see Coda editor).I could also use this in Gwenview importer to create folders based on image date or event name. Think of something like "Import destination: /home/me/Pictures/(year)/(event)/" where the Elements are (year) and (event).

NICE POST!

you are a good writer. evening dresses in our site are good, welcome to view them.

Custom Essays Custom

Dissertation Writing Buy

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Post new comment

The content of this field is kept private and will not be shown publicly.