summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings
Side-by-side diff
Diffstat (limited to 'noncore/settings/networksettings') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/mainwindow/mainwindowimp.cpp20
-rw-r--r--noncore/settings/networksettings/ppp/edit.cpp10
-rw-r--r--noncore/settings/networksettings/wlan/wlanimp2.cpp4
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,41 +1,42 @@
#include "mainwindowimp.h"
#include "addconnectionimp.h"
#include "interfaceinformationimp.h"
#include "interfacesetupimp.h"
#include "interfaces.h"
#include "module.h"
/* OPIE */
#include <opie2/odebug.h>
#include <opie2/oprocess.h>
+#include <opie2/oresource.h>
+
#include <qpe/applnk.h>
#include <qpe/qcopenvelope_qws.h>
#include <qpe/qpeapplication.h>
#include <qpe/config.h>
#include <qpe/qlibrary.h>
-#include <qpe/resource.h>
/* QT */
#include <qpushbutton.h>
#include <qlistbox.h>
#include <qlineedit.h>
#include <qlistview.h>
#include <qheader.h>
#include <qlabel.h>
#include <qtabwidget.h> // in order to disable the profiles tab
#include <qmessagebox.h>
#include <qtextstream.h>
#include <qregexp.h>
#if QT_VERSION < 0x030000
#include <qlist.h>
#else
#include <qptrlist.h>
#endif
#include <qdir.h>
#include <qfile.h>
#include <qtextstream.h>
#include <qregexp.h>
@@ -511,77 +512,68 @@ void MainWindowImp::updateInterface(Interface *i)
if(i->getInterfaceName() == "lo")
return;
}
QListViewItem *item = NULL;
// Find the interface, making it if needed.
if(items.find(i) == items.end())
{
item = new QListViewItem(connectionList, "", "", "");
// See if you can't find a module owner for this interface
QMap<Module*, QLibrary*>::Iterator it;
for( it = libraries.begin(); it != libraries.end(); ++it )
{
if(it.key()->isOwner(i))
i->setModuleOwner(it.key());
}
items.insert(i, item);
interfaceItems.insert(item, i);
}
else
item = items[i];
// Update the icons and information
-#ifdef QWS
- QPixmap pic;
- pic.convertFromImage( Resource::loadImage( i->getStatus() ? "up": "down" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) );
- item->setPixmap(0, ( pic ));
-#else
- item->setPixmap(0, (SmallIcon(i->getStatus() ? "up": "down")));
-#endif
+ item->setPixmap( 0, Opie::Core::OResource::loadPixmap( i->getStatus() ? "up" : "down", Opie::Core::OResource::SmallIcon ) );
QString typeName = "lan";
if(i->getInterfaceName() == "lo")
typeName = "lo";
if(i->getInterfaceName().contains("irda"))
typeName = "irda";
if(i->getInterfaceName().contains("wlan"))
typeName = "wlan";
if(i->getInterfaceName().contains("usb"))
typeName = "usb";
if(!i->isAttached())
typeName = "connect_no";
// Actually try to use the Module
if(i->getModuleOwner() != NULL)
typeName = i->getModuleOwner()->getPixmapName(i);
-#ifdef QWS
- item->setPixmap(1, (Resource::loadPixmap(QString("networksettings/") + typeName)));
-#else
- item->setPixmap(1, (SmallIcon(typeName)));
-#endif
+ item->setPixmap( 1, ( Opie::Core::OResource::loadPixmap( "networksettings/" + typeName, Opie::Core::OResource::SmallIcon ) ) );
+
item->setText(2, i->getHardwareName());
item->setText(3, QString("(%1)").arg(i->getInterfaceName()));
item->setText(4, (i->getStatus()) ? i->getIp() : QString(""));
}
void MainWindowImp::newProfileChanged(const QString& newText)
{
if(newText.length() > 0)
newProfileButton->setEnabled(true);
else
newProfileButton->setEnabled(false);
}
/**
* Adds a new profile to the list of profiles.
* Don't add profiles that already exists.
* Appends to the list and QStringList
*/
void MainWindowImp::addProfile()
{
QString newProfileName = newProfile->text();
if(profiles.grep(newProfileName).count() > 0)
{
QMessageBox::information(this, "Can't Add","Profile already exists.", QMessageBox::Ok);
@@ -761,33 +753,33 @@ void MainWindowImp::setHostname()
f.close();
f.setName(_IRDANAME);
if (f.open(IO_WriteOnly))
{
QTextStream s(&f);
s << m_Nameinput->text();
} else {
QMessageBox::critical(0, tr("Sorry"), tr("Could not set infrared name."));
}
}
void MainWindowImp::initHostname()
{
OProcess h;
_procTemp="";
h << "hostname";
connect(&h,SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int)),this,SLOT(slotHostname(Opie::Core::OProcess*,char*,int)));
h.start(OProcess::Block,OProcess::AllOutput);
odebug << "Got " << _procTemp <<oendl;
m_Nameinput->setText(_procTemp.stripWhiteSpace());
_procTemp="";
}
-void MainWindowImp::slotHostname(Opie::Core::OProcess *proc, char *buffer, int buflen)
+void MainWindowImp::slotHostname(Opie::Core::OProcess */*proc*/, char *buffer, int buflen)
{
if (buflen < 1 || buffer==0) return;
char*_t = new char[buflen+1];
::memset(_t,0,buflen+1);
::memcpy(_t,buffer,buflen);
_procTemp+=_t;
delete[]_t;
}
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
@@ -8,49 +8,51 @@
* based on EzPPP:
* Copyright (C) 1997 Jay Painter
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "edit.h"
#include "pppdata.h"
#include "iplined.h"
#include "auth.h"
/* OPIE */
-#include <qpe/resource.h>
+#include <opie2/oresource.h>
+
+#include <qpe/applnk.h>
#include <qpe/qpeapplication.h>
/* QT */
#include <qlayout.h>
#include <qmessagebox.h>
#include <qwhatsthis.h>
#include <qregexp.h>
#include <qapplication.h>
#include <qbuttongroup.h>
#include <qvgroupbox.h>
#include <qhbox.h>
#include <qdialog.h>
/* STD */
#include <string.h>
#include <termios.h>
DialWidget::DialWidget( PPPData *pd, QWidget *parent, bool isnewaccount
, const char *name )
: QWidget(parent, name), _pppdata(pd)
{
const int GRIDROWS = 6;
@@ -62,51 +64,53 @@ DialWidget::DialWidget( PPPData *pd, QWidget *parent, bool isnewaccount
connectname_l = new QLineEdit(this);
// connectname_l->setMaxLength(ACCNAME_SIZE);
tl->addWidget(connectname_l, 0, 1);
QString tmp = tr("Type in a unique name for this connection");
QWhatsThis::add(connect_label,tmp);
QWhatsThis::add(connectname_l,tmp);
number_label = new QLabel(tr("Phone number:"), this);
number_label->setAlignment(AlignTop|AlignLeft);
tl->addWidget(number_label, 1, 0);
QHBoxLayout *lpn = new QHBoxLayout(5);
tl->addLayout(lpn, 1, 1);
numbers = new QListBox(this);
// numbers->setMinimumSize(120, 70);
lpn->addWidget(numbers);
QVBoxLayout *lpn1 = new QVBoxLayout;
lpn->addLayout(lpn1);
add = new QPushButton(tr("&Add..."), this);
del = new QPushButton(tr("&Remove"), this);
up = new QPushButton(this);
- up->setPixmap( Resource::loadPixmap("up") );
+ up->setPixmap( Opie::Core::OResource::loadPixmap("up", Opie::Core::OResource::SmallIcon) );
+ up->setMinimumHeight( AppLnk::smallIconSize()+4 );
down = new QPushButton(this);
- down->setPixmap( Resource::loadPixmap("down") );
+ down->setPixmap( Opie::Core::OResource::loadPixmap("down", Opie::Core::OResource::SmallIcon) );
+ down->setMinimumHeight( AppLnk::smallIconSize()+4 );
lpn1->addWidget(add);
lpn1->addWidget(del);
lpn1->addStretch(1);
lpn1->addWidget(up);
lpn1->addWidget(down);
connect(add, SIGNAL(clicked()),
this, SLOT(addNumber()));
connect(del, SIGNAL(clicked()),
this, SLOT(delNumber()));
connect(up, SIGNAL(clicked()),
this, SLOT(upNumber()));
connect(down, SIGNAL(clicked()),
this, SLOT(downNumber()));
connect(numbers, SIGNAL(highlighted(int)),
this, SLOT(selectionChanged(int)));
numbersChanged();
tmp = tr("<p>Specifies the phone numbers to dial. You\n"
"can supply multiple numbers here, simply\n"
"click on \"Add\". You can arrange the\n"
"order the numbers are tried by using the\n"
"arrow buttons.\n\n"
"When a number is busy or fails, <i>kppp</i> will \n"
"try the next number and so on");
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
@@ -1,39 +1,39 @@
#include "wlanimp2.h"
#include "keyedit.h"
#include "interfacesetupimp.h"
#include "../interfaces/interface.h"
#include <assert.h>
#include <errno.h>
#include <string.h>
/* OPIE */
#include <opie2/odebug.h>
#include <opie2/oprocess.h>
#include <opie2/onetwork.h>
#include <opie2/opcap.h>
-#include <qpe/resource.h>
+#include <opie2/oresource.h>
using namespace Opie::Core;
using namespace Opie::Net;
/* QT */
#include <qapplication.h>
#include <qfile.h>
#include <qdir.h>
#include <qdialog.h>
#include <qtextstream.h>
#include <qmessagebox.h>
#include <qlineedit.h>
#include <qlabel.h>
#include <qspinbox.h>
#include <qradiobutton.h>
#include <qpushbutton.h>
#include <qcheckbox.h>
#include <qtabwidget.h>
#include <qcombobox.h>
#include <qlistview.h>
#include <qvbox.h>
#include <qprogressbar.h>
/* STD */
#include <assert.h>
@@ -581,47 +581,47 @@ void WLANImp::handlePacket( OPacket* p )
OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) );
QString essid = ssid ? ssid->ID() : QString("<unknown>");
OWaveLanManagementDS* ds = static_cast<OWaveLanManagementDS*>( p->child( "802.11 DS" ) );
int channel = ds ? ds->channel() : -1;
OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) );
displayFoundNetwork( type, channel, essid, header->macAddress2() );
}
}
void WLANImp::displayFoundNetwork( const QString& mode, int channel, const QString& ssid, const OMacAddress& mac )
{
odebug << "found network: <" << (const char*) mode << ">, chn " << channel
<< ", ssid '" << (const char*) ssid << "', mac '" << (const char*) mac.toString() << "'" << oendl;
QListViewItemIterator it( netView );
while ( it.current() && it.current()->text( col_ssid ) != ssid ) ++it;
if ( !it.current() ) // ssid didn't show up yet
{
QListViewItem* item = new QListViewItem( netView, mode.left( 1 ).upper(), ssid, QString::number( channel ), mac.toString() );
QString name;
name.sprintf( "networksettings/%s", (const char*) mode );
- item->setPixmap( col_mode, Resource::loadPixmap( name ) );
+ item->setPixmap( col_mode, Opie::Core::OResource::loadPixmap( name, Opie::Core::OResource::SmallIcon ) );
qApp->processEvents();
}
}
void WLANImp::selectNetwork( QListViewItem* item )
{
bool ok;
if ( item )
{
specifyAp->setChecked(true);
macEdit->setText( item->text( col_mac ) );
specifyChan->setChecked( item->text( col_mode ) == "A" );
networkChannel->setValue( item->text( col_chn ).toInt( &ok ) );
essid->setEditText( item->text( col_ssid ) );
if ( item->text( col_mode ) == "A" )
mode->setCurrentItem( 3 );
else
mode->setCurrentItem( 2 );
}
}