summaryrefslogtreecommitdiff
path: root/noncore/settings
authorkergoth <kergoth>2003-04-09 18:10:11 (UTC)
committer kergoth <kergoth>2003-04-09 18:10:11 (UTC)
commitbacff63f1e4915c683a409e81b18ffcf5aeceda3 (patch) (side-by-side diff)
treea1b898223bd132a29964ec28a89c0756fa9828cf /noncore/settings
parentdc219288ae070e0fe91e2d7da768d620f8b91592 (diff)
downloadopie-bacff63f1e4915c683a409e81b18ffcf5aeceda3.zip
opie-bacff63f1e4915c683a409e81b18ffcf5aeceda3.tar.gz
opie-bacff63f1e4915c683a409e81b18ffcf5aeceda3.tar.bz2
Make networksettings actually compile again. Fix the ifdef on non-kde to actually work, and killed off more references to qt3 widget flags.
Diffstat (limited to 'noncore/settings') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp2
-rw-r--r--noncore/settings/networksettings/mainwindowimp.cpp20
-rw-r--r--noncore/settings/networksettings/mainwindowimp.h4
-rw-r--r--noncore/settings/networksettings/wlan/wlanimp.cpp2
4 files changed, 14 insertions, 14 deletions
diff --git a/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp b/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp
index 15293fd..e00dcce 100644
--- a/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp
+++ b/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp
@@ -1,21 +1,21 @@
#include "interfaceinformationimp.h"
#include "interfaceadvanced.h"
#include <qpushbutton.h>
#include <qlabel.h>
#include <qgroupbox.h>
#include <qmessagebox.h>
-#ifdef QTE_VERSION
+#ifdef QWS
#else
#define showMaximized show
#endif
/**
* Constructor for the InterfaceInformationImp class. This class pretty much
* just display's information about the interface that is passed to it.
*/
InterfaceInformationImp::InterfaceInformationImp(QWidget *parent, const char *name, Interface *i, WFlags f):InterfaceInformation(parent, name, f), interface(i){
connect(i, SIGNAL(updateInterface(Interface *)), this, SLOT(updateInterface(Interface *)));
connect(i, SIGNAL(updateMessage(const QString &)), this, SLOT(showMessage(const QString &)));
updateInterface(interface);
diff --git a/noncore/settings/networksettings/mainwindowimp.cpp b/noncore/settings/networksettings/mainwindowimp.cpp
index d6b708b..581b7e3 100644
--- a/noncore/settings/networksettings/mainwindowimp.cpp
+++ b/noncore/settings/networksettings/mainwindowimp.cpp
@@ -5,30 +5,30 @@
#include "interfaces.h"
#include "module.h"
#include <qpushbutton.h>
#include <qlistbox.h>
#include <qlineedit.h>
#include <qlistview.h>
#include <qheader.h>
#include <qlabel.h>
#include <qmessagebox.h>
-#ifdef QTE_VERSION
+#ifdef QWS
#include <qpe/config.h>
#include <qpe/qlibrary.h>
#include <qpe/resource.h>
#include <qpe/qpeapplication.h>
- #define QLibrary
+// #define QLibrary Library
#else
#include <klibloader.h>
#define QLibrary KLibrary
#include <kconfig.h>
#define Config KConfig
#include <kapplication.h>
#include <kstandarddirs.h>
#include <kiconloader.h>
#define showMaximized show
#endif
#if QT_VERSION < 300
@@ -50,26 +50,26 @@ MainWindowImp::MainWindowImp(QWidget *parent, const char *name) : MainWindow(par
connect(addConnectionButton, SIGNAL(clicked()), this, SLOT(addClicked()));
connect(removeConnectionButton, SIGNAL(clicked()), this, SLOT(removeClicked()));
connect(informationConnectionButton, SIGNAL(clicked()), this, SLOT(informationClicked()));
connect(configureConnectionButton, SIGNAL(clicked()), this, SLOT(configureClicked()));
connect(newProfileButton, SIGNAL(clicked()), this, SLOT(addProfile()));
connect(removeProfileButton, SIGNAL(clicked()), this, SLOT(removeProfile()));
connect(setCurrentProfileButton, SIGNAL(clicked()), this, SLOT(changeProfile()));
connect(newProfile, SIGNAL(textChanged(const QString&)), this, SLOT(newProfileChanged(const QString&)));
// Load connections.
// /usr/local/kde/lib/libinterfaces.la
-#ifdef QTE_VERSION
- loadModules(QPEApplication::kdeDir() + "/plugins/networksettings");
+#ifdef QWS
+ loadModules(QPEApplication::qpeDir() + "/plugins/networksettings");
#else
loader = KLibLoader::self();
loadModules(QString("/usr/")+KStandardDirs::kde_default("lib"));
#endif
getAllInterfaces();
Interfaces i;
QStringList list = i.getInterfaceList();
QMap<QString, Interface*>::Iterator it;
for ( QStringList::Iterator ni = list.begin(); ni != list.end(); ++ni ) {
bool found = false;
for( it = interfaceNames.begin(); it != interfaceNames.end(); ++it ){
@@ -121,25 +121,25 @@ MainWindowImp::~MainWindowImp(){
// Save profiles.
Config cfg("NetworkSetup");
cfg.setGroup("General");
cfg.writeEntry("Profiles", profiles.join(" "));
// Delete all interfaces that don't have owners.
QMap<Interface*, QListViewItem*>::Iterator iIt;
for( iIt = items.begin(); iIt != items.end(); ++iIt ){
if(iIt.key()->getModuleOwner() == NULL)
delete iIt.key();
}
-#ifdef QTE_VERSION
+#ifdef QWS
// Delete Modules and Libraries
QMap<Module*, QLibrary*>::Iterator it;
for( it = libraries.begin(); it != libraries.end(); ++it ){
delete it.key();
// I wonder why I can't delete the libraries
// What fucking shit this is.
//delete it.data();
}
#else
// klibloader automaticly deletes the libraries for us...
#endif
}
@@ -237,25 +237,25 @@ void MainWindowImp::loadModules(const QString &path){
}
/**
* Attempt to load a function and resolve a function.
* @param pluginFileName - the name of the file in which to attempt to load
* @param resolveString - function pointer to resolve
* @return pointer to the function with name resolveString or NULL
*/
Module* MainWindowImp::loadPlugin(const QString &pluginFileName, const QString &resolveString){
#ifdef DEBUG
qDebug("MainWindowImp::loadPlugin: %s", pluginFileName.latin1());
#endif
-#ifdef QTE_VERSION
+#ifdef QWS
QLibrary *lib = new QLibrary(pluginFileName);
void *functionPointer = lib->resolve(resolveString);
if( !functionPointer ){
#ifdef DEBUG
qDebug("MainWindowImp::loadPlugin: File: %s is not a plugin, but though was.", pluginFileName.latin1());
#endif
delete lib;
return NULL;
}
// Try to get an object.
Module *object = ((Module* (*)()) functionPointer)();
if(object == NULL){
@@ -373,25 +373,25 @@ void MainWindowImp::configureClicked(){
return;
}
Interface *i = interfaceItems[item];
if(i->getModuleOwner()){
QWidget *moduleConfigure = i->getModuleOwner()->configure(i);
if(moduleConfigure != NULL){
moduleConfigure->showMaximized();
return;
}
}
- InterfaceSetupImpDialog *configure = new InterfaceSetupImpDialog(this, "InterfaceSetupImp", i, true, Qt::WShowModal | Qt::WDestructiveClose | Qt::WType_Dialog);
+ InterfaceSetupImpDialog *configure = new InterfaceSetupImpDialog(this, "InterfaceSetupImp", i, true, Qt::WType_Modal | Qt::WDestructiveClose | Qt::WStyle_Dialog);
QString currentProfileText = currentProfileLabel->text();
if(currentProfileText.upper() == "ALL");
currentProfileText = "";
configure->setProfile(currentProfileText);
configure->showMaximized();
}
/**
* Pull up the information about the currently selected interface.
* Report an error if no interface is selected.
* If the interface has a module owner then request its configure.
*/
@@ -409,25 +409,25 @@ void MainWindowImp::informationClicked(){
}
if(i->getModuleOwner()){
QWidget *moduleInformation = i->getModuleOwner()->information(i);
if(moduleInformation != NULL){
moduleInformation->showMaximized();
#ifdef DEBUG
qDebug("MainWindowImp::informationClicked:: Module owner has created, we showed.");
#endif
return;
}
}
- InterfaceInformationImp *information = new InterfaceInformationImp(this, "InterfaceSetupImp", i, Qt::WShowModal | Qt::WDestructiveClose | Qt::WType_Dialog);
+ InterfaceInformationImp *information = new InterfaceInformationImp(this, "InterfaceSetupImp", i, Qt::WType_Modal | Qt::WDestructiveClose | Qt::WStyle_Dialog);
information->showMaximized();
}
/**
* Update this interface. If no QListViewItem exists create one.
* @param Interface* pointer to the interface that needs to be updated.
*/
void MainWindowImp::updateInterface(Interface *i){
if(!advancedUserMode){
if(i->getInterfaceName() == "lo")
return;
}
@@ -441,47 +441,47 @@ void MainWindowImp::updateInterface(Interface *i){
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 QTE_VERSION
+#ifdef QWS
item->setPixmap(0, (Resource::loadPixmap(i->getStatus() ? "up": "down")));
#else
item->setPixmap(0, (SmallIcon(i->getStatus() ? "up": "down")));
#endif
QString typeName = "lan";
if(i->getHardwareName().contains("Local Loopback"))
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 QTE_VERSION
+#ifdef QWS
item->setPixmap(1, (Resource::loadPixmap(QString("networksettings/") + typeName)));
#else
item->setPixmap(1, (SmallIcon(typeName)));
#endif
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);
diff --git a/noncore/settings/networksettings/mainwindowimp.h b/noncore/settings/networksettings/mainwindowimp.h
index 2ebf304..49f3eea 100644
--- a/noncore/settings/networksettings/mainwindowimp.h
+++ b/noncore/settings/networksettings/mainwindowimp.h
@@ -1,24 +1,24 @@
#ifndef MAINWINOWIMP_H
#define MAINWINOWIMP_H
#include "mainwindow.h"
#include <qmap.h>
#include <qstringlist.h>
class Module;
class Interface;
class QLibrary;
class KProcess;
-#ifdef QTE_VERSION
+#ifdef QWS
class QLibrary;
#else
class KLibrary;
class KLibLoader;
#define QLibrary KLibrary
#endif
class MainWindowImp : public MainWindow {
Q_OBJECT
public:
@@ -49,21 +49,21 @@ private:
// For our local list of names
QMap<QString, Interface*> interfaceNames;
QMap<Module*, QLibrary*> libraries;
QMap<Interface*, QListViewItem*> items;
QMap<QListViewItem*, Interface*> interfaceItems;
QMap<KProcess*, QString> threads;
QStringList profiles;
bool advancedUserMode;
QString scheme;
-#ifndef QTE_VERSION
+#ifndef QWS
KLibLoader *loader;
#endif
};
#endif
// mainwindowimp.h
diff --git a/noncore/settings/networksettings/wlan/wlanimp.cpp b/noncore/settings/networksettings/wlan/wlanimp.cpp
index 57266bb..8bf004f 100644
--- a/noncore/settings/networksettings/wlan/wlanimp.cpp
+++ b/noncore/settings/networksettings/wlan/wlanimp.cpp
@@ -4,25 +4,25 @@
#include <qfile.h>
#include <qdir.h>
#include <qtextstream.h>
#include <qmessagebox.h>
#include <qlineedit.h>
#include <qlabel.h>
#include <qspinbox.h>
#include <qradiobutton.h>
#include <qcheckbox.h>
#include <qtabwidget.h>
#include <qcombobox.h>
-#ifdef QTE_VERSION
+#ifdef QWS
#include <opie/oprocess.h>
#else
#define OProcess KProcess
#include <kprocess.h>
#endif
#define WIRELESS_OPTS "/etc/pcmcia/wireless.opts"
/**
* Constructor, read in the wireless.opts file for parsing later.
*/
WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, WFlags fl):WLAN(parent, name, modal, fl), currentProfile("*") {