Changeset 3870
- Timestamp:
- 05/05/09 16:21:36 (10 months ago)
- Location:
- pcbsd
- Files:
-
- 2 added
- 12 modified
-
trunk-current/wificonfig/configure.png (added)
-
trunk-current/wificonfig/wificonfig.qrc (modified) (1 diff)
-
trunk-current/wificonfig/wificonfigwidgetbase.cpp (modified) (13 diffs)
-
trunk-current/wificonfig/wificonfigwidgetbase.h (modified) (2 diffs)
-
trunk-current/wificonfig/wificonfigwidgetbase.ui (modified) (6 diffs)
-
trunk-current/wificonfig/wifiselectiondialog.cpp (modified) (2 diffs)
-
trunk-current/wificonfig/wifiselectiondialog.h (modified) (3 diffs)
-
trunk/wificonfig/configure.png (added)
-
trunk/wificonfig/wificonfig.qrc (modified) (1 diff)
-
trunk/wificonfig/wificonfigwidgetbase.cpp (modified) (13 diffs)
-
trunk/wificonfig/wificonfigwidgetbase.h (modified) (2 diffs)
-
trunk/wificonfig/wificonfigwidgetbase.ui (modified) (6 diffs)
-
trunk/wificonfig/wifiselectiondialog.cpp (modified) (2 diffs)
-
trunk/wificonfig/wifiselectiondialog.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pcbsd/trunk-current/wificonfig/wificonfig.qrc
r2904 r3870 1 1 <RCC> 2 2 <qresource> 3 <file>configure.png</file> 3 4 <file>object-locked.png</file> 4 5 <file>object-unlocked.png</file> -
pcbsd/trunk-current/wificonfig/wificonfigwidgetbase.cpp
r2904 r3870 82 82 83 83 // Loop through all the devices we have now 84 for(int curItem=0; curItem < 14 9; curItem++)84 for(int curItem=0; curItem < 145; curItem++) 85 85 { 86 86 if ( ! SSIDList[curItem].isEmpty() ) … … 96 96 } 97 97 98 streamout << " priority=" << 145 - curItem << "\n"; 98 99 streamout << " scan_ssid=1\n"; 99 100 … … 186 187 187 188 // Connect our add / remove buttons for wifi 189 connect( pushDown, SIGNAL( clicked() ), this, SLOT( slotMoveDown() ) ); 190 connect( pushUp, SIGNAL( clicked() ), this, SLOT( slotMoveUp() ) ); 188 191 connect( pushAddWifi, SIGNAL( clicked() ), this, SLOT( slotAddNewProfile() ) ); 192 connect( pushEditWifi, SIGNAL( clicked() ), this, SLOT( slotEditProfile() ) ); 189 193 connect( pushRemoveWifi, SIGNAL( clicked() ), this, SLOT( slotRemoveProfile() ) ); 190 194 … … 393 397 } 394 398 399 // Slot which moves a SSID higher in the connection priority 400 void 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 479 void 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 556 void 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 395 616 void wificonfigwidgetbase::slotRemoveProfile() 396 617 { … … 400 621 // Locate the SSID we want to remove 401 622 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); 409 624 410 625 // Refresh the SSID list and enable the apply button … … 421 636 wifiselect->init(DeviceName); 422 637 638 // Connect our save slots 423 639 connect( wifiselect, SIGNAL( signalSavedOpen(QString, bool) ), this, SLOT( slotAddNewProfileOpen(QString, bool) ) ); 424 425 640 connect( wifiselect, SIGNAL( signalSavedWEP( QString, bool, QString, int, bool ) ), this, SLOT( slotAddNewProfileWEP( QString, bool, QString, int, bool) ) ); 426 641 connect( wifiselect, SIGNAL( signalSavedWPA(QString, bool, QString) ), this, SLOT( slotAddNewProfileWPA(QString, bool, QString) ) ); 427 428 642 connect( wifiselect, SIGNAL( signalSavedWPAE(QString, bool, int, QString, QString, QString, QString, QString) ), this, SLOT( slotAddNewProfileWPAE(QString, bool, int, QString, QString, QString, QString, QString) ) ); 429 643 … … 438 652 } 439 653 654 void 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 440 693 void wificonfigwidgetbase::slotAddNewProfileOpen(QString SSID, bool isBSSID) 441 694 { 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 721 void wificonfigwidgetbase::slotAddNewProfileWEP( QString SSID, bool isBSSID, QString newKey, int newIndex, bool hexkey ) 722 { 723 for (int dupItem = 0; dupItem < 145; dupItem++) 444 724 { 445 725 if ( SSID == SSIDList[dupItem] ) { … … 452 732 int curItem=0; 453 733 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 ) 483 735 { 484 736 curItem++; … … 504 756 void wificonfigwidgetbase::slotAddNewProfileWPA( QString SSID, bool isBSSID, QString newKey ) 505 757 { 506 for (int dupItem = 0; dupItem < 14 9; dupItem++)758 for (int dupItem = 0; dupItem < 145; dupItem++) 507 759 { 508 760 if ( SSID == SSIDList[dupItem] ) { … … 514 766 int curItem=0; 515 767 516 while( ! SSIDList[curItem].isEmpty() && curItem < 14 9)768 while( ! SSIDList[curItem].isEmpty() && curItem < 145 ) 517 769 { 518 770 curItem++; … … 534 786 { 535 787 536 for (int dupItem = 0; dupItem < 14 9; dupItem++)788 for (int dupItem = 0; dupItem < 145; dupItem++) 537 789 { 538 790 if ( SSID == SSIDList[dupItem] ) { … … 544 796 int curItem=0; 545 797 546 while( ! SSIDList[curItem].isEmpty() && curItem < 14 9)798 while( ! SSIDList[curItem].isEmpty() && curItem < 145 ) 547 799 { 548 800 curItem++; … … 965 1217 curItem++; 966 1218 967 // We only need 1 50wireless networks968 if ( curItem > 14 9)1219 // We only need 145 wireless networks 1220 if ( curItem > 145 ) 969 1221 { 970 1222 break; -
pcbsd/trunk-current/wificonfig/wificonfigwidgetbase.h
r2904 r3870 42 42 void slotCheckDHCPBox(); 43 43 void slotAddNewProfile(); 44 void slotEditProfile(); 44 45 void slotRemoveProfile(); 46 void slotRemoveProfileSSID(QString RemoveSSID); 45 47 void slotAddNewProfileOpen( QString SSID, bool isBSSID ); 46 48 void slotAddNewProfileWEP( QString SSID, bool isBSSID, QString newKey, int newIndex, bool hexkey ); … … 54 56 void slotCheckGlobalText(); 55 57 void slotRefreshSSIDList(); 56 58 void slotMoveUp(); 59 void slotMoveDown(); 57 60 58 61 private: -
pcbsd/trunk-current/wificonfig/wificonfigwidgetbase.ui
r2904 r3870 6 6 <x>0</x> 7 7 <y>0</y> 8 <width>3 48</width>9 <height>4 50</height>8 <width>320</width> 9 <height>463</height> 10 10 </rect> 11 11 </property> … … 80 80 <string>&General</string> 81 81 </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> 83 93 <item row="1" column="0" > 84 <layout class="QGridLayout" name="gridLayout_ 3" >94 <layout class="QGridLayout" name="gridLayout_2" > 85 95 <item row="0" column="0" > 86 96 <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> 87 164 </item> 88 165 </layout> … … 101 178 <property name="shortcut" > 102 179 <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> 103 191 </property> 104 192 </widget> … … 130 218 </layout> 131 219 </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> 132 230 <item row="4" column="0" > 133 231 <widget class="QCheckBox" name="checkDHCP" > … … 137 235 <property name="shortcut" > 138 236 <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>159 237 </property> 160 238 </widget> … … 663 741 <tabstops> 664 742 <tabstop>tabMainWidget</tabstop> 743 <tabstop>listWifi</tabstop> 744 <tabstop>pushUp</tabstop> 745 <tabstop>pushDown</tabstop> 665 746 <tabstop>pushAddWifi</tabstop> 747 <tabstop>pushEditWifi</tabstop> 748 <tabstop>pushRemoveWifi</tabstop> 666 749 <tabstop>checkDHCP</tabstop> 667 750 <tabstop>lineIP</tabstop> 668 751 <tabstop>lineNetmask</tabstop> 752 <tabstop>checkDisableWireless</tabstop> 669 753 <tabstop>pushOK</tabstop> 670 754 <tabstop>pushApply</tabstop> 671 755 <tabstop>buttonCancel</tabstop> 672 <tabstop> checkDisableWireless</tabstop>756 <tabstop>lineMAC</tabstop> 673 757 <tabstop>checkMAC</tabstop> 674 <tabstop>lineMAC</tabstop>675 758 </tabstops> 676 759 <includes> -
pcbsd/trunk-current/wificonfig/wifiselectiondialog.cpp
r2904 r3870 82 82 } // End of WPAEnt setting check 83 83 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 } 84 90 85 91 selectedSSID = lineSSID->text(); … … 108 114 109 115 close(); 116 } 117 118 // Overloaded function which lets us set editing variables using WPA-Ent 119 void 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 136 void 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 148 void 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 162 void 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); 110 170 } 111 171 -
pcbsd/trunk-current/wificonfig/wifiselectiondialog.h
r2904 r3870 23 23 void init(QString device); 24 24 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); 25 29 26 30 … … 44 48 QString DeviceName; 45 49 QString SSID; 50 QString EditingSSID; 46 51 47 52 // Setup our dialogs … … 68 73 69 74 signals: 75 void signalDeleteSSID(QString); 70 76 void signalSavedOpen(QString, bool); 71 77 void signalSavedWEP(QString, bool, QString, int, bool ); -
pcbsd/trunk/wificonfig/wificonfig.qrc
r2904 r3870 1 1 <RCC> 2 2 <qresource> 3 <file>configure.png</file> 3 4 <file>object-locked.png</file> 4 5 <file>object-unlocked.png</file> -
pcbsd/trunk/wificonfig/wificonfigwidgetbase.cpp
r2904 r3870 82 82 83 83 // Loop through all the devices we have now 84 for(int curItem=0; curItem < 14 9; curItem++)84 for(int curItem=0; curItem < 145; curItem++) 85 85 { 86 86 if ( ! SSIDList[curItem].isEmpty() ) … … 96 96 } 97 97 98 streamout << " priority=" << 145 - curItem << "\n"; 98 99 streamout << " scan_ssid=1\n"; 99 100 … … 186 187 187 188 // Connect our add / remove buttons for wifi 189 connect( pushDown, SIGNAL( clicked() ), this, SLOT( slotMoveDown() ) ); 190 connect( pushUp, SIGNAL( clicked() ), this, SLOT( slotMoveUp() ) ); 188 191 connect( pushAddWifi, SIGNAL( clicked() ), this, SLOT( slotAddNewProfile() ) ); 192 connect( pushEditWifi, SIGNAL( clicked() ), this, SLOT( slotEditProfile() ) ); 189 193 connect( pushRemoveWifi, SIGNAL( clicked() ), this, SLOT( slotRemoveProfile() ) ); 190 194 … … 393 397 } 394 398 399 // Slot which moves a SSID higher in the connection priority 400 void 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 479 void 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 556 void 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 395 616 void wificonfigwidgetbase::slotRemoveProfile() 396 617 { … … 400 621 // Locate the SSID we want to remove 401 622 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); 409 624 410 625 // Refresh the SSID list and enable the apply button … … 421 636 wifiselect->init(DeviceName); 422 637 638 // Connect our save slots 423 639 connect( wifiselect, SIGNAL( signalSavedOpen(QString, bool) ), this, SLOT( slotAddNewProfileOpen(QString, bool) ) ); 424 425 640 connect( wifiselect, SIGNAL( signalSavedWEP( QString, bool, QString, int, bool ) ), this, SLOT( slotAddNewProfileWEP( QString, bool, QString, int, bool) ) ); 426 641 connect( wifiselect, SIGNAL( signalSavedWPA(QString, bool, QString) ), this, SLOT( slotAddNewProfileWPA(QString, bool, QString) ) ); 427 428 642 connect( wifiselect, SIGNAL( signalSavedWPAE(QString, bool, int, QString, QString, QString, QString, QString) ), this, SLOT( slotAddNewProfileWPAE(QString, bool, int, QString, QString, QString, QString, QString) ) ); 429 643 … … 438 652 } 439 653 654 void 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 440 693 void wificonfigwidgetbase::slotAddNewProfileOpen(QString SSID, bool isBSSID) 441 694 { 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 721 void wificonfigwidgetbase::slotAddNewProfileWEP( QString SSID, bool isBSSID, QString newKey, int newIndex, bool hexkey ) 722 { 723 for (int dupItem = 0; dupItem < 145; dupItem++) 444 724 { 445 725 if ( SSID == SSIDList[dupItem] ) { … … 452 732 int curItem=0; 453 733 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 ) 483 735 { 484 736 curItem++; … … 504 756 void wificonfigwidgetbase::slotAddNewProfileWPA( QString SSID, bool isBSSID, QString newKey ) 505 757 { 506 for (int dupItem = 0; dupItem < 14 9; dupItem++)758 for (int dupItem = 0; dupItem < 145; dupItem++) 507 759 { 508 760 if ( SSID == SSIDList[dupItem] ) { … … 514 766 int curItem=0; 515 767 516 while( ! SSIDList[curItem].isEmpty() && curItem < 14 9)768 while( ! SSIDList[curItem].isEmpty() && curItem < 145 ) 517 769 { 518 770 curItem++; … … 534 786 { 535 787 536 for (int dupItem = 0; dupItem < 14 9; dupItem++)788 for (int dupItem = 0; dupItem < 145; dupItem++) 537 789 { 538 790 if ( SSID == SSIDList[dupItem] ) { … … 544 796 int curItem=0; 545 797 546 while( ! SSIDList[curItem].isEmpty() && curItem < 14 9)798 while( ! SSIDList[curItem].isEmpty() && curItem < 145 ) 547 799 { 548 800 curItem++; … … 965 1217 curItem++; 966 1218 967 // We only need 1 50wireless networks968 if ( curItem > 14 9)1219 // We only need 145 wireless networks 1220 if ( curItem > 145 ) 969 1221 { 970 1222 break; -
pcbsd/trunk/wificonfig/wificonfigwidgetbase.h
r2904 r3870 42 42 void slotCheckDHCPBox(); 43 43 void slotAddNewProfile(); 44 void slotEditProfile(); 44 45 void slotRemoveProfile(); 46 void slotRemoveProfileSSID(QString RemoveSSID); 45 47 void slotAddNewProfileOpen( QString SSID, bool isBSSID ); 46 48 void slotAddNewProfileWEP( QString SSID, bool isBSSID, QString newKey, int newIndex, bool hexkey ); … … 54 56 void slotCheckGlobalText(); 55 57 void slotRefreshSSIDList(); 56 58 void slotMoveUp(); 59 void slotMoveDown(); 57 60 58 61 private: -
pcbsd/trunk/wificonfig/wificonfigwidgetbase.ui
r2904 r3870 6 6 <x>0</x> 7 7 <y>0</y> 8 <width>3 48</width>9 <height>4 50</height>8 <width>320</width> 9 <height>463</height> 10 10 </rect> 11 11 </property> … … 80 80 <string>&General</string> 81 81 </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> 83 93 <item row="1" column="0" > 84 <layout class="QGridLayout" name="gridLayout_ 3" >94 <layout class="QGridLayout" name="gridLayout_2" > 85 95 <item row="0" column="0" > 86 96 <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> 87 164 </item> 88 165 </layout> … … 101 178 <property name="shortcut" > 102 179 <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> 103 191 </property> 104 192 </widget> … … 130 218 </layout> 131 219 </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> 132 230 <item row="4" column="0" > 133 231 <widget class="QCheckBox" name="checkDHCP" > … … 137 235 <property name="shortcut" > 138 236 <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>159 237 </property> 160 238 </widget> … … 663 741 <tabstops> 664 742 <tabstop>tabMainWidget</tabstop> 743 <tabstop>listWifi</tabstop> 744 <tabstop>pushUp</tabstop> 745 <tabstop>pushDown</tabstop> 665 746 <tabstop>pushAddWifi</tabstop> 747 <tabstop>pushEditWifi</tabstop> 748 <tabstop>pushRemoveWifi</tabstop> 666 749 <tabstop>checkDHCP</tabstop> 667 750 <tabstop>lineIP</tabstop> 668 751 <tabstop>lineNetmask</tabstop> 752 <tabstop>checkDisableWireless</tabstop> 669 753 <tabstop>pushOK</tabstop> 670 754 <tabstop>pushApply</tabstop> 671 755 <tabstop>buttonCancel</tabstop> 672 <tabstop> checkDisableWireless</tabstop>756 <tabstop>lineMAC</tabstop> 673 757 <tabstop>checkMAC</tabstop> 674 <tabstop>lineMAC</tabstop>675 758 </tabstops> 676 759 <includes> -
pcbsd/trunk/wificonfig/wifiselectiondialog.cpp
r2904 r3870 82 82 } // End of WPAEnt setting check 83 83 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 } 84 90 85 91 selectedSSID = lineSSID->text(); … … 108 114 109 115 close(); 116 } 117 118 // Overloaded function which lets us set editing variables using WPA-Ent 119 void 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 136 void 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 148 void 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 162 void 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); 110 170 } 111 171 -
pcbsd/trunk/wificonfig/wifiselectiondialog.h
r2904 r3870 23 23 void init(QString device); 24 24 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); 25 29 26 30 … … 44 48 QString DeviceName; 45 49 QString SSID; 50 QString EditingSSID; 46 51 47 52 // Setup our dialogs … … 68 73 69 74 signals: 75 void signalDeleteSSID(QString); 70 76 void signalSavedOpen(QString, bool); 71 77 void signalSavedWEP(QString, bool, QString, int, bool );
