Hijack PopUp# menu names

Posted by: cushman

Hijack PopUp# menu names - 05/06/2003 21:48

Instead of having the "Select Action:" label in the Hijack popup menus, I wanted to have it be set to the menu name you can define for yourself in config.ini. Loren described how you can name your popup menus in this section of the Hijack FAQ. Your config.ini could look like this:

[ir_translate]
PopUp0=PopUp1,PopUp2
PopUp1=Artist,Album,Genre,Year,PopUp0
PopUp2=Equalizer,Sound,PopUp0
[hijack]
PopUp0=Top Menu
PopUp1=Tweak By
PopUp2=Sound


I patched Hijack to display the menu name instead of "Select Action" in hijack.c:

2486c2486
< char buf[16];
---
> char buf[16], disp[18];
2488c2488,2489
< rowcol = draw_string(rowcol, "Select Action: ", COLOR3);
---
> sprintf(disp, "%s: ", get_button_name(current_popup->old, buf));
> rowcol = draw_string(rowcol, disp, COLOR3);


I figured if you liked the "Select Action:" string, you could set PopUp0=Select Action in config.ini and it would be the same. I do have a few questions, though. Is this the right patch format? I've seen others that use the @ sign, but I just used GNU diff on Linux to output this. Secondly, how should I re-compile the kernel without going through a lot of trouble while testing small changes like this? What I did was recompile the hijack.c file in arch/arm/special and it would generate the special.a file, but I had to do a make zImage from the top directory. Is there a way to make the zImage without having it check for uncompiled sources in each of the children directories? I'm a little tired after looking through the Makefile.
Posted by: genixia

Re: Hijack PopUp# menu names - 05/06/2003 22:55

I use diff -Naur -X dontdiff oldtree newtree from my main kernel directory. (dontdiff attached)

Mark hasn't complained, although I think he does something different. As for compilation, I'm not aware of any method to make Make more efficient. It's entire purpose in life is to ensure that necessary files, but only necessary files get compiled. I can't see how you can ask it to do the former without allowing it to check all the potential dependancies.

Look on the bright side, only the first compilation takes a reallly long time.
Posted by: mlord

Re: Hijack PopUp# menu names - 06/06/2003 06:14

diff -u is the most important thing. I don't even look at patches created without that essential flag (see linux/MAINTAINERS).

Lots of other flags also help, as genixia's pointed out.

All of the directory hopping done by make is kinda sluggish, I agree, and I think they've finally improved it a lot in the 2.5.xx kernels. But even with that, my 850Mhz notebook can rebulld Hijack from zero in just a few minutes.

Cheers
Posted by: cushman

Re: Hijack PopUp# menu names - 06/06/2003 06:18

--- hijack.c    2003-06-06 00:25:32.000000000 -0400

+++ orig_hijack.c 2003-06-06 00:25:16.000000000 -0400
@@ -2483,9 +2483,10 @@
} else if (jiffies_since(hijack_last_moved) >= (HZ*4)) {
hijack_deactivate(HIJACK_IDLE);
} else {
- char buf[16];
+ char buf[16], disp[18];
unsigned int rowcol = (geom.first_row+4)|((geom.first_col+6)<<16);
- rowcol = draw_string(rowcol, "Select Action: ", COLOR3);
+ sprintf(disp, "%s: ", get_button_name(current_popup->old, buf));
+ rowcol = draw_string(rowcol, disp, COLOR3);
clear_text_row(rowcol, geom.last_col-4, 1);
(void)draw_string_spaced(rowcol, get_button_name(button, buf), ENTRYCOLOR);
rc = NEED_REFRESH;
Posted by: cushman

Re: Hijack PopUp# menu names - 06/06/2003 06:23

Great! Thanks for the tips on diff, that is what I was looking for.

I'm building on a P133, so all the directory hopping is a little slow, but not too painful. At least I can compile the things I want to ahead of time, and have the compiler catch errors before running the entire make zImage. I'm mostly just poking around under the hood to see how things work