Summary: | Title option doesn't work | ||
---|---|---|---|
Product: | [Applications] kdialog | Reporter: | Jason <jglane> |
Component: | general | Assignee: | David Faure <faure> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
Jason
2003-04-09 12:22:05 UTC
Subject: kdebase/kdialog CVS commit by faure: --title is filtered out by Qt, let's use --caption instead CCMAIL: 57040-done@bugs.kde.org M +4 -4 kdialog.cpp 1.9 M +7 -7 test 1.2 --- kdebase/kdialog/kdialog.cpp #1.8:1.9 @@ -67,5 +67,5 @@ static KCmdLineOptions options[] = - { "title <text>", I18N_NOOP("Dialog title"), 0 }, + { "caption <text>", I18N_NOOP("Dialog caption (title)"), 0 }, { "separate-output", I18N_NOOP("Return list items on separate lines (for checklist option)"), 0 }, @@ -89,8 +89,8 @@ int directCommand(KCmdLineArgs *args) bool separateOutput = FALSE; - // --title text - if (args->isSet("title")) + // --caption text + if (args->isSet("caption")) { - title = QString::fromLocal8Bit(args->getOption("title")); + title = QString::fromLocal8Bit(args->getOption("caption")); cout << title.local8Bit().data() << endl; } --- kdebase/kdialog/test #1.1.1.1:1.2 @@ -1,4 +1,4 @@ echo "yesno box:" -kdialog --title "This is a yesno box" --yesno "Choose: yes or no" +kdialog --caption "This is a yesno box" --yesno "Choose: yes or no" if [ $? = 0 ]; then echo " your choice was: yes" @@ -8,8 +8,8 @@ echo "message box:" -kdialog --title "This is a message" --msgbox "Well, this is it:\nthe message" +kdialog --caption "This is a message" --msgbox "Well, this is it:\nthe message" echo "input box:" -kdialog --title "This is a input box" --inputbox "What is your name" "Joe User" +kdialog --caption "This is a input box" --inputbox "What is your name" "Joe User" if [ $? = 0 ]; then echo " you accepted" @@ -19,12 +19,12 @@ echo "text box:" -kdialog --title "This is a text box" --textbox widgets.h 400 300 +kdialog --caption "This is a text box" --textbox widgets.h 400 300 echo "menu:" -kdialog --title "This is a menu" --menu "Choose one of these" a English b German c French d Spanish +kdialog --caption "This is a menu" --menu "Choose one of these" a English b German c French d Spanish echo "checklist:" -kdialog --title "This is a checklist" --checklist "Choose some of these" a English on b German off c French off d Spanish on +kdialog --caption "This is a checklist" --checklist "Choose some of these" a English on b German off c French off d Spanish on echo "radiolist:" -kdialog --title "This is a radiolist" --radiolist "Choose one of these" a English off b German off c French on d Spanish off +kdialog --caption "This is a radiolist" --radiolist "Choose one of these" a English off b German off c French on d Spanish off Subject: kdebase/kdialog CVS commit by faure: Thanks Waldo, that's even better. Make --title work. CCMAIL: 57040@bugs.kde.org M +5 -6 kdialog.cpp 1.10 M +7 -7 test 1.3 --- kdebase/kdialog/kdialog.cpp #1.9:1.10 @@ -67,5 +67,5 @@ static KCmdLineOptions options[] = - { "caption <text>", I18N_NOOP("Dialog caption (title)"), 0 }, + { "title <text>", I18N_NOOP("Dialog title"), 0 }, { "separate-output", I18N_NOOP("Return list items on separate lines (for checklist option)"), 0 }, @@ -89,9 +89,8 @@ int directCommand(KCmdLineArgs *args) bool separateOutput = FALSE; - // --caption text - if (args->isSet("caption")) - { - title = QString::fromLocal8Bit(args->getOption("caption")); - cout << title.local8Bit().data() << endl; + // --title text + KCmdLineArgs *qtargs = KCmdLineArgs::parsedArgs("qt"); // --title is a qt option + if(qtargs->isSet("title")) { + title = QFile::decodeName(qtargs->getOption("title")); } --- kdebase/kdialog/test #1.2:1.3 @@ -1,4 +1,4 @@ echo "yesno box:" -kdialog --caption "This is a yesno box" --yesno "Choose: yes or no" +kdialog --title "This is a yesno box" --yesno "Choose: yes or no" if [ $? = 0 ]; then echo " your choice was: yes" @@ -8,8 +8,8 @@ echo "message box:" -kdialog --caption "This is a message" --msgbox "Well, this is it:\nthe message" +kdialog --title "This is a message" --msgbox "Well, this is it:\nthe message" echo "input box:" -kdialog --caption "This is a input box" --inputbox "What is your name" "Joe User" +kdialog --title "This is a input box" --inputbox "What is your name" "Joe User" if [ $? = 0 ]; then echo " you accepted" @@ -19,12 +19,12 @@ echo "text box:" -kdialog --caption "This is a text box" --textbox widgets.h 400 300 +kdialog --title "This is a text box" --textbox widgets.h 400 300 echo "menu:" -kdialog --caption "This is a menu" --menu "Choose one of these" a English b German c French d Spanish +kdialog --title "This is a menu" --menu "Choose one of these" a English b German c French d Spanish echo "checklist:" -kdialog --caption "This is a checklist" --checklist "Choose some of these" a English on b German off c French off d Spanish on +kdialog --title "This is a checklist" --checklist "Choose some of these" a English on b German off c French off d Spanish on echo "radiolist:" -kdialog --caption "This is a radiolist" --radiolist "Choose one of these" a English off b German off c French on d Spanish off +kdialog --title "This is a radiolist" --radiolist "Choose one of these" a English off b German off c French on d Spanish off Subject: Re: Title option doesn't work On Wednesday 09 April 2003 11:48 am, you wrote: > ------- Additional Comments From faure@kde.org 2003-04-09 12:48 ------- > Subject: kdebase/kdialog > > CVS commit by faure: > > --title is filtered out by Qt, let's use --caption instead That's why I couldn't figure out why if (args->isSet("title")) would never go true. An extremely quick fix, thanks! I'll test as soon as it gets to the cvs mirror. :-) |