Xdialog.pup - updated to 2.3.1 and built with gtk2

Stuff that has yet to be sorted into a category.
Message
Author
plinej
Posts: 1742
Joined: Mon 14 Aug 2006, 02:21

Xdialog.pup - updated to 2.3.1 and built with gtk2

#1 Post by plinej »

--Updated October 10th 11:30 AM EST--
--/usr/local/bin/Xdialog is a small script that points to /usr/local/Xdialog/--
--/usr/local/Xdialog/ contains Xdialog (gtk2 version) and Xdialog1 (gtk1 version)--
--the script runs the Xdialog1 version when the buildlist option is called--
--otherwise the gtk2 version will be used--
--Test it out and report in this thread--

This is an updated Xdialog built with gtk2 so there are new features since the 2.1.1 version in Puppy plus it was configured with the --with-gtk2 option so the interface is better looking. This will overwrite your existing Xdialog binary at /usr/local/bin/

Here's the changelog since 2.1.1:

18/08/06
v2.3.1 - Fixed the bug, introduced in v2.3.0, where the "Hide typing"
check button always appeared in the input boxes, regardless
of the existence of a password field.

13/08/06
v2.3.0 - Added a new --password=1|2 syntax to allow a password field
in one of the first fields of --2inputsbox and --3inputsbox.
- Added optional <red> <green> <blue> parameters for the
--colorsel widget.
- Corrected a bug in the --treeview widget which was failing to
properly build a tree when decreasing the level of an item by
more than 1, compared to the level of the previous item.
- Corrected a bug in the --colorsel widget which triggered a
GTK warning when the --icon option was used.
- Adapted a patch from Jean-Philippe Guillemin for the GTK2
version of Xdialog (this version is still seriously broken:
DO NOT use it in production projects), implementing the use
of the GTK2 stock icons for the Xdialog buttons.

06/05/06
v2.2.1 - Corrected the bug in the --dselect widget which was
returning a filename by default, instead of the directory
name. Also removed the file specific fields and buttons from
the directory selector.
- Corrected a typo in the man page.

26/01/06
v2.2.0 - Added preliminary GTK2 support (adapted from a patch by
Andrew Van Uitert). Run 'configure' with the --with-gtk2
option to enable the compilation against GTK2.
!!!! BEWARE !!!! This should be considered alpha-code,
and the GTK2 version of Xdialog does not yet implement
everything the GTK1 version got. It also got many problems
when running on non-UTF8 systems... For -SERIOUS- use, use
the GTK+ v1.2.10 version of Xdialog !
- Added the --timeout option for compatibility with cdialog
(requested by Michelle Konzack).
- Partly successful attempt at fixing a problem with some
patched GTK versions (Mandrake's, for instance) which are
reseting the theme each time all windows are closed (thus
breaking --rc-file). Still an issue with the fixed fonts of
the XDIALOG_HIGH_DIALOG_COMPAT mode, because of another
weird patch (rclocal patch): get unpatched version of GTK+
v1.2.10. Such a version is available on Xdialog's website.
- The default fixed font is now:
"-*-*-medium-r-normal-*-*-*-*-*-m-70-*-*"
(removed the iso8859-1 specification).
- Implemented a custom log message handler to prevent GTK/GDK/
GLIB from using stdout as the message output.
- Added XDIALOG_NO_GMSGS environment variable support to forbid
(when TRUE) emission of GTK/GDK/GLIB messages on stderr.
- Brazillian Protuguese translation updates (courtesy of
Ricardo Bertagna).
- Upgrade to gettext-0.14.1.

23/07/04
v2.1.2 - Added the ESC keyboard shortcut for the CANCEL/NO button.
- Added the Indonesian, Dutch, Polish, Italian, Catalan and
Swedish translations.
- Changed Xmessage and textbox samples for compatibility with
bash-less systems.
- Updated for gettext v0.13.1.
- Added fixes in the spec file for automake bugs.
Attachments
Xdialog.pup
(62.2 KiB) Downloaded 524 times
Last edited by plinej on Tue 10 Oct 2006, 18:15, edited 6 times in total.

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#2 Post by MU »

Please try, if Pupget works with it.
The former versions I compiled, could not display this window with uninstalled packages on the left, and installed ones on the right.

A big advantage of Gtk2 would be unicode-support.

Mark

plinej
Posts: 1742
Joined: Mon 14 Aug 2006, 02:21

#3 Post by plinej »

That window seems to work fine for me

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#4 Post by Lobster »

:) works OK for me (I am in 2.11 beta)
Nice job plinej - hope it gets into 2.11 or 2.12

incidentally pupget appears to now read local files too . . .
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#5 Post by MU »

unfortunately it does not work for me in Puppy 2.10 alpha.

Gtk2 (plinej):

Image

Gtk1 (inbuilt):
Image

So I wonder why it works for you.
Other Puppy?
Or maybe I have a dotpup installed, that has a character in the name, that messes up the dialog?

This will need some tests.

Mark

brad_chuck
Posts: 286
Joined: Tue 16 Aug 2005, 03:47
Location: Appalachian Mountains

This breaks PPG

#6 Post by brad_chuck »

This dotpup breaks Puppy Podcast Grabber :(

I will figure out what is wrong in the morning. 8)

plinej
Posts: 1742
Joined: Mon 14 Aug 2006, 02:21

#7 Post by plinej »

Now I see what you mean. The GTK2 version places all installed packages in the left box instead of the right. I compiled the newest version without gtk2 and it works just like the old displaying installed packages on the right. That is weird, I wonder why it does that?

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#8 Post by MU »

