29#include <QHyodaIceT.h>
30#include <QHyodaMachine.h>
31#include <QtNetwork/QtNetwork>
41 const QString localHostName = QHostInfo::localHostName();
44 QJob->layout()->addWidget(localhost);
46 localhost->layout()->addWidget(job);
47 job->setEnabled(
true);
48 setHandlerException();
55 qDebug() <<
"QHyoda::~QHyoda DELETE";
65void QHyoda::hyodaUi(){
69 mainSplitter =
new QSplitter(Qt::Horizontal, mainWidget);
70 mainSplitter->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored);
71 verticalLayout->addWidget(mainSplitter);
73 QTabLeft =
new QTabWidget(mainWidget);
74 QTabLeft->setTabsClosable(
true);
75 QTabLeft->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
78 QJob =
new QWidget(mainWidget);
79 QVBoxLayout *vbox =
new QVBoxLayout;
80 QJob->setLayout(vbox);
82 QTabRight =
new QTabWidget(mainWidget);
83 QTabRight->setTabsClosable(
true);
84 QTabRight->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
86 mainSplitter->addWidget(QTabLeft);
87 mainSplitter->addWidget(QJob);
88 mainSplitter->addWidget(QTabRight);
89 mainSplitter->setSizes(QList<int>()<<128<<512<<128);
97void QHyoda::quit(
void){
122static char *sigAtExitCommand=NULL;
123static void hyodaRestart(
void){execlp(sigAtExitCommand,sigAtExitCommand,NULL);}
124void QHyoda::restart(
void){
125 atexit(hyodaRestart);
126 QCoreApplication::exit(0);
132static void sigHandler(
int sig) {
134 case SIGHUP: qDebug() <<
"Hangup (POSIX)";
break;
136 qDebug() <<
"Interrupt (ANSI)";
139 qDebug() <<
"Quit (POSIX)";
141 case SIGILL: qDebug() <<
"Illegal instruction (ANSI)";
break;
142 case SIGTRAP: qDebug() <<
"Trace trap (POSIX)";
break;
143 case SIGABRT: qDebug() <<
"Abort (ANSI)";
break;
144 case SIGBUS: qDebug() <<
"BUS error (4.2 BSD)";
break;
145 case SIGFPE: qDebug() <<
"Floating-point exception (ANSI)";
break;
146 case SIGKILL: qDebug() <<
"Kill, unblockable (POSIX)";
break;
147 case SIGUSR1: qDebug() <<
"User-defined signal 1 (POSIX)";
break;
148 case SIGSEGV: qDebug() <<
"Segmentation violation (ANSI)";
break;
149 case SIGUSR2: qDebug() <<
"User-defined signal 2 (POSIX)";
break;
150 case SIGPIPE: qDebug() <<
"Broken pipe (POSIX)";
break;
151 case SIGALRM: qDebug() <<
" Alarm clock (POSIX)";
break;
152 case SIGTERM: qDebug() <<
"Termination (ANSI)";
break;
153 case SIGSTKFLT: qDebug() <<
"Stack fault";
break;
154 case SIGCHLD: qDebug() <<
"Child status has changed (POSIX)";
break;
155 case SIGCONT: qDebug() <<
"Continue (POSIX)";
break;
156 case SIGSTOP: qDebug() <<
"Stop, unblockable (POSIX)";
break;
157 case SIGTSTP: qDebug() <<
"Keyboard stop (POSIX)";
break;
158 case SIGTTIN: qDebug() <<
"Background read from tty (POSIX)";
break;
159 case SIGTTOU: qDebug() <<
"Background write to tty (POSIX)";
break;
160 case SIGURG: qDebug() <<
"Urgent condition on socket (4.2 BSD)";
break;
161 case SIGXCPU: qDebug() <<
"CPU limit exceeded (4.2 BSD)";
break;
162 case SIGXFSZ: qDebug() <<
"File size limit exceeded (4.2 BSD)";
break;
163 case SIGVTALRM: qDebug() <<
"Virtual alarm clock (4.2 BSD)";
break;
164 case SIGPROF: qDebug() <<
"Profiling alarm clock (4.2 BSD)";
break;
165 case SIGWINCH: qDebug() <<
"Window size change (4.3 BSD, Sun)";
break;
166 case SIGPOLL: qDebug() <<
" Pollable event occurred (System V)";
break;
167 case SIGPWR: qDebug() <<
"Power failure restart (System V)";
break;
168 case SIGSYS: qDebug() <<
"Bad system call";
break;
169 default: qDebug() <<
"Unknown signal";
177void QHyoda::setHandlerException(){
178 struct sigaction sigAction;
179 sigemptyset(&sigAction.sa_mask);
180 sigAction.sa_handler = &sigHandler;
181 sigAction.sa_flags = 0;
182 sigaction(SIGSEGV, &sigAction, 0);
183 sigaction(SIGINT, &sigAction, 0);