View | Details | Raw Unified | Return to bug 129841
Collapse All | Expand All

(-)kinternet-0.72/kinternet/wepkeyinputdialog.cpp (-2 / +54 lines)
Lines 27-37 Link Here
27
27
28
// Own Header
28
// Own Header
29
#include "wepkeyinputdialog.h"
29
#include "wepkeyinputdialog.h"
30
#include <kwallet.h>
31
32
#define WALLET_NAME "kinternet_wepkeys"
33
34
KWallet::Wallet* wallet = 0;
35
QString essid;
36
QString idtype, idmode;
30
37
31
/*! The default constructor of the class */
38
/*! The default constructor of the class */
32
WepkeyInputDialog::WepkeyInputDialog(QWidget *parent, const char *name)
39
WepkeyInputDialog::WepkeyInputDialog(QString _essid, QWidget *parent, const char *name)
33
 	: wepKey_Inputdialog(parent, name)
40
 	: wepKey_Inputdialog(parent, name)
34
{
41
{
42
43
	QString walletName = tr(WALLET_NAME);
44
	QString wepkey, keytype, authmode;
45
	bool walletOK = false;
46
47
	essid = _essid;
48
49
	idtype = (&essid)->append( 't' );
50
	idmode = (&essid)->append( 'm' );
51
35
	// fill the dropdownbox
52
	// fill the dropdownbox
36
	comboB_authmode->insertItem("open");
53
	comboB_authmode->insertItem("open");
37
	comboB_authmode->insertItem("shared");
54
	comboB_authmode->insertItem("shared");
Lines 40-45 Link Here
40
	comboB_keytype->insertItem("ascii");
57
	comboB_keytype->insertItem("ascii");
41
	comboB_keytype->insertItem("hash (64 bit)");
58
	comboB_keytype->insertItem("hash (64 bit)");
42
	comboB_keytype->insertItem("hash (128 bit)");
59
	comboB_keytype->insertItem("hash (128 bit)");
60
61
	if (KWallet::Wallet::isEnabled())
62
	{
63
		// Open local wallet
64
		wallet = KWallet::Wallet::openWallet(KWallet::Wallet::LocalWallet());
65
		if (wallet != 0)
66
		{
67
			// Check if folder exists, otherwise create it
68
			walletOK = wallet->hasFolder(walletName);
69
			if (walletOK == false)
70
			{
71
				walletOK = wallet->createFolder(walletName);
72
			}
73
			// Read password entry
74
			if (walletOK == true)
75
			{
76
				if(wallet->readPassword( essid, wepkey ) == 0)
77
				{
78
					lineEdit_wepkey->setText( wepkey );
79
				}
80
//				if(wallet->readPassword( idtype, keytype ) == 0)
81
//				{
82
//					comboB_keytype->setCurrentText( keytype );
83
//				}
84
//				if(wallet->readPassword( idmode, authmode ) == 0)
85
//				{
86
//					comboB_authmode->setCurrentText( authmode );
87
//				}
88
			}
89
		}
90
	}
91
43
}
92
}
44
93
45
/*! The default destructor of the class */
94
/*! The default destructor of the class */
Lines 52-59 Link Here
52
 */
101
 */
53
void WepkeyInputDialog::accept(){
102
void WepkeyInputDialog::accept(){
54
	wep_key = lineEdit_wepkey->text();
103
	wep_key = lineEdit_wepkey->text();
55
	
104
	wallet->writePassword( essid, wep_key );
105
56
	wep_key_type = comboB_keytype->currentText();		
106
	wep_key_type = comboB_keytype->currentText();		
107
//	wallet->writePassword( idtype, wep_key_type );
57
108
58
	if(wep_key_type.startsWith("hash (64 bit)")) {
109
	if(wep_key_type.startsWith("hash (64 bit)")) {
59
		wep_key_type = "hash40";
110
		wep_key_type = "hash40";
Lines 63-68 Link Here
63
	}
114
	}
64
	
115
	
65
	authmode = comboB_authmode->currentText();
116
	authmode = comboB_authmode->currentText();
117
//	wallet->writePassword( idmode, authmode );
66
	
118
	
67
	close();
119
	close();
68
}
120
}
(-)kinternet-0.72/kinternet/wepkeyinputdialog.h (-1 / +1 lines)
Lines 30-36 Link Here
30
public:
30
public:
31
	
31
	
32
	//! the default constructor
32
	//! the default constructor
33
	WepkeyInputDialog(QWidget *parent = 0, const char *name = 0);
33
	WepkeyInputDialog(QString essid, QWidget *parent = 0, const char *name = 0);
34
	//! the default destructor
34
	//! the default destructor
35
	~WepkeyInputDialog();
35
	~WepkeyInputDialog();
36
	
36
	
(-)kinternet-0.72/kinternet/wirelessdialog.cpp (-2 / +1 lines)
Lines 44-50 Link Here
44
#include "wirelessdialog.h"
44
#include "wirelessdialog.h"
45
45
46
46
47
48
/*! The default constructor of the class */
47
/*! The default constructor of the class */
49
WirelessDialog::WirelessDialog(Server* _server, QString _interface, QWidget *parent, const char *name)
48
WirelessDialog::WirelessDialog(Server* _server, QString _interface, QWidget *parent, const char *name)
50
    :Wireless_Dialog(parent, name, false, WDestructiveClose)
49
    :Wireless_Dialog(parent, name, false, WDestructiveClose)
Lines 213-219 Link Here
213
		// if WEP needed display dialog
212
		// if WEP needed display dialog
214
		if(wep_needed){
213
		if(wep_needed){
215
			
214
			
216
			wepkeydialog = new WepkeyInputDialog();
215
			wepkeydialog = new WepkeyInputDialog(to_check_essid);
217
			wepkeydialog->exec();
216
			wepkeydialog->exec();
218
			
217
			
219
			QString wep_key = wepkeydialog->wep_key;
218
			QString wep_key = wepkeydialog->wep_key;

Return to bug 129841