00001 #include "tcpplugin.h"
00002
00003
00004
00005
00006
00007 void TcpPlugin::CoreInit(const BCore* core)
00008 {
00009 qDebug("Tcp-> CoreInit()");
00010 bcore = (BCore*) core;
00011
00012
00013 ServerDlog = NULL;
00014 ClientDlog = NULL;
00015
00016
00017 LoadSettings();
00018
00019 }
00020
00021
00022
00023 void TcpPlugin::SaveSettings()
00024 {
00025 bool SDlog;
00026 bool CDlog;
00027
00028
00029 if(NULL == ServerDlog) SDlog = false;
00030 else SDlog = true;
00031
00032 if(NULL == ClientDlog) CDlog = false;
00033 else CDlog = true;
00034
00035
00036 bcore->settings->setValue("TcpPlugin", "ServerDialog_Open", SDlog );
00037 bcore->settings->setValue("TcpPlugin", "ClientDialog_Open", CDlog );
00038 }
00039
00040
00041
00042 void TcpPlugin::LoadSettings()
00043 {
00044
00045 if(bcore->settings->getValue("TcpPlugin", "ServerDialog_Open", false ).toBool())
00046 getDock(commands()[2]);
00047
00048 if(bcore->settings->getValue("TcpPlugin", "ClientDialog_Open", false ).toBool())
00049 getDock(commands()[1]);
00050 }
00051
00052 void TcpPlugin::Module(const QString name, const QStringList params)
00053 {
00054 if (!Modules.contains(name))
00055 Modules[name] = new BBoB_Module((QWidget*) this, name);
00056
00057
00058 QStringList::const_iterator constIterator;
00059 for (constIterator = params.constBegin(); constIterator != params.constEnd(); ++constIterator)
00060 {
00061 QString param = (*constIterator);
00062 ++constIterator;
00063 QString value = (*constIterator);
00064 Modules[name]->setParam(param, value);
00065 }
00066 }
00067
00068