#pragma implementation #include #include #include #include "gurus.h" #include "gurus.m" #include #include MODULE_DEFINE_VERSION(gurus); static const char *keymenu=NULL; static HELP_FILE help_gurus ("gurus","gurus"); static void gurus_menu() { const char *network; const char *pdc; const char *dialinout; glocal.network = MSG_U(M_NETWORK,"Basic network setup"); glocal.pdc = MSG_U(M_NETPDC,"Connecting to a PDC"); glocal.dialinout = MSG_U(M_DIALINOUT,"Setting dialin and dialout (modems)"); const char *menuopt[]={ "",glocal.network, "",glocal.pdc, "",glocal.dialinout, NULL }; (MSG_U(M_gurus,"Friendly helpers (Gurus)") ,MSG_U(I_gurus,"You find here a bunch of dialogs guiding\n" "step by step, so you can perform complex tasks") ,help_gurus ,menuopt); if (perm_rootaccess(MSG_U(P_GLOCALCHANGES,"global changes"))){ if (key == glocal.network){ guru_setnetwork(); }else if (key == glocal.pdc){ xconf_notice ("Sorry, not done yet!"); }else if (key == glocal.dialinout){ xconf_notice ("Sorry, not done yet!"); } } } ("gurus",PACKAGE_REV); tb.add (new SSTRING(MSG_U(T_USAGE ,"linuxconf --modulemain gurus [ options ]\n" "\n" " without options, starts the module main menu\n" " --network\n"))); if (context == MENU_GURUS){ keymenu = MSG_R(M_gurus); dia.new_menuitem ("gurus","",keymenu); } if (context == MENU_GURUS){ if (key == keymenu){ gurus_menu(); } } return 0; int ret = LNCF_NOT_APPLICABLE; if (strcmp(progname,"gurus")==0){ ret = -1; if (argc == 1){ gurus_menu(); }else if (argc == 2 && strcmp(argv[1],"--network")==0){ if (perm_rootaccess(MSG_R(P_GLOCALCHANGES))){ guru_setnetwork(); } }else{ printusage(); } } return ret;