5 files changed, 9 insertions, 19 deletions
diff --git a/noncore/settings/networksettings/main.cpp b/noncore/settings/networksettings/main.cpp index 1b74d62..5d275ac 100644 --- a/noncore/settings/networksettings/main.cpp +++ b/noncore/settings/networksettings/main.cpp | |||
@@ -1,13 +1,6 @@ | |||
1 | #include "mainwindowimp.h" | 1 | #include "mainwindowimp.h" |
2 | #include <qpe/qpeapplication.h> | 2 | #include <opie/oapplicationfactory.h> |
3 | 3 | ||
4 | int main(int argc, char **argv) | 4 | OPIE_EXPORT_APP( OApplicationFactory<MainWindowImp> ) |
5 | { | ||
6 | QPEApplication app(argc, argv); | ||
7 | MainWindowImp window; | ||
8 | app.showMainWidget(&window); | ||
9 | return app.exec(); | ||
10 | } | ||
11 | 5 | ||
12 | // main.cpp | ||
13 | 6 | ||
diff --git a/noncore/settings/networksettings/mainwindowimp.cpp b/noncore/settings/networksettings/mainwindowimp.cpp index f74cf87..d9752ce 100644 --- a/noncore/settings/networksettings/mainwindowimp.cpp +++ b/noncore/settings/networksettings/mainwindowimp.cpp | |||
@@ -21,65 +21,65 @@ | |||
21 | #include <qpe/config.h> | 21 | #include <qpe/config.h> |
22 | #include <qpe/qlibrary.h> | 22 | #include <qpe/qlibrary.h> |
23 | #include <qpe/resource.h> | 23 | #include <qpe/resource.h> |
24 | #include <qpe/qpeapplication.h> | 24 | #include <qpe/qpeapplication.h> |
25 | #else | 25 | #else |
26 | #include <klibloader.h> | 26 | #include <klibloader.h> |
27 | #define QLibrary KLibrary | 27 | #define QLibrary KLibrary |
28 | #include <kconfig.h> | 28 | #include <kconfig.h> |
29 | #define Config KConfig | 29 | #define Config KConfig |
30 | #include <kapplication.h> | 30 | #include <kapplication.h> |
31 | #include <kstandarddirs.h> | 31 | #include <kstandarddirs.h> |
32 | #include <kiconloader.h> | 32 | #include <kiconloader.h> |
33 | #define showMaximized show | 33 | #define showMaximized show |
34 | #endif | 34 | #endif |
35 | 35 | ||
36 | #if QT_VERSION < 300 | 36 | #if QT_VERSION < 300 |
37 | #include <qlist.h> | 37 | #include <qlist.h> |
38 | #else | 38 | #else |
39 | #include <qptrlist.h> | 39 | #include <qptrlist.h> |
40 | #endif | 40 | #endif |
41 | #include <qdir.h> | 41 | #include <qdir.h> |
42 | #include <qfile.h> | 42 | #include <qfile.h> |
43 | #include <qtextstream.h> | 43 | #include <qtextstream.h> |
44 | #include <qregexp.h> | 44 | #include <qregexp.h> |
45 | 45 | ||
46 | #include <net/if.h> | 46 | #include <net/if.h> |
47 | #include <sys/ioctl.h> | 47 | #include <sys/ioctl.h> |
48 | #include <sys/socket.h> | 48 | #include <sys/socket.h> |
49 | 49 | ||
50 | #define DEFAULT_SCHEME "/var/lib/pcmcia/scheme" | 50 | #define DEFAULT_SCHEME "/var/lib/pcmcia/scheme" |
51 | #define _PROCNETDEV "/proc/net/dev" | 51 | #define _PROCNETDEV "/proc/net/dev" |
52 | 52 | ||
53 | MainWindowImp::MainWindowImp(QWidget *parent, const char *name) : MainWindow(parent, name, Qt::WStyle_ContextHelp), advancedUserMode(true), scheme(DEFAULT_SCHEME){ | 53 | MainWindowImp::MainWindowImp(QWidget *parent, const char *name, WFlags) : MainWindow(parent, name, Qt::WStyle_ContextHelp), advancedUserMode(true), scheme(DEFAULT_SCHEME){ |
54 | connect(addConnectionButton, SIGNAL(clicked()), this, SLOT(addClicked())); | 54 | connect(addConnectionButton, SIGNAL(clicked()), this, SLOT(addClicked())); |
55 | connect(removeConnectionButton, SIGNAL(clicked()), this, SLOT(removeClicked())); | 55 | connect(removeConnectionButton, SIGNAL(clicked()), this, SLOT(removeClicked())); |
56 | connect(informationConnectionButton, SIGNAL(clicked()), this, SLOT(informationClicked())); | 56 | connect(informationConnectionButton, SIGNAL(clicked()), this, SLOT(informationClicked())); |
57 | connect(configureConnectionButton, SIGNAL(clicked()), this, SLOT(configureClicked())); | 57 | connect(configureConnectionButton, SIGNAL(clicked()), this, SLOT(configureClicked())); |
58 | 58 | ||
59 | connect(newProfileButton, SIGNAL(clicked()), this, SLOT(addProfile())); | 59 | connect(newProfileButton, SIGNAL(clicked()), this, SLOT(addProfile())); |
60 | connect(removeProfileButton, SIGNAL(clicked()), this, SLOT(removeProfile())); | 60 | connect(removeProfileButton, SIGNAL(clicked()), this, SLOT(removeProfile())); |
61 | connect(setCurrentProfileButton, SIGNAL(clicked()), this, SLOT(changeProfile())); | 61 | connect(setCurrentProfileButton, SIGNAL(clicked()), this, SLOT(changeProfile())); |
62 | 62 | ||
63 | connect(newProfile, SIGNAL(textChanged(const QString&)), this, SLOT(newProfileChanged(const QString&))); | 63 | connect(newProfile, SIGNAL(textChanged(const QString&)), this, SLOT(newProfileChanged(const QString&))); |
64 | 64 | ||
65 | //FIXME: disable profiles for the moment: | 65 | //FIXME: disable profiles for the moment: |
66 | tabWidget->setTabEnabled( tab, false ); | 66 | tabWidget->setTabEnabled( tab, false ); |
67 | 67 | ||
68 | // Load connections. | 68 | // Load connections. |
69 | // /usr/local/kde/lib/libinterfaces.la | 69 | // /usr/local/kde/lib/libinterfaces.la |
70 | #ifdef QWS | 70 | #ifdef QWS |
71 | loadModules(QPEApplication::qpeDir() + "plugins/networksettings"); | 71 | loadModules(QPEApplication::qpeDir() + "plugins/networksettings"); |
72 | #else | 72 | #else |
73 | loader = KLibLoader::self(); | 73 | loader = KLibLoader::self(); |
74 | loadModules(QString("/usr/")+KStandardDirs::kde_default("lib")); | 74 | loadModules(QString("/usr/")+KStandardDirs::kde_default("lib")); |
75 | #endif | 75 | #endif |
76 | getAllInterfaces(); | 76 | getAllInterfaces(); |
77 | 77 | ||
78 | Interfaces i; | 78 | Interfaces i; |
79 | QStringList list = i.getInterfaceList(); | 79 | QStringList list = i.getInterfaceList(); |
80 | QMap<QString, Interface*>::Iterator it; | 80 | QMap<QString, Interface*>::Iterator it; |
81 | for ( QStringList::Iterator ni = list.begin(); ni != list.end(); ++ni ) { | 81 | for ( QStringList::Iterator ni = list.begin(); ni != list.end(); ++ni ) { |
82 | /* | 82 | /* |
83 | * we skipped it in getAllInterfaces now | 83 | * we skipped it in getAllInterfaces now |
84 | * we need to ignore it as well | 84 | * we need to ignore it as well |
85 | */ | 85 | */ |
diff --git a/noncore/settings/networksettings/mainwindowimp.h b/noncore/settings/networksettings/mainwindowimp.h index 451835b..f211d6e 100644 --- a/noncore/settings/networksettings/mainwindowimp.h +++ b/noncore/settings/networksettings/mainwindowimp.h | |||
@@ -1,58 +1,59 @@ | |||
1 | #ifndef MAINWINOWIMP_H | 1 | #ifndef MAINWINOWIMP_H |
2 | #define MAINWINOWIMP_H | 2 | #define MAINWINOWIMP_H |
3 | 3 | ||
4 | #include "mainwindow.h" | 4 | #include "mainwindow.h" |
5 | #include <qmap.h> | 5 | #include <qmap.h> |
6 | #include <qstringlist.h> | 6 | #include <qstringlist.h> |
7 | 7 | ||
8 | class Module; | 8 | class Module; |
9 | class Interface; | 9 | class Interface; |
10 | class QLibrary; | 10 | class QLibrary; |
11 | class KProcess; | 11 | class KProcess; |
12 | class QCopChannel; | 12 | class QCopChannel; |
13 | #ifdef QWS | 13 | #ifdef QWS |
14 | class QLibrary; | 14 | class QLibrary; |
15 | #else | 15 | #else |
16 | class KLibrary; | 16 | class KLibrary; |
17 | class KLibLoader; | 17 | class KLibLoader; |
18 | #define QLibrary KLibrary | 18 | #define QLibrary KLibrary |
19 | #endif | 19 | #endif |
20 | 20 | ||
21 | 21 | ||
22 | class MainWindowImp : public MainWindow { | 22 | class MainWindowImp : public MainWindow { |
23 | Q_OBJECT | 23 | Q_OBJECT |
24 | 24 | ||
25 | public: | 25 | public: |
26 | MainWindowImp(QWidget *parent=0, const char *name=0); | 26 | static QString appName() { return QString::fromLatin1("networksettings"); } |
27 | MainWindowImp(QWidget *parent=0, const char *name=0, WFlags fl = 0); | ||
27 | ~MainWindowImp(); | 28 | ~MainWindowImp(); |
28 | 29 | ||
29 | QCopChannel *channel; | 30 | QCopChannel *channel; |
30 | 31 | ||
31 | private slots: | 32 | private slots: |
32 | void getAllInterfaces(); | 33 | void getAllInterfaces(); |
33 | 34 | ||
34 | void addClicked(); | 35 | void addClicked(); |
35 | void removeClicked(); | 36 | void removeClicked(); |
36 | void configureClicked(); | 37 | void configureClicked(); |
37 | void informationClicked(); | 38 | void informationClicked(); |
38 | 39 | ||
39 | void addProfile(); | 40 | void addProfile(); |
40 | void removeProfile(); | 41 | void removeProfile(); |
41 | void changeProfile(); | 42 | void changeProfile(); |
42 | 43 | ||
43 | void updateInterface(Interface *i); | 44 | void updateInterface(Interface *i); |
44 | void newProfileChanged(const QString& newText); | 45 | void newProfileChanged(const QString& newText); |
45 | 46 | ||
46 | void receive (const QCString &, const QByteArray &); | 47 | void receive (const QCString &, const QByteArray &); |
47 | 48 | ||
48 | private: | 49 | private: |
49 | void makeChannel(); | 50 | void makeChannel(); |
50 | void loadModules(const QString &path); | 51 | void loadModules(const QString &path); |
51 | 52 | ||
52 | Module* loadPlugin(const QString &pluginFileName, | 53 | Module* loadPlugin(const QString &pluginFileName, |
53 | const QString &resolveString = "create_plugin"); | 54 | const QString &resolveString = "create_plugin"); |
54 | 55 | ||
55 | // For our local list of names | 56 | // For our local list of names |
56 | QMap<QString, Interface*> interfaceNames; | 57 | QMap<QString, Interface*> interfaceNames; |
57 | 58 | ||
58 | QMap<Module*, QLibrary*> libraries; | 59 | QMap<Module*, QLibrary*> libraries; |
diff --git a/noncore/settings/networksettings/networksettings.pro b/noncore/settings/networksettings/networksettings.pro index cdd133a..e8dbe5b 100644 --- a/noncore/settings/networksettings/networksettings.pro +++ b/noncore/settings/networksettings/networksettings.pro | |||
@@ -1,16 +1,12 @@ | |||
1 | DESTDIR = $(OPIEDIR)/bin | 1 | CONFIG = qt warn_on debug quick-app |
2 | TEMPLATE = app | ||
3 | # | ||
4 | CONFIG = qt warn_on debug | ||
5 | #CONFIG = qt warn_on release | ||
6 | HEADERS = mainwindowimp.h addconnectionimp.h defaultmodule.h module.h | 2 | HEADERS = mainwindowimp.h addconnectionimp.h defaultmodule.h module.h |
7 | SOURCES = main.cpp mainwindowimp.cpp addconnectionimp.cpp | 3 | SOURCES = main.cpp mainwindowimp.cpp addconnectionimp.cpp |
8 | INCLUDEPATH += $(OPIEDIR)/include interfaces/ | 4 | INCLUDEPATH += $(OPIEDIR)/include interfaces/ |
9 | DEPENDPATH += $(OPIEDIR)/include interfaces/ wlan/ | 5 | DEPENDPATH += $(OPIEDIR)/include interfaces/ wlan/ ppp/ |
10 | LIBS += -lqpe -L$(OPIEDIR)/plugins/networksettings -Linterfaces/ -linterfaces -lopie | 6 | LIBS += -lqpe -L$(OPIEDIR)/plugins/networksettings -Linterfaces/ -linterfaces -lopie -lopiecore2 -lopienet2 |
11 | INTERFACES = mainwindow.ui addconnection.ui | 7 | INTERFACES = mainwindow.ui addconnection.ui |
12 | TARGET = networksettings | 8 | TARGET = networksettings |
13 | 9 | ||
14 | 10 | ||
15 | 11 | ||
16 | include ( $(OPIEDIR)/include.pro ) | 12 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/noncore/settings/networksettings/opie-networksettings.control b/noncore/settings/networksettings/opie-networksettings.control index 82aac2a..08a79c6 100644 --- a/noncore/settings/networksettings/opie-networksettings.control +++ b/noncore/settings/networksettings/opie-networksettings.control | |||
@@ -1,10 +1,10 @@ | |||
1 | Package: opie-networksettings | 1 | Package: opie-networksettings |
2 | Files: plugins/application/libnetworksettings.so* bin/networksettings apps/Settings/networksettings.desktop pics/networksettings/* pics/Network/PPPConnect.png $OPIEDIR/lib/libinterfaces.so* root/usr/bin/changedns bin/getprofile | 2 | Files: plugins/application/libnetworksettings.so* bin/networksettings apps/Settings/networksettings.desktop pics/networksettings/* pics/Network/PPPConnect.png $OPIEDIR/lib/libinterfaces.so* root/usr/bin/changedns bin/getprofile |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/settings | 4 | Section: opie/settings |
5 | Maintainer: Patrick S. Vogt <tille@handhelds.org> | 5 | Maintainer: Patrick S. Vogt <tille@handhelds.org> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Depends: task-opie-minimal | 7 | Depends: task-opie-minimal, libopiecore2, libopienet2 |
8 | Description: Network settings. | 8 | Description: Network settings. |
9 | Replaces: opie-networksetup | 9 | Replaces: opie-networksetup |
10 | Version: $QPE_VERSION$EXTRAVERSION | 10 | Version: $QPE_VERSION$EXTRAVERSION |