Beispiel #1
0
void NetworkRemote::AcceptConnection() {
  if (!signals_connected_) {
    signals_connected_ = true;

    // Setting up the signals, but only once
    connect(incoming_data_parser_.get(), SIGNAL(SendClementineInfo()),
            outgoing_data_creator_.get(), SLOT(SendClementineInfo()));
    connect(incoming_data_parser_.get(), SIGNAL(SendFirstData(bool)),
            outgoing_data_creator_.get(), SLOT(SendFirstData(bool)));
    connect(incoming_data_parser_.get(), SIGNAL(SendAllPlaylists()),
            outgoing_data_creator_.get(), SLOT(SendAllPlaylists()));
    connect(incoming_data_parser_.get(), SIGNAL(SendAllActivePlaylists()),
            outgoing_data_creator_.get(), SLOT(SendAllActivePlaylists()));
    connect(incoming_data_parser_.get(), SIGNAL(SendPlaylistSongs(int)),
            outgoing_data_creator_.get(), SLOT(SendPlaylistSongs(int)));

    connect(app_->playlist_manager(), SIGNAL(ActiveChanged(Playlist*)),
            outgoing_data_creator_.get(), SLOT(ActiveChanged(Playlist*)));
    connect(app_->playlist_manager(), SIGNAL(PlaylistChanged(Playlist*)),
            outgoing_data_creator_.get(), SLOT(PlaylistChanged(Playlist*)));
    connect(app_->playlist_manager(), SIGNAL(PlaylistAdded(int,QString,bool)),
            outgoing_data_creator_.get(), SLOT(PlaylistAdded(int,QString,bool)));
    connect(app_->playlist_manager(), SIGNAL(PlaylistRenamed(int,QString)),
            outgoing_data_creator_.get(), SLOT(PlaylistRenamed(int,QString)));
    connect(app_->playlist_manager(), SIGNAL(PlaylistClosed(int)),
            outgoing_data_creator_.get(), SLOT(PlaylistClosed(int)));
    connect(app_->playlist_manager(), SIGNAL(PlaylistDeleted(int)),
            outgoing_data_creator_.get(), SLOT(PlaylistDeleted(int)));

    connect(app_->player(), SIGNAL(VolumeChanged(int)), outgoing_data_creator_.get(),
            SLOT(VolumeChanged(int)));
    connect(app_->player()->engine(), SIGNAL(StateChanged(Engine::State)),
            outgoing_data_creator_.get(), SLOT(StateChanged(Engine::State)));

    connect(app_->playlist_manager()->sequence(),
            SIGNAL(RepeatModeChanged(PlaylistSequence::RepeatMode)),
            outgoing_data_creator_.get(),
            SLOT(SendRepeatMode(PlaylistSequence::RepeatMode)));
    connect(app_->playlist_manager()->sequence(),
            SIGNAL(ShuffleModeChanged(PlaylistSequence::ShuffleMode)),
            outgoing_data_creator_.get(),
            SLOT(SendShuffleMode(PlaylistSequence::ShuffleMode)));

    connect(incoming_data_parser_.get(), SIGNAL(GetLyrics()),
            outgoing_data_creator_.get(), SLOT(GetLyrics()));

    connect(incoming_data_parser_.get(),
            SIGNAL(SendSongs(pb::remote::RequestDownloadSongs,RemoteClient*)),
            outgoing_data_creator_.get(),
            SLOT(SendSongs(pb::remote::RequestDownloadSongs,RemoteClient*)));
    connect(incoming_data_parser_.get(),
            SIGNAL(ResponseSongOffer(RemoteClient*, bool)),
            outgoing_data_creator_.get(),
            SLOT(ResponseSongOffer(RemoteClient*, bool)));

    connect(incoming_data_parser_.get(),
            SIGNAL(SendLibrary(RemoteClient*)),
            outgoing_data_creator_.get(),
            SLOT(SendLibrary(RemoteClient*)));
  }
Beispiel #2
0
void
TCPClientPort::OnConnect(const boost::system::error_code &ec)
{
  if (ec == boost::asio::error::operation_aborted)
    /* this object has already been deleted; bail out quickly without
       touching anything */
    return;

  if (ec) {
    socket.close();
    state = PortState::FAILED;
    StateChanged();
    Error(ec.message().c_str());
    return;
  }

  SendTimeoutS send_timeout(1);
  socket.set_option(send_timeout);

  state = PortState::READY;
  StateChanged();

  socket.async_receive(boost::asio::buffer(input, sizeof(input)),
                       std::bind(&TCPClientPort::OnRead, this,
                                 std::placeholders::_1,
                                 std::placeholders::_2));
}
Beispiel #3
0
EXPORT m64p_error CALL VidExt_ToggleFullScreen(void)
{
    /* call video extension override if necessary */
    if (l_VideoExtensionActive)
    {
        m64p_error rval = (*l_ExternalVideoFuncTable.VidExtFuncToggleFS)();
        if (rval == M64ERR_SUCCESS)
        {
            l_Fullscreen = !l_Fullscreen;
            StateChanged(M64CORE_VIDEO_MODE, l_Fullscreen ? M64VIDEO_FULLSCREEN : M64VIDEO_WINDOWED);
        }
        return rval;
    }

    if (!SDL_WasInit(SDL_INIT_VIDEO))
        return M64ERR_NOT_INIT;

    /* TODO:
     * SDL_WM_ToggleFullScreen doesn't work under Windows and others
     * (see http://wiki.libsdl.org/moin.cgi/FAQWindows for explanation).
     * Instead, we should call SDL_SetVideoMode with the SDL_FULLSCREEN flag.
     * (see http://sdl.beuc.net/sdl.wiki/SDL_SetVideoMode), but on Windows
     * this resets the OpenGL context and video plugins don't support it yet.
     * Uncomment the next line to test it: */
    //return VidExt_SetVideoMode(l_pScreen->w, l_pScreen->h, l_pScreen->format->BitsPerPixel, l_Fullscreen ? M64VIDEO_WINDOWED : M64VIDEO_FULLSCREEN);
    if (SDL_WM_ToggleFullScreen(l_pScreen) == 1)
    {
        l_Fullscreen = !l_Fullscreen;
        StateChanged(M64CORE_VIDEO_MODE, l_Fullscreen ? M64VIDEO_FULLSCREEN : M64VIDEO_WINDOWED);
        return M64ERR_SUCCESS;
    }

    return M64ERR_SYSTEM_FAIL;
}
Beispiel #4
0
    void VoiceSession::OnIncomingChannelReady(Tp::PendingOperation *op)
    {
        Tp::PendingReady *pr = qobject_cast<Tp::PendingReady *>(op);

        tp_channel_ = Tp::StreamedMediaChannelPtr(qobject_cast<Tp::StreamedMediaChannel *>(pr->object()));

        if (op->isError())
        {
            state_ = STATE_ERROR;
            QString message = QString("Incoming streamed media channel cannot become ready: ").append(op->errorMessage());
            LogError(message.toStdString());
            reason_ = message;
            emit StateChanged(state_);
            return;
        }
        connect(tp_channel_.data(), SIGNAL( invalidated(Tp::DBusProxy *, const QString &, const QString &) ), SLOT( OnChannelInvalidated(Tp::DBusProxy *, const QString &, const QString &) ));

        tp_contact_ = tp_channel_->initiatorContact();

        Contact* contact = new Contact(tp_contact_);   // HACK: The contact should be get from Connection object (now we don't delete it!!!)
        VoiceSessionParticipant* participant = new VoiceSessionParticipant(contact);
        participants_.push_back(participant);
        QString id = tp_contact_->id();

        state_ = STATE_RINGING_LOCAL;
        emit StateChanged(state_);

        emit Ready(this);
    }
Beispiel #5
0
EXPORT m64p_error CALL VidExt_Quit(void)
{
    /* call video extension override if necessary */
    if (l_VideoExtensionActive)
    {
        m64p_error rval = (*l_ExternalVideoFuncTable.VidExtFuncQuit)();
        if (rval == M64ERR_SUCCESS)
        {
            l_VideoOutputActive = 0;
            StateChanged(M64CORE_VIDEO_MODE, M64VIDEO_NONE);
        }
        return rval;
    }

    if (!SDL_WasInit(SDL_INIT_VIDEO))
        return M64ERR_NOT_INIT;

    SDL_ShowCursor(SDL_ENABLE);
#if SDL_VERSION_ATLEAST(2,0,0)
    SDL2_DestroyWindow();
#endif
    SDL_QuitSubSystem(SDL_INIT_VIDEO);
    l_pScreen = NULL;
    l_VideoOutputActive = 0;
    StateChanged(M64CORE_VIDEO_MODE, M64VIDEO_NONE);

    return M64ERR_SUCCESS;
}
Beispiel #6
0
void main_toggle_pause(void)
{
    if (!g_EmulatorRunning)
        return;

    if (rompause)
    {
        DebugMessage(M64MSG_STATUS, "Emulation continued.");
        if(l_msgPause)
        {
            osd_delete_message(l_msgPause);
            l_msgPause = NULL;
        }
        StateChanged(M64CORE_EMU_STATE, M64EMU_RUNNING);
    }
    else
    {
        if(l_msgPause)
            osd_delete_message(l_msgPause);

        DebugMessage(M64MSG_STATUS, "Emulation paused.");
        l_msgPause = osd_new_message(OSD_MIDDLE_CENTER, "Paused");
        osd_message_set_static(l_msgPause);
        StateChanged(M64CORE_EMU_STATE, M64EMU_PAUSED);
    }

    rompause = !rompause;
    l_FrameAdvance = 0;
}
Beispiel #7
0
EXPORT m64p_error CALL VidExt_ToggleFullScreen(void)
{
    /* call video extension override if necessary */
    if (l_VideoExtensionActive)
    {
        m64p_error rval = (*l_ExternalVideoFuncTable.VidExtFuncToggleFS)();
        if (rval == M64ERR_SUCCESS)
        {
            l_Fullscreen = !l_Fullscreen;
            StateChanged(M64CORE_VIDEO_MODE, l_Fullscreen ? M64VIDEO_FULLSCREEN : M64VIDEO_WINDOWED);
        }
        return rval;
    }

    if (!SDL_WasInit(SDL_INIT_VIDEO))
        return M64ERR_NOT_INIT;

    if (SDL_WM_ToggleFullScreen(l_pScreen) == 1)
    {
        l_Fullscreen = !l_Fullscreen;
        StateChanged(M64CORE_VIDEO_MODE, l_Fullscreen ? M64VIDEO_FULLSCREEN : M64VIDEO_WINDOWED);
        return M64ERR_SUCCESS;
    }

    return M64ERR_SYSTEM_FAIL;
}
Beispiel #8
0
void main_set_fastforward(int enable)
{
    static int ff_state = 0;
    static int SavedSpeedFactor = 100;

    if (enable && !ff_state)
    {
        ff_state = 1; /* activate fast-forward */
        SavedSpeedFactor = l_SpeedFactor;
        l_SpeedFactor = 250;
        setSpeedFactor(l_SpeedFactor);  /* call to audio plugin */
        StateChanged(M64CORE_SPEED_FACTOR, l_SpeedFactor);
        // set fast-forward indicator
        l_msgFF = osd_new_message(OSD_TOP_RIGHT, "Fast Forward");
        osd_message_set_static(l_msgFF);
    }
    else if (!enable && ff_state)
    {
        ff_state = 0; /* de-activate fast-forward */
        l_SpeedFactor = SavedSpeedFactor;
        setSpeedFactor(l_SpeedFactor);  // call to audio plugin
        StateChanged(M64CORE_SPEED_FACTOR, l_SpeedFactor);
        // remove message
        osd_delete_message(l_msgFF);
        l_msgFF = NULL;
    }

}
Beispiel #9
0
EXPORT m64p_error CALL VidExt_ResizeWindow(int Width, int Height)
{
    const SDL_VideoInfo *videoInfo;
    int videoFlags = 0;

    /* call video extension override if necessary */
    if (l_VideoExtensionActive)
    {
        m64p_error rval;
        // shut down the OSD
        osd_exit();
        // re-create the OGL context
        rval = (*l_ExternalVideoFuncTable.VidExtFuncResizeWindow)(Width, Height);
        if (rval == M64ERR_SUCCESS)
        {
            StateChanged(M64CORE_VIDEO_SIZE, (Width << 16) | Height);
            // re-create the On-Screen Display
            osd_init(Width, Height);
        }
        return rval;
    }

    if (!l_VideoOutputActive || !SDL_WasInit(SDL_INIT_VIDEO))
        return M64ERR_NOT_INIT;

    if (l_Fullscreen)
    {
        DebugMessage(M64MSG_ERROR, "VidExt_ResizeWindow() called in fullscreen mode.");
        return M64ERR_INVALID_STATE;
    }

    /* Get SDL video flags to use */
    videoFlags = SDL_OPENGL | SDL_RESIZABLE;
    if ((videoInfo = SDL_GetVideoInfo()) == NULL)
    {
        DebugMessage(M64MSG_ERROR, "SDL_GetVideoInfo query failed: %s", SDL_GetError());
        return M64ERR_SYSTEM_FAIL;
    }
    if (videoInfo->hw_available)
        videoFlags |= SDL_HWSURFACE;
    else
        videoFlags |= SDL_SWSURFACE;

    // destroy the On-Screen Display
    osd_exit();

    /* set the re-sizing the screen will create a new OpenGL context */
    l_pScreen = SDL_SetVideoMode(Width, Height, 0, videoFlags);
    if (l_pScreen == NULL)
    {
        DebugMessage(M64MSG_ERROR, "SDL_SetVideoMode failed: %s", SDL_GetError());
        return M64ERR_SYSTEM_FAIL;
    }

    StateChanged(M64CORE_VIDEO_SIZE, (Width << 16) | Height);
    // re-create the On-Screen Display
    osd_init(Width, Height);
    return M64ERR_SUCCESS;
}
Beispiel #10
0
EXPORT m64p_error CALL VidExt_SetVideoMode(int Width, int Height, int BitsPerPixel, m64p_video_mode ScreenMode)
{
    const SDL_VideoInfo *videoInfo;
    int videoFlags = 0;

    /* call video extension override if necessary */
    if (l_VideoExtensionActive)
    {
        m64p_error rval = (*l_ExternalVideoFuncTable.VidExtFuncSetMode)(Width, Height, BitsPerPixel, ScreenMode);
        l_Fullscreen = (rval == M64ERR_SUCCESS && ScreenMode == M64VIDEO_FULLSCREEN);
        l_VideoOutputActive = (rval == M64ERR_SUCCESS);
        if (l_VideoOutputActive)
            StateChanged(M64CORE_VIDEO_MODE, ScreenMode);
        return rval;
    }

    if (!SDL_WasInit(SDL_INIT_VIDEO))
        return M64ERR_NOT_INIT;

    /* Get SDL video flags to use */
    if (ScreenMode == M64VIDEO_WINDOWED)
        videoFlags = SDL_OPENGL;
    else if (ScreenMode == M64VIDEO_FULLSCREEN)
        videoFlags = SDL_OPENGL | SDL_FULLSCREEN;
    else
        return M64ERR_INPUT_INVALID;

    if ((videoInfo = SDL_GetVideoInfo()) == NULL)
    {
        DebugMessage(M64MSG_ERROR, "SDL_GetVideoInfo query failed: %s", SDL_GetError());
        return M64ERR_SYSTEM_FAIL;
    }
    if (videoInfo->hw_available)
        videoFlags |= SDL_HWSURFACE;
    else
        videoFlags |= SDL_SWSURFACE;

    /* set the mode */
    if (BitsPerPixel > 0)
        DebugMessage(M64MSG_INFO, "Setting %i-bit video mode: %ix%i", BitsPerPixel, Width, Height);
    else
        DebugMessage(M64MSG_INFO, "Setting video mode: %ix%i", Width, Height);

    l_pScreen = SDL_SetVideoMode(Width, Height, BitsPerPixel, videoFlags);
    if (l_pScreen == NULL)
    {
        DebugMessage(M64MSG_ERROR, "SDL_SetVideoMode failed: %s", SDL_GetError());
        return M64ERR_SYSTEM_FAIL;
    }

    SDL_ShowCursor(SDL_DISABLE);

    l_Fullscreen = (ScreenMode == M64VIDEO_FULLSCREEN);
    l_VideoOutputActive = 1;
    StateChanged(M64CORE_VIDEO_MODE, ScreenMode);
    return M64ERR_SUCCESS;
}
Beispiel #11
0
EXPORT_C void CEikButtonBase::Animate()
    {
    iButFlags|=KButtonPressedMask;
    StateChanged();
    DrawNow();
    iCoeEnv->Flush(KAnimationDelayInMicroSeconds);
    iButFlags&=(~KButtonPressedMask);
    if (!ClickCompleted())
        StateChanged();
    DrawNow();
	iCoeEnv->WsSession().Flush();
    }
Beispiel #12
0
    void VoiceSession::OnFarsightChannelStatusChanged(TelepathyIM::FarsightChannel::Status status)
    {
        emit ReceivingAudioData(IsReceivingAudioData());
        emit ReceivingVideoData(IsReceivingVideoData());
        emit SendingAudioData(IsReceivingAudioData());
        emit SendingVideoData(IsReceivingVideoData());
 
        switch (status)
        {
        case FarsightChannel::StatusConnecting:
            LogInfo("VoiceSession: FarsightChannel status = Connecting...");
            break;
        case FarsightChannel::StatusConnected:
            LogInfo("VoiceSession: FarsightChannel status = Connected.");
            //state_ = STATE_OPEN;
            //reason_ = "";
            //emit StateChanged(state_);
            break;
        case FarsightChannel::StatusDisconnected:
            LogInfo("VoiceSession: Call FarsightChannel status = terminated.");
            state_ = STATE_CLOSED;
            tp_channel_->requestClose();
            emit StateChanged(state_);
            break;
        }
    }
DownloadItem::DownloadItem(QObject *object)
    : QObject(0)
{
#ifdef WEBENGINEVIEW
    m_DefaultFileName = QString();
    m_DownloadItem = object;
    m_DownloadReply = 0;
    if(QWebEngineDownloadItem *item = qobject_cast<QWebEngineDownloadItem*>(object)){
        connect(item, &QWebEngineDownloadItem::finished,
                this, &DownloadItem::Finished);
        connect(item, &QWebEngineDownloadItem::downloadProgress,
                this, &DownloadItem::DownloadProgress);
#  if QT_VERSION >= 0x050A00
        connect(item, &QWebEngineDownloadItem::stateChanged,
                this, &DownloadItem::StateChanged);
#  endif
        m_RemoteUrl = item->url();
        m_Path = item->path();
    } else if(object){
        connect(object, SIGNAL(stateChanged()),
                this, SLOT(StateChanged()));
        connect(object, SIGNAL(receivedBytesChanged()),
                this, SLOT(ReceivedBytesChanged()));
        m_RemoteUrl = object->property("url").toUrl();
        m_Path = object->property("path").toString();
    }
    // for disabling ReadyRead.
    m_GettingPath = true;
    m_BAOut = QByteArray();
    m_FinishedFlag = false;
#else
    Q_UNUSED(object);
#endif
}
Beispiel #14
0
void main_stop(void)
{
    /* note: this operation is asynchronous.  It may be called from a thread other than the
       main emulator thread, and may return before the emulator is completely stopped */
    if (!g_EmulatorRunning)
        return;

    DebugMessage(M64MSG_STATUS, "Stopping emulation.");
    if(l_msgPause)
    {
        osd_delete_message(l_msgPause);
        l_msgPause = NULL;
    }
    if(l_msgFF)
    {
        osd_delete_message(l_msgFF);
        l_msgFF = NULL;
    }
    if (rompause)
    {
        rompause = 0;
        StateChanged(M64CORE_EMU_STATE, M64EMU_RUNNING);
    }
    stop = 1;
#ifdef DBG
    if(g_DebuggerActive)
    {
        debugger_step();
    }
#endif        
}
Beispiel #15
0
void WED_Select::CopyFrom(const WED_Select * rhs)
{
	DebugAssert(!"We should not be copying selection objects.");
	WED_Thing::CopyFrom(rhs);
	StateChanged();
	mSelected = rhs->mSelected;
}
Beispiel #16
0
bool
TCPClientPort::OnSocketEvent(SocketDescriptor _socket, unsigned mask)
{
  if (gcc_likely(!connecting.IsDefined()))
    /* connection already established: let SocketPort handle reading
       from the connection */
    return SocketPort::OnSocketEvent(_socket, mask);

  /* connection ready: check connect error */

  assert(_socket == connecting);

  io_thread->Remove(connecting.ToFileDescriptor());

  int s_err = 0;
  socklen_t s_err_size = sizeof(s_err);
  if (getsockopt(connecting.Get(), SOL_SOCKET, SO_ERROR,
                 &s_err, &s_err_size) < 0)
    s_err = errno;

  if (s_err == 0) {
    /* connection has been established successfully */
    Set(std::move(connecting));
    connecting.SetUndefined();
  } else {
    /* there was a problem */
    connecting.Close();
    StateChanged();
  }

  return true;
}
Beispiel #17
0
bool
TCPClientPort::Connect(const char *host, unsigned port)
{
  NarrowString<32> service;
  service.UnsafeFormat("%u", port);

  StaticSocketAddress address;
  if (!address.Lookup(host, service, AF_INET))
    return false;

  SocketDescriptor s;
  if (!s.CreateTCP())
    return false;

#ifdef HAVE_POSIX
  s.SetNonBlocking();
#endif

  if (s.Connect(address)) {
    Set(std::move(s));
    return true;
  }

#ifdef HAVE_POSIX
  if (errno == EINPROGRESS) {
    connecting = std::move(s);
    io_thread->LockAdd(connecting.ToFileDescriptor(), Poll::WRITE, *this);
    StateChanged();
    return true;
  }
#endif

  return false;
}
Beispiel #18
0
bool
TTYPort::Open(const TCHAR *path, unsigned _baud_rate)
{
  if (IsAndroid()) {
    /* attempt to give the XCSoar process permissions to access the
       USB serial adapter; this is mostly relevant to the Nook */
    TCHAR command[MAX_PATH];
    StringFormat(command, MAX_PATH, "su -c 'chmod 666 %s'", path);
    system(command);
  }

  if (!tty.OpenNonBlocking(path)) {
    LogErrno(_T("Failed to open port '%s'"), path);
    return false;
  }

  baud_rate = _baud_rate;
  if (!SetBaudrate(baud_rate))
    return false;

  valid.store(true, std::memory_order_relaxed);
  io_thread->LockAdd(tty.ToFileDescriptor(), Poll::READ, *this);
  StateChanged();
  return true;
}
Beispiel #19
0
tERROR cTmProfile::LockTask()
{
	if( m_lockRef++ )
		return errOK;

	AddRef();
	LockTaskReports(true);

	tERROR err = errOK;
	if( !m_remoteTask )
	{
		err = CreateTask();
		if( PR_SUCC(err) )
			err = SetTaskSettings();

		if( PR_SUCC(err) && m_taskObj && (m_stateFlags & dfTaskRestarted) )
			m_taskObj->SetSettings(m_statistics);
	}
	else if( !m_bTaskGroup )
		err = AttachTask(m_remoteTask);

	if( PR_FAIL(err) )
		StateChanged(PROFILE_STATE_FAILED, err);

	return err;
}
Beispiel #20
0
bool RenderWidget::event(QEvent* event)
{
  switch (event->type())
  {
  case QEvent::KeyPress:
  {
    QKeyEvent* ke = static_cast<QKeyEvent*>(event);
    if (ke->key() == Qt::Key_Escape)
      emit EscapePressed();
    break;
  }
  case QEvent::WinIdChange:
    emit HandleChanged((void*)winId());
    break;
  case QEvent::FocusIn:
  case QEvent::FocusOut:
    emit FocusChanged(hasFocus());
    break;
  case QEvent::WindowStateChange:
    emit StateChanged(isFullScreen());
    break;
  case QEvent::Close:
    emit Closed();
    break;
  default:
    break;
  }
  return QWidget::event(event);
}
Beispiel #21
0
void PaintWidget::addFrame(int position)
{
	painter.layers[painter.currentLayer]->addFrameForLayer( position, false );
	painter.setFrame( position, false );
	emit frameChanged(qreal(position));
	emit StateChanged("Add frame");
}
Beispiel #22
0
void ClientGameObject::ApplyState(GameObjectState& i_state)
  {
  if(nullptr != i_state.pPosition)
    SetPosition(*i_state.pPosition);
	
	m_selected = (i_state.iFlags & GOF_Selected) == GOF_Selected;

	if (i_state.informationToShow != InformationToShow::None)
		{
		auto p_game_state = static_cast<ClientStates::GameState*>(ClientGame::appInstance.GetStateMachine().GetCurrentState().get());
		auto p_message_provider = p_game_state->GetMessageProvider()->GetProvider<ClientStates::InformationMessageProvider>();
		UI::WindowType window_type = UI::WindowType::None;
		switch (i_state.informationToShow)
			{
			case InformationToShow::Dialog:
				window_type = UI::WindowType::Dialog;
				break;
			case InformationToShow::Information:
				window_type = UI::WindowType::Information;
				break;
			}

		p_message_provider->AddInformation(window_type, i_state.informationId);
		}

  StateChanged();
  }
Beispiel #23
0
void PaintWidget::group()
{
	if( !canGroup() ) return;

	GContainer *c = new GContainer;
	c->QObject::setObjectName( "New group" );

	int count = painter.layers[painter.currentLayer]->countObjects();
	for( int i = count - 1; i >= 0; i-- )
	{
		if( painter.selection.isInside( painter.layers[painter.currentLayer]->object( i ) ) )
			c->add( painter.layers[painter.currentLayer]->object( i ), true );
	}

	count = painter.selection.countSelected();
	for( int i = 0; i < count; i++ )
	{
		painter.layers[painter.currentLayer]->remove(
				painter.layers[painter.currentLayer]->objectIndex(
					GOBJECT(painter.selection.selected( i )) ) );
	}

	painter.selection.setSelected( c );
	painter.layers[painter.currentLayer]->add( c, true );
	emit allLayersChanged();
	painter.update();
	emit StateChanged("Group");
}
Beispiel #24
0
    void VoiceSession::CreateFarsightChannel()
    {
        try
        {
            // todo: for linux use "autoaudiosrc" for audio_src_name
            //       CURRENT IMPLEMENTATION WORKS ONLY ON WINDOWS
            farsight_channel_ = new FarsightChannel(tp_channel_, "dshowaudiosrc", "autovideosrc", "autovideosink");
            if ( !farsight_channel_->IsAudioSupported() )
            {
                SAFE_DELETE(farsight_channel_);
                QString message = QString("Cannot initialize audio features.");
                reason_ = message;
                LogError(message.toStdString());
                state_ = STATE_ERROR;
                emit StateChanged(state_);
                return;
            }
        }
        catch(Exception &e) 
        {
            QString message = QString("Cannot create FarsightChannel object - ").append(e.what());
            reason_ = message;
            LogError(message.toStdString());
            state_ = STATE_ERROR;
            emit StateChanged(state_);
            return;
        }

        connect( farsight_channel_, SIGNAL(AudioDataAvailable(int)), SLOT( OnFarsightAudioDataAvailable(int ) ), Qt::QueuedConnection );
        connect( farsight_channel_, SIGNAL(AudioBufferOverflow(int)), SLOT( OnFarsightAudioBufferOverflow(int ) ), Qt::QueuedConnection );

        connect(tp_channel_->becomeReady(Tp::StreamedMediaChannel::FeatureStreams),
             SIGNAL( finished(Tp::PendingOperation*) ),
             SLOT( OnStreamFeatureReady(Tp::PendingOperation*) ));

        connect(farsight_channel_,
            SIGNAL(StatusChanged(TelepathyIM::FarsightChannel::Status)),
            SLOT(OnFarsightChannelStatusChanged(TelepathyIM::FarsightChannel::Status)),  Qt::QueuedConnection);

        connect(farsight_channel_,
            SIGNAL( AudioStreamReceived() ),
            SLOT( OnFarsightChannelAudioStreamReceived() ),  Qt::QueuedConnection);

        connect(farsight_channel_,
            SIGNAL( VideoStreamReceived() ),
            SLOT( OnFarsightChannelVideoStreamReceived() ), Qt::QueuedConnection);
    }
Beispiel #25
0
 void VoiceSession::OnChannelInvalidated(Tp::DBusProxy *proxy, const QString &error, const QString &message)
 {
     QString log_message = QString(" VoiceSession::OnChannelInvalidated - ").append(error).append(" - ").append(message);
     LogInfo(log_message.toStdString());
     state_ = STATE_CLOSED;
     reason_ = message;
     emit StateChanged(state_);
 }
Beispiel #26
0
/*
====================
idListGUILocal::Clear
====================
*/
void idListGUILocal::Clear() {
	m_ids.Clear();
	idList<idStr>::Clear();
	if ( m_pGUI ) {
		// will clear all the GUI variables and will set m_water back to 0
		StateChanged();
	}
}
Beispiel #27
0
void PaintWidget::renameFigure( int layer, int obj,  const QString &name )
{
	if(layer!=-1 && obj!=-1)
	{
		painter.layers[layer]->setObjectName( obj, name );
		emit StateChanged("Rename figure");
	}
}
Beispiel #28
0
void		WED_Select::Clear(void)
{
	if (!mSelected.empty())
	{
		StateChanged(wed_Change_Selection);
		mSelected.clear();
	}
}
Beispiel #29
0
 void VoiceStateWidget::setState(State state)
 {
     State old_state = state_;
     state_ = state;
     if (old_state == STATE_OFFLINE && state == STATE_ONLINE)
         voice_activity_ = 1.0; // for notificate user about voice tranmission set on
     UpdateStyleSheet();
     emit StateChanged();
 }
Beispiel #30
0
void PaintWidget::cutToClipboard()
{
	if( !canCopyOrCutToClipboard() )
		return;

	copyToClipboard();
	deleteSelected();
	emit StateChanged("Cut");
}