This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Kdialog Menu generated by script

Tags: None
(comma "," separated)
papageno
Registered Member
Posts
2
Karma
0

Kdialog Menu generated by script

Thu Apr 01, 2010 6:20 pm
Hi,

I'm trying to create a function for a bash script which generates the menu entires by variables. Those variables are stored in a file called .vlc-phone.conf which looks like

Code: Select all
IP1=192.168.0.1,server
IP2=192.168.0.2,server2


I've added a function which reads the variables into a line which looks like:
Code: Select all
MENU=' 1 server1  2 server2 '


Now this should send to kdialog to display the menu.

I've tried many posibilities but only this brings up a menu
Code: Select all
exec kdialog --menu "header" eval $TEXT


But unforunaly all option in one menu entry.

So, I have 2 questions:

1. How to create " in the script so that I get a text like MENU=' 1 "server1" 2 "server2" ' sot that I may use entries with more spaces.

2. How to parse this line to kdialog, that it displays a menu with the given number of options.

I would be very glad if someone could give me a hint.

Thanks
hans
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: Kdialog Menu generated by script

Thu Apr 01, 2010 11:30 pm
Testing on Trunk confirms that the --menu switch is currently broken, as the item selected isn't what the command returns. Can you please file a bug report at bugs.kde.org?


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
papageno
Registered Member
Posts
2
Karma
0
Hi bcooksley,

thank you for your answer. I did some further tests. Question Nr. 1 is solved by adding \" to the string function. So it looks lile this.
Code: Select all
TEXT="$TEXT $I\" "$tmp3a" \""


For question #2 I will follow your answer and file a bug report. Just for your understanding I use the following call:
Code: Select all
   RESULT=`kdialog --menu $3 eval $TEXT`


Kind Regards
Hans


Bookmarks



Who is online

Registered users: Bing [Bot], blue_bullet, Google [Bot], rockscient, Yahoo [Bot]