Diffstat (limited to 'noncore/settings/networksettings') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/mainwindow/mainwindowimp.cpp | 20 | ||||
-rw-r--r-- | noncore/settings/networksettings/ppp/edit.cpp | 10 | ||||
-rw-r--r-- | noncore/settings/networksettings/wlan/wlanimp2.cpp | 4 |
3 files changed, 15 insertions, 19 deletions
diff --git a/noncore/settings/networksettings/mainwindow/mainwindowimp.cpp b/noncore/settings/networksettings/mainwindow/mainwindowimp.cpp index a7b0bdc..650e634 100644 --- a/noncore/settings/networksettings/mainwindow/mainwindowimp.cpp +++ b/noncore/settings/networksettings/mainwindow/mainwindowimp.cpp | |||
@@ -1,29 +1,30 @@ | |||
1 | 1 | ||
2 | #include "mainwindowimp.h" | 2 | #include "mainwindowimp.h" |
3 | #include "addconnectionimp.h" | 3 | #include "addconnectionimp.h" |
4 | #include "interfaceinformationimp.h" | 4 | #include "interfaceinformationimp.h" |
5 | #include "interfacesetupimp.h" | 5 | #include "interfacesetupimp.h" |
6 | #include "interfaces.h" | 6 | #include "interfaces.h" |
7 | #include "module.h" | 7 | #include "module.h" |
8 | 8 | ||
9 | /* OPIE */ | 9 | /* OPIE */ |
10 | #include <opie2/odebug.h> | 10 | #include <opie2/odebug.h> |
11 | #include <opie2/oprocess.h> | 11 | #include <opie2/oprocess.h> |
12 | #include <opie2/oresource.h> | ||
13 | |||
12 | #include <qpe/applnk.h> | 14 | #include <qpe/applnk.h> |
13 | #include <qpe/qcopenvelope_qws.h> | 15 | #include <qpe/qcopenvelope_qws.h> |
14 | #include <qpe/qpeapplication.h> | 16 | #include <qpe/qpeapplication.h> |
15 | #include <qpe/config.h> | 17 | #include <qpe/config.h> |
16 | #include <qpe/qlibrary.h> | 18 | #include <qpe/qlibrary.h> |
17 | #include <qpe/resource.h> | ||
18 | 19 | ||
19 | /* QT */ | 20 | /* QT */ |
20 | #include <qpushbutton.h> | 21 | #include <qpushbutton.h> |
21 | #include <qlistbox.h> | 22 | #include <qlistbox.h> |
22 | #include <qlineedit.h> | 23 | #include <qlineedit.h> |
23 | #include <qlistview.h> | 24 | #include <qlistview.h> |
24 | #include <qheader.h> | 25 | #include <qheader.h> |
25 | #include <qlabel.h> | 26 | #include <qlabel.h> |
26 | #include <qtabwidget.h> // in order to disable the profiles tab | 27 | #include <qtabwidget.h> // in order to disable the profiles tab |
27 | #include <qmessagebox.h> | 28 | #include <qmessagebox.h> |
28 | #include <qtextstream.h> | 29 | #include <qtextstream.h> |
29 | #include <qregexp.h> | 30 | #include <qregexp.h> |
@@ -523,53 +524,44 @@ void MainWindowImp::updateInterface(Interface *i) | |||
523 | for( it = libraries.begin(); it != libraries.end(); ++it ) | 524 | for( it = libraries.begin(); it != libraries.end(); ++it ) |
524 | { | 525 | { |
525 | if(it.key()->isOwner(i)) | 526 | if(it.key()->isOwner(i)) |
526 | i->setModuleOwner(it.key()); | 527 | i->setModuleOwner(it.key()); |
527 | } | 528 | } |
528 | items.insert(i, item); | 529 | items.insert(i, item); |
529 | interfaceItems.insert(item, i); | 530 | interfaceItems.insert(item, i); |
530 | } | 531 | } |
531 | else | 532 | else |
532 | item = items[i]; | 533 | item = items[i]; |
533 | 534 | ||
534 | // Update the icons and information | 535 | // Update the icons and information |
535 | #ifdef QWS | 536 | item->setPixmap( 0, Opie::Core::OResource::loadPixmap( i->getStatus() ? "up" : "down", Opie::Core::OResource::SmallIcon ) ); |
536 | QPixmap pic; | ||
537 | pic.convertFromImage( Resource::loadImage( i->getStatus() ? "up": "down" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); | ||
538 | item->setPixmap(0, ( pic )); | ||
539 | #else | ||
540 | item->setPixmap(0, (SmallIcon(i->getStatus() ? "up": "down"))); | ||
541 | #endif | ||
542 | 537 | ||
543 | QString typeName = "lan"; | 538 | QString typeName = "lan"; |
544 | if(i->getInterfaceName() == "lo") | 539 | if(i->getInterfaceName() == "lo") |
545 | typeName = "lo"; | 540 | typeName = "lo"; |
546 | if(i->getInterfaceName().contains("irda")) | 541 | if(i->getInterfaceName().contains("irda")) |
547 | typeName = "irda"; | 542 | typeName = "irda"; |
548 | if(i->getInterfaceName().contains("wlan")) | 543 | if(i->getInterfaceName().contains("wlan")) |
549 | typeName = "wlan"; | 544 | typeName = "wlan"; |
550 | if(i->getInterfaceName().contains("usb")) | 545 | if(i->getInterfaceName().contains("usb")) |
551 | typeName = "usb"; | 546 | typeName = "usb"; |
552 | 547 | ||
553 | if(!i->isAttached()) | 548 | if(!i->isAttached()) |
554 | typeName = "connect_no"; | 549 | typeName = "connect_no"; |
555 | // Actually try to use the Module | 550 | // Actually try to use the Module |
556 | if(i->getModuleOwner() != NULL) | 551 | if(i->getModuleOwner() != NULL) |
557 | typeName = i->getModuleOwner()->getPixmapName(i); | 552 | typeName = i->getModuleOwner()->getPixmapName(i); |
558 | 553 | ||
559 | #ifdef QWS | 554 | item->setPixmap( 1, ( Opie::Core::OResource::loadPixmap( "networksettings/" + typeName, Opie::Core::OResource::SmallIcon ) ) ); |
560 | item->setPixmap(1, (Resource::loadPixmap(QString("networksettings/") + typeName))); | 555 | |
561 | #else | ||
562 | item->setPixmap(1, (SmallIcon(typeName))); | ||
563 | #endif | ||
564 | item->setText(2, i->getHardwareName()); | 556 | item->setText(2, i->getHardwareName()); |
565 | item->setText(3, QString("(%1)").arg(i->getInterfaceName())); | 557 | item->setText(3, QString("(%1)").arg(i->getInterfaceName())); |
566 | item->setText(4, (i->getStatus()) ? i->getIp() : QString("")); | 558 | item->setText(4, (i->getStatus()) ? i->getIp() : QString("")); |
567 | } | 559 | } |
568 | 560 | ||
569 | void MainWindowImp::newProfileChanged(const QString& newText) | 561 | void MainWindowImp::newProfileChanged(const QString& newText) |
570 | { | 562 | { |
571 | if(newText.length() > 0) | 563 | if(newText.length() > 0) |
572 | newProfileButton->setEnabled(true); | 564 | newProfileButton->setEnabled(true); |
573 | else | 565 | else |
574 | newProfileButton->setEnabled(false); | 566 | newProfileButton->setEnabled(false); |
575 | } | 567 | } |
@@ -773,21 +765,21 @@ void MainWindowImp::initHostname() | |||
773 | { | 765 | { |
774 | OProcess h; | 766 | OProcess h; |
775 | _procTemp=""; | 767 | _procTemp=""; |
776 | 768 | ||
777 | h << "hostname"; | 769 | h << "hostname"; |
778 | connect(&h,SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int)),this,SLOT(slotHostname(Opie::Core::OProcess*,char*,int))); | 770 | connect(&h,SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int)),this,SLOT(slotHostname(Opie::Core::OProcess*,char*,int))); |
779 | h.start(OProcess::Block,OProcess::AllOutput); | 771 | h.start(OProcess::Block,OProcess::AllOutput); |
780 | odebug << "Got " << _procTemp <<oendl; | 772 | odebug << "Got " << _procTemp <<oendl; |
781 | m_Nameinput->setText(_procTemp.stripWhiteSpace()); | 773 | m_Nameinput->setText(_procTemp.stripWhiteSpace()); |
782 | _procTemp=""; | 774 | _procTemp=""; |
783 | } | 775 | } |
784 | 776 | ||
785 | void MainWindowImp::slotHostname(Opie::Core::OProcess *proc, char *buffer, int buflen) | 777 | void MainWindowImp::slotHostname(Opie::Core::OProcess */*proc*/, char *buffer, int buflen) |
786 | { | 778 | { |
787 | if (buflen < 1 || buffer==0) return; | 779 | if (buflen < 1 || buffer==0) return; |
788 | char*_t = new char[buflen+1]; | 780 | char*_t = new char[buflen+1]; |
789 | ::memset(_t,0,buflen+1); | 781 | ::memset(_t,0,buflen+1); |
790 | ::memcpy(_t,buffer,buflen); | 782 | ::memcpy(_t,buffer,buflen); |
791 | _procTemp+=_t; | 783 | _procTemp+=_t; |
792 | delete[]_t; | 784 | delete[]_t; |
793 | } | 785 | } |
diff --git a/noncore/settings/networksettings/ppp/edit.cpp b/noncore/settings/networksettings/ppp/edit.cpp index 6c9735c..0abf161 100644 --- a/noncore/settings/networksettings/ppp/edit.cpp +++ b/noncore/settings/networksettings/ppp/edit.cpp | |||
@@ -20,25 +20,27 @@ | |||
20 | * | 20 | * |
21 | * You should have received a copy of the GNU Library General Public | 21 | * You should have received a copy of the GNU Library General Public |
22 | * License along with this program; if not, write to the Free | 22 | * License along with this program; if not, write to the Free |
23 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 23 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
24 | */ | 24 | */ |
25 | 25 | ||
26 | #include "edit.h" | 26 | #include "edit.h" |
27 | #include "pppdata.h" | 27 | #include "pppdata.h" |
28 | #include "iplined.h" | 28 | #include "iplined.h" |
29 | #include "auth.h" | 29 | #include "auth.h" |
30 | 30 | ||
31 | /* OPIE */ | 31 | /* OPIE */ |
32 | #include <qpe/resource.h> | 32 | #include <opie2/oresource.h> |
33 | |||
34 | #include <qpe/applnk.h> | ||
33 | #include <qpe/qpeapplication.h> | 35 | #include <qpe/qpeapplication.h> |
34 | 36 | ||
35 | /* QT */ | 37 | /* QT */ |
36 | #include <qlayout.h> | 38 | #include <qlayout.h> |
37 | #include <qmessagebox.h> | 39 | #include <qmessagebox.h> |
38 | #include <qwhatsthis.h> | 40 | #include <qwhatsthis.h> |
39 | #include <qregexp.h> | 41 | #include <qregexp.h> |
40 | #include <qapplication.h> | 42 | #include <qapplication.h> |
41 | #include <qbuttongroup.h> | 43 | #include <qbuttongroup.h> |
42 | #include <qvgroupbox.h> | 44 | #include <qvgroupbox.h> |
43 | #include <qhbox.h> | 45 | #include <qhbox.h> |
44 | #include <qdialog.h> | 46 | #include <qdialog.h> |
@@ -74,27 +76,29 @@ DialWidget::DialWidget( PPPData *pd, QWidget *parent, bool isnewaccount | |||
74 | 76 | ||
75 | QHBoxLayout *lpn = new QHBoxLayout(5); | 77 | QHBoxLayout *lpn = new QHBoxLayout(5); |
76 | tl->addLayout(lpn, 1, 1); | 78 | tl->addLayout(lpn, 1, 1); |
77 | numbers = new QListBox(this); | 79 | numbers = new QListBox(this); |
78 | // numbers->setMinimumSize(120, 70); | 80 | // numbers->setMinimumSize(120, 70); |
79 | lpn->addWidget(numbers); | 81 | lpn->addWidget(numbers); |
80 | QVBoxLayout *lpn1 = new QVBoxLayout; | 82 | QVBoxLayout *lpn1 = new QVBoxLayout; |
81 | lpn->addLayout(lpn1); | 83 | lpn->addLayout(lpn1); |
82 | add = new QPushButton(tr("&Add..."), this); | 84 | add = new QPushButton(tr("&Add..."), this); |
83 | del = new QPushButton(tr("&Remove"), this); | 85 | del = new QPushButton(tr("&Remove"), this); |
84 | 86 | ||
85 | up = new QPushButton(this); | 87 | up = new QPushButton(this); |
86 | up->setPixmap( Resource::loadPixmap("up") ); | 88 | up->setPixmap( Opie::Core::OResource::loadPixmap("up", Opie::Core::OResource::SmallIcon) ); |
89 | up->setMinimumHeight( AppLnk::smallIconSize()+4 ); | ||
87 | down = new QPushButton(this); | 90 | down = new QPushButton(this); |
88 | down->setPixmap( Resource::loadPixmap("down") ); | 91 | down->setPixmap( Opie::Core::OResource::loadPixmap("down", Opie::Core::OResource::SmallIcon) ); |
92 | down->setMinimumHeight( AppLnk::smallIconSize()+4 ); | ||
89 | lpn1->addWidget(add); | 93 | lpn1->addWidget(add); |
90 | lpn1->addWidget(del); | 94 | lpn1->addWidget(del); |
91 | lpn1->addStretch(1); | 95 | lpn1->addStretch(1); |
92 | lpn1->addWidget(up); | 96 | lpn1->addWidget(up); |
93 | lpn1->addWidget(down); | 97 | lpn1->addWidget(down); |
94 | connect(add, SIGNAL(clicked()), | 98 | connect(add, SIGNAL(clicked()), |
95 | this, SLOT(addNumber())); | 99 | this, SLOT(addNumber())); |
96 | connect(del, SIGNAL(clicked()), | 100 | connect(del, SIGNAL(clicked()), |
97 | this, SLOT(delNumber())); | 101 | this, SLOT(delNumber())); |
98 | connect(up, SIGNAL(clicked()), | 102 | connect(up, SIGNAL(clicked()), |
99 | this, SLOT(upNumber())); | 103 | this, SLOT(upNumber())); |
100 | connect(down, SIGNAL(clicked()), | 104 | connect(down, SIGNAL(clicked()), |
diff --git a/noncore/settings/networksettings/wlan/wlanimp2.cpp b/noncore/settings/networksettings/wlan/wlanimp2.cpp index 2fd97c3..0c18bcc 100644 --- a/noncore/settings/networksettings/wlan/wlanimp2.cpp +++ b/noncore/settings/networksettings/wlan/wlanimp2.cpp | |||
@@ -3,25 +3,25 @@ | |||
3 | #include "interfacesetupimp.h" | 3 | #include "interfacesetupimp.h" |
4 | #include "../interfaces/interface.h" | 4 | #include "../interfaces/interface.h" |
5 | 5 | ||
6 | #include <assert.h> | 6 | #include <assert.h> |
7 | #include <errno.h> | 7 | #include <errno.h> |
8 | #include <string.h> | 8 | #include <string.h> |
9 | 9 | ||
10 | /* OPIE */ | 10 | /* OPIE */ |
11 | #include <opie2/odebug.h> | 11 | #include <opie2/odebug.h> |
12 | #include <opie2/oprocess.h> | 12 | #include <opie2/oprocess.h> |
13 | #include <opie2/onetwork.h> | 13 | #include <opie2/onetwork.h> |
14 | #include <opie2/opcap.h> | 14 | #include <opie2/opcap.h> |
15 | #include <qpe/resource.h> | 15 | #include <opie2/oresource.h> |
16 | using namespace Opie::Core; | 16 | using namespace Opie::Core; |
17 | using namespace Opie::Net; | 17 | using namespace Opie::Net; |
18 | 18 | ||
19 | /* QT */ | 19 | /* QT */ |
20 | #include <qapplication.h> | 20 | #include <qapplication.h> |
21 | #include <qfile.h> | 21 | #include <qfile.h> |
22 | #include <qdir.h> | 22 | #include <qdir.h> |
23 | #include <qdialog.h> | 23 | #include <qdialog.h> |
24 | #include <qtextstream.h> | 24 | #include <qtextstream.h> |
25 | #include <qmessagebox.h> | 25 | #include <qmessagebox.h> |
26 | #include <qlineedit.h> | 26 | #include <qlineedit.h> |
27 | #include <qlabel.h> | 27 | #include <qlabel.h> |
@@ -593,25 +593,25 @@ void WLANImp::displayFoundNetwork( const QString& mode, int channel, const QStri | |||
593 | { | 593 | { |
594 | 594 | ||
595 | odebug << "found network: <" << (const char*) mode << ">, chn " << channel | 595 | odebug << "found network: <" << (const char*) mode << ">, chn " << channel |
596 | << ", ssid '" << (const char*) ssid << "', mac '" << (const char*) mac.toString() << "'" << oendl; | 596 | << ", ssid '" << (const char*) ssid << "', mac '" << (const char*) mac.toString() << "'" << oendl; |
597 | 597 | ||
598 | QListViewItemIterator it( netView ); | 598 | QListViewItemIterator it( netView ); |
599 | while ( it.current() && it.current()->text( col_ssid ) != ssid ) ++it; | 599 | while ( it.current() && it.current()->text( col_ssid ) != ssid ) ++it; |
600 | if ( !it.current() ) // ssid didn't show up yet | 600 | if ( !it.current() ) // ssid didn't show up yet |
601 | { | 601 | { |
602 | QListViewItem* item = new QListViewItem( netView, mode.left( 1 ).upper(), ssid, QString::number( channel ), mac.toString() ); | 602 | QListViewItem* item = new QListViewItem( netView, mode.left( 1 ).upper(), ssid, QString::number( channel ), mac.toString() ); |
603 | QString name; | 603 | QString name; |
604 | name.sprintf( "networksettings/%s", (const char*) mode ); | 604 | name.sprintf( "networksettings/%s", (const char*) mode ); |
605 | item->setPixmap( col_mode, Resource::loadPixmap( name ) ); | 605 | item->setPixmap( col_mode, Opie::Core::OResource::loadPixmap( name, Opie::Core::OResource::SmallIcon ) ); |
606 | qApp->processEvents(); | 606 | qApp->processEvents(); |
607 | } | 607 | } |
608 | 608 | ||
609 | } | 609 | } |
610 | 610 | ||
611 | 611 | ||
612 | void WLANImp::selectNetwork( QListViewItem* item ) | 612 | void WLANImp::selectNetwork( QListViewItem* item ) |
613 | { | 613 | { |
614 | bool ok; | 614 | bool ok; |
615 | if ( item ) | 615 | if ( item ) |
616 | { | 616 | { |
617 | specifyAp->setChecked(true); | 617 | specifyAp->setChecked(true); |