PupShutdown-3.0

Miscellaneous tools
Message
Author
radky
Posts: 977
Joined: Mon 03 May 2010, 03:13

#31 Post by radky »

An alternative approach which I have adopted is to edit the quick launch menu in ICEWM to provide icons for CD insert/eject & PupShutdown on the taskbar.
ETP,
Launching either PupShutdown or PupControl’s Shutdown manager from the quick launch menu of IceWM is an interesting approach. Thanks for sharing. :)

Works eggzellently!
mickee,
Thanks for your positive comments. By the way, you and ETP have great avatars. :D

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

localised version of PupShutdown-16

#32 Post by don570 »

Have you been thinking about localising PupShutdown?
I recently tried Snow Puppy and it had PupShutdown installed.

http://www.murga-linux.com/puppy/viewto ... 94&t=63163

http://www.murga-linux.com/puppy/viewtopic.php?t=66836

Using Zigbert's method I did a quick and dirty localisation so that I
could switch between French and English by changing the country.

You might be interested in the code. It's quite simple.
Install this pet on Snow puppy and switch back and forth between
French and English.

http://www.filedropper.com/pupshutdown-snow-16

Here is what it looks like in French. I had to put in hard blank spaces
to get the buttons to look symmetrical.

Image
______________________________________________________________

User avatar
mickee
Posts: 207
Joined: Tue 08 Feb 2011, 14:59
Location: Saskatoon SK Canada, Gateway 5300 Laptop, 600MHz Celeron, 384MB RAM, lucid puppy 5.2 (Full Install)
Contact:

#33 Post by mickee »

radky wrote:mickee,
Thanks for your positive comments. By the way, you and ETP have great avatars. :D
I use that avatar alot. It's actually a 6 inch statue I have, complete with lots of drool. It's from "Mickey and The Runaway Brain" - a sort of Dr. Jekyl/Mr. Hyde cartoon. This version of Mickey Mouse is from when he traded brains with his monster. The funnier part was mickey's voice coming out of the gigantic monster's body, LOL.
[img]http://i17.photobucket.com/albums/b68/The_Wizard_of_OZ/Lindows-NOT-1.jpg[/img]
Linux is [i][b]NOT[/b][/i] Windows. Doesn't [i][b]PRETEND[/b][/i] to be, Doesn't [i][b]WANT [/b][/i]to be; Don't try to [i][b]MAKE[/b][/i] it be.

radky
Posts: 977
Joined: Mon 03 May 2010, 03:13

Re: localised version of PupShutdown-16

#34 Post by radky »

don570 wrote:Have you been thinking about localising PupShutdown?
I recently tried Snow Puppy and it had PupShutdown installed.
Thank you for promoting the importance of GUI localization. As true for most in the Puppy community, I have followed your recent forum posts with considerable interest, and I applaud your insight and dedication.

Most of my applications, including PupShutdown, are structured for a certain GUI symmetry that I try to maintain for all global font sizes (72-144 dpi). For some graphical interfaces, a text string that looks OK at 78-dpi may distort the GUI at higher dpi settings. In some instances, by simply adding a few extra characters to certain text strings, a GUI can distort significantly (see below for your example of French localization in PupShutdown at 90-dpi screen resolution).

I could change the format of PupShutdown by increasing the size of the main GUI, and by extending the horizontal dimension of the access buttons, but it would be difficult to anticipate a size that would be sufficient for the translated text of all locales. Also, the large access buttons would appear disproportionate when the localized text strings are small. Even so, I’ll continue to look for ways to embrace localization. Thanks again for your suggestions. :)
Attachments
PSD-En.png
(45.24 KiB) Downloaded 1627 times
PSD-Fr.png
(49.82 KiB) Downloaded 1671 times

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

Fluppy shutdown app

#35 Post by don570 »

Jemimah has written a similar shutdown application for Fluppy 013
It is very simple. Just an hbox and then 3 vboxes inside that hbox.
There is no attempt by Jemimah to control the width of a button.
It works well but doesn't look very fancy...... but then it was probably
written in a rush.

Here's a picture of the French version from

http://www.murga-linux.com/puppy/viewtopic.php?t=65222

Image

___________________________________________________________

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

script to show width of button

#36 Post by don570 »

