Author Topic: Converting our in House Scripts to PerlGTK  (Read 12821 times)

ongoto

  • Guest
Re: Converting our in House Scripts to PerlGTK
« Reply #15 on: August 03, 2010, 09:20:13 PM »
If you have gezSwitch4 installed try this and see if PCC launches it.
As root of course and back-up.

Step 1: Goto /usr/sbin/  and do:
                    ln -s /usr/local/bin/gezSwitch-4.pl   gezSwitch4

Step 2: Open /usr/lib/perl5/vendor_perl/5.10.1/MDV/Control_Center.pm
   Find this section (line 116)
        
         "Boot Theme" =>
         {
          binary => "$sbindir/drakboot --splash",
          embedded => 1,
          description => N("Set up boot graphical theme of system"),
          long_description => N("Select the graphical theme of the system while  booting"),
          icon => 'boot-theme-mdk',
         },
        
   Change drakboot --splash to gezSwitch4   (the name of the link you just made)
   
Step 3. Open /usr/sbin/drakconf.real
   Find this section (line 545)
   
   {
                title => N("Boot look'n feel"),
                list => [
                    #"Boot Theme",
                ]
        },
 
   Uncomment #"Boot Theme",
   
Step 4. Run PCC and select boot in left panel.  You'll see a new section at the bottom 'Boot Look and Feel'
         Click the icon and see what happens.  gezSwitch4 should launch.

   When I close gezSwitch4 I get an error warning.     ???

         Try skipping steps 1 & 2 and just uncomment in step 3.  When you click the icon you don't see Drakboot --splash.
          You see the autologin tool.    ???

« Last Edit: August 03, 2010, 09:53:07 PM by ongoto »

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15846
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Converting our in House Scripts to PerlGTK
« Reply #16 on: August 04, 2010, 06:46:04 AM »
Followed those steps, but it isn't showing in PCC. I'll try a reboot.

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15846
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Converting our in House Scripts to PerlGTK
« Reply #17 on: August 04, 2010, 07:04:09 AM »
The error was mine. I created the link in /usr/bin. ::) I didn't notice my typo in the address field. ::) :( I corrected the mistake and the new entry in PCC shows.

Quote from: ongoto
When I close gezSwitch4 I get an error warning.  ???

Me, too. ???

Offline Mark342

  • Sr. Member
  • ****
  • Posts: 334
Re: Converting our in House Scripts to PerlGTK
« Reply #18 on: August 04, 2010, 12:40:31 PM »
You need to set embeded to -1 because your GUI isn't embedded in the Control Center window.
That's why you are getting the error.

I've been working on that. ;D




We get the menu bar for "free" when it is launched from the PCC
When launched by itself, it looks the same only with it's own window title and without the menu bar.

To embed it you have to write the window code using mygtk/ugtk instead of perl-gtk.
This may seem hard (what?, I have to learn ANOTHER library) , but its actually pretty easy because mygtk/ugtk are very similar to perl-gtk.
So far,  It has only involved:
first gui:
removal  of 28 lines
addition  of 25 lines  

second gui:
removal of some code in the main_window subroutine
addition of 14 lines

I was going to show how to make a entry in the PCC for this, but it seems ongoto beat me to it. :D
The only thing that I can add is an icon for the entry:
Code: [Select]
icon => 'ezswitch',The icon must be placed in /usr/share/mcc/themes/default/ and named ezswitch.png.
Also, I added a line in the code that gives the window an icon.
This icon is placed in the same folder.

Here is the code for the embedded versions of the GUI's:
1st gui link:
http://www.box.net/shared/pyl05u8hpv
EDIT: I accidentally removed the license from the file, new version has been uploaded

2nd gui link:
http://www.box.net/shared/3aszd5use0

I changed the check list to a radio list in the second gui because a radio list is usually used instead of a checklist when only one option can be selected at a time.

You will get a lot of these when you launch one:
Code: [Select]
Use of uninitialized value $name in concatenation (.) or string at /usr/lib/libDrakX/ugtk2.pm line 610.
Use of uninitialized value $real_windowwidth in subtraction (-) at /usr/lib/libDrakX/mygtk2.pm line 1221.

As far as i can tell this has no effect on execution and only appears because of the -w (debug) option in the first line.


Also, is this all of our scripts?
adlocal
getopenoffice
ezswitch
repository-speed-test

Did I miss anything?
« Last Edit: August 04, 2010, 02:02:35 PM by Mark342 »
Anything worth doing is worth overdoing.

Registered Linux user #493318
Register yourself here: Linux Counter

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15846
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Converting our in House Scripts to PerlGTK
« Reply #19 on: August 04, 2010, 03:09:44 PM »
..... Also, is this all of our scripts?
adlocal
getopenoffice
ezswitch
repository-speed-test

Did I miss anything?

There will be another one as soon as Leiche and I can work the bugs out.


Offline parnote

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 4436
  • The truth is out there ... PCLinuxOS!
Re: Converting our in House Scripts to PerlGTK
« Reply #20 on: August 04, 2010, 04:43:26 PM »
..... Also, is this all of our scripts?
adlocal
getopenoffice
ezswitch
repository-speed-test

Did I miss anything?

There will be another one as soon as Leiche and I can work the bugs out.



