[PC-BSD Commits] r7747 - pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager

svn at pcbsd.org svn at pcbsd.org
Fri Oct 8 08:12:26 PDT 2010


Author: kris
Date: 2010-10-08 08:12:26 -0700 (Fri, 08 Oct 2010)
New Revision: 7747

Modified:
   pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/networkman.cpp
   pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/networkman.ui
Log:

Added option to enable / disable DNS fetching from PPP / 3g devices



Modified: pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/networkman.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/networkman.cpp	2010-10-08 14:57:35 UTC (rev 7746)
+++ pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/networkman.cpp	2010-10-08 15:12:26 UTC (rev 7747)
@@ -1208,25 +1208,28 @@
 
 void NetworkMan::updatePPPconf()
 {
+    QString DeviceName = comboPPPOEDev->currentText();
     
-     QString DeviceName = comboPPPOEDev->currentText();
-    
-     QFile filein( "/etc/ppp/ppp.conf" );
-     QFile fileout( "/etc/ppp/ppp.conf" );
-     QString SavedFile;
-     QString ProfileName = linePPPService->text();
+    QFile filein( "/etc/ppp/ppp.conf" );
+    QFile fileout( "/etc/ppp/ppp.conf" );
+    QString ProfileName = linePPPService->text();
 
+    if ( fileout.open( QIODevice::WriteOnly ) ) {
+        QTextStream streamout( &fileout );
 
-     SavedFile = "default:\n set timeout 180\n enable dns\n\n" + ProfileName + ":\n  set device PPPoE:" + DeviceName + ":" + ProfileName + "\n  set authname " + linePPPUsername->text() + "\n  set authkey " + linePPPPassword->text() + "\n  set dial\n  set login\n  set ifaddr 0 0\n  add default HISADDR";
+                    streamout << "default:\n set timeout 180\n";
 
-    if ( fileout.open( QIODevice::WriteOnly ) ) {
-        QTextStream streamout( &fileout );
-                    streamout << SavedFile;
+		    if ( checkPPPOEDNS->isChecked() )
+                      streamout << " enable dns\n\n";
+		    else
+                      streamout << "\n\n";
+
+                    streamout << ProfileName + ":\n  set device PPPoE:" + DeviceName + ":" + ProfileName + "\n  set authname " + linePPPUsername->text() + "\n  set authkey " + linePPPPassword->text() + "\n  set dial\n  set login\n  set ifaddr 0 0\n  add default HISADDR";
+
         fileout.close();
     }
 
-
-    runCommand("chmod 755 /etc/ppp/ppp.conf");
+    runCommand("chmod 600 /etc/ppp/ppp.conf");
     
 }
 

Modified: pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/networkman.ui
===================================================================
--- pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/networkman.ui	2010-10-08 14:57:35 UTC (rev 7746)
+++ pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/networkman.ui	2010-10-08 15:12:26 UTC (rev 7747)
@@ -434,12 +434,12 @@
        <item row="1" column="1">
         <widget class="QGroupBox" name="groupBoxPPPOE">
          <property name="title">
-          <string>PPPoE configuration</string>
+          <string>PPP / 3G wireless configuration</string>
          </property>
          <property name="checkable">
           <bool>true</bool>
          </property>
-         <layout class="QGridLayout" name="gridLayout_9">
+         <layout class="QGridLayout" name="gridLayout_8">
           <item row="0" column="0" rowspan="2">
            <spacer name="spacer32">
             <property name="orientation">
@@ -451,7 +451,7 @@
             <property name="sizeHint" stdset="0">
              <size>
               <width>13</width>
-              <height>77</height>
+              <height>49</height>
              </size>
             </property>
            </spacer>
@@ -502,8 +502,8 @@
             </property>
             <property name="sizeHint" stdset="0">
              <size>
-              <width>26</width>
-              <height>24</height>
+              <width>7</width>
+              <height>20</height>
              </size>
             </property>
            </spacer>
@@ -534,7 +534,7 @@
             </property>
            </widget>
           </item>
-          <item row="1" column="3" colspan="3">
+          <item row="1" column="3" colspan="2">
            <widget class="QCheckBox" name="checkPPPAlwaysOn">
             <property name="text">
              <string>Alwa&amp;ys on connection</string>
@@ -580,6 +580,26 @@
             </property>
            </widget>
           </item>
+          <item row="3" column="1" colspan="2">
+           <spacer name="horizontalSpacer_4">
+            <property name="orientation">
+             <enum>Qt::Horizontal</enum>
+            </property>
+            <property name="sizeHint" stdset="0">
+             <size>
+              <width>287</width>
+              <height>19</height>
+             </size>
+            </property>
+           </spacer>
+          </item>
+          <item row="3" column="3" colspan="2">
+           <widget class="QCheckBox" name="checkPPPOEDNS">
+            <property name="text">
+             <string>Obtain DNS via PPP</string>
+            </property>
+           </widget>
+          </item>
          </layout>
         </widget>
        </item>



More information about the Commits mailing list