ObjectWidget::ObjectWidget(QASObject* obj, QWidget* parent) : ObjectWidgetWithSignals(parent), m_objectWidget(NULL), m_shortObjectWidget(NULL), m_contextLabel(NULL), m_contextButton(NULL), m_topLayout(NULL), m_object(NULL), m_irtObject(NULL), m_short(false) { #ifdef DEBUG_WIDGETS qDebug() << "Creating ObjectWidget"; #endif m_layout = new QVBoxLayout; m_layout->setContentsMargins(0, 0, 0, 0); m_layout->setSpacing(0); // Add label with context "Re:" text and "show context" button for // replies. m_topLayout = new QHBoxLayout; m_topLayout->setContentsMargins(0, 0, 0, 0); m_contextLabel = new RichTextLabel(this, true); m_topLayout->addWidget(m_contextLabel, 0, Qt::AlignVCenter); m_topLayout->addSpacing(10); m_contextButton = new TextToolButton(this); connect(m_contextButton, SIGNAL(clicked()), this, SLOT(onShowContext())); m_topLayout->addWidget(m_contextButton, 0, Qt::AlignVCenter); m_layout->addLayout(m_topLayout); m_objectWidget = new FullObjectWidget(m_object, this); ObjectWidgetWithSignals::connectSignals(m_objectWidget, this); connect(m_objectWidget, SIGNAL(lessClicked()), this, SLOT(showLess())); m_layout->addWidget(m_objectWidget); m_shortObjectWidget = new ShortObjectWidget(m_object, this); connect(m_shortObjectWidget, SIGNAL(follow(QString, bool)), this, SIGNAL(follow(QString, bool))); connect(m_shortObjectWidget, SIGNAL(moreClicked()), this, SLOT(showMore())); m_layout->addWidget(m_shortObjectWidget); changeObject(obj); setLayout(m_layout); }
void ObjectWidget::showLess() { if (m_short || !m_objectWidget) return; m_short = true; m_objectWidget->setVisible(false); m_shortObjectWidget->setVisible(true); m_contextLabel->setVisible(false); m_contextButton->setVisible(false); m_shortObjectWidget->updateMenu(); emit lessClicked(); }
MediaPlayer::MediaPlayer( QObject *parent, const char *name ) : QObject( parent, name ), volumeDirection( 0 ), currentFile( NULL ) { odebug << "MediaPlayer::MediaPlayer" << oendl; // QPEApplication::grabKeyboard(); connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); connect( mediaPlayerState, SIGNAL( playingToggled(bool) ), this, SLOT( setPlaying(bool) ) ); connect( mediaPlayerState, SIGNAL( pausedToggled(bool) ), this, SLOT( pauseCheck(bool) ) ); connect( mediaPlayerState, SIGNAL( next() ), this, SLOT( next() ) ); connect( mediaPlayerState, SIGNAL( prev() ), this, SLOT( prev() ) ); connect( audioUI, SIGNAL( moreClicked() ), this, SLOT( startIncreasingVolume() ) ); connect( audioUI, SIGNAL( lessClicked() ), this, SLOT( startDecreasingVolume() ) ); connect( audioUI, SIGNAL( moreReleased() ), this, SLOT( stopChangingVolume() ) ); connect( audioUI, SIGNAL( lessReleased() ), this, SLOT( stopChangingVolume() ) ); }