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

svn at pcbsd.org svn at pcbsd.org
Fri Oct 8 13:35:47 PDT 2010


Author: kris
Date: 2010-10-08 13:35:47 -0700 (Fri, 08 Oct 2010)
New Revision: 7753

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:

Added options to PPP config to set dialer AT commands, and started on
button for sending 3G pin number



Modified: pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/NetworkManager.pro
===================================================================
--- pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/NetworkManager.pro	2010-10-08 19:31:36 UTC (rev 7752)
+++ pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/NetworkManager.pro	2010-10-08 20:35:47 UTC (rev 7753)
@@ -82,9 +82,15 @@
 desktop.path=/usr/local/share/applications/
 desktop.files=pcnetwork.desktop
 
+cpres.path=/usr/local/share/pcbsd/pc-netmanager/
+cpres.files=resources/umts_stick
+
+resperm.path=/usr/local/share/pcbsd/pc-netmanager/
+resperm.extra=chmod 755 /usr/local/share/pcbsd/pc-netmanager/umts_stick
+
 dotrans.path=/usr/local/share/pcbsd/i18n/
 dotrans.extra=cd i18n && lrelease-qt4 *.ts && cp *.qm /usr/local/share/pcbsd/i18n/
 
-INSTALLS+= dotrans
+INSTALLS+= dotrans cpres resperm
 
 INCLUDEPATH+= ../../../libpcbsd/

Modified: pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/networkman.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/networkman.cpp	2010-10-08 19:31:36 UTC (rev 7752)
+++ pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/networkman.cpp	2010-10-08 20:35:47 UTC (rev 7753)
@@ -60,6 +60,7 @@
     connect(listNetDev, SIGNAL(itemSelectionChanged()), this, SLOT(DevSelectionChanged()) );
     connect(pushConfigure, SIGNAL(clicked()), this, SLOT(PropertiesSlot()) );
     connect(groupBoxPPPOE, SIGNAL(clicked(bool)), this, SLOT(slotPPPOEChanged()) );
+    connect( pushSend3GPIN, SIGNAL( clicked() ), this, SLOT( slotSendPPPOEPIN() ) );
     connect(checkSysTray, SIGNAL(clicked()), this, SLOT(slotSysTray()) );
     listNetDev->setContextMenuPolicy( Qt::CustomContextMenu );
     connect(listNetDev, SIGNAL(itemDoubleClicked( QListWidgetItem *) ), this, SLOT(slotDoubleClick(QListWidgetItem *) ) );
@@ -77,7 +78,6 @@
     connect(linePPPPassword, SIGNAL(textChanged(const QString &)), this, SLOT(slotCheckGlobalText()) );
     connect(linePPPService, SIGNAL(textChanged(const QString &)), this, SLOT(slotCheckGlobalText()) );
 
-         
     // Get the FreeBSD Major version we are using
     checkFreeBSDVer();
     
@@ -884,6 +884,7 @@
 
 	    if ( foundProfile == 1)
 	    {
+		
 		// Search for the username and load it
 		if ( line.indexOf("authname") != -1 )
 		{
@@ -896,7 +897,18 @@
 			tmp = line.remove(0, line.indexOf("authkey") + 8 );
 			linePPPPassword->setText(tmp);
 		}
+
+		// Check if using ppp dns
+		if ( line.indexOf("enable dns") != -1 )
+		   checkPPPOEDNS->setChecked(true);
 		
+		// Get the dialer commands
+		if ( line.indexOf("set dial \"") != -1 ) {
+			tmp = line.replace("set dial \"", "");
+			tmp = tmp.replace("\"", "");
+			textDialerAT->setPlainText(tmp);
+		}
+
 		// Search for the device / service tag
 		if ( line.indexOf("set device PPPoE:") != -1 )
 		{
@@ -908,6 +920,7 @@
 			linePPPService->setText(tmp2);
 			tmp.truncate( tmp.indexOf(":") );
 		    }
+
 		    
 		    // Now look for device string
 		   /* int i = 0;
@@ -1208,6 +1221,7 @@
 
 void NetworkMan::updatePPPconf()
 {
+    QString tmp;
     QString DeviceName = comboPPPOEDev->currentText();
     
     QFile filein( "/etc/ppp/ppp.conf" );
@@ -1218,14 +1232,23 @@
         QTextStream streamout( &fileout );
 
                     streamout << "default:\n set timeout 180\n";
+                    streamout << ProfileName + ":\n";
 
 		    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";
 
+                    streamout << "  set device PPPoE:" + DeviceName + ":" + ProfileName + "\n  set authname " + linePPPUsername->text() + "\n  set authkey " + linePPPPassword->text() + "\n";
+		    if ( ! textDialerAT->toPlainText().isEmpty() ) {
+		      tmp = textDialerAT->toPlainText();
+		      streamout << "  set dial \"" + tmp.simplified() + "\"\n";
+		    } else {
+		      streamout << "  set dial\n";
+		    }
+		    streamout << "  set login\n  set ifaddr 0 0\n  add default HISADDR";
+
         fileout.close();
     }
 
@@ -1319,3 +1342,12 @@
    Utils::setProxyPort(QString::number(spinProxyPort->value()));
 
 }
+
+void NetworkMan::slotSendPPPOEPIN()
+{
+
+   // KPM Needs finishing, umts_stick needs update to allow providing pin / device from prompt
+   QString pinout = getLineFromCommandOutput("/usr/local/share/pcbsd/pc-netmanager/umts_stick -a ");
+   QMessageBox::information( this, tr("Pin Output"),
+	  tr("The PIN setting returned the following output:") + "\n"  + pinout );
+}

Modified: pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/networkman.h
===================================================================
--- pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/networkman.h	2010-10-08 19:31:36 UTC (rev 7752)
+++ pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/networkman.h	2010-10-08 20:35:47 UTC (rev 7753)
@@ -42,6 +42,7 @@
     void slotCheckGlobalText();
     void slotPPPOEChanged();
     void slotProxyUserChecked();
+    void slotSendPPPOEPIN();
 
 
 private:

Modified: pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/networkman.ui
===================================================================
--- pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/networkman.ui	2010-10-08 19:31:36 UTC (rev 7752)
+++ pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/networkman.ui	2010-10-08 20:35:47 UTC (rev 7753)
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>658</width>
-    <height>451</height>
+    <height>525</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -233,24 +233,8 @@
       <attribute name="title">
        <string>Network Configuration (Advanced)</string>
       </attribute>
-      <layout class="QGridLayout" name="gridLayout_4">
-       <item row="0" column="0" rowspan="2">
-        <spacer name="spacer35">
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-         <property name="sizeType">
-          <enum>QSizePolicy::Expanding</enum>
-         </property>
-         <property name="sizeHint" stdset="0">
-          <size>
-           <width>50</width>
-           <height>31</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-       <item row="0" column="1">
+      <layout class="QGridLayout" name="gridLayout_8">
+       <item row="0" column="0">
         <widget class="QGroupBox" name="groupBox_3">
          <property name="title">
           <string>System configuration settings</string>
@@ -415,7 +399,7 @@
          </layout>
         </widget>
        </item>
-       <item row="0" column="2" rowspan="2">
+       <item row="0" column="1" rowspan="3">
         <spacer name="spacer34">
          <property name="orientation">
           <enum>Qt::Horizontal</enum>
@@ -431,7 +415,7 @@
          </property>
         </spacer>
        </item>
-       <item row="1" column="1">
+       <item row="1" column="0">
         <widget class="QGroupBox" name="groupBoxPPPOE">
          <property name="title">
           <string>PPP / 3G wireless configuration</string>
@@ -439,7 +423,7 @@
          <property name="checkable">
           <bool>true</bool>
          </property>
-         <layout class="QGridLayout" name="gridLayout_8">
+         <layout class="QGridLayout" name="gridLayout_4">
           <item row="0" column="0" rowspan="2">
            <spacer name="spacer32">
             <property name="orientation">
@@ -580,18 +564,15 @@
             </property>
            </widget>
           </item>
-          <item row="3" column="1" colspan="2">
-           <spacer name="horizontalSpacer_4">
-            <property name="orientation">
-             <enum>Qt::Horizontal</enum>
+          <item row="3" column="0" colspan="2">
+           <widget class="QLabel" name="label_8">
+            <property name="text">
+             <string>Dialer AT commands</string>
             </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>287</width>
-              <height>19</height>
-             </size>
+            <property name="alignment">
+             <set>Qt::AlignCenter</set>
             </property>
-           </spacer>
+           </widget>
           </item>
           <item row="3" column="3" colspan="2">
            <widget class="QCheckBox" name="checkPPPOEDNS">
@@ -600,26 +581,94 @@
             </property>
            </widget>
           </item>
+          <item row="4" column="0" rowspan="2" colspan="3">
+           <widget class="QTextEdit" name="textDialerAT">
+            <property name="html">
+             <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
+p, li { white-space: pre-wrap; }
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Bitstream Vera Sans'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
+&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+            </property>
+            <property name="acceptRichText">
+             <bool>false</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="4" column="3" colspan="3">
+           <layout class="QHBoxLayout" name="horizontalLayout_8">
+            <item>
+             <spacer name="horizontalSpacer_8">
+              <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>
+             <widget class="QLineEdit" name="line3GPin"/>
+            </item>
+            <item>
+             <spacer name="horizontalSpacer_7">
+              <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>
+          </item>
+          <item row="5" column="3" colspan="3">
+           <layout class="QHBoxLayout" name="horizontalLayout_7">
+            <item>
+             <spacer name="horizontalSpacer_9">
+              <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>
+             <widget class="QPushButton" name="pushSend3GPIN">
+              <property name="text">
+               <string>Send 3G PIN</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <spacer name="horizontalSpacer_4">
+              <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>
+          </item>
          </layout>
         </widget>
        </item>
-       <item row="3" column="0" colspan="3">
-        <spacer name="spacer33">
-         <property name="orientation">
-          <enum>Qt::Vertical</enum>
-         </property>
-         <property name="sizeType">
-          <enum>QSizePolicy::Expanding</enum>
-         </property>
-         <property name="sizeHint" stdset="0">
-          <size>
-           <width>21</width>
-           <height>270</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-       <item row="2" column="1">
+       <item row="2" column="0">
         <widget class="QGroupBox" name="groupIPv6">
          <property name="title">
           <string>Enable IPv6 support</string>
@@ -688,6 +737,22 @@
          </layout>
         </widget>
        </item>
+       <item row="3" column="0" colspan="2">
+        <spacer name="spacer33">
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeType">
+          <enum>QSizePolicy::Expanding</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>21</width>
+           <height>270</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
       </layout>
      </widget>
      <widget class="QWidget" name="tab">



More information about the Commits mailing list