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

svn at pcbsd.org svn at pcbsd.org
Wed Mar 14 09:54:04 PDT 2012


Author: yurkis
Date: 2012-03-14 16:54:04 +0000 (Wed, 14 Mar 2012)
New Revision: 15813

Added:
   pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/dnslist.cpp
   pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/dnslist.h
   pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/dnslist.ui
Modified:
   pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/NetworkManager.pro
   pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/networkman.cpp
   pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/networkman.h
   pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/networkman.ui
Log:
Public DNS servers dialog added both for IPv4 and IPv6
DNS servers are hardcoded in the beginig of file dnslist.cpp

Please check.

Modified: pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/NetworkManager.pro
===================================================================
--- pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/NetworkManager.pro	2012-03-14 14:59:31 UTC (rev 15812)
+++ pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/NetworkManager.pro	2012-03-14 16:54:04 UTC (rev 15813)
@@ -7,11 +7,14 @@
 
 LIBS	+= -lpcbsd
 
-HEADERS	+= networkman.h
+HEADERS	+= networkman.h \
+    dnslist.h
 
-SOURCES	+= main.cpp networkman.cpp
+SOURCES	+= main.cpp networkman.cpp \
+    dnslist.cpp
 
-FORMS	= networkman.ui
+FORMS	= networkman.ui \
+    dnslist.ui
 
 RESOURCES += NetworkManager.qrc 
 

Modified: pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/networkman.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/networkman.cpp	2012-03-14 14:59:31 UTC (rev 15812)
+++ pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/networkman.cpp	2012-03-14 16:54:04 UTC (rev 15813)
@@ -24,6 +24,7 @@
 #include "networkman.h"
 #include "ui_networkman.h"
 #include "../../../config.h"
+#include "dnslist.h"
 
 // Set our max number of wlan[0-9] devices we'll support
 #define MAX_WLAN_DEVICES 10
@@ -85,6 +86,11 @@
     connect(linePPPPassword, SIGNAL(textChanged(const QString &)), this, SLOT(slotCheckGlobalText()) );
     connect(linePPPService, SIGNAL(textChanged(const QString &)), this, SLOT(slotCheckGlobalText()) );
 
+    connect(PublicDNS1, SIGNAL(clicked()), this, SLOT(slotPublicDNS1Clicked()) );
+    connect(PublicDNS2, SIGNAL(clicked()), this, SLOT(slotPublicDNS2Clicked()) );
+    connect(IPV6DNS1Button, SIGNAL(clicked()), this, SLOT(slotIPV6DNS1Clicked()) );
+    connect(IPV6DNS2Button, SIGNAL(clicked()), this, SLOT(slotIPV6DNS2Clicked()) );
+
     // Get the FreeBSD Major version we are using
     checkFreeBSDVer();
     
@@ -1290,3 +1296,35 @@
    QMessageBox::information( this, tr("Pin Output"),
 	  tr("The PIN setting returned the following output:") + "\n"  + pinout );
 }
+
+void NetworkMan::slotPublicDNS1Clicked()
+{
+    DNSList* dlg=new DNSList (this);
+    QString ip;
+    if ( QDialog::Accepted == dlg->getIP(DNSList::eIPV4, ip))
+        lineDNS1->setText(ip);
+}
+
+void NetworkMan::slotPublicDNS2Clicked()
+{
+    DNSList* dlg=new DNSList (this);
+    QString ip;
+    if ( QDialog::Accepted == dlg->getIP(DNSList::eIPV4, ip))
+        lineDNS2->setText(ip);
+}
+
+void NetworkMan::slotIPV6DNS1Clicked()
+{
+    DNSList* dlg=new DNSList (this);
+    QString ip;
+    if ( QDialog::Accepted == dlg->getIP(DNSList::eIPV6, ip))
+        lineIPv6DNS1->setText(ip);
+}
+
+void NetworkMan::slotIPV6DNS2Clicked()
+{
+    DNSList* dlg=new DNSList (this);
+    QString ip;
+    if ( QDialog::Accepted == dlg->getIP(DNSList::eIPV6, ip))
+        lineIPv6DNS2->setText(ip);
+}

