Logo Search packages:      
Sourcecode: valknut version File versions  Download package

void DCOptions::slotTestHost (  )  [private, slot]

Definition at line 633 of file dcoptions.cpp.

Referenced by InitDocument().

{
      QString sip="";
      CSocket Socket;
      CString s;

      if ( RadioButton_IPHOSTNAME->isOn() )
      {
            s = LineEdit_IP->text().ascii();
            s = s.Replace(' ',"");
            LineEdit_IP->setText(s.Data());

            if ( s != "" )
            {
                  sip = CSocket::GetHostByName(s).Data();
            }

            if ( sip != "" )
            {
                  QMessageBox::information( 0, "Valknut", QString(tr("Host IP: "))+sip);
            }
            else
            {
                  QMessageBox::critical( 0, "Valknut", QString(tr("Can't get Host IP!")));
            }
      }
      else
      {
            sip = Socket.GetInterfaceIP(LineEdit_IP->text().ascii()).Data();

            if ( sip != "" )
            {
                  QMessageBox::information( 0, "Valknut", QString(tr("Interface IP: "))+sip);
            }
            else
            {
                  QMessageBox::critical( 0, "Valknut", QString(tr("Can't get interface IP!")));
            }
      }
}


Generated by  Doxygen 1.6.0   Back to index