Ignore:
Timestamp:
Apr 12, 2013 8:40:12 AM (12 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, 9.1-release, 9.2-release, releng/10.0, releng/10.0.1
Children:
bb72d33
Parents:
afd00d6
Message:

Add all the changes for related using of split pcbsd-utils libs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/pc-netmanager/src/NetworkManager/networkman.cpp

    r1f0939e r0cfe72f  
    242242   dev.remove(0, dev.size() -1 ); 
    243243   QString DevNum = dev; 
    244    return Utils::sysctl("net.wlan." + DevNum + ".%parent"); 
     244   return pcbsd::Utils::sysctl("net.wlan." + DevNum + ".%parent"); 
    245245} 
    246246 
     
    519519{     
    520520    QString tmp; 
    521     lineHostname->setText(Utils::getConfFileValue("/etc/rc.conf", "hostname=", 1)); 
    522  
    523     tmp = Utils::getConfFileValue("/etc/rc.conf", "defaultrouter=", 1); 
     521    lineHostname->setText(pcbsd::Utils::getConfFileValue("/etc/rc.conf", "hostname=", 1)); 
     522 
     523    tmp = pcbsd::Utils::getConfFileValue("/etc/rc.conf", "defaultrouter=", 1); 
    524524    if ( tmp.isEmpty() ) 
    525525    { 
     
    531531    } else { 
    532532        groupGateway->setChecked(true); 
    533         lineGateway->setText(Utils::getConfFileValue("/etc/rc.conf", "defaultrouter=", 1) ); 
     533        lineGateway->setText(pcbsd::Utils::getConfFileValue("/etc/rc.conf", "defaultrouter=", 1) ); 
    534534    } 
    535535 
    536536    /* Use simple regular expressions to distinguish IPv4 and IPv6 addresses. */ 
    537     lineDNS1->setText(Utils::getConfFileValue("/etc/resolv.conf", "nameserver ", "\\b(?:\\d{1,3}\\.){3}\\d{1,3}\\b", 1) ); 
    538     lineDNS2->setText(Utils::getConfFileValue("/etc/resolv.conf", "nameserver ", "\\b(?:\\d{1,3}\\.){3}\\d{1,3}\\b", 2) ); 
     537    lineDNS1->setText(pcbsd::Utils::getConfFileValue("/etc/resolv.conf", "nameserver ", "\\b(?:\\d{1,3}\\.){3}\\d{1,3}\\b", 1) ); 
     538    lineDNS2->setText(pcbsd::Utils::getConfFileValue("/etc/resolv.conf", "nameserver ", "\\b(?:\\d{1,3}\\.){3}\\d{1,3}\\b", 2) ); 
    539539    // Check if we are using custom DNS 
    540     tmp = Utils::getConfFileValue("/etc/dhclient.conf", "supersede domain-name-servers", 1); 
     540    tmp = pcbsd::Utils::getConfFileValue("/etc/dhclient.conf", "supersede domain-name-servers", 1); 
    541541    if ( tmp.isEmpty() ) 
    542542       groupDNS->setChecked(false); 
     
    545545 
    546546 
    547     lineIPv6DNS1->setText(Utils::getConfFileValue("/etc/resolv.conf", "nameserver ", "\\b.*:.*:.*\\b", 1) ); 
    548     lineIPv6DNS2->setText(Utils::getConfFileValue("/etc/resolv.conf", "nameserver ", "\\b.*:.*:.*\\b", 2) ); 
    549     lineSearchDomain->setText(Utils::getConfFileValue("/etc/resolv.conf", "search ", 1) ); 
     547    lineIPv6DNS1->setText(pcbsd::Utils::getConfFileValue("/etc/resolv.conf", "nameserver ", "\\b.*:.*:.*\\b", 1) ); 
     548    lineIPv6DNS2->setText(pcbsd::Utils::getConfFileValue("/etc/resolv.conf", "nameserver ", "\\b.*:.*:.*\\b", 2) ); 
     549    lineSearchDomain->setText(pcbsd::Utils::getConfFileValue("/etc/resolv.conf", "search ", 1) ); 
    550550 
    551551    // Check for IPv6 settings 
    552     lineIPv6Gateway->setText(Utils::getConfFileValue("/etc/rc.conf", "ipv6_defaultrouter=", 1) ); 
    553     tmp = Utils::getConfFileValue("/etc/rc.conf", "ipv6_activate_all_interfaces=", 1) ; 
     552    lineIPv6Gateway->setText(pcbsd::Utils::getConfFileValue("/etc/rc.conf", "ipv6_defaultrouter=", 1) ); 
     553    tmp = pcbsd::Utils::getConfFileValue("/etc/rc.conf", "ipv6_activate_all_interfaces=", 1) ; 
    554554    if ( tmp == "YES" ) 
    555555        groupIPv6->setChecked(TRUE); 
     
    582582void NetworkMan::restartNetwork() 
    583583{ 
    584    Utils::restartNetworking(); 
     584   pcbsd::Utils::restartNetworking(); 
    585585} 
    586586 
     
    824824    } 
    825825   
    826      if ( lineDNS1->text() != "..."  && ! Utils::validateIPV4(lineDNS1->text() ) && groupDNS->isChecked()) { 
     826     if ( lineDNS1->text() != "..."  && ! pcbsd::Utils::validateIPV4(lineDNS1->text() ) && groupDNS->isChecked()) { 
    827827         textGlobalError->setText(tr("Invalid DNS specified")); 
    828828         return; 
    829829     } 
    830830     
    831     if ( lineDNS2->text() != "..."  && ! Utils::validateIPV4(lineDNS2->text() ) && groupDNS->isChecked()) { 
     831    if ( lineDNS2->text() != "..."  && ! pcbsd::Utils::validateIPV4(lineDNS2->text() ) && groupDNS->isChecked()) { 
    832832         textGlobalError->setText(tr("Invalid DNS specified")); 
    833833         return; 
     
    835835     
    836836     
    837      if ( lineGateway->text() != "..."  && ! Utils::validateIPV4(lineGateway->text())  && groupGateway->isChecked() ) { 
     837     if ( lineGateway->text() != "..."  && ! pcbsd::Utils::validateIPV4(lineGateway->text())  && groupGateway->isChecked() ) { 
    838838         textGlobalError->setText(tr("Invalid Gateway specified")); 
    839839         return; 
     
    869869{ 
    870870     
    871    if ( !lineHostname->text().isEmpty() && (lineHostname->text().toLower() != Utils::getConfFileValue("/etc/rc.conf", "hostname=", 1).toLower() ) ) { 
    872       Utils::setConfFileValue("/etc/rc.conf", "hostname=", "hostname=\"" + lineHostname->text() + "\"", -1); 
    873       Utils::setConfFileValue("/etc/hosts", "::1", "::1\t\t\tlocalhost localhost.localdomain " + lineHostname->text() + ".localhost " + lineHostname->text(), -1); 
    874       Utils::setConfFileValue("/etc/hosts", "127.0.0.1", "127.0.0.1\t\tlocalhost localhost.localdomain " + lineHostname->text() + ".localhost " + lineHostname->text(), -1); 
     871   if ( !lineHostname->text().isEmpty() && (lineHostname->text().toLower() != pcbsd::Utils::getConfFileValue("/etc/rc.conf", "hostname=", 1).toLower() ) ) { 
     872      pcbsd::Utils::setConfFileValue("/etc/rc.conf", "hostname=", "hostname=\"" + lineHostname->text() + "\"", -1); 
     873      pcbsd::Utils::setConfFileValue("/etc/hosts", "::1", "::1\t\t\tlocalhost localhost.localdomain " + lineHostname->text() + ".localhost " + lineHostname->text(), -1); 
     874      pcbsd::Utils::setConfFileValue("/etc/hosts", "127.0.0.1", "127.0.0.1\t\tlocalhost localhost.localdomain " + lineHostname->text() + ".localhost " + lineHostname->text(), -1); 
    875875      QMessageBox::information(this,tr("Computer Restart Required"), tr("You must restart your computer to finish changing your hostname") ); 
    876876   } 
     
    878878     
    879879   if ( lineGateway->text() == "..." || ! groupGateway->isChecked() ) { 
    880      Utils::setConfFileValue("/etc/rc.conf", "defaultrouter=", "", -1); 
     880     pcbsd::Utils::setConfFileValue("/etc/rc.conf", "defaultrouter=", "", -1); 
    881881   } else { 
    882      Utils::setConfFileValue("/etc/rc.conf", "defaultrouter=", "defaultrouter=\"" + lineGateway->text() + "\"", -1);   
     882     pcbsd::Utils::setConfFileValue("/etc/rc.conf", "defaultrouter=", "defaultrouter=\"" + lineGateway->text() + "\"", -1);   
    883883   } 
    884884    
     
    888888    if ( groupIPv6->isChecked() ) { 
    889889        if ( ! lineIPv6DNS1->text().isEmpty() ) { 
    890             Utils::setConfFileValue("/etc/resolv.conf", "nameserver", "nameserver " + lineIPv6DNS1->text(), DNSline);   
     890            pcbsd::Utils::setConfFileValue("/etc/resolv.conf", "nameserver", "nameserver " + lineIPv6DNS1->text(), DNSline);   
    891891            DNSline++; 
    892892        } 
    893893        if ( ! lineIPv6DNS2->text().isEmpty() ) { 
    894             Utils::setConfFileValue("/etc/resolv.conf", "nameserver", "nameserver " + lineIPv6DNS2->text(), DNSline);   
     894            pcbsd::Utils::setConfFileValue("/etc/resolv.conf", "nameserver", "nameserver " + lineIPv6DNS2->text(), DNSline);   
    895895            DNSline++; 
    896896        } 
     
    898898    
    899899   if ( lineDNS1->text() == "..."  || ! groupDNS->isChecked() ) { 
    900      Utils::setConfFileValue("/etc/resolv.conf", "nameserver", "", DNSline); 
     900     pcbsd::Utils::setConfFileValue("/etc/resolv.conf", "nameserver", "", DNSline); 
    901901   } else { 
    902      Utils::setConfFileValue("/etc/resolv.conf", "nameserver", "nameserver " + lineDNS1->text(), DNSline);   
     902     pcbsd::Utils::setConfFileValue("/etc/resolv.conf", "nameserver", "nameserver " + lineDNS1->text(), DNSline);   
    903903     DNSline++; 
    904904   }    
    905905   if ( lineDNS2->text() == "..." || ! groupDNS->isChecked() ) { 
    906      Utils::setConfFileValue("/etc/resolv.conf", "nameserver", "", DNSline); 
     906     pcbsd::Utils::setConfFileValue("/etc/resolv.conf", "nameserver", "", DNSline); 
    907907   } else { 
    908      Utils::setConfFileValue("/etc/resolv.conf", "nameserver", "nameserver " + lineDNS2->text(), DNSline);   
     908     pcbsd::Utils::setConfFileValue("/etc/resolv.conf", "nameserver", "nameserver " + lineDNS2->text(), DNSline);   
    909909   }    
    910910    
    911911   // If we have custom DNS, make sure it survives a dhclient run 
    912912   if ( lineDNS1->text() != "..." && lineDNS2->text() != "..." && groupDNS->isChecked() ) 
    913      Utils::setConfFileValue("/etc/dhclient.conf", "supersede domain-name-servers", "supersede domain-name-servers " + lineDNS1->text() + ", " + lineDNS2->text() +";");   
     913     pcbsd::Utils::setConfFileValue("/etc/dhclient.conf", "supersede domain-name-servers", "supersede domain-name-servers " + lineDNS1->text() + ", " + lineDNS2->text() +";");   
    914914   else if ( lineDNS1->text() != "..." ) 
    915      Utils::setConfFileValue("/etc/dhclient.conf", "supersede domain-name-servers", "supersede domain-name-servers " + lineDNS1->text() +";");   
     915     pcbsd::Utils::setConfFileValue("/etc/dhclient.conf", "supersede domain-name-servers", "supersede domain-name-servers " + lineDNS1->text() +";");   
    916916   else if ( lineDNS2->text() != "..." ) 
    917      Utils::setConfFileValue("/etc/dhclient.conf", "supersede domain-name-servers", "supersede domain-name-servers " + lineDNS2->text() +";");   
     917     pcbsd::Utils::setConfFileValue("/etc/dhclient.conf", "supersede domain-name-servers", "supersede domain-name-servers " + lineDNS2->text() +";");   
    918918   else 
    919      Utils::setConfFileValue("/etc/dhclient.conf", "supersede domain-name-servers", "");   
     919     pcbsd::Utils::setConfFileValue("/etc/dhclient.conf", "supersede domain-name-servers", "");   
    920920     
    921921 
    922922   if ( lineSearchDomain->text().isEmpty() || ! groupDNS->isChecked() ) { 
    923      Utils::setConfFileValue("/etc/resolv.conf", "search", "", 1); 
     923     pcbsd::Utils::setConfFileValue("/etc/resolv.conf", "search", "", 1); 
    924924   } else { 
    925      Utils::setConfFileValue("/etc/resolv.conf", "search", "search " + lineSearchDomain->text(), 1); 
     925     pcbsd::Utils::setConfFileValue("/etc/resolv.conf", "search", "search " + lineSearchDomain->text(), 1); 
    926926   } 
    927927 
    928928   // Save the IPv6 stuff 
    929929    if ( groupIPv6->isChecked() ) { 
    930         Utils::setConfFileValue("/etc/rc.conf", "ipv6_activate_all_interfaces=", "ipv6_activate_all_interfaces=\"YES\"", -1); 
     930        pcbsd::Utils::setConfFileValue("/etc/rc.conf", "ipv6_activate_all_interfaces=", "ipv6_activate_all_interfaces=\"YES\"", -1); 
    931931        if ( ! lineIPv6Gateway->text().isEmpty() ) { 
    932             Utils::setConfFileValue("/etc/rc.conf", "ipv6_defaultrouter=", "ipv6_defaultrouter=\"" + lineIPv6Gateway->text() + "\"", -1); 
     932            pcbsd::Utils::setConfFileValue("/etc/rc.conf", "ipv6_defaultrouter=", "ipv6_defaultrouter=\"" + lineIPv6Gateway->text() + "\"", -1); 
    933933        } else { 
    934             Utils::setConfFileValue("/etc/rc.conf", "ipv6_defaultrouter=", "", -1); 
     934            pcbsd::Utils::setConfFileValue("/etc/rc.conf", "ipv6_defaultrouter=", "", -1); 
    935935        } 
    936936    } else { 
    937         Utils::setConfFileValue("/etc/rc.conf", "ipv6_activate_all_interfaces=", "", -1); 
    938         Utils::setConfFileValue("/etc/rc.conf", "ipv6_defaultrouter=", "", -1); 
     937        pcbsd::Utils::setConfFileValue("/etc/rc.conf", "ipv6_activate_all_interfaces=", "", -1); 
     938        pcbsd::Utils::setConfFileValue("/etc/rc.conf", "ipv6_defaultrouter=", "", -1); 
    939939    } 
    940940 
     
    969969   bool ok; 
    970970 
    971    tmp = Utils::getProxyURL(); 
     971   tmp = pcbsd::Utils::getProxyURL(); 
    972972   if ( tmp.isEmpty() ) 
    973973      groupProxySettings->setChecked(false); 
     
    977977   lineProxyAddress->setText(tmp); 
    978978 
    979    tmp = Utils::getProxyUser(); 
     979   tmp = pcbsd::Utils::getProxyUser(); 
    980980   lineProxyUser->setText(tmp); 
    981981   if ( tmp.isEmpty() ) 
     
    984984      checkProxyUser->setChecked(true); 
    985985 
    986    lineProxyPass->setText(Utils::getProxyPass()); 
    987  
    988    tmp = Utils::getProxyPort(); 
     986   lineProxyPass->setText(pcbsd::Utils::getProxyPass()); 
     987 
     988   tmp = pcbsd::Utils::getProxyPort(); 
    989989   tmp.toInt(&ok); 
    990990   if ( ok ) 
     
    992992    
    993993 
    994    tmp = Utils::getProxyType(); 
     994   tmp = pcbsd::Utils::getProxyType(); 
    995995   if ( tmp == "digest" ) 
    996996      radioSOCKSProxy->setChecked(true); 
     
    10061006 
    10071007   if ( ! groupProxySettings->isChecked() ) { 
    1008          Utils::setProxyAuth(QString()); 
    1009          Utils::setProxyAddress(QString()); 
     1008         pcbsd::Utils::setProxyAuth(QString()); 
     1009         pcbsd::Utils::setProxyAddress(QString()); 
    10101010   } else { 
    1011         Utils::setProxyAddress(lineProxyAddress->text() + ":" + tmp.setNum(spinProxyPort->value())); 
     1011        pcbsd::Utils::setProxyAddress(lineProxyAddress->text() + ":" + tmp.setNum(spinProxyPort->value())); 
    10121012 
    10131013        QString authLine; 
    10141014        if ( ! checkProxyUser->isChecked() || lineProxyUser->text().isEmpty() ) { 
    1015           Utils::setProxyAuth(QString()); 
     1015          pcbsd::Utils::setProxyAuth(QString()); 
    10161016        } else { 
    10171017          if ( radioHTTPProxy->isChecked() ) 
     
    10211021          authLine += lineProxyUser->text() + ":"; 
    10221022          authLine += lineProxyPass->text() + ""; 
    1023           Utils::setProxyAuth(authLine); 
     1023          pcbsd::Utils::setProxyAuth(authLine); 
    10241024        } 
    10251025        QMessageBox::warning( this, tr("Proxy enabled"), tr("You may need to re-login for proxy settings to take effect.")); 
Note: See TracChangeset for help on using the changeset viewer.