[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-usability
Subject:    Re: kppp
From:       "Aaron J. Seigo" <aseigo () olympusproject ! org>
Date:       2003-02-11 19:11:16
[Download RAW message or body]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tuesday 11 February 2003 03:33, Mikolaj Machowski wrote:
> > these are really, really easy to add... anyone can do it, even if you
> > aren't a programmer. if you compile from source and are interested in a
> > short HOWTO (it's just a couple of steps) i'd be happy to oblige...
>
> Yes, please.

There are two ways of doing this, depending on how the interface was made: by 
hand or using Qt Designer. There are some commonalities between both however, 
and I'll cover those first.

Let's take a real world example and pretend that we want to add an accel to 
the "Store Password" checkbox and the "Connection name:" label in the New 
Account dialog in kppp.

We will start by finding the actual text of each and inserting an '&' right 
before the letter we want to use as the accel key. So, for instance, if we 
wanted "Store Password" to be activated by Alt-P, we would change the name in 
the source to "Store &Password". 

The same is true for the "Connection Name" label, which we might turn into 
"Connection &name". but there is one more step with this one because it's 
just a text label and needs to be told which input widget it is associated 
with. Once it is given this information, pressing Alt-N would cause the 
cursor to appear in the Connection Name textbox.

Here are the specifics on how to do this:

Qt Designer
- --------

0. Open up the file in Qt Designer
1. Click on the "Store Password" checkbox.
2. In the "Property Editor" window, scroll down to the "text" item and change 
it to "Store &password". 
3. Click on the text input next to the "Connection name:" label
4. In the "Property Editor" window, copy the "name" entry (connectname_l)
5. Click on the "Connection name:" label
6. In the "Property Editor" window, scroll down to the "text" item and change 
it to "Connection &name:". 
7. Still in the "Property Editor" window, scroll down to the "buddy" item and 
paste the name (connectname_l) of the text input into it
8. Save the changes, recompile kppp and test!

Written By Hand
- -----------

0. In the sources directory do `grep -n Store *cpp`
1. Looking through the results we'll see:

  edit.cpp:137:  store_password = new QCheckBox(i18n("Store password"), 
parent);

2. Open up edit.cpp in your text editor of choice, go to line 137 and change 
it to:

   store_password = new QCheckBox(i18n("Store &password"), parent);

3. Save the file and from the command line do `grep -n Connection *cpp`
4. Looking through the results we'll see:

  edit.cpp:54:  connect_label = new QLabel(i18n("Connection name:"), parent);

  Note the name of the label: connect_label. We'll need this later when 
setting the buddy widget.

5. Go to line 54 of edit.cpp and change it to:

  connect_label = new QLabel(i18n("Connection &name:"), parent);

6. A few lines below we see:

    connectname_l = new QLineEdit(parent);

  This is the textbox (aka LineEdit) that we are looking for.

7. Somewhere after that line (I'd suggest line 59 in this case) add:

   connect_label->setBuddy(connectname_l);

  That will make the connectname_l lineedit the buddy of the connect_label.

8. Save the changes, recompile kppp and test!

- -- 
Aaron J. Seigo
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE: The 'K' is for 'kick ass'
http://www.kde.org       http://promo.kde.org/3.1/feature_guide.php
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+SUrV1rcusafx20MRAiA3AJ9y96eGmzmqZNxx5NgHC48TSUK/WACdGpzC
pENxEwrrIIJ33HVOkKkb+R0=
=mawk
-----END PGP SIGNATURE-----

_______________________________________________
kde-usability mailing list
kde-usability@mail.kde.org
http://mail.kde.org/mailman/listinfo/kde-usability
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic