Changeset 3870

Show
Ignore:
Timestamp:
05/05/09 16:21:36 (10 months ago)
Author:
kris
Message:

Updated our WiFi? setup tool. Now you can "edit" a saved profile / key, and also you can set priority to which network you want to connect to first.

Location:
pcbsd
Files:
2 added
12 modified

Legend:

Unmodified
Added
Removed
  • pcbsd/trunk-current/wificonfig/wificonfig.qrc

    r2904 r3870  
    11<RCC> 
    22  <qresource> 
     3    <file>configure.png</file> 
    34    <file>object-locked.png</file> 
    45    <file>object-unlocked.png</file> 
  • pcbsd/trunk-current/wificonfig/wificonfigwidgetbase.cpp

    r2904 r3870  
    8282 
    8383       // Loop through all the devices we have now 
    84        for(int curItem=0; curItem < 149; curItem++) 
     84       for(int curItem=0; curItem < 145; curItem++) 
    8585       { 
    8686         if ( ! SSIDList[curItem].isEmpty() ) 
     
    9696       } 
    9797 
     98       streamout << " priority=" << 145 - curItem << "\n"; 
    9899       streamout << " scan_ssid=1\n"; 
    99100 
     
    186187     
    187188  // Connect our add / remove buttons for wifi 
     189  connect( pushDown, SIGNAL( clicked() ), this, SLOT( slotMoveDown() ) );  
     190  connect( pushUp, SIGNAL( clicked() ), this, SLOT( slotMoveUp() ) );  
    188191  connect( pushAddWifi, SIGNAL( clicked() ), this, SLOT( slotAddNewProfile() ) );  
     192  connect( pushEditWifi, SIGNAL( clicked() ), this, SLOT( slotEditProfile() ) );  
    189193  connect( pushRemoveWifi, SIGNAL( clicked() ), this, SLOT( slotRemoveProfile() ) );  
    190194 
     
    393397} 
    394398 
     399// Slot which moves a SSID higher in the connection priority 
     400void wificonfigwidgetbase::slotMoveUp() 
     401{ 
     402    QString tmpString; 
     403    int tmpInt; 
     404    bool tmpBool; 
     405 
     406    // Check if we have a selection to work with 
     407    if ( listWifi->currentRow() != -1 ) 
     408    { 
     409      // Locate the SSID we want to remove 
     410      QString editSSID = listWifi->item(listWifi->currentRow())->text(); 
     411      for ( int i = 0; i < 145; i++) 
     412      { 
     413          if ( SSIDList[i] == editSSID && i != 0 ) 
     414          { 
     415            // We found the ssid we need to move up 
     416            tmpString = SSIDList[i-1]; 
     417            SSIDList[i-1] = SSIDList[i] ;  
     418            SSIDList[i] = tmpString;  
     419             
     420            tmpInt = SSIDEncType[i-1]; 
     421            SSIDEncType[i-1] = SSIDEncType[i]; 
     422            SSIDEncType[i] = tmpInt; 
     423 
     424            tmpBool = BSSID[i-1]; 
     425            BSSID[i-1] = BSSID[i]; 
     426            BSSID[i] = tmpBool; 
     427 
     428            tmpString = WEPKey[i-1]; 
     429            WEPKey[i-1] = WEPKey[i]; 
     430            WEPKey[i] = tmpString; 
     431 
     432            tmpInt = WEPIndex[i-1]; 
     433            WEPIndex[i-1] = WEPIndex[i]; 
     434            WEPIndex[i] = tmpInt; 
     435 
     436            tmpBool = WEPHex[i-1]; 
     437            WEPHex[i-1] = WEPHex[i]; 
     438            WEPHex[i] = tmpBool; 
     439 
     440            tmpString = WPAPersonalKey[i-1]; 
     441            WPAPersonalKey[i-1] = WPAPersonalKey[i]; 
     442            WPAPersonalKey[i] = tmpString; 
     443 
     444            tmpString = WPAEIdent[i-1]; 
     445            WPAEIdent[i-1] = WPAEIdent[i]; 
     446            WPAEIdent[i] = tmpString; 
     447 
     448            tmpString = WPAECACert[i-1]; 
     449            WPAECACert[i-1] = WPAECACert[i]; 
     450            WPAECACert[i] = tmpString; 
     451 
     452            tmpString = WPAEClientCert[i-1]; 
     453            WPAEClientCert[i-1] = WPAEClientCert[i]; 
     454            WPAEClientCert[i] = tmpString; 
     455 
     456            tmpString = WPAEPrivKeyFile[i-1]; 
     457            WPAEPrivKeyFile[i-1] = WPAEPrivKeyFile[i]; 
     458            WPAEPrivKeyFile[i] = tmpString; 
     459 
     460            tmpString = WPAEPassword[i-1]; 
     461            WPAEPassword[i-1] = WPAEPassword[i]; 
     462            WPAEPassword[i] = tmpString; 
     463 
     464            tmpInt = WPAEType[i-1]; 
     465            WPAEType[i-1] = WPAEType[i]; 
     466            WPAEType[i] = tmpInt; 
     467            break; 
     468          } 
     469      } 
     470 
     471      // Refresh the SSID list and enable the apply button 
     472      slotRefreshSSIDList(); 
     473      pushApply->setEnabled(TRUE); 
     474    } 
     475} 
     476 
     477 
     478// Slot which moves a SSID lower in the connection priority 
     479void wificonfigwidgetbase::slotMoveDown() 
     480{ 
     481    QString tmpString; 
     482    int tmpInt; 
     483    bool tmpBool; 
     484 
     485    // Check if we have a selection to work with 
     486    if ( listWifi->currentRow() != -1 ) 
     487    { 
     488      // Locate the SSID we want to remove 
     489      QString editSSID = listWifi->item(listWifi->currentRow())->text(); 
     490      for ( int i = 0; i < 145; i++) 
     491      { 
     492          if ( SSIDList[i] == editSSID && ! SSIDList[i+1].isEmpty()) 
     493          { 
     494            // We found the ssid we need to move down 
     495            tmpString = SSIDList[i+1]; 
     496            SSIDList[i+1] = SSIDList[i] ;  
     497            SSIDList[i] = tmpString;  
     498             
     499            tmpInt = SSIDEncType[i+1]; 
     500            SSIDEncType[i+1] = SSIDEncType[i]; 
     501            SSIDEncType[i] = tmpInt; 
     502 
     503            tmpBool = BSSID[i+1]; 
     504            BSSID[i+1] = BSSID[i]; 
     505            BSSID[i] = tmpBool; 
     506 
     507            tmpString = WEPKey[i+1]; 
     508            WEPKey[i+1] = WEPKey[i]; 
     509            WEPKey[i] = tmpString; 
     510 
     511            tmpInt = WEPIndex[i+1]; 
     512            WEPIndex[i+1] = WEPIndex[i]; 
     513            WEPIndex[i] = tmpInt; 
     514 
     515            tmpBool = WEPHex[i+1]; 
     516            WEPHex[i+1] = WEPHex[i]; 
     517            WEPHex[i] = tmpBool; 
     518 
     519            tmpString = WPAPersonalKey[i+1]; 
     520            WPAPersonalKey[i+1] = WPAPersonalKey[i]; 
     521            WPAPersonalKey[i] = tmpString; 
     522 
     523            tmpString = WPAEIdent[i+1]; 
     524            WPAEIdent[i+1] = WPAEIdent[i]; 
     525            WPAEIdent[i] = tmpString; 
     526 
     527            tmpString = WPAECACert[i+1]; 
     528            WPAECACert[i+1] = WPAECACert[i]; 
     529            WPAECACert[i] = tmpString; 
     530 
     531            tmpString = WPAEClientCert[i+1]; 
     532            WPAEClientCert[i+1] = WPAEClientCert[i]; 
     533            WPAEClientCert[i] = tmpString; 
     534 
     535            tmpString = WPAEPrivKeyFile[i+1]; 
     536            WPAEPrivKeyFile[i+1] = WPAEPrivKeyFile[i]; 
     537            WPAEPrivKeyFile[i] = tmpString; 
     538 
     539            tmpString = WPAEPassword[i+1]; 
     540            WPAEPassword[i+1] = WPAEPassword[i]; 
     541            WPAEPassword[i] = tmpString; 
     542 
     543            tmpInt = WPAEType[i+1]; 
     544            WPAEType[i+1] = WPAEType[i]; 
     545            WPAEType[i] = tmpInt; 
     546            break; 
     547          } 
     548      } 
     549 
     550      // Refresh the SSID list and enable the apply button 
     551      slotRefreshSSIDList(); 
     552      pushApply->setEnabled(TRUE); 
     553    } 
     554} 
     555 
     556void wificonfigwidgetbase::slotEditProfile() 
     557{ 
     558    bool foundSSID=false; 
     559    int curItem=0; 
     560 
     561    // Check if we have a selection to work with 
     562    if ( listWifi->currentRow() != -1 ) 
     563    { 
     564      // Locate the SSID we want to remove 
     565      QString editSSID = listWifi->item(listWifi->currentRow())->text(); 
     566      for ( int i = 0; i < 145; i++) 
     567      { 
     568          if ( SSIDList[i] == editSSID ) 
     569          { 
     570            // We found the ssid we need to edit 
     571            foundSSID=true;  
     572            curItem=i; 
     573            break; 
     574          } 
     575      } 
     576 
     577      // Lets go ahead and open the edit dialog on this SSID 
     578      if (foundSSID) 
     579      { 
     580          // Set our internal flag that this is an edit on an existing device 
     581          wifiselect = new wifiselectiondialog(); 
     582          wifiselect->init(DeviceName); 
     583 
     584          // Check the type of SSID this is, and issue appropriate edit  
     585          if ( SSIDEncType[curItem] == NO_ENCRYPTION) { 
     586             wifiselect->initEdit(SSIDList[curItem], BSSID[curItem]); 
     587          } 
     588          if ( SSIDEncType[curItem] == WEP_ENCRYPTION) { 
     589             wifiselect->initEdit(SSIDList[curItem], BSSID[curItem], WEPKey[curItem], WEPIndex[curItem], WEPHex[curItem]); 
     590          } 
     591          if ( SSIDEncType[curItem] == WPA_ENCRYPTION) { 
     592             wifiselect->initEdit(SSIDList[curItem], BSSID[curItem], WPAPersonalKey[curItem]); 
     593          } 
     594          if ( SSIDEncType[curItem] == WPAE_ENCRYPTION) { 
     595             wifiselect->initEdit(SSIDList[curItem], BSSID[curItem], WPAEType[curItem], WPAEIdent[curItem], WPAECACert[curItem], WPAEClientCert[curItem], WPAEPrivKeyFile[curItem], WPAEPassword[curItem]); 
     596          } 
     597 
     598 
     599          // Connect our delete signal, which runs before we add a new SSID 
     600          connect( wifiselect, SIGNAL( signalDeleteSSID(QString) ), this, SLOT( slotRemoveProfileSSID(QString) ) );  
     601 
     602          // Connect our save signals 
     603          connect( wifiselect, SIGNAL( signalSavedOpen(QString, bool) ), this, SLOT( slotAddNewProfileOpen(QString, bool) ) ); 
     604          connect( wifiselect, SIGNAL( signalSavedWEP( QString, bool, QString, int, bool ) ), this, SLOT( slotAddNewProfileWEP( QString, bool, QString, int, bool) ) ); 
     605   connect( wifiselect, SIGNAL( signalSavedWPA(QString, bool, QString) ), this, SLOT( slotAddNewProfileWPA(QString, bool, QString) ) ); 
     606          connect( wifiselect, SIGNAL( signalSavedWPAE(QString, bool, int, QString, QString, QString, QString, QString) ), this, SLOT ( slotAddNewProfileWPAE(QString, bool, int, QString, QString, QString, QString, QString) ) ); 
     607 
     608          wifiselect->exec(); 
     609      } 
     610 
     611 
     612    } 
     613} 
     614 
     615 
    395616void wificonfigwidgetbase::slotRemoveProfile() 
    396617{ 
     
    400621      // Locate the SSID we want to remove 
    401622      QString removeSSID = listWifi->item(listWifi->currentRow())->text(); 
    402       for ( int curItem = 0; curItem < 149; curItem++) 
    403       { 
    404           if ( SSIDList[curItem] == removeSSID ) 
    405           { 
    406              SSIDList[curItem] = ""; 
    407           } 
    408       } 
     623      slotRemoveProfileSSID(removeSSID); 
    409624 
    410625      // Refresh the SSID list and enable the apply button 
     
    421636   wifiselect->init(DeviceName); 
    422637 
     638   // Connect our save slots 
    423639   connect( wifiselect, SIGNAL( signalSavedOpen(QString, bool) ), this, SLOT( slotAddNewProfileOpen(QString, bool) ) );  
    424  
    425640   connect( wifiselect, SIGNAL( signalSavedWEP( QString, bool, QString, int, bool ) ), this, SLOT( slotAddNewProfileWEP( QString, bool, QString, int, bool) ) );  
    426641   connect( wifiselect, SIGNAL( signalSavedWPA(QString, bool, QString) ), this, SLOT( slotAddNewProfileWPA(QString, bool, QString) ) );  
    427  
    428642   connect( wifiselect, SIGNAL( signalSavedWPAE(QString, bool, int, QString, QString, QString, QString, QString) ), this, SLOT( slotAddNewProfileWPAE(QString, bool, int, QString, QString, QString, QString, QString) ) );  
    429643 
     
    438652} 
    439653 
     654void wificonfigwidgetbase::slotRemoveProfileSSID(QString RemoveSSID) 
     655{ 
     656   bool foundSSID=false; 
     657 
     658   // Loop through, remove selected SSID, and move any entries after it up 
     659   for (int remItem = 0; remItem < 145; remItem++) 
     660   { 
     661 
     662     if ( RemoveSSID == SSIDList[remItem] ) { 
     663       foundSSID=true; 
     664     } 
     665 
     666     if(foundSSID)  
     667     { 
     668       SSIDList[remItem] = SSIDList[remItem+1] ;  
     669       SSIDEncType[remItem] = SSIDEncType[remItem+1]; 
     670       BSSID[remItem] = BSSID[remItem+1]; 
     671       WEPKey[remItem] = WEPKey[remItem+1]; 
     672       WEPIndex[remItem] = WEPIndex[remItem+1]; 
     673       WEPHex[remItem] = WEPHex[remItem+1]; 
     674       WPAPersonalKey[remItem] = WPAPersonalKey[remItem+1]; 
     675       WPAEIdent[remItem] = WPAEIdent[remItem+1]; 
     676       WPAECACert[remItem] = WPAECACert[remItem+1]; 
     677       WPAEClientCert[remItem] = WPAEClientCert[remItem+1]; 
     678       WPAEPrivKeyFile[remItem] = WPAEPrivKeyFile[remItem+1]; 
     679       WPAEPassword[remItem] = WPAEPassword[remItem+1]; 
     680       WPAEType[remItem] = WPAEType[remItem+1]; 
     681     } 
     682 
     683     if ( SSIDList[remItem+1].isEmpty() ) 
     684     { 
     685       break; 
     686     } 
     687 
     688   } 
     689 
     690    
     691} 
     692 
    440693void wificonfigwidgetbase::slotAddNewProfileOpen(QString SSID, bool isBSSID) 
    441694{ 
    442  
    443    for (int dupItem = 0; dupItem < 149; dupItem++) 
     695   for (int dupItem = 0; dupItem < 145; dupItem++) 
     696   { 
     697      if ( SSID == SSIDList[dupItem] ) { 
     698          QMessageBox::warning( this, tr("Error"), tr("You already have a wireless network with this SSID! Please remove it first.\n") ); 
     699          return; 
     700      } 
     701   } 
     702 
     703 
     704   int curItem=0; 
     705 
     706   while( ! SSIDList[curItem].isEmpty() && curItem < 145 ) 
     707   { 
     708     curItem++; 
     709   } 
     710 
     711    // Find which current item we are working on 
     712 
     713    SSIDList[curItem] = SSID; 
     714    BSSID[curItem] = isBSSID; 
     715     
     716    // Refresh the SSID listbox and enable the apply button 
     717    slotRefreshSSIDList(); 
     718    slotCheckGlobalText(); 
     719} 
     720 
     721void wificonfigwidgetbase::slotAddNewProfileWEP( QString SSID, bool isBSSID, QString newKey, int newIndex, bool hexkey ) 
     722{ 
     723   for (int dupItem = 0; dupItem < 145; dupItem++) 
    444724   { 
    445725      if ( SSID == SSIDList[dupItem] ) { 
     
    452732   int curItem=0; 
    453733 
    454    while( ! SSIDList[curItem].isEmpty() && curItem < 149 ) 
    455    { 
    456      curItem++; 
    457    } 
    458  
    459     // Find which current item we are working on 
    460  
    461     SSIDList[curItem] = SSID; 
    462     BSSID[curItem] = isBSSID; 
    463      
    464     // Refresh the SSID listbox and enable the apply button 
    465     slotRefreshSSIDList(); 
    466     slotCheckGlobalText(); 
    467 } 
    468  
    469 void wificonfigwidgetbase::slotAddNewProfileWEP( QString SSID, bool isBSSID, QString newKey, int newIndex, bool hexkey ) 
    470 { 
    471    for (int dupItem = 0; dupItem < 149; dupItem++) 
    472    { 
    473       if ( SSID == SSIDList[dupItem] ) { 
    474         QMessageBox::warning( this, tr("Error"), tr("You already have a wireless network with this SSID! Please remove it first.\n") ); 
    475         return; 
    476       } 
    477    } 
    478  
    479  
    480    int curItem=0; 
    481  
    482    while( ! SSIDList[curItem].isEmpty() && curItem < 149 ) 
     734   while( ! SSIDList[curItem].isEmpty() && curItem < 145 ) 
    483735   { 
    484736     curItem++; 
     
    504756void wificonfigwidgetbase::slotAddNewProfileWPA( QString SSID, bool isBSSID, QString newKey ) 
    505757{ 
    506    for (int dupItem = 0; dupItem < 149; dupItem++) 
     758   for (int dupItem = 0; dupItem < 145; dupItem++) 
    507759   { 
    508760      if ( SSID == SSIDList[dupItem] ) { 
     
    514766   int curItem=0; 
    515767 
    516    while( ! SSIDList[curItem].isEmpty() && curItem < 149 ) 
     768   while( ! SSIDList[curItem].isEmpty() && curItem < 145 ) 
    517769   { 
    518770     curItem++; 
     
    534786{ 
    535787 
    536    for (int dupItem = 0; dupItem < 149; dupItem++) 
     788   for (int dupItem = 0; dupItem < 145; dupItem++) 
    537789   { 
    538790      if ( SSID == SSIDList[dupItem] ) { 
     
    544796   int curItem=0; 
    545797 
    546    while( ! SSIDList[curItem].isEmpty() && curItem < 149 ) 
     798   while( ! SSIDList[curItem].isEmpty() && curItem < 145 ) 
    547799   { 
    548800     curItem++; 
     
    9651217     curItem++; 
    9661218 
    967      // We only need 150 wireless networks 
    968      if ( curItem > 149 ) 
     1219     // We only need 145 wireless networks 
     1220     if ( curItem > 145 ) 
    9691221     { 
    9701222        break; 
  • pcbsd/trunk-current/wificonfig/wificonfigwidgetbase.h

    r2904 r3870  
    4242    void slotCheckDHCPBox(); 
    4343    void slotAddNewProfile(); 
     44    void slotEditProfile(); 
    4445    void slotRemoveProfile(); 
     46    void slotRemoveProfileSSID(QString RemoveSSID); 
    4547    void slotAddNewProfileOpen( QString SSID, bool isBSSID ); 
    4648    void slotAddNewProfileWEP( QString SSID, bool isBSSID, QString newKey, int newIndex, bool hexkey ); 
     
    5456    void slotCheckGlobalText(); 
    5557    void slotRefreshSSIDList(); 
    56  
     58    void slotMoveUp(); 
     59    void slotMoveDown(); 
    5760 
    5861private: 
  • pcbsd/trunk-current/wificonfig/wificonfigwidgetbase.ui

    r2904 r3870  
    66    <x>0</x> 
    77    <y>0</y> 
    8     <width>348</width> 
    9     <height>450</height> 
     8    <width>320</width> 
     9    <height>463</height> 
    1010   </rect> 
    1111  </property> 
     
    8080       <string>&amp;General</string> 
    8181      </attribute> 
    82       <layout class="QGridLayout" name="gridLayout_4" > 
     82      <layout class="QGridLayout" name="gridLayout_3" > 
     83       <item row="0" column="0" > 
     84        <widget class="QLabel" name="textLabel2" > 
     85         <property name="text" > 
     86          <string>Wireless network profiles</string> 
     87         </property> 
     88         <property name="wordWrap" > 
     89          <bool>false</bool> 
     90         </property> 
     91        </widget> 
     92       </item> 
    8393       <item row="1" column="0" > 
    84         <layout class="QGridLayout" name="gridLayout_3" > 
     94        <layout class="QGridLayout" name="gridLayout_2" > 
    8595         <item row="0" column="0" > 
    8696          <widget class="QListWidget" name="listWifi" /> 
     97         </item> 
     98         <item row="0" column="1" > 
     99          <layout class="QVBoxLayout" name="verticalLayout" > 
     100           <property name="sizeConstraint" > 
     101            <enum>QLayout::SetDefaultConstraint</enum> 
     102           </property> 
     103           <item> 
     104            <spacer name="verticalSpacer_2" > 
     105             <property name="orientation" > 
     106              <enum>Qt::Vertical</enum> 
     107             </property> 
     108             <property name="sizeHint" stdset="0" > 
     109              <size> 
     110               <width>28</width> 
     111               <height>18</height> 
     112              </size> 
     113             </property> 
     114            </spacer> 
     115           </item> 
     116           <item> 
     117            <widget class="QPushButton" name="pushUp" > 
     118             <property name="sizePolicy" > 
     119              <sizepolicy vsizetype="Fixed" hsizetype="Fixed" > 
     120               <horstretch>0</horstretch> 
     121               <verstretch>0</verstretch> 
     122              </sizepolicy> 
     123             </property> 
     124             <property name="text" > 
     125              <string/> 
     126             </property> 
     127             <property name="icon" > 
     128              <iconset resource="wificonfig.qrc" > 
     129               <normaloff>:/arrow-up.png</normaloff>:/arrow-up.png</iconset> 
     130             </property> 
     131            </widget> 
     132           </item> 
     133           <item> 
     134            <widget class="QPushButton" name="pushDown" > 
     135             <property name="sizePolicy" > 
     136              <sizepolicy vsizetype="Fixed" hsizetype="Fixed" > 
     137               <horstretch>0</horstretch> 
     138               <verstretch>0</verstretch> 
     139              </sizepolicy> 
     140             </property> 
     141             <property name="text" > 
     142              <string/> 
     143             </property> 
     144             <property name="icon" > 
     145              <iconset resource="wificonfig.qrc" > 
     146               <normaloff>:/arrow-down.png</normaloff>:/arrow-down.png</iconset> 
     147             </property> 
     148            </widget> 
     149           </item> 
     150           <item> 
     151            <spacer name="verticalSpacer" > 
     152             <property name="orientation" > 
     153              <enum>Qt::Vertical</enum> 
     154             </property> 
     155             <property name="sizeHint" stdset="0" > 
     156              <size> 
     157               <width>20</width> 
     158               <height>40</height> 
     159              </size> 
     160             </property> 
     161            </spacer> 
     162           </item> 
     163          </layout> 
    87164         </item> 
    88165        </layout> 
     
    101178           <property name="shortcut" > 
    102179            <string>Alt+S</string> 
     180           </property> 
     181          </widget> 
     182         </item> 
     183         <item> 
     184          <widget class="QPushButton" name="pushEditWifi" > 
     185           <property name="text" > 
     186            <string>Edit</string> 
     187           </property> 
     188           <property name="icon" > 
     189            <iconset resource="wificonfig.qrc" > 
     190             <normaloff>:/configure.png</normaloff>:/configure.png</iconset> 
    103191           </property> 
    104192          </widget> 
     
    130218        </layout> 
    131219       </item> 
     220       <item row="3" column="0" > 
     221        <widget class="Line" name="line1" > 
     222         <property name="frameShape" > 
     223          <enum>QFrame::HLine</enum> 
     224         </property> 
     225         <property name="frameShadow" > 
     226          <enum>QFrame::Sunken</enum> 
     227         </property> 
     228        </widget> 
     229       </item> 
    132230       <item row="4" column="0" > 
    133231        <widget class="QCheckBox" name="checkDHCP" > 
     
    137235         <property name="shortcut" > 
    138236          <string>Alt+B</string> 
    139          </property> 
    140         </widget> 
    141        </item> 
    142        <item row="3" column="0" > 
    143         <widget class="Line" name="line1" > 
    144          <property name="frameShape" > 
    145           <enum>QFrame::HLine</enum> 
    146          </property> 
    147          <property name="frameShadow" > 
    148           <enum>QFrame::Sunken</enum> 
    149          </property> 
    150         </widget> 
    151        </item> 
    152        <item row="0" column="0" > 
    153         <widget class="QLabel" name="textLabel2" > 
    154          <property name="text" > 
    155           <string>Wireless network profiles</string> 
    156          </property> 
    157          <property name="wordWrap" > 
    158           <bool>false</bool> 
    159237         </property> 
    160238        </widget> 
     
    663741 <tabstops> 
    664742  <tabstop>tabMainWidget</tabstop> 
     743  <tabstop>listWifi</tabstop> 
     744  <tabstop>pushUp</tabstop> 
     745  <tabstop>pushDown</tabstop> 
    665746  <tabstop>pushAddWifi</tabstop> 
     747  <tabstop>pushEditWifi</tabstop> 
     748  <tabstop>pushRemoveWifi</tabstop> 
    666749  <tabstop>checkDHCP</tabstop> 
    667750  <tabstop>lineIP</tabstop> 
    668751  <tabstop>lineNetmask</tabstop> 
     752  <tabstop>checkDisableWireless</tabstop> 
    669753  <tabstop>pushOK</tabstop> 
    670754  <tabstop>pushApply</tabstop> 
    671755  <tabstop>buttonCancel</tabstop> 
    672   <tabstop>checkDisableWireless</tabstop> 
     756  <tabstop>lineMAC</tabstop> 
    673757  <tabstop>checkMAC</tabstop> 
    674   <tabstop>lineMAC</tabstop> 
    675758 </tabstops> 
    676759 <includes> 
  • pcbsd/trunk-current/wificonfig/wifiselectiondialog.cpp

    r2904 r3870  
    8282    } // End of WPAEnt setting check 
    8383     
     84 
     85    if( ! EditingSSID.isEmpty() ) 
     86    { 
     87      // We are editing an existing SSID, issue delete command before adding new one 
     88      emit signalDeleteSSID(EditingSSID); 
     89    } 
    8490     
    8591    selectedSSID = lineSSID->text(); 
     
    108114 
    109115    close(); 
     116} 
     117 
     118// Overloaded function which lets us set editing variables using WPA-Ent 
     119void wifiselectiondialog::initEdit(QString selectedSSID, bool usingBSSID, int editWPAEType, QString editWPAEIdent, QString editWPAECACert, QString editWPAEClientCert, QString editWPAEPrivKeyFile, QString editWPAEPassword) 
     120{ 
     121   pushConnect->setText(tr("Save")); 
     122   EditingSSID=selectedSSID; 
     123   SSID=selectedSSID; 
     124   lineSSID->setText(selectedSSID); 
     125   checkBSSID->setChecked(usingBSSID); 
     126   radioSecurityWPAEnt->setChecked(true); 
     127   WPAEType=editWPAEType;  
     128   WPAEIdent=editWPAEIdent;  
     129   WPAECACert=editWPAECACert;  
     130   WPAEClientCert=editWPAEClientCert;  
     131   WPAEPrivKeyFile=editWPAEPrivKeyFile;  
     132   WPAEPassword=editWPAEPassword;  
     133} 
     134 
     135// Overloaded function which lets us set editing variables using WPA-Personal 
     136void wifiselectiondialog::initEdit(QString selectedSSID, bool usingBSSID, QString editWPAPersonalKey) 
     137{ 
     138   pushConnect->setText(tr("Save")); 
     139   EditingSSID=selectedSSID; 
     140   SSID=selectedSSID; 
     141   lineSSID->setText(selectedSSID); 
     142   checkBSSID->setChecked(usingBSSID); 
     143   radioSecurityWPAPersonal->setChecked(true); 
     144   WPAPersonalKey=editWPAPersonalKey; 
     145} 
     146 
     147// Overloaded function which lets us set editing variables using WEP 
     148void wifiselectiondialog::initEdit(QString selectedSSID, bool usingBSSID, QString editWEPKey, int editWEPIndex, bool editWEPHex) 
     149{ 
     150   pushConnect->setText(tr("Save")); 
     151   EditingSSID=selectedSSID; 
     152   SSID=selectedSSID; 
     153   lineSSID->setText(selectedSSID); 
     154   checkBSSID->setChecked(usingBSSID); 
     155   radioSecurityWEP->setChecked(true); 
     156   WEPKey=editWEPKey; 
     157   WEPIndex=editWEPIndex; 
     158   WEPHex=editWEPHex; 
     159} 
     160 
     161// Overloaded function which lets us set what we are editing with no encryption 
     162void wifiselectiondialog::initEdit(QString selectedSSID, bool usingBSSID) 
     163{ 
     164   pushConnect->setText(tr("Save")); 
     165   EditingSSID=selectedSSID; 
     166   SSID=selectedSSID; 
     167   lineSSID->setText(selectedSSID); 
     168   checkBSSID->setChecked(usingBSSID); 
     169   radioSecurityDisabled->setChecked(true); 
    110170} 
    111171 
  • pcbsd/trunk-current/wificonfig/wifiselectiondialog.h

    r2904 r3870  
    2323   void init(QString device); 
    2424   void scanWifi(); 
     25   void initEdit(QString selectedSSID, bool usingBSSID); 
     26   void initEdit(QString selectedSSID, bool usingBSSID, QString editWEPKey, int editWEPIndex, bool editWEPHex); 
     27   void initEdit(QString selectedSSID, bool usingBSSID, QString editWPAPersonalKey); 
     28   void initEdit(QString selectedSSID, bool usingBSSID, int editWPAEType, QString editWPAEIdent, QString editWPAECACert, QString editWPAEClientCert, QString editWPAEPrivKeyFile, QString editWPAEPassword); 
    2529 
    2630 
     
    4448    QString DeviceName; 
    4549    QString SSID; 
     50    QString EditingSSID; 
    4651 
    4752    // Setup our dialogs 
     
    6873 
    6974signals: 
     75   void signalDeleteSSID(QString); 
    7076   void signalSavedOpen(QString, bool); 
    7177   void signalSavedWEP(QString, bool, QString, int, bool ); 
  • pcbsd/trunk/wificonfig/wificonfig.qrc

    r2904 r3870  
    11<RCC> 
    22  <qresource> 
     3    <file>configure.png</file> 
    34    <file>object-locked.png</file> 
    45    <file>object-unlocked.png</file> 
  • pcbsd/trunk/wificonfig/wificonfigwidgetbase.cpp

    r2904 r3870  
    8282 
    8383       // Loop through all the devices we have now 
    84        for(int curItem=0; curItem < 149; curItem++) 
     84       for(int curItem=0; curItem < 145; curItem++) 
    8585       { 
    8686         if ( ! SSIDList[curItem].isEmpty() ) 
     
    9696       } 
    9797 
     98       streamout << " priority=" << 145 - curItem << "\n"; 
    9899       streamout << " scan_ssid=1\n"; 
    99100 
     
    186187     
    187188  // Connect our add / remove buttons for wifi 
     189  connect( pushDown, SIGNAL( clicked() ), this, SLOT( slotMoveDown() ) );  
     190  connect( pushUp, SIGNAL( clicked() ), this, SLOT( slotMoveUp() ) );  
    188191  connect( pushAddWifi, SIGNAL( clicked() ), this, SLOT( slotAddNewProfile() ) );  
     192  connect( pushEditWifi, SIGNAL( clicked() ), this, SLOT( slotEditProfile() ) );  
    189193  connect( pushRemoveWifi, SIGNAL( clicked() ), this, SLOT( slotRemoveProfile() ) );  
    190194 
     
    393397} 
    394398 
     399// Slot which moves a SSID higher in the connection priority 
     400void wificonfigwidgetbase::slotMoveUp() 
     401{ 
     402    QString tmpString; 
     403    int tmpInt; 
     404    bool tmpBool; 
     405 
     406    // Check if we have a selection to work with 
     407    if ( listWifi->currentRow() != -1 ) 
     408    { 
     409      // Locate the SSID we want to remove 
     410      QString editSSID = listWifi->item(listWifi->currentRow())->text(); 
     411      for ( int i = 0; i < 145; i++) 
     412      { 
     413          if ( SSIDList[i] == editSSID && i != 0 ) 
     414          { 
     415            // We found the ssid we need to move up 
     416            tmpString = SSIDList[i-1]; 
     417            SSIDList[i-1] = SSIDList[i] ;  
     418            SSIDList[i] = tmpString;  
     419             
     420            tmpInt = SSIDEncType[i-1]; 
     421            SSIDEncType[i-1] = SSIDEncType[i]; 
     422            SSIDEncType[i] = tmpInt; 
     423 
     424            tmpBool = BSSID[i-1]; 
     425            BSSID[i-1] = BSSID[i]; 
     426            BSSID[i] = tmpBool; 
     427 
     428            tmpString = WEPKey[i-1]; 
     429            WEPKey[i-1] = WEPKey[i]; 
     430            WEPKey[i] = tmpString; 
     431 
     432            tmpInt = WEPIndex[i-1]; 
     433            WEPIndex[i-1] = WEPIndex[i]; 
     434            WEPIndex[i] = tmpInt; 
     435 
     436            tmpBool = WEPHex[i-1]; 
     437            WEPHex[i-1] = WEPHex[i]; 
     438            WEPHex[i] = tmpBool; 
     439 
     440            tmpString = WPAPersonalKey[i-1]; 
     441            WPAPersonalKey[i-1] = WPAPersonalKey[i]; 
     442            WPAPersonalKey[i] = tmpString; 
     443 
     444            tmpString = WPAEIdent[i-1]; 
     445            WPAEIdent[i-1] = WPAEIdent[i]; 
     446            WPAEIdent[i] = tmpString; 
     447 
     448            tmpString = WPAECACert[i-1]; 
     449            WPAECACert[i-1] = WPAECACert[i]; 
     450            WPAECACert[i] = tmpString; 
     451 
     452            tmpString = WPAEClientCert[i-1]; 
     453            WPAEClientCert[i-1] = WPAEClientCert[i]; 
     454            WPAEClientCert[i] = tmpString; 
     455 
     456            tmpString = WPAEPrivKeyFile[i-1]; 
     457            WPAEPrivKeyFile[i-1] = WPAEPrivKeyFile[i]; 
     458            WPAEPrivKeyFile[i] = tmpString; 
     459 
     460            tmpString = WPAEPassword[i-1]; 
     461            WPAEPassword[i-1] = WPAEPassword[i]; 
     462            WPAEPassword[i] = tmpString; 
     463 
     464            tmpInt = WPAEType[i-1]; 
     465            WPAEType[i-1] = WPAEType[i]; 
     466            WPAEType[i] = tmpInt; 
     467            break; 
     468          } 
     469      } 
     470 
     471      // Refresh the SSID list and enable the apply button 
     472      slotRefreshSSIDList(); 
     473      pushApply->setEnabled(TRUE); 
     474    } 
     475} 
     476 
     477 
     478// Slot which moves a SSID lower in the connection priority 
     479void wificonfigwidgetbase::slotMoveDown() 
     480{ 
     481    QString tmpString; 
     482    int tmpInt; 
     483    bool tmpBool; 
     484 
     485    // Check if we have a selection to work with 
     486    if ( listWifi->currentRow() != -1 ) 
     487    { 
     488      // Locate the SSID we want to remove 
     489      QString editSSID = listWifi->item(listWifi->currentRow())->text(); 
     490      for ( int i = 0; i < 145; i++) 
     491      { 
     492          if ( SSIDList[i] == editSSID && ! SSIDList[i+1].isEmpty()) 
     493          { 
     494            // We found the ssid we need to move down 
     495            tmpString = SSIDList[i+1]; 
     496            SSIDList[i+1] = SSIDList[i] ;  
     497            SSIDList[i] = tmpString;  
     498             
     499            tmpInt = SSIDEncType[i+1]; 
     500            SSIDEncType[i+1] = SSIDEncType[i]; 
     501            SSIDEncType[i] = tmpInt; 
     502 
     503            tmpBool = BSSID[i+1]; 
     504            BSSID[i+1] = BSSID[i]; 
     505            BSSID[i] = tmpBool; 
     506 
     507            tmpString = WEPKey[i+1]; 
     508            WEPKey[i+1] = WEPKey[i]; 
     509            WEPKey[i] = tmpString; 
     510 
     511            tmpInt = WEPIndex[i+1]; 
     512            WEPIndex[i+1] = WEPIndex[i]; 
     513            WEPIndex[i] = tmpInt; 
     514 
     515            tmpBool = WEPHex[i+1]; 
     516            WEPHex[i+1] = WEPHex[i]; 
     517            WEPHex[i] = tmpBool; 
     518 
     519            tmpString = WPAPersonalKey[i+1]; 
     520            WPAPersonalKey[i+1] = WPAPersonalKey[i]; 
     521            WPAPersonalKey[i] = tmpString; 
     522 
     523            tmpString = WPAEIdent[i+1]; 
     524            WPAEIdent[i+1] = WPAEIdent[i]; 
     525            WPAEIdent[i] = tmpString; 
     526 
     527            tmpString = WPAECACert[i+1]; 
     528            WPAECACert[i+1] = WPAECACert[i]; 
     529            WPAECACert[i] = tmpString; 
     530 
     531            tmpString = WPAEClientCert[i+1]; 
     532            WPAEClientCert[i+1] = WPAEClientCert[i]; 
     533            WPAEClientCert[i] = tmpString; 
     534 
     535            tmpString = WPAEPrivKeyFile[i+1]; 
     536            WPAEPrivKeyFile[i+1] = WPAEPrivKeyFile[i]; 
     537            WPAEPrivKeyFile[i] = tmpString; 
     538 
     539            tmpString = WPAEPassword[i+1]; 
     540            WPAEPassword[i+1] = WPAEPassword[i]; 
     541            WPAEPassword[i] = tmpString; 
     542 
     543            tmpInt = WPAEType[i+1]; 
     544            WPAEType[i+1] = WPAEType[i]; 
     545            WPAEType[i] = tmpInt; 
     546            break; 
     547          } 
     548      } 
     549 
     550      // Refresh the SSID list and enable the apply button 
     551      slotRefreshSSIDList(); 
     552      pushApply->setEnabled(TRUE); 
     553    } 
     554} 
     555 
     556void wificonfigwidgetbase::slotEditProfile() 
     557{ 
     558    bool foundSSID=false; 
     559    int curItem=0; 
     560 
     561    // Check if we have a selection to work with 
     562    if ( listWifi->currentRow() != -1 ) 
     563    { 
     564      // Locate the SSID we want to remove 
     565      QString editSSID = listWifi->item(listWifi->currentRow())->text(); 
     566      for ( int i = 0; i < 145; i++) 
     567      { 
     568          if ( SSIDList[i] == editSSID ) 
     569          { 
     570            // We found the ssid we need to edit 
     571            foundSSID=true;  
     572            curItem=i; 
     573            break; 
     574          } 
     575      } 
     576 
     577      // Lets go ahead and open the edit dialog on this SSID 
     578      if (foundSSID) 
     579      { 
     580          // Set our internal flag that this is an edit on an existing device 
     581          wifiselect = new wifiselectiondialog(); 
     582          wifiselect->init(DeviceName); 
     583 
     584          // Check the type of SSID this is, and issue appropriate edit  
     585          if ( SSIDEncType[curItem] == NO_ENCRYPTION) { 
     586             wifiselect->initEdit(SSIDList[curItem], BSSID[curItem]); 
     587          } 
     588          if ( SSIDEncType[curItem] == WEP_ENCRYPTION) { 
     589             wifiselect->initEdit(SSIDList[curItem], BSSID[curItem], WEPKey[curItem], WEPIndex[curItem], WEPHex[curItem]); 
     590          } 
     591          if ( SSIDEncType[curItem] == WPA_ENCRYPTION) { 
     592             wifiselect->initEdit(SSIDList[curItem], BSSID[curItem], WPAPersonalKey[curItem]); 
     593          } 
     594          if ( SSIDEncType[curItem] == WPAE_ENCRYPTION) { 
     595             wifiselect->initEdit(SSIDList[curItem], BSSID[curItem], WPAEType[curItem], WPAEIdent[curItem], WPAECACert[curItem], WPAEClientCert[curItem], WPAEPrivKeyFile[curItem], WPAEPassword[curItem]); 
     596          } 
     597 
     598 
     599          // Connect our delete signal, which runs before we add a new SSID 
     600          connect( wifiselect, SIGNAL( signalDeleteSSID(QString) ), this, SLOT( slotRemoveProfileSSID(QString) ) );  
     601 
     602          // Connect our save signals 
     603          connect( wifiselect, SIGNAL( signalSavedOpen(QString, bool) ), this, SLOT( slotAddNewProfileOpen(QString, bool) ) ); 
     604          connect( wifiselect, SIGNAL( signalSavedWEP( QString, bool, QString, int, bool ) ), this, SLOT( slotAddNewProfileWEP( QString, bool, QString, int, bool) ) ); 
     605   connect( wifiselect, SIGNAL( signalSavedWPA(QString, bool, QString) ), this, SLOT( slotAddNewProfileWPA(QString, bool, QString) ) ); 
     606          connect( wifiselect, SIGNAL( signalSavedWPAE(QString, bool, int, QString, QString, QString, QString, QString) ), this, SLOT ( slotAddNewProfileWPAE(QString, bool, int, QString, QString, QString, QString, QString) ) ); 
     607 
     608          wifiselect->exec(); 
     609      } 
     610 
     611 
     612    } 
     613} 
     614 
     615 
    395616void wificonfigwidgetbase::slotRemoveProfile() 
    396617{ 
     
    400621      // Locate the SSID we want to remove 
    401622      QString removeSSID = listWifi->item(listWifi->currentRow())->text(); 
    402       for ( int curItem = 0; curItem < 149; curItem++) 
    403       { 
    404           if ( SSIDList[curItem] == removeSSID ) 
    405           { 
    406              SSIDList[curItem] = ""; 
    407           } 
    408       } 
     623      slotRemoveProfileSSID(removeSSID); 
    409624 
    410625      // Refresh the SSID list and enable the apply button 
     
    421636   wifiselect->init(DeviceName); 
    422637 
     638   // Connect our save slots 
    423639   connect( wifiselect, SIGNAL( signalSavedOpen(QString, bool) ), this, SLOT( slotAddNewProfileOpen(QString, bool) ) );  
    424  
    425640   connect( wifiselect, SIGNAL( signalSavedWEP( QString, bool, QString, int, bool ) ), this, SLOT( slotAddNewProfileWEP( QString, bool, QString, int, bool) ) );  
    426641   connect( wifiselect, SIGNAL( signalSavedWPA(QString, bool, QString) ), this, SLOT( slotAddNewProfileWPA(QString, bool, QString) ) );  
    427  
    428642   connect( wifiselect, SIGNAL( signalSavedWPAE(QString, bool, int, QString, QString, QString, QString, QString) ), this, SLOT( slotAddNewProfileWPAE(QString, bool, int, QString, QString, QString, QString, QString) ) );  
    429643 
     
    438652} 
    439653 
     654void wificonfigwidgetbase::slotRemoveProfileSSID(QString RemoveSSID) 
     655{ 
     656   bool foundSSID=false; 
     657 
     658   // Loop through, remove selected SSID, and move any entries after it up 
     659   for (int remItem = 0; remItem < 145; remItem++) 
     660   { 
     661 
     662     if ( RemoveSSID == SSIDList[remItem] ) { 
     663       foundSSID=true; 
     664     } 
     665 
     666     if(foundSSID)  
     667     { 
     668       SSIDList[remItem] = SSIDList[remItem+1] ;  
     669       SSIDEncType[remItem] = SSIDEncType[remItem+1]; 
     670       BSSID[remItem] = BSSID[remItem+1]; 
     671       WEPKey[remItem] = WEPKey[remItem+1]; 
     672       WEPIndex[remItem] = WEPIndex[remItem+1]; 
     673       WEPHex[remItem] = WEPHex[remItem+1]; 
     674       WPAPersonalKey[remItem] = WPAPersonalKey[remItem+1]; 
     675       WPAEIdent[remItem] = WPAEIdent[remItem+1]; 
     676       WPAECACert[remItem] = WPAECACert[remItem+1]; 
     677       WPAEClientCert[remItem] = WPAEClientCert[remItem+1]; 
     678       WPAEPrivKeyFile[remItem] = WPAEPrivKeyFile[remItem+1]; 
     679       WPAEPassword[remItem] = WPAEPassword[remItem+1]; 
     680       WPAEType[remItem] = WPAEType[remItem+1]; 
     681     } 
     682 
     683     if ( SSIDList[remItem+1].isEmpty() ) 
     684     { 
     685       break; 
     686     } 
     687 
     688   } 
     689 
     690    
     691} 
     692 
    440693void wificonfigwidgetbase::slotAddNewProfileOpen(QString SSID, bool isBSSID) 
    441694{ 
    442  
    443    for (int dupItem = 0; dupItem < 149; dupItem++) 
     695   for (int dupItem = 0; dupItem < 145; dupItem++) 
     696   { 
     697      if ( SSID == SSIDList[dupItem] ) { 
     698          QMessageBox::warning( this, tr("Error"), tr("You already have a wireless network with this SSID! Please remove it first.\n") ); 
     699          return; 
     700      } 
     701   } 
     702 
     703 
     704   int curItem=0; 
     705 
     706   while( ! SSIDList[curItem].isEmpty() && curItem < 145 ) 
     707   { 
     708     curItem++; 
     709   } 
     710 
     711    // Find which current item we are working on 
     712 
     713    SSIDList[curItem] = SSID; 
     714    BSSID[curItem] = isBSSID; 
     715     
     716    // Refresh the SSID listbox and enable the apply button 
     717    slotRefreshSSIDList(); 
     718    slotCheckGlobalText(); 
     719} 
     720 
     721void wificonfigwidgetbase::slotAddNewProfileWEP( QString SSID, bool isBSSID, QString newKey, int newIndex, bool hexkey ) 
     722{ 
     723   for (int dupItem = 0; dupItem < 145; dupItem++) 
    444724   { 
    445725      if ( SSID == SSIDList[dupItem] ) { 
     
    452732   int curItem=0; 
    453733 
    454    while( ! SSIDList[curItem].isEmpty() && curItem < 149 ) 
    455    { 
    456      curItem++; 
    457    } 
    458  
    459     // Find which current item we are working on 
    460  
    461     SSIDList[curItem] = SSID; 
    462     BSSID[curItem] = isBSSID; 
    463      
    464     // Refresh the SSID listbox and enable the apply button 
    465     slotRefreshSSIDList(); 
    466     slotCheckGlobalText(); 
    467 } 
    468  
    469 void wificonfigwidgetbase::slotAddNewProfileWEP( QString SSID, bool isBSSID, QString newKey, int newIndex, bool hexkey ) 
    470 { 
    471    for (int dupItem = 0; dupItem < 149; dupItem++) 
    472    { 
    473       if ( SSID == SSIDList[dupItem] ) { 
    474         QMessageBox::warning( this, tr("Error"), tr("You already have a wireless network with this SSID! Please remove it first.\n") ); 
    475         return; 
    476       } 
    477    } 
    478  
    479  
    480    int curItem=0; 
    481  
    482    while( ! SSIDList[curItem].isEmpty() && curItem < 149 ) 
     734   while( ! SSIDList[curItem].isEmpty() && curItem < 145 ) 
    483735   { 
    484736     curItem++; 
     
    504756void wificonfigwidgetbase::slotAddNewProfileWPA( QString SSID, bool isBSSID, QString newKey ) 
    505757{ 
    506    for (int dupItem = 0; dupItem < 149; dupItem++) 
     758   for (int dupItem = 0; dupItem < 145; dupItem++) 
    507759   { 
    508760      if ( SSID == SSIDList[dupItem] ) { 
     
    514766   int curItem=0; 
    515767 
    516    while( ! SSIDList[curItem].isEmpty() && curItem < 149 ) 
     768   while( ! SSIDList[curItem].isEmpty() && curItem < 145 ) 
    517769   { 
    518770     curItem++; 
     
    534786{ 
    535787 
    536    for (int dupItem = 0; dupItem < 149; dupItem++) 
     788   for (int dupItem = 0; dupItem < 145; dupItem++) 
    537789   { 
    538790      if ( SSID == SSIDList[dupItem] ) { 
     
    544796   int curItem=0; 
    545797 
    546    while( ! SSIDList[curItem].isEmpty() && curItem < 149 ) 
     798   while( ! SSIDList[curItem].isEmpty() && curItem < 145 ) 
    547799   { 
    548800     curItem++; 
     
    9651217     curItem++; 
    9661218 
    967      // We only need 150 wireless networks 
    968      if ( curItem > 149 ) 
     1219     // We only need 145 wireless networks 
     1220     if ( curItem > 145 ) 
    9691221     { 
    9701222        break; 
  • pcbsd/trunk/wificonfig/wificonfigwidgetbase.h

    r2904 r3870  
    4242    void slotCheckDHCPBox(); 
    4343    void slotAddNewProfile(); 
     44    void slotEditProfile(); 
    4445    void slotRemoveProfile(); 
     46    void slotRemoveProfileSSID(QString RemoveSSID); 
    4547    void slotAddNewProfileOpen( QString SSID, bool isBSSID ); 
    4648    void slotAddNewProfileWEP( QString SSID, bool isBSSID, QString newKey, int newIndex, bool hexkey ); 
     
    5456    void slotCheckGlobalText(); 
    5557    void slotRefreshSSIDList(); 
    56  
     58    void slotMoveUp(); 
     59    void slotMoveDown(); 
    5760 
    5861private: 
  • pcbsd/trunk/wificonfig/wificonfigwidgetbase.ui

    r2904 r3870  
    66    <x>0</x> 
    77    <y>0</y> 
    8     <width>348</width> 
    9     <height>450</height> 
     8    <width>320</width> 
     9    <height>463</height> 
    1010   </rect> 
    1111  </property> 
     
    8080       <string>&amp;General</string> 
    8181      </attribute> 
    82       <layout class="QGridLayout" name="gridLayout_4" > 
     82      <layout class="QGridLayout" name="gridLayout_3" > 
     83       <item row="0" column="0" > 
     84        <widget class="QLabel" name="textLabel2" > 
     85         <property name="text" > 
     86          <string>Wireless network profiles</string> 
     87         </property> 
     88         <property name="wordWrap" > 
     89          <bool>false</bool> 
     90         </property> 
     91        </widget> 
     92       </item> 
    8393       <item row="1" column="0" > 
    84         <layout class="QGridLayout" name="gridLayout_3" > 
     94        <layout class="QGridLayout" name="gridLayout_2" > 
    8595         <item row="0" column="0" > 
    8696          <widget class="QListWidget" name="listWifi" /> 
     97         </item> 
     98         <item row="0" column="1" > 
     99          <layout class="QVBoxLayout" name="verticalLayout" > 
     100           <property name="sizeConstraint" > 
     101            <enum>QLayout::SetDefaultConstraint</enum> 
     102           </property> 
     103           <item> 
     104            <spacer name="verticalSpacer_2" > 
     105             <property name="orientation" > 
     106              <enum>Qt::Vertical</enum> 
     107             </property> 
     108             <property name="sizeHint" stdset="0" > 
     109              <size> 
     110               <width>28</width> 
     111               <height>18</height> 
     112              </size> 
     113             </property> 
     114            </spacer> 
     115           </item> 
     116           <item> 
     117            <widget class="QPushButton" name="pushUp" > 
     118             <property name="sizePolicy" > 
     119              <sizepolicy vsizetype="Fixed" hsizetype="Fixed" > 
     120               <horstretch>0</horstretch> 
     121               <verstretch>0</verstretch> 
     122              </sizepolicy> 
     123             </property> 
     124             <property name="text" > 
     125              <string/> 
     126             </property> 
     127             <property name="icon" > 
     128              <iconset resource="wificonfig.qrc" > 
     129               <normaloff>:/arrow-up.png</normaloff>:/arrow-up.png</iconset> 
     130             </property> 
     131            </widget> 
     132           </item> 
     133           <item> 
     134            <widget class="QPushButton" name="pushDown" > 
     135             <property name="sizePolicy" > 
     136              <sizepolicy vsizetype="Fixed" hsizetype="Fixed" > 
     137               <horstretch>0</horstretch> 
     138               <verstretch>0</verstretch> 
     139              </sizepolicy> 
     140             </property> 
     141             <property name="text" > 
     142              <string/> 
     143             </property> 
     144             <property name="icon" > 
     145              <iconset resource="wificonfig.qrc" > 
     146               <normaloff>:/arrow-down.png</normaloff>:/arrow-down.png</iconset> 
     147             </property> 
     148            </widget> 
     149           </item> 
     150           <item> 
     151            <spacer name="verticalSpacer" > 
     152             <property name="orientation" > 
     153              <enum>Qt::Vertical</enum> 
     154             </property> 
     155             <property name="sizeHint" stdset="0" > 
     156              <size> 
     157               <width>20</width> 
     158               <height>40</height> 
     159              </size> 
     160             </property> 
     161            </spacer> 
     162           </item> 
     163          </layout> 
    87164         </item> 
    88165        </layout> 
     
    101178           <property name="shortcut" > 
    102179            <string>Alt+S</string> 
     180           </property> 
     181          </widget> 
     182         </item> 
     183         <item> 
     184          <widget class="QPushButton" name="pushEditWifi" > 
     185           <property name="text" > 
     186            <string>Edit</string> 
     187           </property> 
     188           <property name="icon" > 
     189            <iconset resource="wificonfig.qrc" > 
     190             <normaloff>:/configure.png</normaloff>:/configure.png</iconset> 
    103191           </property> 
    104192          </widget> 
     
    130218        </layout> 
    131219       </item> 
     220       <item row="3" column="0" > 
     221        <widget class="Line" name="line1" > 
     222         <property name="frameShape" > 
     223          <enum>QFrame::HLine</enum> 
     224         </property> 
     225         <property name="frameShadow" > 
     226          <enum>QFrame::Sunken</enum> 
     227         </property> 
     228        </widget> 
     229       </item> 
    132230       <item row="4" column="0" > 
    133231        <widget class="QCheckBox" name="checkDHCP" > 
     
    137235         <property name="shortcut" > 
    138236          <string>Alt+B</string> 
    139          </property> 
    140         </widget> 
    141        </item> 
    142        <item row="3" column="0" > 
    143         <widget class="Line" name="line1" > 
    144          <property name="frameShape" > 
    145           <enum>QFrame::HLine</enum> 
    146          </property> 
    147          <property name="frameShadow" > 
    148           <enum>QFrame::Sunken</enum> 
    149          </property> 
    150         </widget> 
    151        </item> 
    152        <item row="0" column="0" > 
    153         <widget class="QLabel" name="textLabel2" > 
    154          <property name="text" > 
    155           <string>Wireless network profiles</string> 
    156          </property> 
    157          <property name="wordWrap" > 
    158           <bool>false</bool> 
    159237         </property> 
    160238        </widget> 
     
    663741 <tabstops> 
    664742  <tabstop>tabMainWidget</tabstop> 
     743  <tabstop>listWifi</tabstop> 
     744  <tabstop>pushUp</tabstop> 
     745  <tabstop>pushDown</tabstop> 
    665746  <tabstop>pushAddWifi</tabstop> 
     747  <tabstop>pushEditWifi</tabstop> 
     748  <tabstop>pushRemoveWifi</tabstop> 
    666749  <tabstop>checkDHCP</tabstop> 
    667750  <tabstop>lineIP</tabstop> 
    668751  <tabstop>lineNetmask</tabstop> 
     752  <tabstop>checkDisableWireless</tabstop> 
    669753  <tabstop>pushOK</tabstop> 
    670754  <tabstop>pushApply</tabstop> 
    671755  <tabstop>buttonCancel</tabstop> 
    672   <tabstop>checkDisableWireless</tabstop> 
     756  <tabstop>lineMAC</tabstop> 
    673757  <tabstop>checkMAC</tabstop> 
    674   <tabstop>lineMAC</tabstop> 
    675758 </tabstops> 
    676759 <includes> 
  • pcbsd/trunk/wificonfig/wifiselectiondialog.cpp

    r2904 r3870  
    8282    } // End of WPAEnt setting check 
    8383     
     84 
     85    if( ! EditingSSID.isEmpty() ) 
     86    { 
     87      // We are editing an existing SSID, issue delete command before adding new one 
     88      emit signalDeleteSSID(EditingSSID); 
     89    } 
    8490     
    8591    selectedSSID = lineSSID->text(); 
     
    108114 
    109115    close(); 
     116} 
     117 
     118// Overloaded function which lets us set editing variables using WPA-Ent 
     119void wifiselectiondialog::initEdit(QString selectedSSID, bool usingBSSID, int editWPAEType, QString editWPAEIdent, QString editWPAECACert, QString editWPAEClientCert, QString editWPAEPrivKeyFile, QString editWPAEPassword) 
     120{ 
     121   pushConnect->setText(tr("Save")); 
     122   EditingSSID=selectedSSID; 
     123   SSID=selectedSSID; 
     124   lineSSID->setText(selectedSSID); 
     125   checkBSSID->setChecked(usingBSSID); 
     126   radioSecurityWPAEnt->setChecked(true); 
     127   WPAEType=editWPAEType;  
     128   WPAEIdent=editWPAEIdent;  
     129   WPAECACert=editWPAECACert;  
     130   WPAEClientCert=editWPAEClientCert;  
     131   WPAEPrivKeyFile=editWPAEPrivKeyFile;  
     132   WPAEPassword=editWPAEPassword;  
     133} 
     134 
     135// Overloaded function which lets us set editing variables using WPA-Personal 
     136void wifiselectiondialog::initEdit(QString selectedSSID, bool usingBSSID, QString editWPAPersonalKey) 
     137{ 
     138   pushConnect->setText(tr("Save")); 
     139   EditingSSID=selectedSSID; 
     140   SSID=selectedSSID; 
     141   lineSSID->setText(selectedSSID); 
     142   checkBSSID->setChecked(usingBSSID); 
     143   radioSecurityWPAPersonal->setChecked(true); 
     144   WPAPersonalKey=editWPAPersonalKey; 
     145} 
     146 
     147// Overloaded function which lets us set editing variables using WEP 
     148void wifiselectiondialog::initEdit(QString selectedSSID, bool usingBSSID, QString editWEPKey, int editWEPIndex, bool editWEPHex) 
     149{ 
     150   pushConnect->setText(tr("Save")); 
     151   EditingSSID=selectedSSID; 
     152   SSID=selectedSSID; 
     153   lineSSID->setText(selectedSSID); 
     154   checkBSSID->setChecked(usingBSSID); 
     155   radioSecurityWEP->setChecked(true); 
     156   WEPKey=editWEPKey; 
     157   WEPIndex=editWEPIndex; 
     158   WEPHex=editWEPHex; 
     159} 
     160 
     161// Overloaded function which lets us set what we are editing with no encryption 
     162void wifiselectiondialog::initEdit(QString selectedSSID, bool usingBSSID) 
     163{ 
     164   pushConnect->setText(tr("Save")); 
     165   EditingSSID=selectedSSID; 
     166   SSID=selectedSSID; 
     167   lineSSID->setText(selectedSSID); 
     168   checkBSSID->setChecked(usingBSSID); 
     169   radioSecurityDisabled->setChecked(true); 
    110170} 
    111171 
  • pcbsd/trunk/wificonfig/wifiselectiondialog.h

    r2904 r3870  
    2323   void init(QString device); 
    2424   void scanWifi(); 
     25   void initEdit(QString selectedSSID, bool usingBSSID); 
     26   void initEdit(QString selectedSSID, bool usingBSSID, QString editWEPKey, int editWEPIndex, bool editWEPHex); 
     27   void initEdit(QString selectedSSID, bool usingBSSID, QString editWPAPersonalKey); 
     28   void initEdit(QString selectedSSID, bool usingBSSID, int editWPAEType, QString editWPAEIdent, QString editWPAECACert, QString editWPAEClientCert, QString editWPAEPrivKeyFile, QString editWPAEPassword); 
    2529 
    2630 
     
    4448    QString DeviceName; 
    4549    QString SSID; 
     50    QString EditingSSID; 
    4651 
    4752    // Setup our dialogs 
     
    6873 
    6974signals: 
     75   void signalDeleteSSID(QString); 
    7076   void signalSavedOpen(QString, bool); 
    7177   void signalSavedWEP(QString, bool, QString, int, bool );