1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-09-27 15:26:33 -04:00

Multi device support: removed main window channel acion dependency

This commit is contained in:
f4exb 2016-05-14 20:57:43 +02:00
parent 58709e0bae
commit 3cba9014b6
15 changed files with 37 additions and 37 deletions

View File

@ -28,9 +28,9 @@ void ChannelAnalyzerPlugin::initPlugin(PluginAPI* pluginAPI)
m_pluginAPI = pluginAPI; m_pluginAPI = pluginAPI;
// register demodulator // register demodulator
QAction* action = new QAction(tr("&ChannelAnalyzer"), this); // QAction* action = new QAction(tr("&ChannelAnalyzer"), this);
connect(action, SIGNAL(triggered()), this, SLOT(createInstanceChannelAnalyzer())); // connect(action, SIGNAL(triggered()), this, SLOT(createInstanceChannelAnalyzer()));
m_pluginAPI->registerChannel("org.f4exb.sdrangelove.channel.chanalyzer", this, action); m_pluginAPI->registerChannel("org.f4exb.sdrangelove.channel.chanalyzer", this);
} }
PluginGUI* ChannelAnalyzerPlugin::createChannel(const QString& channelName) PluginGUI* ChannelAnalyzerPlugin::createChannel(const QString& channelName)

View File

@ -29,9 +29,9 @@ void AMPlugin::initPlugin(PluginAPI* pluginAPI)
m_pluginAPI = pluginAPI; m_pluginAPI = pluginAPI;
// register AM demodulator // register AM demodulator
QAction* action = new QAction(tr("&AM Demodulator"), this); // QAction* action = new QAction(tr("&AM Demodulator"), this);
// connect(action, SIGNAL(triggered()), this, SLOT(createInstanceAM())); // connect(action, SIGNAL(triggered()), this, SLOT(createInstanceAM()));
m_pluginAPI->registerChannel("de.maintech.sdrangelove.channel.am", this, action); m_pluginAPI->registerChannel("de.maintech.sdrangelove.channel.am", this);
} }
PluginGUI* AMPlugin::createChannel(const QString& channelName) PluginGUI* AMPlugin::createChannel(const QString& channelName)

View File

@ -47,9 +47,9 @@ void BFMPlugin::initPlugin(PluginAPI* pluginAPI)
m_pluginAPI = pluginAPI; m_pluginAPI = pluginAPI;
// register BFM demodulator // register BFM demodulator
QAction* action = new QAction(tr("&Broadcast FM Demodulator"), this); // QAction* action = new QAction(tr("&Broadcast FM Demodulator"), this);
connect(action, SIGNAL(triggered()), this, SLOT(createInstanceBFM())); // connect(action, SIGNAL(triggered()), this, SLOT(createInstanceBFM()));
m_pluginAPI->registerChannel("sdrangel.channel.bfm", this, action); m_pluginAPI->registerChannel("sdrangel.channel.bfm", this);
} }
PluginGUI* BFMPlugin::createChannel(const QString& channelName) PluginGUI* BFMPlugin::createChannel(const QString& channelName)

View File

@ -45,9 +45,9 @@ void DSDDemodPlugin::initPlugin(PluginAPI* pluginAPI)
m_pluginAPI = pluginAPI; m_pluginAPI = pluginAPI;
// register DSD demodulator // register DSD demodulator
QAction* action = new QAction(tr("&DSD Demodulator"), this); // QAction* action = new QAction(tr("&DSD Demodulator"), this);
connect(action, SIGNAL(triggered()), this, SLOT(createInstanceDSDDemod())); // connect(action, SIGNAL(triggered()), this, SLOT(createInstanceDSDDemod()));
m_pluginAPI->registerChannel("sdrangel.channel.dsddemod", this, action); m_pluginAPI->registerChannel("sdrangel.channel.dsddemod", this);
} }
PluginGUI* DSDDemodPlugin::createChannel(const QString& channelName) PluginGUI* DSDDemodPlugin::createChannel(const QString& channelName)

View File

