udpplugin-display.cpp

Go to the documentation of this file.
00001 #include "udpplugin.h"
00002 
00003 
00004 /** List of menu commands - 
00005  ** Text shown in menu and in dock titlebar.
00006  **/
00007 QStringList UdpPlugin::commands() const
00008 {
00009     return QStringList() << tr("Udp")<< tr("Sender") << tr("Receiver");
00010 }
00011 
00012 /** Displayable widget - 
00013  ** Creates Dialog and connects signals/slots.  Then creates QDockWidget so dock options can be set,
00014  ** then it's passed to BCore which can pass to the MainWindow.
00015  **/
00016 QDockWidget* UdpPlugin::getDock(const QString &command)
00017 {
00018     QDialog* dialog = 0;
00019 
00020     if ( command == commands()[2] )
00021     {
00022         ReceiverDlog = new ReceiverDialog();
00023         dialog = ReceiverDlog;
00024     }
00025     else if ( command == commands()[1] )
00026     {
00027         SenderDlog = new SenderDialog();
00028         dialog = SenderDlog;
00029     }
00030 
00031     QDockWidget* dock = new QDockWidget("UDP " + command);
00032     dock->setAllowedAreas(Qt::AllDockWidgetAreas);
00033     dock->setWidget(dialog);
00034 
00035     bcore->addDock(dock);
00036 
00037     return 0;
00038 }
00039 

Generated on Sun Oct 28 22:51:29 2007 for BBoB by  doxygen 1.5.3