Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

MainWindowImp Class Reference

#include </home/clem/local/src/opie/noncore/settings/networksettings/mainwindow/mainwindowimp.h>

Inheritance diagram for MainWindowImp:

Inheritance graph
[legend]
Collaboration diagram for MainWindowImp:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 MainWindowImp (QWidget *parent=0, const char *name=0, WFlags fl=0)
 ~MainWindowImp ()

Static Public Member Functions

static QString appName ()

Public Attributes

QCopChannelchannel

Protected Slots

virtual void setHostname ()
virtual void slotHostname (Opie::Core::OProcess *proc, char *buffer, int buflen)

Private Slots

void getAllInterfaces ()
void addClicked ()
void removeClicked ()
void configureClicked ()
void informationClicked ()
void addProfile ()
void removeProfile ()
void changeProfile ()
void updateInterface (Interface *i)
void newProfileChanged (const QString &newText)
void receive (const QCString &, const QByteArray &)

Private Member Functions

void makeChannel ()
void loadModules (const QString &path)
void initHostname ()
ModuleloadPlugin (const QString &pluginFileName, const QString &resolveString="create_plugin")

Private Attributes

QMap< QString, Interface * > interfaceNames
QMap< Module *, QLibrary * > libraries
QMap< Interface *, QListViewItem * > items
QMap< QListViewItem *, Interface * > interfaceItems
QStringList m_handledIfaces
QMap< KProcess *, QStringthreads
QStringList profiles
bool advancedUserMode
QString scheme
QString _procTemp
KLibLoader * loader

Constructor & Destructor Documentation

MainWindowImp::MainWindowImp QWidget *  parent = 0,
const char *  name = 0,
WFlags  fl = 0
 

Definition at line 57 of file mainwindowimp.cpp.

References addClicked(), advancedUserMode, QMap< Key, T >::begin(), QValueList< T >::begin(), configureClicked(), QString::contains(), QValueList< T >::contains(), DEFAULT_SCHEME, QMap< Key, T >::end(), QValueList< T >::end(), QTextStream::eof(), getAllInterfaces(), Interfaces::getInterfaceList(), Interface::getInterfaceName(), i, informationClicked(), initHostname(), QMap< Key, T >::insert(), interfaceNames, IO_ReadOnly, QString::length(), list, loadModules(), m_handledIfaces, makeChannel(), QString::mid(), odebug, oendl, QFile::open(), profiles, QPEApplication::qpeDir(), Config::readBoolEntry(), Config::readEntry(), QTextStream::readLine(), removeClicked(), Opie::Ui::OTabWidget::removePage(), scheme, Interface::setAttached(), Interface::setHardwareName(), QStringList::split(), stream, MainWindow::tabWidget(), tr, and updateInterface().

MainWindowImp::~MainWindowImp  ) 
 

Deconstructor. Save profiles. Delete loaded libraries.

Definition at line 141 of file mainwindowimp.cpp.

References QMap< Key, T >::begin(), QMap< Key, T >::end(), items, QStringList::join(), libraries, NULL, profiles, Config::setGroup(), and Config::writeEntry().


Member Function Documentation

void MainWindowImp::addClicked  )  [private, slot]
 

The Add button was clicked. Bring up the add dialog and if OK is hit load the plugin and append it to the list

Definition at line 359 of file mainwindowimp.cpp.

References AddConnectionImp::addConnections(), QMap< Key, T >::begin(), QMap< Key, T >::count(), QMap< Key, T >::end(), QPEApplication::execDialog(), Interface::getInterfaceName(), i, QMap< Key, T >::insert(), interfaceNames, libraries, list, odebug, oendl, and updateInterface().

Referenced by MainWindowImp().

void MainWindowImp::addProfile  )  [private, slot]
 

Adds a new profile to the list of profiles. Don't add profiles that already exists. Appends to the list and QStringList

Definition at line 574 of file mainwindowimp.cpp.

References QValueList< T >::append(), QStringList::grep(), and profiles.

static QString MainWindowImp::appName  )  [inline, static]
 

Reimplemented from MainWindow.

Definition at line 31 of file mainwindowimp.h.

References QString::fromLatin1().

void MainWindowImp::changeProfile  )  [private, slot]
 

A new profile has been selected, change.

Parameters:
newProfile the new profile.

Definition at line 649 of file mainwindowimp.cpp.

References QMap< Key, T >::begin(), QMap< Key, T >::end(), IO_ReadWrite, items, QFile::open(), QFile::remove(), scheme, and stream.