Modified: pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/networkman.h
===================================================================
--- pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/networkman.h	2012-03-14 14:59:31 UTC (rev 15812)
+++ pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/networkman.h	2012-03-14 16:54:04 UTC (rev 15813)
@@ -45,6 +45,10 @@
     void slotPPPOEChanged();
     void slotProxyUserChecked();
     void slotSendPPPOEPIN();
+    void slotPublicDNS1Clicked();
+    void slotPublicDNS2Clicked();
+    void slotIPV6DNS1Clicked();
+    void slotIPV6DNS2Clicked();
 
 
 private:

Modified: pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/networkman.ui
===================================================================
--- pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/networkman.ui	2012-03-14 14:59:31 UTC (rev 15812)
+++ pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/networkman.ui	2012-03-14 16:54:04 UTC (rev 15813)
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>664</width>
-    <height>506</height>
+    <width>660</width>
+    <height>502</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -242,86 +242,105 @@
          <property name="title">
           <string>System configuration settings</string>
          </property>
-         <layout class="QGridLayout" name="gridLayout_2">
-          <item row="0" column="1">
-           <layout class="QHBoxLayout" name="horizontalLayout_2">
-            <item>
-             <layout class="QVBoxLayout" name="verticalLayout_4">
-              <item>
-               <widget class="QLabel" name="textLabel11_2_2">
-                <property name="text">
-                 <string>DNS 1:</string>
-                </property>
-                <property name="alignment">
-                 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-                </property>
-                <property name="wordWrap">
-                 <bool>false</bool>
-                </property>
-               </widget>
-              </item>
-              <item>
-               <widget class="QLabel" name="textLabel11_2_3">
-                <property name="text">
-                 <string>DNS 2:</string>
-                </property>
-                <property name="alignment">
-                 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-                </property>
-                <property name="wordWrap">
-                 <bool>false</bool>
-                </property>
-               </widget>
-              </item>
-              <item>
-               <widget class="QLabel" name="label">
-                <property name="text">
-                 <string>Search Domain:</string>
-                </property>
-               </widget>
-              </item>
-             </layout>
+         <layout class="QHBoxLayout" name="horizontalLayout_2">
+          <item>
+           <spacer name="horizontalSpacer_12">
+            <property name="orientation">
+             <enum>Qt::Horizontal</enum>
+            </property>
+            <property name="sizeHint" stdset="0">
+             <size>
+              <width>40</width>
+              <height>20</height>
+             </size>
+            </property>
+           </spacer>
+          </item>
+          <item>
+           <layout class="QGridLayout" name="gridLayout_2">
+            <item row="0" column="0">
+             <widget class="QLabel" name="textLabel11_2_2">
+              <property name="text">
+               <string>DNS 1:</string>
+              </property>
+              <property name="alignment">
+               <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+              </property>
+              <property name="wordWrap">
+               <bool>false</bool>
+              </property>
+             </widget>
             </item>
-            <item>
-             <layout class="QVBoxLayout" name="verticalLayout_3">
-              <item>
-               <widget class="QLineEdit" name="lineDNS1">
-                <property name="sizePolicy">
-                 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-                  <horstretch>0</horstretch>
-                  <verstretch>0</verstretch>
-                 </sizepolicy>
-                </property>
-                <property name="inputMask">
-                 <string>999\.999\.999\.999; </string>
-                </property>
-                <property name="alignment">
-                 <set>Qt::AlignHCenter</set>
-                </property>
-               </widget>
-              </item>
-              <item>
-               <widget class="QLineEdit" name="lineDNS2">
-                <property name="sizePolicy">
-                 <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
-                  <horstretch>0</horstretch>
-                  <verstretch>0</verstretch>
-                 </sizepolicy>
-                </property>
-                <property name="inputMask">
-                 <string>999\.999\.999\.999; </string>
-                </property>
-                <property name="alignment">
-                 <set>Qt::AlignHCenter</set>
-                </property>
-               </widget>
-              </item>
-              <item>
-               <widget class="QLineEdit" name="lineSearchDomain"/>
-              </item>
-             </layout>
+            <item row="0" column="1">
+             <widget class="QLineEdit" name="lineDNS1">
+              <property name="sizePolicy">
+               <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+                <horstretch>0</horstretch>
+                <verstretch>0</verstretch>
+               </sizepolicy>
+              </property>
+              <property name="inputMask">
+               <string>999\.999\.999\.999; </string>
+              </property>
+              <property name="alignment">
+               <set>Qt::AlignHCenter</set>
+              </property>
+             </widget>
             </item>
