summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/ppp/accounts.cpp
Unidiff
Diffstat (limited to 'noncore/settings/networksettings/ppp/accounts.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/ppp/accounts.cpp42
1 files changed, 8 insertions, 34 deletions
diff --git a/noncore/settings/networksettings/ppp/accounts.cpp b/noncore/settings/networksettings/ppp/accounts.cpp
index 19db9ef..11d4739 100644
--- a/noncore/settings/networksettings/ppp/accounts.cpp
+++ b/noncore/settings/networksettings/ppp/accounts.cpp
@@ -54,13 +54,7 @@ AccountWidget::AccountWidget( QWidget *parent, const char *name )
54 : QWidget( parent, name ) 54 : QWidget( parent, name )
55{ 55{
56// int min = 0;
57 QVBoxLayout *l1 = new QVBoxLayout(this, 10, 10); 56 QVBoxLayout *l1 = new QVBoxLayout(this, 10, 10);
58
59 // add a hbox
60// QHBoxLayout *l11 = new QHBoxLayout;
61// l1->addLayout(l11);
62
63 accountlist_l = new QListBox(this); 57 accountlist_l = new QListBox(this);
64// accountlist_l->setMinimumSize(160, 128); 58
65 connect(accountlist_l, SIGNAL(highlighted(int)), 59 connect(accountlist_l, SIGNAL(highlighted(int)),
66 this, SLOT(slotListBoxSelect(int))); 60 this, SLOT(slotListBoxSelect(int)));
@@ -69,14 +63,7 @@ AccountWidget::AccountWidget( QWidget *parent, const char *name )
69 l1->addWidget(accountlist_l, 10); 63 l1->addWidget(accountlist_l, 10);
70 64
71// QVBoxLayout *l111 = new QVBoxLayout(this);
72// l11->addLayout(l111, 1);
73 edit_b = new QPushButton(i18n("&Edit..."), this); 65 edit_b = new QPushButton(i18n("&Edit..."), this);
74 connect(edit_b, SIGNAL(clicked()), SLOT(editaccount())); 66 connect(edit_b, SIGNAL(clicked()), SLOT(editaccount()));
75 QWhatsThis::add(edit_b, i18n("Allows you to modify the selected account")); 67 QWhatsThis::add(edit_b, i18n("Allows you to modify the selected account"));
76
77// min = edit_b->sizeHint().width();
78// min = QMAX(70,min);
79// edit_b->setMinimumWidth(min);
80
81 l1->addWidget(edit_b); 68 l1->addWidget(edit_b);
82 69
@@ -173,5 +160,8 @@ AccountWidget::AccountWidget( QWidget *parent, const char *name )
173 } 160 }
174 161
175 slotListBoxSelect(accountlist_l->currentItem()); 162// slotListBoxSelect(accountlist_l->currentItem());
163 qDebug("setting listview index to %i",PPPData::data()->currentAccountID() );
164 accountlist_l->setCurrentItem( PPPData::data()->currentAccountID() );
165// slotListBoxSelect( PPPData::data()->currentAccountID());
176 166
177 l1->activate(); 167 l1->activate();
@@ -185,25 +175,9 @@ void AccountWidget::slotListBoxSelect(int idx) {
185 copy_b->setEnabled((bool)(idx != -1)); 175 copy_b->setEnabled((bool)(idx != -1));
186 if(idx!=-1) { 176 if(idx!=-1) {
177 qDebug("setting account to %i", idx);
187 QString account = PPPData::data()->accname(); 178 QString account = PPPData::data()->accname();
188 PPPData::data()->setAccountbyIndex(accountlist_l->currentItem()); 179 PPPData::data()->setAccountbyIndex(accountlist_l->currentItem());
189// reset->setEnabled(TRUE); 180 // PPPData::data()->setAccount(account);
190// costlabel->setEnabled(TRUE); 181 }
191// costedit->setEnabled(TRUE);
192// costedit->setText(AccountingBase::getCosts(accountlist_l->text(accountlist_l->currentItem())));
193
194// vollabel->setEnabled(TRUE);
195// voledit->setEnabled(TRUE);
196// int bytes = PPPData::data()->totalBytes();
197// voledit->setText(prettyPrintVolume(bytes));
198 PPPData::data()->setAccount(account);
199 } else{
200 // reset->setEnabled(FALSE);
201// costlabel->setEnabled(FALSE);
202// costedit->setText("");
203// costedit->setEnabled(FALSE);
204// vollabel->setEnabled(FALSE);
205// voledit->setText("");
206// voledit->setEnabled(FALSE);
207 }
208} 182}
209 183