void MainWindowImp::configureClicked  )  [private, slot]
 

Pull up the configure about the currently selected interface. Report an error if no interface is selected. If the interface has a module owner then request its configure.

Definition at line 437 of file mainwindowimp.cpp.

References MainWindowBase::configure, Interface::getModuleOwner(), i, interfaceItems, NULL, InterfaceSetupImpDialog::setProfile(), QPEApplication::showDialog(), QPEApplication::showWidget(), tr, QString::upper(), Qt::WDestructiveClose, and Qt::WStyle_ContextHelp.

Referenced by MainWindowImp().

void MainWindowImp::getAllInterfaces  )  [private, slot]
 

Query the kernel for all of the interfaces.

Definition at line 170 of file mainwindowimp.cpp.

References _PROCNETDEV, QMap< Key, T >::begin(), QValueList< T >::contains(), QMap< Key, T >::end(), QFile::exists(), QString::find(), flags, Interface::getInterfaceName(), i, ifaces, QMap< Key, T >::insert(), interfaceNames, IO_ReadOnly, QString::left(), libraries, loc, m_handledIfaces, NULL, QString::null, odebug, oendl, QFile::open(), owarn, QTextStream::readLine(), Interface::setAttached(), Interface::setHardwareName(), Interface::setStatus(), and updateInterface().

Referenced by MainWindowImp().

void MainWindowImp::informationClicked  )  [private, slot]
 

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.

Definition at line 473 of file mainwindowimp.cpp.

References Interface::getModuleOwner(), i, interfaceItems, NULL, odebug, oendl, QPEApplication::showWidget(), Qt::WDestructiveClose, Qt::WStyle_ContextHelp, Qt::WStyle_Dialog, and Qt::WType_Modal.

Referenced by MainWindowImp().

void MainWindowImp::initHostname  )  [private]
 

Definition at line 764 of file mainwindowimp.cpp.

References _procTemp, OProcess::AllOutput, OProcess::Block, odebug, oendl, slotHostname(), Opie::Core::OProcess::start(), and QString::stripWhiteSpace().

Referenced by MainWindowImp().

void MainWindowImp::loadModules const QString path  )  [private]
 

Load all modules that are found in the path

Parameters:
path a directory that is scaned for any plugins that can be loaded and attempts to load them

Definition at line 283 of file mainwindowimp.cpp.

References QPtrListIterator< type >::current(), d, QDir::entryInfoList(), QDir::exists(), QFileInfo::fileName(), QDir::Files, l, QString::latin1(), list, loadPlugin(), QDir::NoSymLinks, odebug, oendl, qApp, QPEApplication::qpeDir(), and QDir::setFilter().

Referenced by MainWindowImp().

Module * MainWindowImp::loadPlugin const QString pluginFileName,
const QString resolveString = "create_plugin"
[private]
 

Attempt to load a function and resolve a function.

Parameters:
pluginFileName - the name of the file in which to attempt to load
resolveString - function pointer to resolve
Returns:
pointer to the function with name resolveString or NULL

Definition at line 323 of file mainwindowimp.cpp.

References Module::handledInterfaceNames(), QMap< Key, T >::insert(), QString::latin1(), libraries, m_handledIfaces, odebug, oendl, QLibrary, and QLibrary::resolve().

Referenced by loadModules().

void MainWindowImp::makeChannel  )  [private]
 

Reimplemented from MainWindow.

Definition at line 684 of file mainwindowimp.cpp.

References channel, and receive().

Referenced by MainWindowImp().

void MainWindowImp::newProfileChanged const QString newText  )  [private, slot]
 

Definition at line 561 of file mainwindowimp.cpp.

References QString::length().

void MainWindowImp::receive const QCString ,
const QByteArray
[private, slot]
 

Reimplemented from MainWindow.

Definition at line 691 of file mainwindowimp.cpp.

References QMap< Key, T >::begin(), Opie::MM::dest, QMap< Key, T >::end(), QCString::find(), QString::latin1(), QCString::left(), QCString::length(), libraries, odebug, oendl, QCString::right(), and QPEApplication::setKeepRunning().

Referenced by makeChannel().

void MainWindowImp::removeClicked  )  [private, slot]
 

Prompt the user to see if they really want to do this. If they do then remove from the list and unload.

Definition at line 406 of file mainwindowimp.cpp.

References Interface::getModuleOwner(), i, interfaceItems, NULL, and tr.

Referenced by MainWindowImp().

void MainWindowImp::removeProfile  )  [private, slot]
 

