#pragma implementation #include #include #include #include "monitortasks.h" #include "monitortasks.m" MODULE_DEFINE_VERSION(monitortasks); PUBLIC MODULE_monitortasks::MODULE_monitortasks() : LINUXCONF_MODULE("monitortasks") { linuxconf_loadmsg ("monitortasks",PACKAGE_REV); } static const char *keymenu=NULL; PUBLIC void MODULE_monitortasks::setmenu ( DIALOG &dia, MENU_CONTEXT context) { if (context == MENU_MISCSERV){ keymenu = MSG_U(M_monitortasks,"Task monitor"); dia.new_menuitem ("monitortasks","",keymenu); } } PUBLIC int MODULE_monitortasks::domenu ( MENU_CONTEXT context, const char *key) { if (context == MENU_MISCSERV){ if (key == keymenu){ // ### Place the call to the edit function here } } return 0; } PUBLIC int MODULE_monitortasks::dohtml (const char *key) { int ret = LNCF_NOT_APPLICABLE; if (strcmp(key,"monitortasks")==0){ // ### Insert any menu and dialog here ret = 0; } return ret; } static void usage() { xconf_error (MSG_U(T_USAGE ,"linuxconf --modulemain monitortasks usage\n" "\n" " monitortasks --option ...\n") ); } PUBLIC void MODULE_monitortasks::usage (SSTRINGS &tb) { tb.add (new SSTRING (MSG_R(T_USAGE))); } PUBLIC int MODULE_monitortasks::execmain (int argc , char *argv[], bool standalone) { int ret = LNCF_NOT_APPLICABLE; const char *pt = strrchr(argv[0],'/'); if (pt != NULL){ pt++; }else{ pt = argv[0]; } if (strcmp(pt,"monitortasks")==0){ ret = -1; if (argc == 1){ // ### Place call to main menu of the module }else{ // ### Add some option parsing for the module ::usage(); } } return ret; } static MODULE_monitortasks monitortasks;