author | alwin <alwin> | 2004-03-02 12:21:11 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-03-02 12:21:11 (UTC) |
commit | b6b1c97559c0ed9f2e33632272426bf98f289232 (patch) (unidiff) | |
tree | d3a9987704770cdf5eb14e1136f6e3ecb2f36a04 /noncore/settings/networksettings | |
parent | 0d59c780513da78033f4d9040475dee9db0256d4 (diff) | |
download | opie-b6b1c97559c0ed9f2e33632272426bf98f289232.zip opie-b6b1c97559c0ed9f2e33632272426bf98f289232.tar.gz opie-b6b1c97559c0ed9f2e33632272426bf98f289232.tar.bz2 |
applied the patch generated by the optimize_connect script from
TT.
Diffstat (limited to 'noncore/settings/networksettings') (more/less context) (ignore whitespace changes)
7 files changed, 24 insertions, 24 deletions
diff --git a/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp b/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp index 698dfd3..ff65424 100644 --- a/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp +++ b/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp | |||
@@ -4,50 +4,50 @@ | |||
4 | 4 | ||
5 | /* OPIE */ | 5 | /* OPIE */ |
6 | #include <qpe/config.h> | 6 | #include <qpe/config.h> |
7 | #include <qpe/qpeapplication.h> | 7 | #include <qpe/qpeapplication.h> |
8 | 8 | ||
9 | /* QT */ | 9 | /* QT */ |
10 | #include <qcheckbox.h> | 10 | #include <qcheckbox.h> |
11 | #include <qpushbutton.h> | 11 | #include <qpushbutton.h> |
12 | #include <qlabel.h> | 12 | #include <qlabel.h> |
13 | #include <qgroupbox.h> | 13 | #include <qgroupbox.h> |
14 | #include <qmessagebox.h> | 14 | #include <qmessagebox.h> |
15 | 15 | ||
16 | 16 | ||
17 | #ifdef QWS | 17 | #ifdef QWS |
18 | #else | 18 | #else |
19 | #define showMaximized show | 19 | #define showMaximized show |
20 | #endif | 20 | #endif |
21 | 21 | ||
22 | /** | 22 | /** |
23 | * Constructor for the InterfaceInformationImp class. This class pretty much | 23 | * Constructor for the InterfaceInformationImp class. This class pretty much |
24 | * just display's information about the interface that is passed to it. | 24 | * just display's information about the interface that is passed to it. |
25 | */ | 25 | */ |
26 | InterfaceInformationImp::InterfaceInformationImp(QWidget *parent, const char *name, Interface *i, WFlags f):InterfaceInformation(parent, name, f), interface(i) | 26 | InterfaceInformationImp::InterfaceInformationImp(QWidget *parent, const char *name, Interface *i, WFlags f):InterfaceInformation(parent, name, f), interface(i) |
27 | { | 27 | { |
28 | connect(i, SIGNAL(updateInterface(Interface *)), this, SLOT(updateInterface(Interface *))); | 28 | connect(i, SIGNAL(updateInterface(Interface*)), this, SLOT(updateInterface(Interface*))); |
29 | connect(i, SIGNAL(updateMessage(const QString &)), this, SLOT(showMessage(const QString &))); | 29 | connect(i, SIGNAL(updateMessage(const QString&)), this, SLOT(showMessage(const QString&))); |
30 | updateInterface(interface); | 30 | updateInterface(interface); |
31 | connect(startButton, SIGNAL(clicked()), interface, SLOT(start())); | 31 | connect(startButton, SIGNAL(clicked()), interface, SLOT(start())); |
32 | connect(stopButton, SIGNAL(clicked()), interface, SLOT(stop())); | 32 | connect(stopButton, SIGNAL(clicked()), interface, SLOT(stop())); |
33 | connect(restartButton, SIGNAL(clicked()), interface, SLOT(restart())); | 33 | connect(restartButton, SIGNAL(clicked()), interface, SLOT(restart())); |
34 | connect(refreshButton, SIGNAL(clicked()), interface, SLOT(refresh())); | 34 | connect(refreshButton, SIGNAL(clicked()), interface, SLOT(refresh())); |
35 | connect(advancedButton, SIGNAL(clicked()), this, SLOT(advanced())); | 35 | connect(advancedButton, SIGNAL(clicked()), this, SLOT(advanced())); |
36 | Config cfg("networksettings", Config::User); | 36 | Config cfg("networksettings", Config::User); |
37 | cfg.setGroup("interface"); | 37 | cfg.setGroup("interface"); |
38 | CheckBoxSilent->setChecked( cfg.readBoolEntry("silent", false) ); | 38 | CheckBoxSilent->setChecked( cfg.readBoolEntry("silent", false) ); |
39 | } | 39 | } |
40 | 40 | ||
41 | InterfaceInformationImp::~InterfaceInformationImp() | 41 | InterfaceInformationImp::~InterfaceInformationImp() |
42 | { | 42 | { |
43 | Config cfg("networksettings", Config::User); | 43 | Config cfg("networksettings", Config::User); |
44 | cfg.setGroup("interface"); | 44 | cfg.setGroup("interface"); |
45 | cfg.writeEntry("silent", CheckBoxSilent->isChecked() ); | 45 | cfg.writeEntry("silent", CheckBoxSilent->isChecked() ); |
46 | } | 46 | } |
47 | 47 | ||
48 | /** | 48 | /** |
49 | * Update the interface information and buttons. | 49 | * Update the interface information and buttons. |
50 | * @param Intarface *i the interface to update (should be the one we already | 50 | * @param Intarface *i the interface to update (should be the one we already |
51 | * know about). | 51 | * know about). |
52 | */ | 52 | */ |
53 | void InterfaceInformationImp::updateInterface(Interface *) | 53 | void InterfaceInformationImp::updateInterface(Interface *) |
diff --git a/noncore/settings/networksettings/mainwindowimp.cpp b/noncore/settings/networksettings/mainwindowimp.cpp index b0a1dd9..1e16b97 100644 --- a/noncore/settings/networksettings/mainwindowimp.cpp +++ b/noncore/settings/networksettings/mainwindowimp.cpp | |||
@@ -76,49 +76,49 @@ MainWindowImp::MainWindowImp(QWidget *parent, const char *name, WFlags) : MainWi | |||
76 | /* | 76 | /* |
77 | * we skipped it in getAllInterfaces now | 77 | * we skipped it in getAllInterfaces now |
78 | * we need to ignore it as well | 78 | * we need to ignore it as well |
79 | */ | 79 | */ |
80 | if (m_handledIfaces.contains( *ni) ) | 80 | if (m_handledIfaces.contains( *ni) ) |
81 | { | 81 | { |
82 | qDebug("Not up iface handled by module"); | 82 | qDebug("Not up iface handled by module"); |
83 | continue; | 83 | continue; |
84 | } | 84 | } |
85 | bool found = false; | 85 | bool found = false; |
86 | for( it = interfaceNames.begin(); it != interfaceNames.end(); ++it ) | 86 | for( it = interfaceNames.begin(); it != interfaceNames.end(); ++it ) |
87 | { | 87 | { |
88 | if(it.key() == (*ni)) | 88 | if(it.key() == (*ni)) |
89 | found = true; | 89 | found = true; |
90 | } | 90 | } |
91 | if(!found) | 91 | if(!found) |
92 | { | 92 | { |
93 | if(!(*ni).contains("_")) | 93 | if(!(*ni).contains("_")) |
94 | { | 94 | { |
95 | Interface *i = new Interface(this, *ni, false); | 95 | Interface *i = new Interface(this, *ni, false); |
96 | i->setAttached(false); | 96 | i->setAttached(false); |
97 | i->setHardwareName(tr("Disconnected")); | 97 | i->setHardwareName(tr("Disconnected")); |
98 | interfaceNames.insert(i->getInterfaceName(), i); | 98 | interfaceNames.insert(i->getInterfaceName(), i); |
99 | updateInterface(i); | 99 | updateInterface(i); |
100 | connect(i, SIGNAL(updateInterface(Interface *)), this, SLOT(updateInterface(Interface *))); | 100 | connect(i, SIGNAL(updateInterface(Interface*)), this, SLOT(updateInterface(Interface*))); |
101 | } | 101 | } |
102 | } | 102 | } |
103 | } | 103 | } |
104 | 104 | ||
105 | //getInterfaceList(); | 105 | //getInterfaceList(); |
106 | connectionList->header()->hide(); | 106 | connectionList->header()->hide(); |
107 | 107 | ||
108 | Config cfg("NetworkSetup"); | 108 | Config cfg("NetworkSetup"); |
109 | profiles = QStringList::split(" ", cfg.readEntry("Profiles", "All")); | 109 | profiles = QStringList::split(" ", cfg.readEntry("Profiles", "All")); |
110 | for ( QStringList::Iterator it = profiles.begin(); | 110 | for ( QStringList::Iterator it = profiles.begin(); |
111 | it != profiles.end(); ++it) | 111 | it != profiles.end(); ++it) |
112 | profilesList->insertItem((*it)); | 112 | profilesList->insertItem((*it)); |
113 | currentProfileLabel->setText(cfg.readEntry("CurrentProfile", "All")); | 113 | currentProfileLabel->setText(cfg.readEntry("CurrentProfile", "All")); |
114 | advancedUserMode = cfg.readBoolEntry("AdvancedUserMode", false); | 114 | advancedUserMode = cfg.readBoolEntry("AdvancedUserMode", false); |
115 | scheme = cfg.readEntry("SchemeFile", DEFAULT_SCHEME); | 115 | scheme = cfg.readEntry("SchemeFile", DEFAULT_SCHEME); |
116 | 116 | ||
117 | QFile file(scheme); | 117 | QFile file(scheme); |
118 | if ( file.open(IO_ReadOnly) ) | 118 | if ( file.open(IO_ReadOnly) ) |
119 | { // file opened successfully | 119 | { // file opened successfully |
120 | QTextStream stream( &file ); // use a text stream | 120 | QTextStream stream( &file ); // use a text stream |
121 | while ( !stream.eof() ) | 121 | while ( !stream.eof() ) |
122 | { // until end of file... | 122 | { // until end of file... |
123 | QString line = stream.readLine(); // line of text excluding '\n' | 123 | QString line = stream.readLine(); // line of text excluding '\n' |
124 | if(line.contains("SCHEME")) | 124 | if(line.contains("SCHEME")) |
@@ -231,66 +231,66 @@ void MainWindowImp::getAllInterfaces() | |||
231 | ifcopy = ifr; | 231 | ifcopy = ifr; |
232 | result = ioctl(sockfd, SIOCGIFFLAGS, &ifcopy); | 232 | result = ioctl(sockfd, SIOCGIFFLAGS, &ifcopy); |
233 | flags = ifcopy.ifr_flags; | 233 | flags = ifcopy.ifr_flags; |
234 | i = new Interface(this, ifr.ifr_name, false); | 234 | i = new Interface(this, ifr.ifr_name, false); |
235 | i->setAttached(true); | 235 | i->setAttached(true); |
236 | if ((flags & IFF_UP) == IFF_UP) | 236 | if ((flags & IFF_UP) == IFF_UP) |
237 | i->setStatus(true); | 237 | i->setStatus(true); |
238 | else | 238 | else |
239 | i->setStatus(false); | 239 | i->setStatus(false); |
240 | 240 | ||
241 | if ((flags & IFF_BROADCAST) == IFF_BROADCAST) | 241 | if ((flags & IFF_BROADCAST) == IFF_BROADCAST) |
242 | i->setHardwareName("Ethernet"); | 242 | i->setHardwareName("Ethernet"); |
243 | else if ((flags & IFF_POINTOPOINT) == IFF_POINTOPOINT) | 243 | else if ((flags & IFF_POINTOPOINT) == IFF_POINTOPOINT) |
244 | i->setHardwareName("Point to Point"); | 244 | i->setHardwareName("Point to Point"); |
245 | else if ((flags & IFF_MULTICAST) == IFF_MULTICAST) | 245 | else if ((flags & IFF_MULTICAST) == IFF_MULTICAST) |
246 | i->setHardwareName("Multicast"); | 246 | i->setHardwareName("Multicast"); |
247 | else if ((flags & IFF_LOOPBACK) == IFF_LOOPBACK) | 247 | else if ((flags & IFF_LOOPBACK) == IFF_LOOPBACK) |
248 | i->setHardwareName("Loopback"); | 248 | i->setHardwareName("Loopback"); |
249 | else | 249 | else |
250 | i->setHardwareName("Unknown"); | 250 | i->setHardwareName("Unknown"); |
251 | 251 | ||
252 | qWarning("Adding interface %s to interfaceNames\n", ifr.ifr_name); | 252 | qWarning("Adding interface %s to interfaceNames\n", ifr.ifr_name); |
253 | interfaceNames.insert(i->getInterfaceName(), i); | 253 | interfaceNames.insert(i->getInterfaceName(), i); |
254 | updateInterface(i); | 254 | updateInterface(i); |
255 | connect(i, SIGNAL(updateInterface(Interface *)), | 255 | connect(i, SIGNAL(updateInterface(Interface*)), |
256 | this, SLOT(updateInterface(Interface *))); | 256 | this, SLOT(updateInterface(Interface*))); |
257 | } | 257 | } |
258 | // now lets ask the plugins too ;) | 258 | // now lets ask the plugins too ;) |
259 | QMap<Module*, QLibrary*>::Iterator it; | 259 | QMap<Module*, QLibrary*>::Iterator it; |
260 | QList<Interface> ilist; | 260 | QList<Interface> ilist; |
261 | for( it = libraries.begin(); it != libraries.end(); ++it ) | 261 | for( it = libraries.begin(); it != libraries.end(); ++it ) |
262 | { | 262 | { |
263 | if(it.key()) | 263 | if(it.key()) |
264 | { | 264 | { |
265 | ilist = it.key()->getInterfaces(); | 265 | ilist = it.key()->getInterfaces(); |
266 | for( i = ilist.first(); i != 0; i = ilist.next() ) | 266 | for( i = ilist.first(); i != 0; i = ilist.next() ) |
267 | { | 267 | { |
268 | qWarning("Adding interface %s to interfaceNames\n", i->getInterfaceName().latin1() ); | 268 | qWarning("Adding interface %s to interfaceNames\n", i->getInterfaceName().latin1() ); |
269 | interfaceNames.insert(i->getInterfaceName(), i); | 269 | interfaceNames.insert(i->getInterfaceName(), i); |
270 | updateInterface(i); | 270 | updateInterface(i); |
271 | connect(i, SIGNAL(updateInterface(Interface *)), | 271 | connect(i, SIGNAL(updateInterface(Interface*)), |
272 | this, SLOT(updateInterface(Interface *))); | 272 | this, SLOT(updateInterface(Interface*))); |
273 | } | 273 | } |
274 | } | 274 | } |
275 | } | 275 | } |
276 | } | 276 | } |
277 | 277 | ||
278 | /** | 278 | /** |
279 | * Load all modules that are found in the path | 279 | * Load all modules that are found in the path |
280 | * @param path a directory that is scaned for any plugins that can be loaded | 280 | * @param path a directory that is scaned for any plugins that can be loaded |
281 | * and attempts to load them | 281 | * and attempts to load them |
282 | */ | 282 | */ |
283 | void MainWindowImp::loadModules(const QString &path) | 283 | void MainWindowImp::loadModules(const QString &path) |
284 | { | 284 | { |
285 | #ifdef DEBUG | 285 | #ifdef DEBUG |
286 | qDebug("MainWindowImp::loadModules: %s", path.latin1()); | 286 | qDebug("MainWindowImp::loadModules: %s", path.latin1()); |
287 | #endif | 287 | #endif |
288 | QDir d(path); | 288 | QDir d(path); |
289 | if(!d.exists()) | 289 | if(!d.exists()) |
290 | return; | 290 | return; |
291 | 291 | ||
292 | // Don't want sym links | 292 | // Don't want sym links |
293 | d.setFilter( QDir::Files | QDir::NoSymLinks ); | 293 | d.setFilter( QDir::Files | QDir::NoSymLinks ); |
294 | const QFileInfoList *list = d.entryInfoList(); | 294 | const QFileInfoList *list = d.entryInfoList(); |
295 | QFileInfoListIterator it( *list ); | 295 | QFileInfoListIterator it( *list ); |
296 | QFileInfo *fi; | 296 | QFileInfo *fi; |
@@ -691,50 +691,50 @@ void MainWindowImp::changeProfile() | |||
691 | { | 691 | { |
692 | QTextStream stream( &file ); | 692 | QTextStream stream( &file ); |
693 | stream << QString("SCHEME=%1").arg(newProfile); | 693 | stream << QString("SCHEME=%1").arg(newProfile); |
694 | file.close(); | 694 | file.close(); |
695 | } | 695 | } |
696 | // restart all up devices? | 696 | // restart all up devices? |
697 | if(QMessageBox::information(this, "Question","Restart all running interfaces?", QMessageBox::Ok, QMessageBox::No) == QMessageBox::Ok) | 697 | if(QMessageBox::information(this, "Question","Restart all running interfaces?", QMessageBox::Ok, QMessageBox::No) == QMessageBox::Ok) |
698 | { | 698 | { |
699 | // Go through them one by one | 699 | // Go through them one by one |
700 | QMap<Interface*, QListViewItem*>::Iterator it; | 700 | QMap<Interface*, QListViewItem*>::Iterator it; |
701 | for( it = items.begin(); it != items.end(); ++it ) | 701 | for( it = items.begin(); it != items.end(); ++it ) |
702 | { | 702 | { |
703 | if(it.key()->getStatus() == true) | 703 | if(it.key()->getStatus() == true) |
704 | it.key()->restart(); | 704 | it.key()->restart(); |
705 | } | 705 | } |
706 | } | 706 | } |
707 | } | 707 | } |
708 | // TODO change the profile in the modules | 708 | // TODO change the profile in the modules |
709 | } | 709 | } |
710 | 710 | ||
711 | 711 | ||
712 | void MainWindowImp::makeChannel() | 712 | void MainWindowImp::makeChannel() |
713 | { | 713 | { |
714 | channel = new QCopChannel( "QPE/Application/networksettings", this ); | 714 | channel = new QCopChannel( "QPE/Application/networksettings", this ); |
715 | connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), | 715 | connect( channel, SIGNAL(received(const QCString&,const QByteArray&)), |
716 | this, SLOT(receive(const QCString&, const QByteArray&)) ); | 716 | this, SLOT(receive(const QCString&,const QByteArray&)) ); |
717 | } | 717 | } |
718 | 718 | ||
719 | void MainWindowImp::receive(const QCString &msg, const QByteArray &arg) | 719 | void MainWindowImp::receive(const QCString &msg, const QByteArray &arg) |
720 | { | 720 | { |
721 | bool found = false; | 721 | bool found = false; |
722 | qDebug("MainWindowImp::receive QCop msg >"+msg+"<"); | 722 | qDebug("MainWindowImp::receive QCop msg >"+msg+"<"); |
723 | if (msg == "raise") | 723 | if (msg == "raise") |
724 | { | 724 | { |
725 | raise(); | 725 | raise(); |
726 | return; | 726 | return; |
727 | } | 727 | } |
728 | 728 | ||
729 | QString dest = msg.left(msg.find("(")); | 729 | QString dest = msg.left(msg.find("(")); |
730 | QCString param = msg.right(msg.length() - msg.find("(") - 1); | 730 | QCString param = msg.right(msg.length() - msg.find("(") - 1); |
731 | param = param.left( param.length() - 1 ); | 731 | param = param.left( param.length() - 1 ); |
732 | qDebug("dest >%s< param >"+param+"<",dest.latin1()); | 732 | qDebug("dest >%s< param >"+param+"<",dest.latin1()); |
733 | 733 | ||
734 | QMap<Module*, QLibrary*>::Iterator it; | 734 | QMap<Module*, QLibrary*>::Iterator it; |
735 | for( it = libraries.begin(); it != libraries.end(); ++it ) | 735 | for( it = libraries.begin(); it != libraries.end(); ++it ) |
736 | { | 736 | { |
737 | qDebug("plugin >%s<", it.key()->type().latin1() ); | 737 | qDebug("plugin >%s<", it.key()->type().latin1() ); |
738 | if(it.key()->type() == dest) | 738 | if(it.key()->type() == dest) |
739 | { | 739 | { |
740 | it.key()->receive( param, arg ); | 740 | it.key()->receive( param, arg ); |
diff --git a/noncore/settings/networksettings/ppp/edit.cpp b/noncore/settings/networksettings/ppp/edit.cpp index 7d21605..3b2393c 100644 --- a/noncore/settings/networksettings/ppp/edit.cpp +++ b/noncore/settings/networksettings/ppp/edit.cpp | |||
@@ -551,50 +551,50 @@ DNSWidget::DNSWidget( PPPData *pd, QWidget *parent, bool isnewaccount, const cha | |||
551 | tl->addWidget(conf_label, 1, 0); | 551 | tl->addWidget(conf_label, 1, 0); |
552 | 552 | ||
553 | bg = new QButtonGroup("Group", this); | 553 | bg = new QButtonGroup("Group", this); |
554 | connect(bg, SIGNAL(clicked(int)), SLOT(DNS_Mode_Selected(int))); | 554 | connect(bg, SIGNAL(clicked(int)), SLOT(DNS_Mode_Selected(int))); |
555 | bg->hide(); | 555 | bg->hide(); |
556 | 556 | ||
557 | autodns = new QRadioButton(tr("Automatic"), this); | 557 | autodns = new QRadioButton(tr("Automatic"), this); |
558 | bg->insert(autodns, 0); | 558 | bg->insert(autodns, 0); |
559 | tl->addWidget(autodns, 1, 1); | 559 | tl->addWidget(autodns, 1, 1); |
560 | if(!_pppdata->pppdVersionMin(2, 3, 7)) | 560 | if(!_pppdata->pppdVersionMin(2, 3, 7)) |
561 | autodns->setEnabled(false); | 561 | autodns->setEnabled(false); |
562 | 562 | ||
563 | mandns = new QRadioButton(tr("Manual"), this); | 563 | mandns = new QRadioButton(tr("Manual"), this); |
564 | bg->insert(mandns, 1); | 564 | bg->insert(mandns, 1); |
565 | tl->addWidget(mandns, 2, 1); | 565 | tl->addWidget(mandns, 2, 1); |
566 | 566 | ||
567 | dns_label = new QLabel(tr("DNS IP address:"), this); | 567 | dns_label = new QLabel(tr("DNS IP address:"), this); |
568 | tl->addWidget(dns_label, 3, 0); | 568 | tl->addWidget(dns_label, 3, 0); |
569 | 569 | ||
570 | QHBoxLayout *l2 = new QHBoxLayout; | 570 | QHBoxLayout *l2 = new QHBoxLayout; |
571 | tl->addLayout(l2, 3, 1); | 571 | tl->addLayout(l2, 3, 1); |
572 | dnsipaddr = new IPLineEdit(this); | 572 | dnsipaddr = new IPLineEdit(this); |
573 | connect(dnsipaddr, SIGNAL(returnPressed()), | 573 | connect(dnsipaddr, SIGNAL(returnPressed()), |
574 | SLOT(adddns())); | 574 | SLOT(adddns())); |
575 | connect(dnsipaddr, SIGNAL(textChanged(const QString &)), | 575 | connect(dnsipaddr, SIGNAL(textChanged(const QString&)), |
576 | SLOT(DNS_Edit_Changed(const QString &))); | 576 | SLOT(DNS_Edit_Changed(const QString&))); |
577 | l2->addWidget(dnsipaddr, 1); | 577 | l2->addWidget(dnsipaddr, 1); |
578 | l2->addStretch(1); | 578 | l2->addStretch(1); |
579 | tmp = tr("<p>Allows you to specify a new DNS server to be\n" | 579 | tmp = tr("<p>Allows you to specify a new DNS server to be\n" |
580 | "used while you are connected. When the\n" | 580 | "used while you are connected. When the\n" |
581 | "connection is closed, this DNS entry will be\n" | 581 | "connection is closed, this DNS entry will be\n" |
582 | "removed again.\n" | 582 | "removed again.\n" |
583 | "\n" | 583 | "\n" |
584 | "To add a DNS server, type in the IP address of\n" | 584 | "To add a DNS server, type in the IP address of\n" |
585 | "the DNS server here and click on <b>Add</b>"); | 585 | "the DNS server here and click on <b>Add</b>"); |
586 | 586 | ||
587 | QWhatsThis::add(dns_label, tmp); | 587 | QWhatsThis::add(dns_label, tmp); |
588 | QWhatsThis::add(dnsipaddr, tmp); | 588 | QWhatsThis::add(dnsipaddr, tmp); |
589 | 589 | ||
590 | QHBoxLayout *l1 = new QHBoxLayout; | 590 | QHBoxLayout *l1 = new QHBoxLayout; |
591 | tl->addLayout(l1, 4, 1); | 591 | tl->addLayout(l1, 4, 1); |
592 | add = new QPushButton(tr("Add"), this); | 592 | add = new QPushButton(tr("Add"), this); |
593 | connect(add, SIGNAL(clicked()), SLOT(adddns())); | 593 | connect(add, SIGNAL(clicked()), SLOT(adddns())); |
594 | l1->addWidget(add); | 594 | l1->addWidget(add); |
595 | // l1->addStretch(1); | 595 | // l1->addStretch(1); |
596 | QWhatsThis::add(add, | 596 | QWhatsThis::add(add, |
597 | tr("Click this button to add the DNS server\n" | 597 | tr("Click this button to add the DNS server\n" |
598 | "specified in the field above. The entry\n" | 598 | "specified in the field above. The entry\n" |
599 | "will then be added to the list below")); | 599 | "will then be added to the list below")); |
600 | 600 | ||
@@ -1163,49 +1163,49 @@ void ScriptWidget::removeButton() | |||
1163 | // Used to specify a new phone number | 1163 | // Used to specify a new phone number |
1164 | // | 1164 | // |
1165 | ///////////////////////////////////////////////////////////////////////////// | 1165 | ///////////////////////////////////////////////////////////////////////////// |
1166 | PhoneNumberDialog::PhoneNumberDialog(QWidget *parent) | 1166 | PhoneNumberDialog::PhoneNumberDialog(QWidget *parent) |
1167 | : QDialog(parent,"PhoneNumberDialog",true) | 1167 | : QDialog(parent,"PhoneNumberDialog",true) |
1168 | { | 1168 | { |
1169 | setCaption( tr("Add Phone Number") ); | 1169 | setCaption( tr("Add Phone Number") ); |
1170 | 1170 | ||
1171 | 1171 | ||
1172 | QVBoxLayout *layout = new QVBoxLayout( this ); | 1172 | QVBoxLayout *layout = new QVBoxLayout( this ); |
1173 | layout->setSpacing( 3 ); | 1173 | layout->setSpacing( 3 ); |
1174 | layout->setMargin( 3 ); | 1174 | layout->setMargin( 3 ); |
1175 | 1175 | ||
1176 | // QHBox *hbox = new QHBox(this); | 1176 | // QHBox *hbox = new QHBox(this); |
1177 | // setMainWidget(hbox); | 1177 | // setMainWidget(hbox); |
1178 | 1178 | ||
1179 | // hbox->setSpacing( 2 );//KDialog::spacingHint()); | 1179 | // hbox->setSpacing( 2 );//KDialog::spacingHint()); |
1180 | 1180 | ||
1181 | QLabel *label = new QLabel(this, tr("Enter a phone number:")); | 1181 | QLabel *label = new QLabel(this, tr("Enter a phone number:")); |
1182 | layout->addWidget( label ); | 1182 | layout->addWidget( label ); |
1183 | 1183 | ||
1184 | le = new QLineEdit(this, "lineEdit"); | 1184 | le = new QLineEdit(this, "lineEdit"); |
1185 | layout->addWidget( le ); | 1185 | layout->addWidget( le ); |
1186 | 1186 | ||
1187 | connect(le, SIGNAL(textChanged(const QString &)), | 1187 | connect(le, SIGNAL(textChanged(const QString&)), |
1188 | this, SLOT(textChanged(const QString &))); | 1188 | this, SLOT(textChanged(const QString&))); |
1189 | 1189 | ||
1190 | le->setFocus(); | 1190 | le->setFocus(); |
1191 | textChanged(""); | 1191 | textChanged(""); |
1192 | 1192 | ||
1193 | 1193 | ||
1194 | } | 1194 | } |
1195 | 1195 | ||
1196 | 1196 | ||
1197 | QString PhoneNumberDialog::phoneNumber() | 1197 | QString PhoneNumberDialog::phoneNumber() |
1198 | { | 1198 | { |
1199 | QString s = le->text(); | 1199 | QString s = le->text(); |
1200 | 1200 | ||
1201 | return s; | 1201 | return s; |
1202 | } | 1202 | } |
1203 | 1203 | ||
1204 | 1204 | ||
1205 | void PhoneNumberDialog::textChanged(const QString &s) | 1205 | void PhoneNumberDialog::textChanged(const QString &s) |
1206 | { | 1206 | { |
1207 | // enableButtonOK(s.length() > 0); | 1207 | // enableButtonOK(s.length() > 0); |
1208 | } | 1208 | } |
1209 | 1209 | ||
1210 | 1210 | ||
1211 | //#include "edit.moc" | 1211 | //#include "edit.moc" |
diff --git a/noncore/settings/networksettings/ppp/general.cpp b/noncore/settings/networksettings/ppp/general.cpp index ff1b11b..81dab38 100644 --- a/noncore/settings/networksettings/ppp/general.cpp +++ b/noncore/settings/networksettings/ppp/general.cpp | |||
@@ -63,50 +63,50 @@ ModemWidget::ModemWidget( PPPData *pd, QWidget *parent, const char *name ) | |||
63 | 63 | ||
64 | modemname = new QLineEdit(this, "modemName"); | 64 | modemname = new QLineEdit(this, "modemName"); |
65 | modemname->setText( _pppdata->devname() ); | 65 | modemname->setText( _pppdata->devname() ); |
66 | label1->setBuddy(modemname); | 66 | label1->setBuddy(modemname); |
67 | tl->addWidget(modemname, 0, 1); | 67 | tl->addWidget(modemname, 0, 1); |
68 | 68 | ||
69 | label1 = new QLabel(tr("Modem de&vice:"), this); | 69 | label1 = new QLabel(tr("Modem de&vice:"), this); |
70 | tl->addWidget(label1, 1, 0); | 70 | tl->addWidget(label1, 1, 0); |
71 | 71 | ||
72 | modemdevice = new QComboBox(false, this); | 72 | modemdevice = new QComboBox(false, this); |
73 | modemdevice->setEditable( true ); | 73 | modemdevice->setEditable( true ); |
74 | modemdevice->setDuplicatesEnabled ( false ); | 74 | modemdevice->setDuplicatesEnabled ( false ); |
75 | modemdevice->setInsertionPolicy( QComboBox::AtTop ); | 75 | modemdevice->setInsertionPolicy( QComboBox::AtTop ); |
76 | label1->setBuddy(modemdevice); | 76 | label1->setBuddy(modemdevice); |
77 | 77 | ||
78 | Config cfg("NetworkSetupPPP"); | 78 | Config cfg("NetworkSetupPPP"); |
79 | cfg.setGroup("Devices_General"); | 79 | cfg.setGroup("Devices_General"); |
80 | QStringList devs = cfg.readListEntry("devices",','); | 80 | QStringList devs = cfg.readListEntry("devices",','); |
81 | if (devs.isEmpty()) devs << "/dev/modem" << "/dev/ircomm0" << "/dev/ttyS0"; | 81 | if (devs.isEmpty()) devs << "/dev/modem" << "/dev/ircomm0" << "/dev/ttyS0"; |
82 | modemdevice->insertStringList( devs ); | 82 | modemdevice->insertStringList( devs ); |
83 | tl->addWidget(modemdevice, 1, 1); | 83 | tl->addWidget(modemdevice, 1, 1); |
84 | 84 | ||
85 | // connect(modemdevice, SIGNAL(activated(int)), | 85 | // connect(modemdevice, SIGNAL(activated(int)), |
86 | // SLOT(setmodemdc(int))); | 86 | // SLOT(setmodemdc(int))); |
87 | // connect(modemdevice, SIGNAL(textChanged( const QString & ) ), | 87 | // connect(modemdevice, SIGNAL(textChanged(const QString&) ), |
88 | // SLOT( setmodemdc( const QString &) ) ); | 88 | // SLOT( setmodemdc(const QString&) ) ); |
89 | 89 | ||
90 | QString tmp = tr("This specifies the serial port your modem is attached \n" | 90 | QString tmp = tr("This specifies the serial port your modem is attached \n" |
91 | "to. On Linux/x86, typically this is either /dev/ttyS0 \n" | 91 | "to. On Linux/x86, typically this is either /dev/ttyS0 \n" |
92 | "(COM1 under DOS) or /dev/ttyS1 (COM2 under DOS).\n" | 92 | "(COM1 under DOS) or /dev/ttyS1 (COM2 under DOS).\n" |
93 | "\n" | 93 | "\n" |
94 | "If you have an internal ISDN card with AT command\n" | 94 | "If you have an internal ISDN card with AT command\n" |
95 | "emulation (most cards under Linux support this), you\n" | 95 | "emulation (most cards under Linux support this), you\n" |
96 | "should select one of the /dev/ttyIx devices."); | 96 | "should select one of the /dev/ttyIx devices."); |
97 | 97 | ||
98 | QWhatsThis::add(label1,tmp); | 98 | QWhatsThis::add(label1,tmp); |
99 | QWhatsThis::add(modemdevice,tmp); | 99 | QWhatsThis::add(modemdevice,tmp); |
100 | 100 | ||
101 | 101 | ||
102 | label1 = new QLabel(tr("&Flow control:"), this); | 102 | label1 = new QLabel(tr("&Flow control:"), this); |
103 | tl->addWidget(label1, 2, 0); | 103 | tl->addWidget(label1, 2, 0); |
104 | 104 | ||
105 | flowcontrol = new QComboBox(false, this); | 105 | flowcontrol = new QComboBox(false, this); |
106 | label1->setBuddy(flowcontrol); | 106 | label1->setBuddy(flowcontrol); |
107 | flowcontrol->insertItem(tr("Hardware [CRTSCTS]")); | 107 | flowcontrol->insertItem(tr("Hardware [CRTSCTS]")); |
108 | flowcontrol->insertItem(tr("Software [XON/XOFF]")); | 108 | flowcontrol->insertItem(tr("Software [XON/XOFF]")); |
109 | flowcontrol->insertItem(tr("None")); | 109 | flowcontrol->insertItem(tr("None")); |
110 | tl->addWidget(flowcontrol, 2, 1); | 110 | tl->addWidget(flowcontrol, 2, 1); |
111 | // connect(flowcontrol, SIGNAL(activated(int)), | 111 | // connect(flowcontrol, SIGNAL(activated(int)), |
112 | // SLOT(setflowcontrol(int))); | 112 | // SLOT(setflowcontrol(int))); |
diff --git a/noncore/settings/networksettings/ppp/kpppwidget.cpp b/noncore/settings/networksettings/ppp/kpppwidget.cpp index e466358..e21bbc7 100644 --- a/noncore/settings/networksettings/ppp/kpppwidget.cpp +++ b/noncore/settings/networksettings/ppp/kpppwidget.cpp | |||
@@ -375,53 +375,53 @@ void KPPPWidget::log_window_toggled(bool on) { | |||
375 | // for(int i=0; i < count; i++) { | 375 | // for(int i=0; i < count; i++) { |
376 | // _pppdata->setAccountbyIndex(i); | 376 | // _pppdata->setAccountbyIndex(i); |
377 | // connectto_c->insertItem(_pppdata->accname()); | 377 | // connectto_c->insertItem(_pppdata->accname()); |
378 | // } | 378 | // } |
379 | 379 | ||
380 | // //set the default account | 380 | // //set the default account |
381 | // if(!_pppdata->defaultAccount().isEmpty()) { | 381 | // if(!_pppdata->defaultAccount().isEmpty()) { |
382 | // for(int i=0; i < count; i++) | 382 | // for(int i=0; i < count; i++) |
383 | // if(_pppdata->defaultAccount() == connectto_c->text(i)) { | 383 | // if(_pppdata->defaultAccount() == connectto_c->text(i)) { |
384 | // connectto_c->setCurrentItem(i); | 384 | // connectto_c->setCurrentItem(i); |
385 | // _pppdata->setAccountbyIndex(i); | 385 | // _pppdata->setAccountbyIndex(i); |
386 | 386 | ||
387 | // ID_Edit->setText(_pppdata->storedUsername()); | 387 | // ID_Edit->setText(_pppdata->storedUsername()); |
388 | // PW_Edit->setText(_pppdata->storedPassword()); | 388 | // PW_Edit->setText(_pppdata->storedPassword()); |
389 | // } | 389 | // } |
390 | // } | 390 | // } |
391 | // else | 391 | // else |
392 | // if(count > 0) { | 392 | // if(count > 0) { |
393 | // _pppdata->setDefaultAccount(connectto_c->text(0)); | 393 | // _pppdata->setDefaultAccount(connectto_c->text(0)); |
394 | // _pppdata->save(); | 394 | // _pppdata->save(); |
395 | // ID_Edit->setText(_pppdata->storedUsername()); | 395 | // ID_Edit->setText(_pppdata->storedUsername()); |
396 | // PW_Edit->setText(_pppdata->storedPassword()); | 396 | // PW_Edit->setText(_pppdata->storedPassword()); |
397 | // } | 397 | // } |
398 | 398 | ||
399 | // connect(ID_Edit, SIGNAL(textChanged(const QString &)), | 399 | // connect(ID_Edit, SIGNAL(textChanged(const QString&)), |
400 | // this, SLOT(usernameChanged(const QString &))); | 400 | // this, SLOT(usernameChanged(const QString&))); |
401 | 401 | ||
402 | // connect(PW_Edit, SIGNAL(textChanged(const QString &)), | 402 | // connect(PW_Edit, SIGNAL(textChanged(const QString&)), |
403 | // this, SLOT(passwordChanged(const QString &))); | 403 | // this, SLOT(passwordChanged(const QString&))); |
404 | 404 | ||
405 | // if (ID_Edit->text().isEmpty()) | 405 | // if (ID_Edit->text().isEmpty()) |
406 | // ID_Edit->setFocus(); | 406 | // ID_Edit->setFocus(); |
407 | // else if (PW_Edit->text().isEmpty()) | 407 | // else if (PW_Edit->text().isEmpty()) |
408 | // PW_Edit->setFocus(); | 408 | // PW_Edit->setFocus(); |
409 | // } | 409 | // } |
410 | 410 | ||
411 | 411 | ||
412 | void KPPPWidget::interruptConnection() { | 412 | void KPPPWidget::interruptConnection() { |
413 | // interrupt dial up | 413 | // interrupt dial up |
414 | // | 414 | // |
415 | 415 | ||
416 | if (con->isVisible()) | 416 | if (con->isVisible()) |
417 | emit con->cancelbutton(); | 417 | emit con->cancelbutton(); |
418 | 418 | ||
419 | // disconnect if online | 419 | // disconnect if online |
420 | if (_pppdata->pppdRunning()) | 420 | if (_pppdata->pppdRunning()) |
421 | emit disconnect(); | 421 | emit disconnect(); |
422 | } | 422 | } |
423 | 423 | ||
424 | 424 | ||
425 | void KPPPWidget::sigPPPDDied() { | 425 | void KPPPWidget::sigPPPDDied() { |
426 | qDebug( "Received a SIGUSR1" ); | 426 | qDebug( "Received a SIGUSR1" ); |
427 | 427 | ||
@@ -700,50 +700,50 @@ void KPPPWidget::quitbutton() { | |||
700 | 700 | ||
701 | 701 | ||
702 | // void KPPPWidget::rulesetLoadError() { | 702 | // void KPPPWidget::rulesetLoadError() { |
703 | // QMessageBox::warning(this,"error", ruleset_load_errmsg); | 703 | // QMessageBox::warning(this,"error", ruleset_load_errmsg); |
704 | // } | 704 | // } |
705 | 705 | ||
706 | 706 | ||
707 | // void KPPPWidget::startAccounting() { | 707 | // void KPPPWidget::startAccounting() { |
708 | // // volume accounting | 708 | // // volume accounting |
709 | // stats->totalbytes = 0; | 709 | // stats->totalbytes = 0; |
710 | 710 | ||
711 | // kdDebug() << "AcctEnabled: " << _pppdata->AcctEnabled() << endl; | 711 | // kdDebug() << "AcctEnabled: " << _pppdata->AcctEnabled() << endl; |
712 | 712 | ||
713 | // // load the ruleset | 713 | // // load the ruleset |
714 | // if(!_pppdata->AcctEnabled()) | 714 | // if(!_pppdata->AcctEnabled()) |
715 | // return; | 715 | // return; |
716 | 716 | ||
717 | // QString d = AccountingBase::getAccountingFile(_pppdata->accountingFile()); | 717 | // QString d = AccountingBase::getAccountingFile(_pppdata->accountingFile()); |
718 | // // if(::access(d.data(), X_OK) != 0) | 718 | // // if(::access(d.data(), X_OK) != 0) |
719 | // acct = new Accounting(this, stats); | 719 | // acct = new Accounting(this, stats); |
720 | // // else | 720 | // // else |
721 | // // acct = new ExecutableAccounting(this); | 721 | // // acct = new ExecutableAccounting(this); |
722 | 722 | ||
723 | // // connect to the accounting object | 723 | // // connect to the accounting object |
724 | // connect(acct, SIGNAL(changed(QString, QString)), | 724 | // connect(acct, SIGNAL(changed(QString,QString)), |
725 | // con_win, SLOT(slotAccounting(QString, QString))); | 725 | // con_win, SLOT(slotAccounting(QString,QString))); |
726 | 726 | ||
727 | // // if(!acct->loadRuleSet(_pppdata->accountingFile())) { | 727 | // // if(!acct->loadRuleSet(_pppdata->accountingFile())) { |
728 | // // QString s= QObject::tr("Can not load the accounting " | 728 | // // QString s= QObject::tr("Can not load the accounting " |
729 | // // "ruleset \"%1\"!").arg(_pppdata->accountingFile()); | 729 | // // "ruleset \"%1\"!").arg(_pppdata->accountingFile()); |
730 | 730 | ||
731 | // // starting the messagebox with a timer will prevent us | 731 | // // starting the messagebox with a timer will prevent us |
732 | // // from blocking the calling function ConnectWidget::timerEvent | 732 | // // from blocking the calling function ConnectWidget::timerEvent |
733 | // ruleset_load_errmsg = s; | 733 | // ruleset_load_errmsg = s; |
734 | // QTimer::singleShot(0, this, SLOT(rulesetLoadError())); | 734 | // QTimer::singleShot(0, this, SLOT(rulesetLoadError())); |
735 | // return; | 735 | // return; |
736 | // } | 736 | // } |
737 | // //else | 737 | // //else |
738 | // // acct->slotStart(); | 738 | // // acct->slotStart(); |
739 | // } | 739 | // } |
740 | 740 | ||
741 | // void KPPPWidget::stopAccounting() { | 741 | // void KPPPWidget::stopAccounting() { |
742 | // // store volume accounting | 742 | // // store volume accounting |
743 | // // if(stats->totalbytes != 0) | 743 | // // if(stats->totalbytes != 0) |
744 | // // _pppdata->setTotalBytes(stats->totalbytes); | 744 | // // _pppdata->setTotalBytes(stats->totalbytes); |
745 | 745 | ||
746 | // if(!_pppdata->AcctEnabled()) | 746 | // if(!_pppdata->AcctEnabled()) |
747 | // return; | 747 | // return; |
748 | 748 | ||
749 | // // if(acct != 0) { | 749 | // // if(acct != 0) { |
diff --git a/noncore/settings/networksettings/ppp/pppdargs.cpp b/noncore/settings/networksettings/ppp/pppdargs.cpp index 66a4d82..d6d8d88 100644 --- a/noncore/settings/networksettings/ppp/pppdargs.cpp +++ b/noncore/settings/networksettings/ppp/pppdargs.cpp | |||
@@ -34,50 +34,50 @@ | |||
34 | 34 | ||
35 | PPPdArguments::PPPdArguments( PPPData *pd, QWidget *parent, const char *name) | 35 | PPPdArguments::PPPdArguments( PPPData *pd, QWidget *parent, const char *name) |
36 | : QDialog(parent, name, TRUE), _pppdata(pd) | 36 | : QDialog(parent, name, TRUE), _pppdata(pd) |
37 | { | 37 | { |
38 | setCaption(tr("Customize pppd Arguments")); | 38 | setCaption(tr("Customize pppd Arguments")); |
39 | // KWin::setIcons(winId(), kapp->icon(), kapp->miniIcon()); | 39 | // KWin::setIcons(winId(), kapp->icon(), kapp->miniIcon()); |
40 | QVBoxLayout *l = new QVBoxLayout(this, 10, 10); | 40 | QVBoxLayout *l = new QVBoxLayout(this, 10, 10); |
41 | QHBoxLayout *tl = new QHBoxLayout(10); | 41 | QHBoxLayout *tl = new QHBoxLayout(10); |
42 | l->addLayout(tl); | 42 | l->addLayout(tl); |
43 | QVBoxLayout *l1 = new QVBoxLayout(); | 43 | QVBoxLayout *l1 = new QVBoxLayout(); |
44 | QVBoxLayout *l2 = new QVBoxLayout(); | 44 | QVBoxLayout *l2 = new QVBoxLayout(); |
45 | tl->addLayout(l1, 1); | 45 | tl->addLayout(l1, 1); |
46 | tl->addLayout(l2, 0); | 46 | tl->addLayout(l2, 0); |
47 | 47 | ||
48 | QHBoxLayout *l11 = new QHBoxLayout(10); | 48 | QHBoxLayout *l11 = new QHBoxLayout(10); |
49 | l1->addLayout(l11); | 49 | l1->addLayout(l11); |
50 | 50 | ||
51 | argument_label = new QLabel(tr("Argument:"), this); | 51 | argument_label = new QLabel(tr("Argument:"), this); |
52 | l11->addWidget(argument_label); | 52 | l11->addWidget(argument_label); |
53 | 53 | ||
54 | argument = new QLineEdit(this); | 54 | argument = new QLineEdit(this); |
55 | connect(argument, SIGNAL(returnPressed()), | 55 | connect(argument, SIGNAL(returnPressed()), |
56 | SLOT(addbutton())); | 56 | SLOT(addbutton())); |
57 | l11->addWidget(argument); | 57 | l11->addWidget(argument); |
58 | connect(argument, SIGNAL(textChanged(const QString &)), | 58 | connect(argument, SIGNAL(textChanged(const QString&)), |
59 | this, SLOT(textChanged(const QString &))); | 59 | this, SLOT(textChanged(const QString&))); |
60 | 60 | ||
61 | arguments = new QListBox(this); | 61 | arguments = new QListBox(this); |
62 | arguments->setMinimumSize(1, fontMetrics().lineSpacing()*10); | 62 | arguments->setMinimumSize(1, fontMetrics().lineSpacing()*10); |
63 | connect(arguments, SIGNAL(highlighted(int)), | 63 | connect(arguments, SIGNAL(highlighted(int)), |
64 | this, SLOT(itemSelected(int))); | 64 | this, SLOT(itemSelected(int))); |
65 | l1->addWidget(arguments, 1); | 65 | l1->addWidget(arguments, 1); |
66 | 66 | ||
67 | add = new QPushButton(tr("Add"), this); | 67 | add = new QPushButton(tr("Add"), this); |
68 | connect(add, SIGNAL(clicked()), SLOT(addbutton())); | 68 | connect(add, SIGNAL(clicked()), SLOT(addbutton())); |
69 | l2->addWidget(add); | 69 | l2->addWidget(add); |
70 | l2->addStretch(1); | 70 | l2->addStretch(1); |
71 | 71 | ||
72 | remove = new QPushButton(tr("Remove"), this); | 72 | remove = new QPushButton(tr("Remove"), this); |
73 | connect(remove, SIGNAL(clicked()), SLOT(removebutton())); | 73 | connect(remove, SIGNAL(clicked()), SLOT(removebutton())); |
74 | l2->addWidget(remove); | 74 | l2->addWidget(remove); |
75 | 75 | ||
76 | defaults = new QPushButton(tr("Defaults"), this); | 76 | defaults = new QPushButton(tr("Defaults"), this); |
77 | connect(defaults, SIGNAL(clicked()), SLOT(defaultsbutton())); | 77 | connect(defaults, SIGNAL(clicked()), SLOT(defaultsbutton())); |
78 | l2->addWidget(defaults); | 78 | l2->addWidget(defaults); |
79 | 79 | ||
80 | l->addSpacing(5); | 80 | l->addSpacing(5); |
81 | 81 | ||
82 | 82 | ||
83 | //load info from gpppdata | 83 | //load info from gpppdata |
diff --git a/noncore/settings/networksettings/wlan/wlanimp2.cpp b/noncore/settings/networksettings/wlan/wlanimp2.cpp index 92339d6..dd1db28 100644 --- a/noncore/settings/networksettings/wlan/wlanimp2.cpp +++ b/noncore/settings/networksettings/wlan/wlanimp2.cpp | |||
@@ -33,49 +33,49 @@ | |||
33 | #include <opie2/opcap.h> | 33 | #include <opie2/opcap.h> |
34 | #else | 34 | #else |
35 | #define OProcess KProcess | 35 | #define OProcess KProcess |
36 | #include <kprocess.h> | 36 | #include <kprocess.h> |
37 | #endif | 37 | #endif |
38 | 38 | ||
39 | #define WIRELESS_OPTS "/etc/pcmcia/wireless.opts" | 39 | #define WIRELESS_OPTS "/etc/pcmcia/wireless.opts" |
40 | #define PREUP "/etc/network/if-pre-up.d/wireless-tools" | 40 | #define PREUP "/etc/network/if-pre-up.d/wireless-tools" |
41 | 41 | ||
42 | /** | 42 | /** |
43 | * Constructor, read in the wireless.opts file for parsing later. | 43 | * Constructor, read in the wireless.opts file for parsing later. |
44 | */ | 44 | */ |
45 | WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, WFlags fl) : WLAN(parent, name, modal, fl), interface(i), currentProfile("*") { | 45 | WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, WFlags fl) : WLAN(parent, name, modal, fl), interface(i), currentProfile("*") { |
46 | interfaces = new Interfaces(); | 46 | interfaces = new Interfaces(); |
47 | interfaceSetup = new InterfaceSetupImp(tabWidget, "InterfaceSetupImp", i, interfaces); | 47 | interfaceSetup = new InterfaceSetupImp(tabWidget, "InterfaceSetupImp", i, interfaces); |
48 | tabWidget->insertTab(interfaceSetup, "TCP/IP"); | 48 | tabWidget->insertTab(interfaceSetup, "TCP/IP"); |
49 | 49 | ||
50 | // Check sanity - the existance of the wireless-tools if-pre-up script | 50 | // Check sanity - the existance of the wireless-tools if-pre-up script |
51 | QFile file(QString(PREUP)); | 51 | QFile file(QString(PREUP)); |
52 | if (file.exists()) { | 52 | if (file.exists()) { |
53 | qWarning(QString("WLANImp: Unable to open /etc/network/if-pre-up.d/wireless-tools")); | 53 | qWarning(QString("WLANImp: Unable to open /etc/network/if-pre-up.d/wireless-tools")); |
54 | } | 54 | } |
55 | 55 | ||
56 | connect( rescanButton, SIGNAL( clicked() ), this, SLOT( rescanNeighbourhood() ) ); | 56 | connect( rescanButton, SIGNAL( clicked() ), this, SLOT( rescanNeighbourhood() ) ); |
57 | connect( netView, SIGNAL( clicked( QListViewItem* ) ), this, SLOT( selectNetwork( QListViewItem* ) ) ); | 57 | connect( netView, SIGNAL( clicked(QListViewItem*) ), this, SLOT( selectNetwork(QListViewItem*) ) ); |
58 | netView->setColumnAlignment( col_chn, AlignCenter ); | 58 | netView->setColumnAlignment( col_chn, AlignCenter ); |
59 | netView->setItemMargin( 3 ); | 59 | netView->setItemMargin( 3 ); |
60 | netView->setAllColumnsShowFocus( true ); | 60 | netView->setAllColumnsShowFocus( true ); |
61 | 61 | ||
62 | } | 62 | } |
63 | 63 | ||
64 | WLANImp::~WLANImp() { | 64 | WLANImp::~WLANImp() { |
65 | //FIXME: delete interfaces; | 65 | //FIXME: delete interfaces; |
66 | } | 66 | } |
67 | 67 | ||
68 | /** | 68 | /** |
69 | * Change the profile for both wireless settings and network settings. | 69 | * Change the profile for both wireless settings and network settings. |
70 | */ | 70 | */ |
71 | void WLANImp::setProfile(const QString &profile){ | 71 | void WLANImp::setProfile(const QString &profile){ |
72 | interfaceSetup->setProfile(profile); | 72 | interfaceSetup->setProfile(profile); |
73 | parseOpts(); | 73 | parseOpts(); |
74 | } | 74 | } |
75 | 75 | ||
76 | void WLANImp::parseOpts() { | 76 | void WLANImp::parseOpts() { |
77 | bool error; | 77 | bool error; |
78 | QString opt; | 78 | QString opt; |
79 | 79 | ||
80 | if (! interfaces->isInterfaceSet()) | 80 | if (! interfaces->isInterfaceSet()) |
81 | return; | 81 | return; |