-            <item>
+            <item row="0" column="2">
+             <widget class="QPushButton" name="PublicDNS1">
+              <property name="text">
+               <string>Public servers</string>
+              </property>
+             </widget>
+            </item>
+            <item row="1" column="2" rowspan="2">
+             <widget class="QPushButton" name="PublicDNS2">
+              <property name="text">
+               <string>Public servers</string>
+              </property>
+             </widget>
+            </item>
+            <item row="2" column="0">
+             <widget class="QLabel" name="textLabel11_2_3">
+              <property name="text">
+               <string>DNS 2:</string>
+              </property>
+              <property name="alignment">
+               <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+              </property>
+              <property name="wordWrap">
+               <bool>false</bool>
+              </property>
+             </widget>
+            </item>
+            <item row="2" column="1">
+             <widget class="QLineEdit" name="lineDNS2">
+              <property name="sizePolicy">
+               <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+                <horstretch>0</horstretch>
+                <verstretch>0</verstretch>
+               </sizepolicy>
+              </property>
+              <property name="inputMask">
+               <string>999\.999\.999\.999; </string>
+              </property>
+              <property name="alignment">
+               <set>Qt::AlignHCenter</set>
+              </property>
+             </widget>
+            </item>
+            <item row="3" column="0">
+             <widget class="QLabel" name="label">
+              <property name="text">
+               <string>Search Domain:</string>
+              </property>
+             </widget>
+            </item>
+            <item row="3" column="1">
+             <widget class="QLineEdit" name="lineSearchDomain"/>
+            </item>
+            <item row="3" column="2">
              <spacer name="horizontalSpacer_10">
               <property name="orientation">
                <enum>Qt::Horizontal</enum>
@@ -336,7 +355,7 @@
             </item>
            </layout>
           </item>
-          <item row="0" column="2">
+          <item>
            <layout class="QHBoxLayout" name="horizontalLayout">
             <item>
              <layout class="QVBoxLayout" name="verticalLayout_2">
@@ -412,7 +431,7 @@
             </item>
            </layout>
           </item>
-          <item row="0" column="3">
+          <item>
            <spacer name="horizontalSpacer_11">
             <property name="orientation">
              <enum>Qt::Horizontal</enum>
@@ -425,19 +444,6 @@
             </property>
            </spacer>
           </item>
-          <item row="0" column="0">
-           <spacer name="horizontalSpacer_12">
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>40</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
          </layout>
         </widget>
        </item>
@@ -579,6 +585,32 @@
            </item>
           </layout>
          </widget>
+         <widget class="QPushButton" name="IPV6DNS1Button">
+          <property name="geometry">
+           <rect>
+            <x>440</x>
+            <y>60</y>
+            <width>111</width>
+            <height>23</height>
+           </rect>
+          </property>
+          <property name="text">
+           <string>Public servers</string>
+          </property>
+         </widget>
+         <widget class="QPushButton" name="IPV6DNS2Button">
+          <property name="geometry">
+           <rect>
+            <x>440</x>
+            <y>90</y>
+            <width>111</width>
+            <height>23</height>
+           </rect>
+          </property>
+          <property name="text">
+           <string>Public servers</string>
+          </property>
+         </widget>
         </widget>
        </item>
       </layout>
@@ -760,8 +792,8 @@
              <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
 <html><head><meta name="qrichtext" content="1" /><style type="text/css">
 p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Bitstream Vera Sans'; font-size:10pt; font-weight:400; font-style:normal;">
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p></body></html></string>
+</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Bitstream Vera Sans'; font-size:10pt;"></p></body></html></string>
             </property>
             <property name="acceptRichText">
              <bool>false</bool>



More information about the Commits mailing list