public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/3] kconfig and lxdialog, kernel 2.6.13.4
@ 2005-10-27 16:07 Fao, Sean
  2005-10-27 21:27 ` Roman Zippel
  0 siblings, 1 reply; 4+ messages in thread
From: Fao, Sean @ 2005-10-27 16:07 UTC (permalink / raw)
  To: linux-kernel, zippel

This patch is a functionality modification that implements a proposed 
design change to lxdialog.  Specifically, this patch makes use of the 
proposed "Abort" functionality of lxdialog, which adds an "Abort" button 
in *addition* to the "Yes" and "No" buttons that are currently displayed 
when a user exits kconfig.  The Abort button allows a user to return to 
the root menu of kconfig rather than exiting.

Signed-off-by: Sean E. Fao <sean.fao@capitalgenomix.com>

diff -up linux-2.6.13.4/scripts/kconfig/mconf.c 
linux/scripts/kconfig/mconf.c
--- linux-2.6.13.4/scripts/kconfig/mconf.c    2005-10-10 
13:54:29.000000000 -0500
+++ linux/scripts/kconfig/mconf.c    2005-10-27 09:32:09.000000000 -0500
@@ -1041,7 +1041,7 @@ int main(int ac, char **av)
 {
     struct symbol *sym;
     char *mode;
-    int stat;
+    int stat, abort;
 
     setlocale(LC_ALL, "");
     bindtextdomain(PACKAGE, LOCALEDIR);
@@ -1064,34 +1064,44 @@ int main(int ac, char **av)
     tcgetattr(1, &ios_org);
     atexit(conf_cleanup);
     init_wsize();
-    conf(&rootmenu);
 
-    do {
-        cprint_init();
-        cprint("--yesno");
-        cprint(_("Do you wish to save your new kernel configuration?"));
-        cprint("5");
-        cprint("60");
-        stat = exec_conf();
-    } while (stat < 0);
-
-    if (stat == 0) {
-        if (conf_write(NULL)) {
-            fprintf(stderr, _("\n\n"
-                "Error during writing of the kernel configuration.\n"
-                "Your kernel configuration changes were NOT saved."
-                "\n\n"));
-            return 1;
-        }
-        printf(_("\n\n"
-            "*** End of Linux kernel configuration.\n"
-            "*** Execute 'make' to build the kernel or try 'make help'."
-            "\n\n"));
-    } else {
-        fprintf(stderr, _("\n\n"
-            "Your kernel configuration changes were NOT saved."
-            "\n\n"));
-    }
+  /* Loop if abort button is pushed from exit dialog */
+  do
+  {
+      conf(&rootmenu);
+
+      do {
+          cprint_init();
+          cprint("--yesnoabort");
+          cprint(_("Do you wish to save your new kernel configuration?"));
+          cprint("5");
+          cprint("60");
+          stat = exec_conf();
+      } while (stat < 0);
+
+      if (stat == 0) {
+          if (conf_write(NULL)) {
+              fprintf(stderr, _("\n\n"
+                  "Error during writing of the kernel configuration.\n"
+                  "Your kernel configuration changes were NOT saved."
+                  "\n\n"));
+        abort = 0;
+              return 1;
+          }
+          printf(_("\n\n"
+              "*** End of Linux kernel configuration.\n"
+              "*** Execute 'make' to build the kernel or try 'make help'."
+              "\n\n"));
+      abort = 0;
+      } else if (stat == 2) {
+        abort = 1;
+    } else {
+            fprintf(stderr, _("\n\n"
+                "Your kernel configuration changes were NOT saved."
+                "\n\n"));
+        abort = 0;
+      }
+  } while (abort); /* Loop if abort button is pushed from exit dialog */
 
     return 0;
 }

-- 
Sean


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 3/3] kconfig and lxdialog, kernel 2.6.13.4
  2005-10-27 16:07 [PATCH 3/3] kconfig and lxdialog, kernel 2.6.13.4 Fao, Sean
@ 2005-10-27 21:27 ` Roman Zippel
  2005-11-04 15:42   ` [PATCH 3/3] kconfig and lxdialog, kernel 2.6.14 sean
  0 siblings, 1 reply; 4+ messages in thread
From: Roman Zippel @ 2005-10-27 21:27 UTC (permalink / raw)
  To: Fao, Sean; +Cc: linux-kernel

Hi,

On Thu, 27 Oct 2005, Fao, Sean wrote:

> This patch is a functionality modification that implements a proposed design
> change to lxdialog.  Specifically, this patch makes use of the proposed
> "Abort" functionality of lxdialog, which adds an "Abort" button in *addition*
> to the "Yes" and "No" buttons that are currently displayed when a user exits
> kconfig.  The Abort button allows a user to return to the root menu of kconfig
> rather than exiting.

This reminds me I had a similiar patch lying around, could you use this 
one as a basis.

bye, Roman

 scripts/kconfig/mconf.c |   49 +++++++++++++++++++++++++-----------------------
 1 file changed, 26 insertions(+), 23 deletions(-)

Index: linux-2.6/scripts/kconfig/mconf.c
===================================================================
--- linux-2.6.orig/scripts/kconfig/mconf.c	2005-10-27 23:02:15.000000000 +0200
+++ linux-2.6/scripts/kconfig/mconf.c	2005-10-27 23:04:12.000000000 +0200
@@ -1064,34 +1064,37 @@ int main(int ac, char **av)
 	tcgetattr(1, &ios_org);
 	atexit(conf_cleanup);
 	init_wsize();
-	conf(&rootmenu);
+	while (1) {
+		conf(&rootmenu);
 
-	do {
-		cprint_init();
-		cprint("--yesno");
-		cprint(_("Do you wish to save your new kernel configuration?"));
-		cprint("5");
-		cprint("60");
-		stat = exec_conf();
-	} while (stat < 0);
+		do {
+			cprint_init();
+			cprint("--yesno");
+			cprint(_("Do you wish to save your new kernel configuration?"));
+			cprint("5");
+			cprint("60");
+			stat = exec_conf();
+		} while (stat < 0);
 
-	if (stat == 0) {
-		if (conf_write(NULL)) {
+		switch (stat) {
+		case 0:
+			if (conf_write(NULL)) {
+				fprintf(stderr, _("\n\n"
+					"Error during writing of the kernel configuration.\n"
+					"Your kernel configuration changes were NOT saved."
+					"\n\n"));
+				return 1;
+			}
+			printf(_("\n\n"
+				"*** End of Linux kernel configuration.\n"
+				"*** Execute 'make' to build the kernel or try 'make help'."
+				"\n\n"));
+			return 0;
+		case 1:
 			fprintf(stderr, _("\n\n"
-				"Error during writing of the kernel configuration.\n"
 				"Your kernel configuration changes were NOT saved."
 				"\n\n"));
-			return 1;
+			return 0;
 		}
-		printf(_("\n\n"
-			"*** End of Linux kernel configuration.\n"
-			"*** Execute 'make' to build the kernel or try 'make help'."
-			"\n\n"));
-	} else {
-		fprintf(stderr, _("\n\n"
-			"Your kernel configuration changes were NOT saved."
-			"\n\n"));
 	}
-
-	return 0;
 }

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 3/3] kconfig and lxdialog, kernel 2.6.14
  2005-10-27 21:27 ` Roman Zippel
