XmlPrompt::XmlPrompt(QWidget *parent)
	: QDialog(parent)
{
	setAttribute(Qt::WA_DeleteOnClose);
	setWindowTitle(tr("XML Input"));

	QVBoxLayout *vb1 = new QVBoxLayout(this);

	te = new QTextEdit(this);
	te->setAcceptRichText(false);
	vb1->addWidget(te);

	QHBoxLayout *hb1 = new QHBoxLayout(this);
	QPushButton *pb;

	pb = new QPushButton(tr("&Send"), this);
	pb->setDefault(TRUE);
	connect(pb, SIGNAL(clicked()), SLOT(doTransmit()));
	hb1->addWidget(pb);
	hb1->addStretch(1);

	pb = new QPushButton(tr("&Close"), this);
	connect(pb, SIGNAL(clicked()), SLOT(close()));
	hb1->addWidget(pb);
	vb1->addLayout(hb1);
	resize(320,240);
}
示例#2
0
void ElogThreadSubmit::run( ) {
  int status, sock, error;
  
  error = makeConnection( &sock, &status );
  if( status == 0 ) {
    doTransmit( sock );
    close( sock );
  }
  else {
    switch( error ) {
      case -1:
        doError( tr2i18n("Failed to add ELOG entry: failed to connect to host.") );          	      		  break;
      case -2:
        doError( tr2i18n("Failed to add ELOG entry: failed to get host name.") );          	      		  break;
      case -3:
        doError( tr2i18n("Failed to add ELOG entry: failed to create socket.") );
        break;
      case -4:
        doError( tr2i18n("Failed to add ELOG entry: failed to get host by address.") );
        break;
      case -5:
        doError( tr2i18n("Failed to add ELOG entry: failed to get host by name.") );          	      		  break;
      default:
        doError( tr2i18n("Failed to add ELOG entry: unknown error.") );
        break;
    }
  }
}