void k9astTitles::selectAll(bool _state) { bool oldState; for (int i=0; i < m_src->topLevelItemCount();i++) { _k9ItemWidget *item=(_k9ItemWidget*) m_src->topLevelItem(i); oldState=item->title->isSelected(); if (_state) { m_updating=true; // all streams are checked by default for (int j=0;j < item->title->getaudioStreamCount();j++) { item->title->getaudioStream(j)->setselected(true); if (j==0) item->title->setDefAudio(item->title->getaudioStream(j)); } for (int j=0;j < item->title->getsubPictureCount();j++) { item->title->getsubtitle(j)->setselected(true); if (j==0) item->title->setDefSubtitle(item->title->getsubtitle(j)); } item->title->setvideoSelected(true); m_updating=false; if (_state!=oldState) emit addTitle(item->title); } else { m_updating=true; item->title->setSelected(false); item->title->setDefSubtitle(NULL); item->title->setDefAudio(NULL); m_updating=false; if (_state!=oldState) emit removeTitle(item->title); } } }
bool TitlePicker::eventFilter(QObject *object, QEvent *e) { if (object != (QObject *)title) return FALSE; if (object->inherits("QwtTextLabel") && e->type() == QEvent::MouseButtonDblClick) { emit doubleClicked(); d_selected = true; return TRUE; } if (object->inherits("QwtTextLabel") && e->type() == QEvent::MouseButtonPress) { const QMouseEvent *me = (const QMouseEvent *)e; emit clicked(); if (me->button() == Qt::RightButton) emit showTitleMenu(); else if (me->button() == Qt::LeftButton) setSelected(); return !(me->modifiers() & Qt::ShiftModifier); } if (object->inherits("QwtTextLabel") && e->type() == QEvent::KeyPress) { switch (((const QKeyEvent *)e)->key()) { case Qt::Key_Delete: emit removeTitle(); return TRUE; } } return QObject::eventFilter(object, e); }
bool TitlePicker::eventFilter(QObject *object, QEvent *e) { if (object != (QObject *)title) return FALSE; if ( object->inherits("QLabel") && e->type() == QEvent::MouseButtonDblClick) { emit doubleClicked(); return TRUE; } if ( object->inherits("QLabel") && e->type() == QEvent::MouseButtonPress ) { emit clicked(); const QMouseEvent *me = (const QMouseEvent *)e; if (me->button()==QEvent::LeftButton) { if(me->state()==Qt::ShiftButton) ShiftButton=TRUE; return TRUE; } else if (me->button()==QEvent::RightButton) { emit showTitleMenu(); return TRUE; } } if ( object->inherits("QLabel") && e->type() == QEvent::MouseMove) { const QMouseEvent *me = (const QMouseEvent *)e; if(ShiftButton) { graphToResize=TRUE; emit resizeGraph(me->pos()); } else { movedGraph=TRUE; emit moveGraph(me->pos()); } return TRUE; } if ( object->inherits("QLabel") && e->type() == QEvent::MouseButtonRelease) { const QMouseEvent *me = (const QMouseEvent *)e; if (me->button()== QEvent::LeftButton) { emit clicked(); if (movedGraph) { emit releasedGraph(); movedGraph=FALSE; } if (graphToResize) { emit resizedGraph(); graphToResize=FALSE; ShiftButton=FALSE; } return TRUE; } } if ( object->inherits("QLabel") && e->type() == QEvent::KeyPress) { switch (((const QKeyEvent *)e)->key()) { case Qt::Key_Delete: emit removeTitle(); return TRUE; } } return QObject::eventFilter(object, e); }
void k9astTitles::titleUnSelected(k9DVDTitle *_title) { if (!m_updating) emit removeTitle(_title); }
bool TitlePicker::eventFilter(QObject *object, QEvent *e) { if (object != (QObject *)title) return FALSE; if ( object->inherits("QLabel") && e->type() == QEvent::MouseButtonDblClick) { emit doubleClicked(); return TRUE; } if ( object->inherits("QLabel") && e->type() == QEvent::MouseButtonPress ) { emit clicked(); const QMouseEvent *me = (const QMouseEvent *)e; if (me->button()==QEvent::RightButton) emit showTitleMenu(); QwtPlot *plot = (QwtPlot *)title->parent(); if (plot->margin() < 2 && plot->lineWidth() < 2) { QRect r = title->rect(); r.addCoords(2, 2, -2, -2); if (!r.contains(me->pos())) emit highlightGraph(); } return TRUE; } if ( object->inherits("QLabel") && e->type() == QEvent::MouseMove) { const QMouseEvent *me = (const QMouseEvent *)e; movedGraph=TRUE; emit moveGraph(me->pos()); return TRUE; } if ( object->inherits("QLabel") && e->type() == QEvent::MouseButtonRelease) { const QMouseEvent *me = (const QMouseEvent *)e; if (me->button()== QEvent::LeftButton) { emit clicked(); if (movedGraph) { emit releasedGraph(); movedGraph=FALSE; } return TRUE; } } if ( object->inherits("QLabel") && e->type() == QEvent::KeyPress) { switch (((const QKeyEvent *)e)->key()) { case Qt::Key_Delete: emit removeTitle(); return TRUE; } } return QObject::eventFilter(object, e); }