Skip to contentSkip to conversation

mconf: Add Save button

PATCH Superseded Wang YanQing 2 participants 6 messages Oct 8, 2012

Subsystems (2)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 mconf: Add Save button

mconf make me annoying I have to make menuconfig && exit to save the config when I am tuning .config time by time, it is even worse I have to search down to my desire submenu time by time. So I add "Save" button to save our time. With "Save" button, I can use CRTL-Z after save config, and then use "%" or fg to resume menuconfig and go on tuning.

v2: Rewrite the most code to make it more correct
v3: Fix the behavior of conf_message_callback when exit.

---
 scripts/kconfig/lxdialog/menubox.c | 17 +++++++-------
 scripts/kconfig/mconf.c            | 47 ++++++++++++++++++++++++++++++++------
 2 files changed, 49 insertions(+), 15 deletions(-)
scripts/kconfig/lxdialog/menubox.c +9 -8
index 1d60473..f71f112 100644
@@ -26,7 +26,7 @@
  *
  *    *)  A bugfix for the Page-Down problem
  *
- *    *)  Formerly when I used Page Down and Page Up, the cursor would be set 
+ *    *)  Formerly when I used Page Down and Page Up, the cursor would be set
  *        to the first position in the menu box.  Now lxdialog is a bit
  *        smarter and works more like other menu systems (just have a look at
  *        it).
@@ -160,6 +160,7 @@ static void print_buttons(WINDOW * win, int height, int width, int selected)
 	print_button(win, gettext("Select"), y, x, selected == 0);
 	print_button(win, gettext(" Exit "), y, x + 12, selected == 1);
 	print_button(win, gettext(" Help "), y, x + 24, selected == 2);
+	print_button(win, gettext(" Save "), y, x + 36, selected == 3);
 
 	wmove(win, y, x + 1 + 12 * selected);
 	wrefresh(win);
@@ -372,7 +373,7 @@ do_resize:
 		case TAB:
 		case KEY_RIGHT:
 			button = ((key == KEY_LEFT ? --button : ++button) < 0)
-			    ? 2 : (button > 2 ? 0 : button);
+			    ? 3 : (button > 3 ? 0 : button);
 
 			print_buttons(dialog, height, width, button);
 			wrefresh(menu);
@@ -399,17 +400,17 @@ do_resize:
 				return 2;
 			case 's':
 			case 'y':
-				return 3;
-			case 'n':
 				return 4;
-			case 'm':
+			case 'n':
 				return 5;
-			case ' ':
+			case 'm':
 				return 6;
-			case '/':
+			case ' ':
 				return 7;
-			case 'z':
+			case '/':
 				return 8;
+			case 'z':
+				return 9;
 			case '\n':
 				return button;
 			}
scripts/kconfig/mconf.c +40 -7

106 lines not on this page · raw message

Signature · 1 line
1.7.11.1.116.g8228a23
#1 lore raw
Quoted 3 lines · Wang YanQing

mconf make me annoying I have to make menuconfig && exit to save the config when I am tuning .config time by time, it is even worse I have to search down to my desire submenu time by time.

Well, there are a bunch of patches from Benjamin Poirier adding the possibility to jump to search results and you could use them to go to your desired submenu.

They're not upstream yet, AFAICT, although Michal applied them.

Quoted 3 lines

So I add "Save" button to save our time. With "Save" button, I can use CRTL-Z after save config, and then use "%" or fg to resume menuconfig and go on tuning.

Ok, IIUC, when you put menuconfig in the background, edit .config by hand in the shell and then do 'fg', you need to reload the edited .config back otherwise you lose your changes you just did by hand.

And generally speaking, why exactly do you need to edit .config by hand, and, at same time, do it over menuconfig? IMO, with Benjamin's patches, you don't need to do that anymore, right?

Thanks.

Signature · 2 lines
Regards/Gruss,
    Boris.
#2 lore raw
Quoted 3 lines · Borislav Petkov

Well, there are a bunch of patches from Benjamin Poirier adding the possibility to jump to search results and you could use them to go to your desired submenu.

First there are two ways to save the .config in menuconfig
1:Exit menuconfig with choice the "Yes" to save .config
2:go to top menu and use the "Save an alternate Configuration File" to save .config

No matter which way you choice, it is slow and annoying to find the origin submenu where you have interest.The bunch of patches from Benjamin make it a little annoying, but not ignore it.Just image the situation that you have to exit menuconfig then "make menuconfig" and search down the submenu time by time, it is really annoying.

Quoted 8 lines
Quoted 3 lines

So I add "Save" button to save our time. With "Save" button, I can use CRTL-Z after save config, and then use "%" or fg to resume menuconfig and go on tuning.

Ok, IIUC, when you put menuconfig in the background, edit .config by hand in the shell and then do 'fg', you need to reload the edited .config back otherwise you lose your changes you just did by hand.

Quoted 5 lines

And generally speaking, why exactly do you need to edit .config by hand, and, at same time, do it over menuconfig? IMO, with Benjamin's patches, you don't need to do that anymore, right?

Thanks.

It is not the first time to make me trouble with representation by my poor English, sorry for that.I hope the below words show the really meaning that I want to give you.

With one terminal, I can do:
1: make menuconfig
2: ajust and use "Save" button to save .config 3: use CRTL-Z(konsole) to "menuconfig" run in background 3: make && test kernel
4: fg or "%1" to resume the menuconfig

With two terminal, I can do:
in first terminal
1: make menuconfig
2: ajust and use "Save" button to save .config

in second terminal
3: make && test kernel

go back the first terminal and go on tuning.

Now, you can see what the "Save" button can do,
it make there is no "exit menuconfig" or go to
the top menu when you want to save .config in
menuconfig

Thanks!

#3 lore raw
Quoted 6 lines · Wang YanQing

With one terminal, I can do:
1: make menuconfig
2: ajust and use "Save" button to save .config 3: use CRTL-Z(konsole) to "menuconfig" run in background 3: make && test kernel
4: fg or "%1" to resume the menuconfig

I understand all that, but why do you think your usecase should be in the kernel? I still fail to see its relevance for the majority of people.

AFAICT, this is only if you want to experiment with different options but you're better off replicating your .config with the couple options instead of adding a save button.

IOW, this would only make a distant sense if you were playing with all kconfig options but why would you want to do that?

Thanks.

Signature · 2 lines
Regards/Gruss,
    Boris.
#4 lore raw
Quoted 11 lines · Borislav Petkov
Quoted 6 lines · Wang YanQing

With one terminal, I can do:
1: make menuconfig
2: ajust and use "Save" button to save .config 3: use CRTL-Z(konsole) to "menuconfig" run in background 3: make && test kernel
4: fg or "%1" to resume the menuconfig

I understand all that, but why do you think your usecase should be in the kernel? I still fail to see its relevance for the majority of people.

No, I don't think it is only my usecase. Use fg,CRTL-Z is very normal in terminal or in vt(console), without save button you have to exit menuconfig every time you want to save .config.

By the way,just a quick test, qconfig, xconfig, nconfig all have the Save button, why do them exist if we follow your opinion?

Thanks.

#5 lore raw
Quoted 2 lines · Wang YanQing

By the way,just a quick test, qconfig, xconfig, nconfig all have the Save button, why do them exist if we follow your opinion?

Because someone added them thinking it would be cool to have them, what do I know...

In any case, I still fail to see a real value in this considering the use case, that's all. Unless someone proves me wrong with a better example that this...

Thanks.

Signature · 2 lines
Regards/Gruss,
Boris.