Exemplo n.º 1
0
void CGalcon::connectSendersToTakers()
{
   connect(m_gui, SIGNAL(SendView(Message::CMessageAddViewPtr)),
           m_game, SLOT(AddView(Message::CMessageAddViewPtr)));
   connect(m_game, SIGNAL(SendStartGame(uint,uint)),
           m_gui, SLOT(TakeFieldSize(uint,uint)));
   connect(m_game, SIGNAL(SendError(Message::CMessageInformationPtr)),
           m_gui, SLOT(TakeInInformation(Message::CMessageInformationPtr)));
   connect(m_game, SIGNAL(SendFinishGame(Message::CMessageFinishGamePtr)),
           m_gui, SLOT(TakeFinishGame(Message::CMessageFinishGamePtr)));
   connect(m_game, SIGNAL(signalTimer()), m_game, SLOT(slotTimer()));
   connect(m_gui, SIGNAL(signalDisconnect()), this, SLOT(slotDisconnect()));
   connect(m_gui, SIGNAL(SendClientToServer(Message::CMessageConnectToServerPtr)),
           m_manager, SLOT(TakeServerConnect(Message::CMessageConnectToServerPtr)));
   connect(m_gui, SIGNAL(SendClientToSingleGame(Message::CMessageConnectToSingleGamePtr)),
           m_singleGame, SLOT(TakeServerConnect(Message::CMessageConnectToSingleGamePtr)), Qt::QueuedConnection);

   connect(m_gui, SIGNAL(signalPause()), m_game, SLOT(SlotPause()));
   connect(m_gui, SIGNAL(signalPause()), m_singleGame, SLOT(TakePause()));
   connect(m_gui, SIGNAL(signalExit()), m_game, SLOT(SlotExitGame()));

   connect(m_gui, SIGNAL(signalChoiceNetworkGame()), this, SLOT(slotChoiceNetworkGame()));
   connect(m_gui, SIGNAL(signalChoiceSingleGame()), this, SLOT(slotChoiceSingleGame()));

   connect(m_manager, SIGNAL(SendConfirmConnect(Message::CMessageConfirmationConnectToServerPtr)),
           m_gui, SLOT(TakeConfirmConnectToServer(Message::CMessageConfirmationConnectToServerPtr)));
   connect(m_manager, SIGNAL(SendError(Message::CMessageErrorPtr)),
           m_gui, SLOT(TakeError(Message::CMessageErrorPtr)));
   connect(m_manager, SIGNAL(SendFinishGame(Message::CMessageFinishGamePtr)),
           m_game, SLOT(SlotFinishGame(Message::CMessageFinishGamePtr)));
   connect(m_manager, SIGNAL(SendStateMap(Message::CMessageStateMapPtr)),
           m_game, SLOT(SlotStateMap(Message::CMessageStateMapPtr)));
   connect(m_manager, SIGNAL(SendStartGame(Message::CMessageStartMapGamePtr)),
           m_game, SLOT(SlotStartData(Message::CMessageStartMapGamePtr)));
   connect(m_manager, SIGNAL(SendTimeToStart(Message::CMessageTimeToStartGamePtr)),
           m_gui, SLOT(TakeTimeStartToGame(Message::CMessageTimeToStartGamePtr)));
   connect(m_manager, SIGNAL(SendInInformation(Message::CMessageInformationPtr)),
           m_gui, SLOT(TakeInInformation(Message::CMessageInformationPtr)));

   connect(m_singleGame, SIGNAL(SendConfirmConnect(Message::CMessageConfirmationConnectToServerPtr)),
           m_gui, SLOT(TakeConfirmConnectToServer(Message::CMessageConfirmationConnectToServerPtr)));
   connect(m_singleGame, SIGNAL(SendError(Message::CMessageErrorPtr)),
           m_gui, SLOT(TakeError(Message::CMessageErrorPtr)));
   connect(m_singleGame, SIGNAL(SendFinishGame(Message::CMessageFinishGamePtr)),
           m_game, SLOT(SlotFinishGame(Message::CMessageFinishGamePtr)));
   connect(m_singleGame, SIGNAL(SendStateMap(Message::CMessageStateMapPtr)),
           m_game, SLOT(SlotStateMap(Message::CMessageStateMapPtr)));
   connect(m_singleGame, SIGNAL(SendStartGame(Message::CMessageStartMapGamePtr)),
           m_game, SLOT(SlotStartData(Message::CMessageStartMapGamePtr)));
   connect(m_singleGame, SIGNAL(SendTimeToStart(Message::CMessageTimeToStartGamePtr)),
           m_gui, SLOT(TakeTimeStartToGame(Message::CMessageTimeToStartGamePtr)));
   connect(m_singleGame, SIGNAL(SendInInformation(Message::CMessageInformationPtr)),
           m_gui, SLOT(TakeInInformation(Message::CMessageInformationPtr)));
}
Exemplo n.º 2
0
void SlideToolBar::slotNexPrevClicked()
{
    if (!d->playBtn->isChecked())
    {
        d->playBtn->setChecked(true);
        d->playBtn->setIcon(QIcon::fromTheme(QLatin1String("media-playback-start")));
        emit signalPause();
    }
}
Exemplo n.º 3
0
void PresentationCtrlWidget::slotNexPrevClicked()
{
    if (!m_playButton->isChecked())
    {
        m_playButton->setChecked(true);
        m_canHide = false;
        m_playButton->setIcon(QIcon::fromTheme(QString::fromLatin1("media-playback-start")).pixmap(22));
        emit signalPause();
    }
}
Exemplo n.º 4
0
void SlidePlaybackWidget::slotNexPrevClicked()
{
    if (!m_playButton->isChecked())
    {
        m_playButton->setChecked(true);
        m_canHide = false;
        KIconLoader* loader = KIconLoader::global();
        m_playButton->setIcon(loader->loadIcon("media-playback-start", KIconLoader::NoGroup, 22));
        emit signalPause();
    }
}
Exemplo n.º 5
0
MediaPlayer2Player::MediaPlayer2Player(QObject* parent)
    : QDBusAbstractAdaptor(parent)
    , m_player(JuK::JuKInstance()->playerManager())
{
    connect(m_player, SIGNAL(signalItemChanged(FileHandle)), this, SLOT(currentSourceChanged()));
    connect(m_player, SIGNAL(signalPause()), this, SLOT(stateUpdated()));
    connect(m_player, SIGNAL(signalStop()), this, SLOT(stateUpdated()));
    connect(m_player, SIGNAL(totalTimeChanged(int)), this, SLOT(totalTimeChanged()));
    connect(m_player, SIGNAL(seekableChanged(bool)), this, SLOT(seekableChanged(bool)));
    connect(m_player, SIGNAL(volumeChanged(float)), this, SLOT(volumeChanged(float)));
    connect(m_player, SIGNAL(seeked(int)), this, SLOT(seeked(int)));
}
Exemplo n.º 6
0
void SlideToolBar::slotPlayBtnToggled()
{
    if (d->playBtn->isChecked())
    {
        d->playBtn->setIcon(QIcon::fromTheme(QLatin1String("media-playback-start")));
        emit signalPause();
    }
    else
    {
        d->playBtn->setIcon(QIcon::fromTheme(QLatin1String("media-playback-pause")));
        emit signalPlay();
    }
}
Exemplo n.º 7
0
void PresentationCtrlWidget::slotPlayButtonToggled()
{
    if (m_playButton->isChecked())
    {
        m_canHide = false;
        m_playButton->setIcon(QIcon::fromTheme(QString::fromLatin1("media-playback-start")).pixmap(22));
        emit signalPause();
    }
    else
    {
        m_canHide = true;
        m_playButton->setIcon(QIcon::fromTheme(QString::fromLatin1("media-playback-pause")).pixmap(22));
        emit signalPlay();
    }
}
Exemplo n.º 8
0
void SlidePlaybackWidget::slotPlayButtonToggled()
{
    if (m_playButton->isChecked())
    {
        m_canHide = false;
        KIconLoader* loader = KIconLoader::global();
        m_playButton->setIcon(loader->loadIcon("media-playback-start", KIconLoader::NoGroup, 22));
        emit signalPause();
    }
    else
    {
        m_canHide = true;
        KIconLoader* loader = KIconLoader::global();
        m_playButton->setIcon(loader->loadIcon("media-playback-pause", KIconLoader::NoGroup, 22));
        emit signalPlay();
    }
}
Exemplo n.º 9
0
void PresentationAudioWidget::slotPlay()
{
    if (d->mediaObject->state() == QMediaPlayer::PlayingState || d->mediaObject->mediaStatus() == QMediaPlayer::BufferingMedia)
    {
        d->mediaObject->pause();
        setGUIPlay(true);
        d->canHide = false;
        emit signalPause();
        return;
    }

    if (d->mediaObject->state() == QMediaPlayer::PausedState || d->mediaObject->state() == QMediaPlayer::StoppedState)
    {
        d->mediaObject->play();
        setGUIPlay(false);
        d->canHide = true;
        emit signalPlay();
    }
}
Exemplo n.º 10
0
void PlaybackWidget::slotPlay()
{
    if ( m_mediaObject->state() == Phonon::PlayingState ||
         m_mediaObject->state() == Phonon::BufferingState )
    {
        m_mediaObject->pause();
        setGUIPlay(true);
        m_canHide = false;
        emit signalPause();
        return;
    }

    if ( m_mediaObject->state() == Phonon::PausedState ||
         m_mediaObject->state() == Phonon::StoppedState )
    {
        m_mediaObject->play();
        setGUIPlay(false);
        m_canHide = true;
        emit signalPlay();
    }
}