void ConnectionListWidget::updateList()
{
    nameList.clear();
    for(quint16 i=0;i<connections->size();i++)
    {
        nameList.append(connections->at(i)->getName());
    }

    emit connectionListChanged(nameList);
}
Exemple #2
0
Flipp::Flipp(QWidget *parent)
    : QMainWindow(parent)
{
    connections = new QList<ConnectionUnit*>;
    connectionListWidget = new ConnectionListWidget(this, connections);
    terminals = new TerminalListWidget(this);
    parsers = new QList<ParserUnit*>;
    parserListWidget = new ParserListWidget(this, parsers);
    linkers = new QList<LinkerUnit*>;
    linkerListWidget = new LinkerListWidget(this, linkers);
//    plotter = new PlotterWidget(this,linkers);
        plotter = new PlotterWidget(linkers);
//    thread = new QThread;
//    plotter->moveToThread(thread);
//    thread->start();

    //    plotter = new PlotterWidget(this);

    m_sSettingsFile = QApplication::applicationDirPath() + "/lastSettings.flp";
    setCentralWidget(plotter);
    createDocks();
    createMenus();

    this->setWindowTitle(tr("f l i p p"));

    QFile qss("../flipp/styles/flipp.css");
    qss.open(QFile::ReadOnly);
    setStyleSheet(qss.readAll());
    qss.close();

    connect(connectionListWidget,SIGNAL(connectionListChanged(QStringList)),terminals,SLOT(updateConnections(QStringList)));
    connect(connectionListWidget,SIGNAL(connectionListChanged(QStringList)),linkerListWidget,SLOT(updateConnections(QStringList)));
    connect(terminals,SIGNAL(terminalRequest(TerminalWidget*,QString)),this,SLOT(handleTerminalRequest(TerminalWidget*,QString)));
    connect(parserListWidget,SIGNAL(parserListChanged(QStringList)),linkerListWidget,SLOT(updateParsers(QStringList)));

    connect(linkerListWidget,SIGNAL(linkerConnectionRequest(LinkerUnit*,QString)),this,SLOT(handleLinkerConnectionRequest(LinkerUnit*, QString)));
    connect(linkerListWidget,SIGNAL(linkerParserRequest(LinkerUnit*,QString)),this,SLOT(handleLinkerParserRequest(LinkerUnit*, QString)));

    connect(linkerListWidget,SIGNAL(linkerListChanged()),plotter,SLOT(updateLinkerList()));

    restoreSettings();
}
void ConnectionManager::delistConnection(int connectionId)
{
    m_connectionList.remove(connectionId);

    emit connectionListChanged();
}
void ConnectionManager::enlistConnection(int connectionId, Server* server)
{
    m_connectionList.insert(connectionId, server);

    emit connectionListChanged();
}