Example #1
0
QSharedDataPointer<QNetworkInterfacePrivate> QNetworkInterfaceManager::interfaceFromIndex(int index)
{
    QList<QSharedDataPointer<QNetworkInterfacePrivate> > interfaceList = allInterfaces();
    QList<QSharedDataPointer<QNetworkInterfacePrivate> >::ConstIterator it = interfaceList.constBegin();
    for ( ; it != interfaceList.constEnd(); ++it)
        if ((*it)->index == index)
            return *it;

    return empty;
}
Example #2
0
QSharedDataPointer<QNetworkInterfacePrivate> QNetworkInterfaceManager::interfaceFromName(const QString &name)
{
    QList<QSharedDataPointer<QNetworkInterfacePrivate> > interfaceList = allInterfaces();
    QList<QSharedDataPointer<QNetworkInterfacePrivate> >::ConstIterator it = interfaceList.constBegin();
    for ( ; it != interfaceList.constEnd(); ++it)
        if ((*it)->name == name)
            return *it;

    return empty;
}
Example #3
0
    gatewayEditList.push_back(ui->gatewayEdit_3);
    gatewayEditList.push_back(ui->gatewayEdit_4);


    //Add validator for all text fields
    foreach(QLineEdit* e, lineEditList){
        e->setValidator(ipValidator);
    }

    //Set window position at the start:
    centerWindow(this);

    //Initializing the text edits and variables
    defaultConnection = "wlan0";    //Default Connection type is Wireless.
    interface = new QNetworkInterface();    //Creating a new QNetworkInterface object to use in filling the values
    list = interface->allInterfaces();
    interfacesdotDpath = "/etc/network/interfaces.d/";
    resolvconfHeadpath = "/etc/resolvconf/resolv.conf.d/";
    ifstatePath = "/run/network/ifstate";
    process = new QProcess(this);
    getGatewayCommand = "netstat -rn | grep 0.0.0.0 | awk '{print $2}' | grep -v '0.0.0.0'";

    ui->tickLabel->setHidden(true);
    ui->crossLabel->setHidden(true);


    initializeValues();

}

MainWindow::~MainWindow()