it might have to do with spaces in the lines, I found that they sometimes can confuse dialog-based programs.

Or maybe the new one needs ' instead of " as seperator.

Maybe this issue could be fixed with a slight modification to the pupget -script.

I had a look some weeks ago, but found no quick solution.
But this does not mean, that it would be impossible.

I just had no time yet, to have a closer look :(

Mark

plinej
Posts: 1742
Joined: Mon 14 Aug 2006, 02:21

#9 Post by plinej »

It seems that probably everything that uses Xdialog --buildlist won't work with this gtk2 version. The buildlist example that comes with the source code doesn't even work. It doesn't matter if selections are "on" or "off" they are all put in the left column. I tried changing the on and off to uppercase and tried changing the " to ' but got the same results so it seems this dotpup isn't going to be 100% compatible. I was reading up on the xdialog website and the creator isn't interested in working on gtk2 compatability but a user created a patch for it and he included it as a configuring option although he states it's still buggy. I suppose you could rename the old gtk1 version of Xdialog to Xdialog1 and then modify any portion of scripts that utilizies the --buildlist option and change that Xdialog to Xdialog1 in that line of the script. May be a pain but if you want the gtk2 option to work it may be the only workaround until someone can patch the source code appropriately.

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#10 Post by Lobster »

:( plinej, MU I am glad you pointed out the error - to confirm I am getting the same. I assumed xdialog was just the dialog box that opens before the main pupget listing. :oops:

I then thought the pupget program had been updated by Barry and was not quite working in 2.11.

When pupget decided to delete all my installed programs and did so - without any WARNING, I was still thinking it was part of a cleanup - oops. :oops:

So I have to update this program to

WARNING may delete programs from your installed pupgets. Try only on test computers

Sorry for any confusion
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

plinej
Posts: 1742
Joined: Mon 14 Aug 2006, 02:21

#11 Post by plinej »

I thought of maybe making a directory /usr/local/Xdialog/ and putting in a Xdialog1 (old gtk1 version renamed) and a Xdialog (new gtk2 version) binaries and then putting a script named Xdialog in /usr/local/bin/
The script would be something like this:

#!/bin/sh
rm -f /tmp/Xdialog.txt
rm -f /tmp/Xdialog2.txt
echo "$@" > /tmp/Xdialog.txt
grep buildlist /tmp/Xdialog.txt > /tmp/Xdialog2.txt
if [ "`cat /tmp/Xdialog2.txt`" != "" ]; then
/usr/local/Xdialog/Xdialog1 "$@"
else
/usr/local/Xdialog/Xdialog "$@"
fi
rm -f /tmp/Xdialog.txt
rm -f /tmp/Xdialog2.txt
exit

That way whenever the buildlist option is called it will use the Xdialog1 binary otherwise it will use the gtk2 version. There seems to be something wrong with the script though since I'm put in an endless Xdialog loop when trying to create a dotpup using Mark's DotPup-wizard. Maybe someone else knows what can be done with the script?

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#12 Post by MU »

Xdialog uses the errorchanel "stderr" (2) to return values.


You often use
Xdialog ... options ... 2>/tmp/result.txt

Now if you replace Xdialog with a script, then the errorchannel of this script is used, but not the one of Xdialog.

I think Barrys wizards use a different method, what might complicate things even more.

At moment I have no solution, this is just written as a possible reason for problems using this approach.

maybe if you replace this
/usr/local/Xdialog/Xdialog "$@"
with
exec /usr/local/Xdialog/Xdialog "$@"
(also the other one)
This would not start Xdialog in a subshell, but replace the current process (the script) with Xdialog.
Maybe that fixes it.

Mark

plinej
Posts: 1742
Joined: Mon 14 Aug 2006, 02:21

#13 Post by plinej »

Thanks Mark, that appears to have worked. I'll play around a bit and then make another dotpup for people to test.

plinej
Posts: 1742
Joined: Mon 14 Aug 2006, 02:21

#14 Post by plinej »

Alright ran thru a few scripts and they seemed to work with this new version. Re-download the updated file from the beginning of this thread and test it out.

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#15 Post by MU »

it still seems to be the old dotpup, /usr/local/bin/Xdialog is a binary, no script.

If you upload the new one, I'll have a look later, will leave here from work soon.
Mark

plinej
Posts: 1742
Joined: Mon 14 Aug 2006, 02:21

#16 Post by plinej »

Alright, re-uploaded again

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#17 Post by MU »

:D cool, seems to work.

Will check it intensive in the next days, if no other problems appear, this really should go into Puppy :)

It even works without temporary files, what should be prefered to avoid potential conflicts with several programs running at the same time:

Code: Select all

#!/bin/bash

a=`echo "$@" | grep buildlist`
if [ "$a" != "" ]; then
exec /usr/local/Xdialog/Xdialog1 "$@"
else
exec /usr/local/Xdialog/Xdialog "$@"
fi
Mark

plinej
Posts: 1742
Joined: Mon 14 Aug 2006, 02:21

#18 Post by plinej »

That's a good idea Mark, I'll take the tmp files out of the script.

plinej
Posts: 1742
Joined: Mon 14 Aug 2006, 02:21

#19 Post by plinej »

Okay version 3 with Mark's updated script with no temp files is now available for download at the beginning of this thread.

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#20 Post by Lobster »

Great work - downloaded and pupget is displaying correctly in Puppy Parlour Beta (Puppy 2.11)

:) hope Marks tests work out and Barry implements

can someone add here please :)
http://puppylinux.org/wikka/UnderDevelopment
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

Post Reply