@ -28,9 +28,9 @@ void LoRaPlugin::initPlugin(PluginAPI* pluginAPI)
m_pluginAPI = pluginAPI; m_pluginAPI = pluginAPI;
// register demodulator // register demodulator
QAction* action = new QAction(tr("&LoRa Demodulator"), this); // QAction* action = new QAction(tr("&LoRa Demodulator"), this);
connect(action, SIGNAL(triggered()), this, SLOT(createInstanceLoRa())); // connect(action, SIGNAL(triggered()), this, SLOT(createInstanceLoRa()));
m_pluginAPI->registerChannel("de.maintech.sdrangelove.channel.lora", this, action); m_pluginAPI->registerChannel("de.maintech.sdrangelove.channel.lora", this);
} }
PluginGUI* LoRaPlugin::createChannel(const QString& channelName) PluginGUI* LoRaPlugin::createChannel(const QString& channelName)

View File

@ -28,9 +28,9 @@ void NFMPlugin::initPlugin(PluginAPI* pluginAPI)
m_pluginAPI = pluginAPI; m_pluginAPI = pluginAPI;
// register NFM demodulator // register NFM demodulator
QAction* action = new QAction(tr("&NFM Demodulator"), this); // QAction* action = new QAction(tr("&NFM Demodulator"), this);
connect(action, SIGNAL(triggered()), this, SLOT(createInstanceNFM())); // connect(action, SIGNAL(triggered()), this, SLOT(createInstanceNFM()));
m_pluginAPI->registerChannel("de.maintech.sdrangelove.channel.nfm", this, action); m_pluginAPI->registerChannel("de.maintech.sdrangelove.channel.nfm", this);
} }
PluginGUI* NFMPlugin::createChannel(const QString& channelName) PluginGUI* NFMPlugin::createChannel(const QString& channelName)

View File

@ -28,9 +28,9 @@ void SSBPlugin::initPlugin(PluginAPI* pluginAPI)
m_pluginAPI = pluginAPI; m_pluginAPI = pluginAPI;
// register demodulator // register demodulator
QAction* action = new QAction(tr("&SSB Demodulator"), this); // QAction* action = new QAction(tr("&SSB Demodulator"), this);
connect(action, SIGNAL(triggered()), this, SLOT(createInstanceSSB())); // connect(action, SIGNAL(triggered()), this, SLOT(createInstanceSSB()));
m_pluginAPI->registerChannel("de.maintech.sdrangelove.channel.ssb", this, action); m_pluginAPI->registerChannel("de.maintech.sdrangelove.channel.ssb", this);
} }
PluginGUI* SSBPlugin::createChannel(const QString& channelName) PluginGUI* SSBPlugin::createChannel(const QString& channelName)

View File

@ -29,9 +29,9 @@ void WFMPlugin::initPlugin(PluginAPI* pluginAPI)
m_pluginAPI = pluginAPI; m_pluginAPI = pluginAPI;
// register WFM demodulator // register WFM demodulator
QAction* action = new QAction(tr("&WFM Demodulator"), this); // QAction* action = new QAction(tr("&WFM Demodulator"), this);
connect(action, SIGNAL(triggered()), this, SLOT(createInstanceWFM())); // connect(action, SIGNAL(triggered()), this, SLOT(createInstanceWFM()));
m_pluginAPI->registerChannel("de.maintech.sdrangelove.channel.wfm", this, action); m_pluginAPI->registerChannel("de.maintech.sdrangelove.channel.wfm", this);
} }
PluginGUI* WFMPlugin::createChannel(const QString& channelName) PluginGUI* WFMPlugin::createChannel(const QString& channelName)

View File

@ -28,9 +28,9 @@ void TCPSrcPlugin::initPlugin(PluginAPI* pluginAPI)
m_pluginAPI = pluginAPI; m_pluginAPI = pluginAPI;
// register TCP Channel Source // register TCP Channel Source
QAction* action = new QAction(tr("&TCP Source"), this); // QAction* action = new QAction(tr("&TCP Source"), this);
connect(action, SIGNAL(triggered()), this, SLOT(createInstanceTCPSrc())); // connect(action, SIGNAL(triggered()), this, SLOT(createInstanceTCPSrc()));
m_pluginAPI->registerChannel("sdrangel.channel.tcpsrc", this, action); m_pluginAPI->registerChannel("sdrangel.channel.tcpsrc", this);
} }
PluginGUI* TCPSrcPlugin::createChannel(const QString& channelName) PluginGUI* TCPSrcPlugin::createChannel(const QString& channelName)