I did a quick experiment to see if buttons can be placed easily
in a window in a script.

Zigbert likes to specify the width of his buttons (and he's the expert)

So I looked at some of his code and made a script.

I made an hbox and then put 4 vboxes inside.

I then experimented with each of the vboxes.

Enclosed is the screen image.

The left hand side vbox is just some non-breaking characters.

The next vbox has a width-request of 100.

The next vbox has a width-request of 200.

Then the far right vbox has a width-request of 100,
but to make the space open I put a few non-breaking characters
in the label <label>   </label> .

It seems to work well.

Image

Here's the final script.

Code: Select all

#!/bin/sh

export shutdown=" 
<window title=\"Experiment\" icon-name=\"gtk-stop\">

<hbox>

   <vbox>
   <text><label>             </label></text>   
   </vbox>

   <vbox>
   <text width-request=\"100\"><label>First button</label></text>
   <button>  
      <label>Lock</label>    
      <input file icon=\"lock48\"></input>
      <action>/usr/local/apps/Xlock/AppRun &</action>
      <action type=\"exit\">Exit-NOW</action>
   </button>
   </vbox>

   <vbox>
   <text width-request=\"200\"><label>Second button</label></text>
   <button>   
       <label>Lock</label>    
       <input file icon=\"lock48\"></input>
       <action>/usr/local/apps/Xlock/AppRun &</action>
       <action type=\"exit\">Exit-NOW</action>
   </button>
   </vbox>
   
    <vbox>
    <text width-request=\"100\"><label>   </label></text>
    </vbox>
    
</hbox>
</window>
"

#echo "$shutdown" | gtkdialog --stdin
gtkdialog3 --program=shutdown --center

unset shutdown

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

Barry Kauler localisation

#37 Post by don570 »

Barry Kauler talked about localising the first screen in Puppy
on this thread

http://murga-linux.com/puppy/viewtopic. ... &start=300


_________________________________________________

radky
Posts: 977
Joined: Mon 03 May 2010, 03:13

#38 Post by radky »

don570 wrote:Jemimah has written a similar shutdown application for Fluppy 013
Yes, PupShutdown is just one of many GUI options available to close a Puppy session. Jemimah, runtt21, sc0ttman, tazoc, ttuuxxx, zigbert and other developers have included very nice shutdown managers in their Puppy derivatives. Of course, there is also the default shutdown manager available in the menu of all Puppy releases. The choices are many, and localization for many of those would be relatively easy. :)
don570 wrote:I did a quick experiment to see if buttons can be placed easily in a window in a script.
Yes, button placement in gtkdialog scripts is relatively easy, and PupShutdown incorporates variable button width-request values to automatically compensate for text-strings which vary in length as the global font size is changed. The question (in my mind) is how to best structure the PupShutdown GUI to accommodate the variability in text-string width inherent in various translations. For example, "Restart X" becomes "Relancer le serveur X" in your example of the French translation for PupShutdown, and that translated text string requires a very wide button when viewed at high screen dpi values, such as 144 dpi. Structuring a gtkdialog GUI to look OK in a narrow range of screen dpi values is not difficult. However, a GUI designed to look OK at 78-96 screen dpi, may not retain the same symmetry or visual appeal when viewed at higher screen dpi values. I will continue to experiment. :)

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

suggestion for pupshutdown

#39 Post by don570 »

:idea: I have a suggestion to help localization.

I suggest that you have two interfaces built into one program.
The interface that is in use would depend on the LANG variable.

For instance if LANG is English then the user gets your attractive interface.

Then when the user changes to another LANG
such as French you would use an inferface like Jemimah's program
which is more favorable to localization.

I don't know of any program that does a change of inferface
simply due to localization but I think it is a possibility.
Zigbert's method of localization is compatible with this idea, I think.
______________________________________

radky
Posts: 977
Joined: Mon 03 May 2010, 03:13

Re: suggestion for pupshutdown

#40 Post by radky »

don570 wrote::idea: I suggest that you have two interfaces built into one program. The interface that is in use would depend on the LANG variable.
Thanks for the suggestion. I'll think about it for a few days. :)

CoronelN
Posts: 68
Joined: Wed 22 Dec 2010, 17:18

#41 Post by CoronelN »

Hello, is there any way to remove the message about removing the CD when rebooting ?

i looked at the code and tried commenting the msg but then it wont reboot at all.....

EDIT:

I understood the code :D

Now it reboots, no message waiting for me to remove a CD I dont have :D
However I would like it to have a timer... lets say 10 seconds to abort the shutdown.... just dont know how to implement it :P

Also I managed to add (simple copy paste)
to the Dialog for power off where it also asks to remove the CD
the options to hybernate and suspend.

Quite useful for netbook/notebook users.

I tried to attach the modified file but the forum dont allow me, PM if you like it.
Attachments
PSDhack.png
PSD dialog
(33.46 KiB) Downloaded 1372 times
PSDhackedpoweroffDialog.png
Power off Dialog
(55.47 KiB) Downloaded 1371 times

CoronelN
Posts: 68
Joined: Wed 22 Dec 2010, 17:18

#42 Post by CoronelN »

Toutu or French localization...

I live in france i am married to a french girl... I almost arrived to the point where i understand the french way of thinking....

I mention this regarding the GUI distortion on the French localization.

May I suggest:

Power-Off --> Arrêter le P.C becomes: Arreter
Reboot --> Redemarrer le P.C --> Redémarrer
Log-out --> Démarrer la Console --> Fermer X
Lock Screen --> Xlock bloquer l'écran --> Verrouiller


Restart X --> Relancer le serveur X --> Relancer X
Restart WM --> Relancer JWM --> Relancer WM (it restarts whatever you are running not just JWM)
Manage Task --> Gestionaire de tâche --> Gestion des tâches
Backup flies --> Gadmin - rsync --> sauvegarde (or other single word) that gadmin assumes you know what actually is gadmin....



See a pattern... Simplify the names of your localization and try to keep them as close as possible to the original english ones and the distorsion will be reduced...

I will give a try to spanish localization from the french file to feel i actually did something useful.

Cheerio

radky
Posts: 977
Joined: Mon 03 May 2010, 03:13

#43 Post by radky »

CoronelN wrote:Toutu or French localization...
Hi CoronelN,

Thank you for your thoughts and recommendations.

I'm preparing a localized version of PupShutdown, which should accept the variance of text strings in different languages. I'll keep you posted. :)
Attachments
PSD-Loc.png
(33.01 KiB) Downloaded 1367 times

CoronelN
Posts: 68
Joined: Wed 22 Dec 2010, 17:18

#44 Post by CoronelN »

Hey Radky

I see you made the dialog wider to accomodate for the long names.

I tried to dl the french hack but the link is broken, i would like to experiment with spanish.

By looking at your code localization is going to be a problem as there are lots of text inside the dialogs.

the ideal would be to replace them all with a VAR and call it in from your code but i dont know how efficient that will be as i understand that bash even thou powerful is not a complete programming enviroment and maybe it will be too long a code + constant VAR calling etc...

I have not looked at the other files in your pet but if i get the time i can try to make a test dirty mod to see if we can read the VARs from a file and load them then u to anyone to localize/personalize the dialogs...

the drawback is that i am not much of a bash programmer but i get my way around

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

experiment with pupshutdown

#45 Post by don570 »

If you want to experiment with another language
First install snow puppy and set language to French
then install this pet. I used Zigbert's method of localization.

__________________
Attachments
PupShutdown-snow-1.6.pet
Experiment with pup shutdown
(64.51 KiB) Downloaded 960 times

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

PupShutdown-1.6

#46 Post by L18L »

CoronelN wrote:the ideal would be to replace them all with a VAR and call it in from your code but i dont know how efficient that will be as i understand that bash even thou powerful is not a complete programming enviroment and maybe it will be too long a code + constant VAR calling etc...
Using just GNU gettext is working in shell. 8)
see screenshot for Afrikaans and Française.

Code: Select all