@ 2005-11-04 15:42   ` sean
  2005-11-04 16:03     ` sean.fao
  0 siblings, 1 reply; 4+ messages in thread
From: sean @ 2005-11-04 15:42 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: mconf.patch --]
[-- Type: text/plain, Size: 2572 bytes --]

On Thu, Oct 27, 2005 at 11:27:42PM +0200, Roman Zippel wrote:
>
> On Thu, 27 Oct 2005, Fao, Sean wrote:
>
> > This patch is a functionality modification that implements a proposed design
> > change to lxdialog.  Specifically, this patch makes use of the proposed
> > "Abort" functionality of lxdialog, which adds an "Abort" button in addition
> > to the "Yes" and "No" buttons that are currently displayed when a user exits
> > kconfig.  The Abort button allows a user to return to the root menu of
> > kconfig rather than exiting.
>
> This reminds me I had a similiar patch lying around, could you use this
> one as a basis.

I like your patch because it was the same idea and one less variable.  The
only thing that worries me is that the return value from "changes NOT saved"
is 0 rather than 1, which the original returned.  Is there any reason for
this?

Signed-off-by: Sean Fao <sean.fao@capitalgenomix.com>

---

--- linux-2.6.14/scripts/kconfig/mconf.c	2005-10-27 19:02:08.000000000 -0500
+++ linux/scripts/kconfig/mconf.c	2005-11-03 10:49:43.000000000 -0500
@@ -1064,34 +1064,37 @@ int main(int ac, char **av)
 	tcgetattr(1, &ios_org);
 	atexit(conf_cleanup);
 	init_wsize();
