Bug 129498

Summary: setting custom button names
Product: [Applications] kdialog Reporter: Maciej Pilichowski <bluedzins>
Component: generalAssignee: David Faure <faure>
Status: RESOLVED FIXED    
Severity: wishlist    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Maciej Pilichowski 2006-06-20 17:43:50 UTC
Version:            (using KDE KDE 3.5.2)
Installed from:    SuSE RPMs

Such option would be great because using dialogs with buttons [delete lock] / [cancel] is more productive than with [yes] / [no] since you have to read the whole message.
Comment 1 Brad Hards 2006-08-22 13:30:14 UTC
Do you have a preferred API (option format / name) for this?
Comment 2 Maciej Pilichowski 2006-08-22 20:01:52 UTC
Preferred, no. My suggestions, however:

--yes-[button-]label
--no-[button-]label
etc.

  where the part "button-" is better to omit.
Comment 3 Square87 2007-12-16 10:33:43 UTC
Hi.
I suggested to have something more similar to actual code.
Consider it as a checklist. I mean (for example):

kdialog --button 1 "Close All window" off 2 "Close only this window" off 3 "Cancel" on

When you press a button it returns 1, 2 or 3
if you press enter it returns 3 (in this case)
If you press X to close kdialog it returns nothing.
Bye
Comment 4 Maciej Pilichowski 2007-12-16 10:40:49 UTC
What does this on/off mean? Default button? It can be only one, so it is a bit redundant tu put "off".

> If you press X to close kdialog it returns nothing.

This would be bad. With such solution it is hard to link cancel button with X button, an "escape" key would not be assigned properly.


Comment 5 Square87 2007-12-16 11:13:47 UTC
Hi
Yes on/off should set the default value. It could be redundant but it is much similar to radiolist.
For example, radiolist is:

kdialog --radiolist "What do you want to do?" 1 "Close all windows" off 2 "Close only this window" off 3 "Close" on

If you put more than one as default value only the last value set as "on" it will be considered as default value.

Now consider that code with checklist:
kdialog --checklist  "What do you want to do?" 1 "Close all windows" off 2 "Close only this window" off 3 "Close" on

The syntax is the same. But for checklist you can set more then one value and also more then one default value.

Now i don't know how they works i can just image...
But the suggestion is to have a syntax like radiolist (before i said checklist, but i forgot that with checklist i can select more than one value).

About the X and Escape: radiolist (and checklist) return an empty string. But i understand what do you mean maybe you can link the default button with them.
Comment 6 Jaime Torres 2010-10-29 20:26:37 UTC
SVN commit 1191144 by jtamate:

Add custom button labels for yes, no, continue and cancel buttons
--yes-label <text>
--no-label  <text>
--cancel-label  <text>
--continue-label  <text>
For example:
kdialog --yes-label "&Siiiii" --no-label "&Noooooo" --cancel-label "&Cancelaaar" --yesnocancel Hola

BUG: 129498



 M  +50 -5     kdialog.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1191144