[Frugalware-darcs] setup: asklang: handle DLG_EXIT_CANCEL

VMiklos vmiklos at frugalware.org
Wed Mar 29 23:48:31 CEST 2006


[asklang: handle DLG_EXIT_CANCEL
VMiklos <vmiklos at frugalware.org>**20051104115614] {
hunk ./src/plugins/asklang.c 45
+	int ret;
hunk ./src/plugins/asklang.c 49
-	dialog_menu("Please select your language",
+	while(1)
+	{
+		ret = dialog_menu("Please select your language",
hunk ./src/plugins/asklang.c 55
+		if (ret != DLG_EXIT_CANCEL)
+			break;
+		if(exit_confirm())
+			exit_perform();
+	}
hunk ./src/setup.c 101
+	dlg_clear();
hunk ./src/util.c 4
+#include <dialog.h>
hunk ./src/util.c 71
+}
+
+int exit_confirm(void)
+{
+	int ret;
+	ret = dialog_yesno(_("Exit from the installer"),
+		_("Are you sure you want to exit from the installer?"), 0, 0);
+	if(ret==DLG_EXIT_OK)
+		return(1);
+	else
+		return(0);
+}
+
+int exit_perform(void)
+{
+#if 1
+	end_dialog();
+#endif
+
+	// TODO
+	printf("/sbin/reboot\n");
+	exit(1);
hunk ./src/util.h 12
+int exit_confirm(void);
+int exit_perform(void);
}


More information about the Frugalware-darcs mailing list