/* * Localwebfaker - Web sites faker for LAN * Copyright (C) 2007-2009 Lucas J. González * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see #include int main(int argc, char **argv) { int salida ; QApplication app(argc, argv); QLocale::setDefault ( QLocale::Spanish ) ; // ...-----------------------------unix_signal_handlers() ; struct sigaction intsig, hup, term; intsig.sa_handler = MyDaemon::intSignalHandler; sigemptyset(&intsig.sa_mask); intsig.sa_flags = 0; intsig.sa_flags |= SA_RESTART; if (sigaction(SIGINT, &intsig, 0) > 0) return 1; hup.sa_handler = MyDaemon::hupSignalHandler; sigemptyset(&hup.sa_mask); hup.sa_flags = 0; hup.sa_flags |= SA_RESTART; if (sigaction(SIGHUP, &hup, 0) > 0) return 1; term.sa_handler = MyDaemon::termSignalHandler; sigemptyset(&term.sa_mask); term.sa_flags |= SA_RESTART; if (sigaction(SIGTERM, &term, 0) > 0) return 2; // ...-----------------------------unix_signal_handlers() ; Comun *comun = new Comun() ; if (!comun->IamRoot()) { ventanaNotice *aviso = new ventanaNotice(0, QString("You are not root")) ; aviso->show(); return app.exec(); } backupCreator *backup = new backupCreator(); backup->Respaldar(); ventanaInicio *mainWin = new ventanaInicio(0); mainWin->show(); salida = app.exec(); return salida ; }