#!/bin/bash
#PupShutdown 1.6
#Copyright 2011 GPL3
#Roger Grider (radky)
# i18n L18L
export TEXTDOMAIN=pupshutdown
.
.
.
#ENVIRONMENT_LANG=`echo $LANG | sed "s/\(..\).*/\1/"` ##detect language 
#case $ENVIRONMENT_LANG in
#af)	PUP_POWEROFF="Power-Off   "
#	PUP_REBOOT="   Herlaai      "
#	PUP_PROMPT="Aan Prompt "
#	PUP_LOCK=" Skermsluit  "
#	PUP_RESTART="Herbegin X  "
#	PUP_RESTARTWM="Herbegin WM "
#	PUP_TASK="Beheer Taak   "
#	PUP_BACKUP=" Backup Files  " ;;
#*)	PUP_POWEROFF="  Power-Off    "
#	PUP_REBOOT="    Reboot      "
#	PUP_PROMPT="   Log-Out      "
#	PUP_LOCK="Lock Screen   "
#	PUP_RESTART="  Restart X     "
#	PUP_RESTARTWM=" Restart WM   "
#	PUP_TASK="Manage Task   "
#	PUP_BACKUP=" Backup Files   " ;;
#esac
	PUP_POWEROFF=$(gettext "  Power-Off    ")
	PUP_REBOOT=$(gettext "    Reboot      ")
	PUP_PROMPT=$(gettext "   Log-Out      ")
	PUP_LOCK=$(gettext "Lock Screen   ")
	PUP_RESTART=$(gettext "  Restart X     ")
	PUP_RESTARTWM=$(gettext " Restart WM   ")
	PUP_TASK=$(gettext "Manage Task   ")
	PUP_BACKUP=$(gettext " Backup Files   ")
#About dlg...
.
And here is the language template file pupshutdown.pot

Code: Select all

# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PupShutdown 1.6\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-06-21 17:26+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: PupShutdown:85
#, sh-format
msgid "  Power-Off    "
msgstr ""

#: PupShutdown:86
#, sh-format
msgid "    Reboot      "
msgstr ""

#: PupShutdown:87
#, sh-format
msgid "   Log-Out      "
msgstr ""

#: PupShutdown:88
#, sh-format
msgid "Lock Screen   "
msgstr ""

#: PupShutdown:89
#, sh-format
msgid "  Restart X     "
msgstr ""

#: PupShutdown:90
#, sh-format
msgid " Restart WM   "
msgstr ""

#: PupShutdown:91
#, sh-format
msgid "Manage Task   "
msgstr ""

#: PupShutdown:92
#, sh-format
msgid " Backup Files   "
msgstr ""
make spanish:

Code: Select all

msginit --locale=es
will create es.po

Code: Select all

geany es.po

fill msgstr with Spanish translation and then

Code: Select all

msgfmt es.po -o - > /usr/share/locale/es/LC_MESSAGES/pupshutdown.mo

Start in Spanish:

Code: Select all

LANGUAGE=es /usr/local/PupShutdown/PupShutdown
If your locale is es do not need LANGUAGE=es :lol:
Attachments
PupShutdown-1.6.png
(39.64 KiB) Downloaded 3449 times

radky
Posts: 977
Joined: Mon 03 May 2010, 03:13

Re: PupShutdown-1.6

#47 Post by radky »

Hi Don570 and L18L,

Sorry for the delay in releasing a localized version of PupShutdown. :oops:
I've been involved in other projects, but I hope to upload the next version of PupShutdown in the near future.

Thanks for your patience ! :D

radky
Posts: 977
Joined: Mon 03 May 2010, 03:13

#48 Post by radky »

Version 1.7. See main post.
1 - Enhanced access to configuration options.
2 - Enhanced access to suspend features in ACPI compliant notebooks.
3 - Added option to enable or disable the ‘Remove CD

User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

review pupshutdown

#49 Post by don570 »

It works great in French and English!!

I have a suggestion for an improvement.

I find it a bit confusing that a couple of the buttons
do nothing when first clicked.

When the application is run for the first time,
you should check for the existence of 'pmirror'
and 'pprocess' and if they are installed you
should connect them to the corresponding
buttons in the window.

radky
Posts: 977
Joined: Mon 03 May 2010, 03:13

Re: review pupshutdown

#50 Post by radky »

don570 wrote:It works great in French and English!!

I have a suggestion for an improvement.

I find it a bit confusing that a couple of the buttons
do nothing when first clicked.

When the application is run for the first time,
you should check for the existence of 'pmirror'
and 'pprocess' and if they are installed you
should connect them to the corresponding
buttons in the window.
Thanks for the suggestion. An update is on the way. :)

Post Reply