-	conf(&rootmenu);
+	while (1) {
+		conf(&rootmenu);
 
-	do {
-		cprint_init();
-		cprint("--yesno");
-		cprint(_("Do you wish to save your new kernel configuration?"));
-		cprint("5");
-		cprint("60");
-		stat = exec_conf();
-	} while (stat < 0);
+		do {
+			cprint_init();
+			cprint("--yesnoabort");
+			cprint(_("Do you wish to save your new kernel configuration?"));
+			cprint("5");
+			cprint("60");
+			stat = exec_conf();
+		} while (stat < 0);
 
-	if (stat == 0) {
-		if (conf_write(NULL)) {
+		switch (stat) {
+		case 0:
+			if (conf_write(NULL)) {
+				fprintf(stderr, _("\n\n"
+					"Error during writing of the kernel configuration.\n"
+					"Your kernel configuration changes were NOT saved."
+					"\n\n"));
+				return 1;
+			}
+			printf(_("\n\n"
+				"*** End of Linux kernel configuration.\n"
+				"*** Execute 'make' to build the kernel or try 'make help'."
+				"\n\n"));
+			return 0;
+		case 1:
 			fprintf(stderr, _("\n\n"
-				"Error during writing of the kernel configuration.\n"
 				"Your kernel configuration changes were NOT saved."
 				"\n\n"));
-			return 1;
+			return 0;
 		}
-		printf(_("\n\n"
-			"*** End of Linux kernel configuration.\n"
-			"*** Execute 'make' to build the kernel or try 'make help'."
-			"\n\n"));
-	} else {
-		fprintf(stderr, _("\n\n"
-			"Your kernel configuration changes were NOT saved."
-			"\n\n"));
 	}
-
-	return 0;
 }

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 3/3] kconfig and lxdialog, kernel 2.6.14
  2005-11-04 15:42   ` [PATCH 3/3] kconfig and lxdialog, kernel 2.6.14 sean
@ 2005-11-04 16:03     ` sean.fao
  0 siblings, 0 replies; 4+ messages in thread
From: sean.fao @ 2005-11-04 16:03 UTC (permalink / raw)
  To: linux-kernel

I'm having a bad time with this patch.  First I forgot to send it to the
LKML then mutt attached the wrong email address for me.

Please use sean.fao@capitalgenomix.com for reply messages and I
apologize for the confusion.

-- 
Sean

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-11-04 16:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-27 16:07 [PATCH 3/3] kconfig and lxdialog, kernel 2.6.13.4 Fao, Sean
2005-10-27 21:27 ` Roman Zippel
2005-11-04 15:42   ` [PATCH 3/3] kconfig and lxdialog, kernel 2.6.14 sean
2005-11-04 16:03     ` sean.fao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox