void DvbChannelTableModel::setChannelModel(DvbChannelModel *channelModel_) { if (channelModel != NULL) { qWarning("Channel model already set"); return; } channelModel = channelModel_; connect(channelModel, SIGNAL(channelAdded(DvbSharedChannel)), this, SLOT(channelAdded(DvbSharedChannel))); connect(channelModel, SIGNAL(channelAboutToBeUpdated(DvbSharedChannel)), this, SLOT(channelAboutToBeUpdated(DvbSharedChannel))); connect(channelModel, SIGNAL(channelUpdated(DvbSharedChannel)), this, SLOT(channelUpdated(DvbSharedChannel))); connect(channelModel, SIGNAL(channelRemoved(DvbSharedChannel)), this, SLOT(channelRemoved(DvbSharedChannel))); reset(channelModel->getChannels()); }
ItemsListModel::ItemsListModel (QObject *parent) : QAbstractItemModel (parent) , CurrentRow_ (-1) , CurrentChannel_ (-1) { ItemHeaders_ << tr ("Name") << tr ("Date"); connect (&Core::Instance (), SIGNAL (channelRemoved (IDType_t)), this, SLOT (handleChannelRemoved (IDType_t))); }
EPGWidget::EPGWidget( QWidget *parent ) : QWidget( parent ) { b_input_type_known = false; m_rulerWidget = new EPGRuler( this ); m_epgView = new EPGView( this ); m_channelsWidget = new EPGChannels( this, m_epgView ); m_channelsWidget->setMinimumWidth( 100 ); m_epgView->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); setZoom( 1 ); rootWidget = new QStackedWidget( this ); QWidget *containerWidget = new QWidget( this ); QGridLayout* layout = new QGridLayout( this ); layout->addWidget( m_rulerWidget, 0, 1 ); layout->addWidget( m_channelsWidget, 1, 0 ); layout->addWidget( m_epgView, 1, 1 ); layout->setSpacing( 0 ); containerWidget->setLayout( layout ); rootWidget->insertWidget( EPGVIEW_WIDGET, containerWidget ); QLabel *noepgLabel = new QLabel( qtr("No EPG Data Available"), this ); noepgLabel->setAlignment( Qt::AlignCenter ); rootWidget->insertWidget( NOEPG_WIDGET, noepgLabel ); rootWidget->setCurrentIndex( 1 ); layout = new QGridLayout( this ); layout->addWidget( rootWidget ); setLayout( layout ); CONNECT( m_epgView, startTimeChanged(QDateTime), m_rulerWidget, setStartTime(QDateTime) ); CONNECT( m_epgView, durationChanged(int), m_rulerWidget, setDuration(int) ); CONNECT( m_epgView->horizontalScrollBar(), valueChanged(int), m_rulerWidget, setOffset(int) ); CONNECT( m_epgView->verticalScrollBar(), valueChanged(int), m_channelsWidget, setOffset(int) ); connect( m_epgView, SIGNAL( itemFocused(EPGItem*)), this, SIGNAL(itemSelectionChanged(EPGItem*)) ); CONNECT( m_epgView, channelAdded(QString), m_channelsWidget, addChannel(QString) ); CONNECT( m_epgView, channelRemoved(QString), m_channelsWidget, removeChannel(QString) ); }