View File

@ -47,9 +47,9 @@ void UDPSrcPlugin::initPlugin(PluginAPI* pluginAPI)
m_pluginAPI = pluginAPI; m_pluginAPI = pluginAPI;
// register TCP Channel Source // register TCP Channel Source
QAction* action = new QAction(tr("&UDP Source"), this); // QAction* action = new QAction(tr("&UDP Source"), this);
connect(action, SIGNAL(triggered()), this, SLOT(createInstanceUDPSrc())); // connect(action, SIGNAL(triggered()), this, SLOT(createInstanceUDPSrc()));
m_pluginAPI->registerChannel("sdrangel.channel.udpsrc", this, action); m_pluginAPI->registerChannel("sdrangel.channel.udpsrc", this);
} }
PluginGUI* UDPSrcPlugin::createChannel(const QString& channelName) PluginGUI* UDPSrcPlugin::createChannel(const QString& channelName)

View File

@ -238,10 +238,10 @@ void MainWindow::removeLastDevice()
m_deviceUIs.pop_back(); m_deviceUIs.pop_back();
} }
void MainWindow::addChannelCreateAction(QAction* action) // TODO: move to some tabbed UI //void MainWindow::addChannelCreateAction(QAction* action) // TODO: move to some tabbed UI
{ //{
ui->menu_Channels->addAction(action); // ui->menu_Channels->addAction(action);
} //}
void MainWindow::addChannelRollup(QWidget* widget) void MainWindow::addChannelRollup(QWidget* widget)
{ {

View File

@ -71,7 +71,7 @@ public:
MessageQueue* getInputMessageQueue() { return &m_inputMessageQueue; } MessageQueue* getInputMessageQueue() { return &m_inputMessageQueue; }
void addChannelCreateAction(QAction* action); // void addChannelCreateAction(QAction* action);
void addChannelRollup(QWidget* widget); void addChannelRollup(QWidget* widget);
void addViewAction(QAction* action); void addViewAction(QAction* action);

View File

@ -31,7 +31,7 @@ public:
void setInputGUI(QWidget* inputGUI); void setInputGUI(QWidget* inputGUI);
// Channel stuff // Channel stuff
void registerChannel(const QString& channelName, PluginInterface* plugin, QAction* action); void registerChannel(const QString& channelName, PluginInterface* plugin, QAction* action = 0);
void registerChannelInstance(const QString& channelName, PluginGUI* pluginGUI); void registerChannelInstance(const QString& channelName, PluginGUI* pluginGUI);
void addChannelRollup(QWidget* pluginGUI); void addChannelRollup(QWidget* pluginGUI);
void removeChannelInstance(PluginGUI* pluginGUI); void removeChannelInstance(PluginGUI* pluginGUI);

View File

@ -54,7 +54,7 @@ void PluginManager::loadPlugins()
void PluginManager::registerChannel(const QString& channelName, PluginInterface* plugin, QAction* action) void PluginManager::registerChannel(const QString& channelName, PluginInterface* plugin, QAction* action)
{ {
m_channelRegistrations.append(ChannelRegistration(channelName, plugin)); m_channelRegistrations.append(ChannelRegistration(channelName, plugin));
m_mainWindow->addChannelCreateAction(action); // m_mainWindow->addChannelCreateAction(action);
} }
void PluginManager::registerChannelInstance(const QString& channelName, PluginGUI* pluginGUI) void PluginManager::registerChannelInstance(const QString& channelName, PluginGUI* pluginGUI)

View File

@ -46,7 +46,7 @@ public:
const Plugins& getPlugins() const { return m_plugins; } const Plugins& getPlugins() const { return m_plugins; }
// Callbacks from the plugins // Callbacks from the plugins
void registerChannel(const QString& channelName, PluginInterface* plugin, QAction* action); void registerChannel(const QString& channelName, PluginInterface* plugin, QAction* action = 0);
void registerChannelInstance(const QString& channelName, PluginGUI* pluginGUI); void registerChannelInstance(const QString& channelName, PluginGUI* pluginGUI);
void addChannelRollup(QWidget* pluginGUI); void addChannelRollup(QWidget* pluginGUI);
void removeChannelInstance(PluginGUI* pluginGUI); void removeChannelInstance(PluginGUI* pluginGUI);