Option to set no title for the folderview applet

Review Request #100750 - Created Feb. 25, 2011 and submitted

Farhad Hedayati Fard
Let the user set a blank label. The label should not take up any space when it is blank.
Works fine here! 
Farhad Hedayati Fard
Farhad Hedayati Fard
Sebastian Kügler
Farhad Hedayati Fard
Review request changed

Change Summary:

removed the UI option, now an autocompletion box is opened whenever the user wants to edit the title, it has three values :

* Empty
* Default title
* Full path 

If the user enters nothing (labelEdit.isEmpty()) "Empty" is used but the text of labelEdit is changed to "Empty" next time the user opens the config dialog.
Also, If "Default title" or "Full path" is chosen, labelEdit shows these values instead of the actual default title or full path...


Revision 3 (+81 -20)

Show changes

Aaron J. Seigo
nice idea :)

there is a string translation (localization) issue on lines 615-617 and a handful of whitespace issues. once those are addressed, please commit.
  1. * On strings, some thoughts:
       - For the options, "No title" or, maybe better, just "None" is more explicit about what's going to happen than "Empty" (you'll end up with no title and not an empty space) and, possibly, "title" is redundant in "Default title" option (you're setting the title, so "Default" should do it); and
       - Maybe there's no more point on keeping the "Custom" in the label (I suggest dropping it and leaving it just as "Title", since you're actually setting the options for the title rather than just customizing its text).
    * On the (agreed, great) idea for the widget, if it's an editable combobox (that is, if the options don't come up only if the user types something, less discoverable) the user can, instead of exclusively typing, always just open the drop-down-list of options and choose one of the three or, then, type anything he wants in place.
  2. I agree J! Thanks for your nice opinions :)
    I think that the current completion box is a little bit ugly, IMHO It's better to create a custom widget for this rather than using KLineEdit with completionbox (maybe inherit from QComboBox?).
    Aaron, Sebastian, please let me know if you think this is OK so that I start implementing the widget! ;)
  3. Farhad, I don't think there's a need for a custom widget: KComboBox have autoCompletion (never looked for it before, Qt Designer to the rescue =) ) ...
  4. I edited the texts (Default title to Default and Empty to None) and fixed the problems that Aaron mentioned, But I don't know how to do the Combobox combined with lineEdit using KComboBox...
    I'm going to push my changes, But I'll try to change the KLineEdit to something more appropriate that is somehow like KComboBox with a lineEdit and autocomplete and create another review request for that :)
plasma/applets/folderview/folderview.cpp (Diff revision 3)
the strings need to be wrapped in i18n, e.g. i18n("Empty")
instead of "if (!m_blankLabel)" with the "if it is blank" in the else, please reverse for readability so it is "if (m_blanLabel) { .."
plasma/applets/folderview/folderview.cpp (Diff revision 3)
should be on same line: } else {
plasma/applets/folderview/folderview.cpp (Diff revision 3)
should be on same line
plasma/applets/folderview/folderview.cpp (Diff revision 3)
should be on same line
plasma/applets/folderview/folderview.cpp (Diff revision 3)
should be on same line
Commit Hook
This review has been submitted with commit 40f36dd3cdd7f6604c0b6f2179c42dc053190fbe by Farhad Hedayati Fard.