You guys are welcome to include TouchpadToggle if you like. I can barely do bash scripts ... PerlGTK is outta the question for me, atm.

parnote
PCLinuxOS Magazine Chief Editor

Linux Registered User #485009

In a world without walls, who needs Windows?

PCLinuxOS Wiki: Contribute tips/tricks/how-to's!

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15846
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Converting our in House Scripts to PerlGTK
« Reply #21 on: August 04, 2010, 04:54:19 PM »
Paul,
"can barely" is better than "not at all." The most important thing, IMO, is the determination to keep at it until you get the desired result; i.e. ya gotta get stubborn. ;D

Offline parnote

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 4436
  • The truth is out there ... PCLinuxOS!
Re: Converting our in House Scripts to PerlGTK
« Reply #22 on: August 04, 2010, 05:03:10 PM »
Stubborn? I got that covered. My problem is a lack of time. The magazine consumes much of my available time. I'm slowly learning some bash scripting, when I have things sufficiently caught up on the magazine ... and of course, making sure I spend an appropriate amount of time with my lovely (and very understanding!) wife.

But believe me ... stubborn is covered!

parnote
PCLinuxOS Magazine Chief Editor

Linux Registered User #485009

In a world without walls, who needs Windows?

PCLinuxOS Wiki: Contribute tips/tricks/how-to's!

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15846
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Converting our in House Scripts to PerlGTK
« Reply #23 on: August 04, 2010, 05:09:51 PM »
Stubborn? I got that covered. My problem is a lack of time. The magazine consumes much of my available time. I'm slowly learning some bash scripting, when I have things sufficiently caught up on the magazine ... and of course, making sure I spend an appropriate amount of time with my lovely (and very understanding!) wife.

But believe me ... stubborn is covered!

parnote

 :D :D :D Thought it might be. ;) ;D

Offline Mark342

  • Sr. Member
  • ****
  • Posts: 334
Re: Converting our in House Scripts to PerlGTK
« Reply #24 on: August 05, 2010, 03:40:13 AM »
Also there is no way to know who is working on what and where they are with it, and so on.  A thread within this one for each project might help keep us in the know about what's happening.  Else we might all be duplicating each others efforts. ?

Also some kind of versioning scheme so people could keep track of the latest changes and be working on the most current script, etc. ?

+1 to both of these




Anything worth doing is worth overdoing.

Registered Linux user #493318
Register yourself here: Linux Counter

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15846
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Converting our in House Scripts to PerlGTK
« Reply #25 on: August 08, 2010, 04:56:24 AM »
I've downloaded the tar file and will test this morning.

Offline daniel

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3731
  • God knows, i'm not an Angel!
    • Tipps und Tricks
Re: Converting our in House Scripts to PerlGTK
« Reply #26 on: August 08, 2010, 08:17:28 AM »
..... Also, is this all of our scripts?
adlocal
getopenoffice
ezswitch
repository-speed-test

Did I miss anything?

There will be another one as soon as Leiche and I can work the bugs out.



Sorry i don't know  a another script, that should be convert...

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15846
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Converting our in House Scripts to PerlGTK
« Reply #27 on: August 08, 2010, 03:33:36 PM »
On my test box, the new script works very well, so I decided to install it on my main box. ::) But it does not show up in the menu or PCC from my user account. Clicking the drakconf.real script in /usr/local/bin/EZ/ launches PCC with the entry, but that opens the autologin set up. ??? If I launch the new script with gksu /usr/local/bin/EZ/gezSwitch4.pl in the terminal, it works fine. ??? ::) ???

I'm beginning to think something is wrong with my install. :(

Offline Mark342

  • Sr. Member
  • ****
  • Posts: 334
Re: Converting our in House Scripts to PerlGTK
« Reply #28 on: August 08, 2010, 04:41:57 PM »
I think i know what the problem is.

There shouldn't be a /usr/local/bin/EZ directory.
It should be /usr/local/EZ.

The install script looks for the files in the /usr/local/EZ directory.
If they aren't there, it won't copy any files to the required locations.

I had the same problem myself, so this is probably it.
=====================================

While the website was down, I was doing some more work on gezSwitch4.

gezSwitch version 0.4.2
Changes:
Clicking another theme no longer changes the theme. An apply button was added instead.
List was changed into a true radio list that only allows one selection at a time.
Moved the theme switching process to an ithread. (separate file is no longer needed)
The progress dialog now exits when the theme has been changed. (It was estimated before);
The progress bar was changed to 'pulse' because there is no way to monitor the progress of "switch-themes".
The close button in the window decoration of the progress dialog will no longer close the dialog while the theme is being switched.
I THINK all of ongoto's new changes are in here as well.
Download:
http://www.box.net/shared/z48tuazizz

« Last Edit: August 08, 2010, 04:43:36 PM by Mark342 »
Anything worth doing is worth overdoing.

Registered Linux user #493318
Register yourself here: Linux Counter

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15846
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Converting our in House Scripts to PerlGTK
« Reply #29 on: August 08, 2010, 05:54:32 PM »
That fixed the problem. Thanks, Mark.

One thing --
Quote
The progress bar was changed to 'pulse'.....

The 'pulse' is a blue square running back and forth in the progress pane so fast it blurs and disturbs the eyes somewhat. Can it be slowed to about 1/4 the speed?