Removes the currently selected profile in the combo. Doesn't delete if there are less then 2 profiles.

Definition at line 590 of file mainwindowimp.cpp.

References QMap< Key, T >::begin(), QValueList< T >::begin(), QValueList< T >::clear(), QMap< Key, T >::end(), QValueList< T >::end(), items, QStringList::join(), QString::latin1(), odebug, oendl, profiles, Interfaces::removeInterface(), Interfaces::removeMap(), Interfaces::removeMapping(), Interfaces::setInterface(), Interfaces::setMapping(), QStringList::split(), and Interfaces::write().

void MainWindowImp::setHostname  )  [protected, virtual, slot]
 

Definition at line 722 of file mainwindowimp.cpp.

References _HOSTFILE, _IRDANAME, _procTemp, OProcess::Block, QFile::close(), Opie::Core::OProcess::exitStatus(), f, IO_Truncate, IO_WriteOnly, QRegExp::match(), odebug, oendl, QFile::open(), s, QFile::setName(), slotHostname(), Opie::Core::OProcess::start(), OProcess::Stderr, QString::stripWhiteSpace(), and tr.

void MainWindowImp::slotHostname Opie::Core::OProcess proc,
char *  buffer,
int  buflen
[protected, virtual, slot]
 

Definition at line 777 of file mainwindowimp.cpp.

References _procTemp.

Referenced by initHostname(), and setHostname().

void MainWindowImp::updateInterface Interface i  )  [private, slot]
 

Update this interface. If no QListViewItem exists create one.

Parameters:
Interface* pointer to the interface that needs to be updated.

Definition at line 508 of file mainwindowimp.cpp.

References advancedUserMode, QMap< Key, T >::begin(), QMap< Key, T >::end(), QMap< Key, T >::find(), Interface::getInterfaceName(), Interface::getModuleOwner(), Interface::getStatus(), QMap< Key, T >::insert(), interfaceItems, Interface::isAttached(), items, libraries, Opie::Core::OResource::loadPixmap(), NULL, Interface::setModuleOwner(), and Opie::Core::OResource::SmallIcon.

Referenced by addClicked(), getAllInterfaces(), and MainWindowImp().


Member Data Documentation

QString MainWindowImp::_procTemp [private]
 

Definition at line 79 of file mainwindowimp.h.

Referenced by initHostname(), setHostname(), and slotHostname().

bool MainWindowImp::advancedUserMode [private]
 

Definition at line 77 of file mainwindowimp.h.

Referenced by MainWindowImp(), and updateInterface().

QCopChannel* MainWindowImp::channel
 

Reimplemented from MainWindow.

Definition at line 35 of file mainwindowimp.h.

Referenced by makeChannel().

QMap<QListViewItem*, Interface*> MainWindowImp::interfaceItems [private]
 

Definition at line 71 of file mainwindowimp.h.

Referenced by configureClicked(), informationClicked(), removeClicked(), and updateInterface().

QMap<QString, Interface*> MainWindowImp::interfaceNames [private]
 

Definition at line 67 of file mainwindowimp.h.

Referenced by addClicked(), getAllInterfaces(), and MainWindowImp().

QMap<Interface*, QListViewItem*> MainWindowImp::items [private]
 

Definition at line 70 of file mainwindowimp.h.

Referenced by changeProfile(), removeProfile(), updateInterface(), and ~MainWindowImp().

QMap<Module*, QLibrary*> MainWindowImp::libraries [private]
 

Definition at line 69 of file mainwindowimp.h.

Referenced by addClicked(), getAllInterfaces(), loadPlugin(), receive(), updateInterface(), and ~MainWindowImp().

KLibLoader* MainWindowImp::loader [private]
 

Definition at line 81 of file mainwindowimp.h.

QStringList MainWindowImp::m_handledIfaces [private]
 

Definition at line 72 of file mainwindowimp.h.

Referenced by getAllInterfaces(), loadPlugin(), and MainWindowImp().

QStringList MainWindowImp::profiles [private]
 

Definition at line 75 of file mainwindowimp.h.

Referenced by addProfile(), MainWindowImp(), removeProfile(), and ~MainWindowImp().

QString MainWindowImp::scheme [private]
 

Definition at line 78 of file mainwindowimp.h.

Referenced by changeProfile(), and MainWindowImp().

QMap<KProcess*, QString> MainWindowImp::threads [private]
 

Definition at line 74 of file mainwindowimp.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:39:39 2005 for OPIE by  doxygen 1.4.2