void ChatSession::OnIncomingTextChannelReady(Tp::PendingOperation* op)
{
    if (op->isError())
    {
        state_ = STATE_ERROR;
        LogError("Incoming text channel cannot become ready state");
        return;
    }
    LogDebug("Incoming text channel ready.");
    Tp::PendingReady *pr = qobject_cast<Tp::PendingReady *>(op);
    Tp::TextChannelPtr channel = Tp::TextChannelPtr(qobject_cast<Tp::TextChannel *>(pr->object()));
    tp_text_channel_ = channel;

    connect(tp_text_channel_.data(),
            SIGNAL( messageReceived(const Tp::ReceivedMessage &) ),
            SLOT( OnMessageReceived(const Tp::ReceivedMessage &) ));

    connect(tp_text_channel_.data(),
            SIGNAL( pendingMessageRemoved(const Tp::ReceivedMessage &) ),
            SLOT( OnChannelPendingMessageRemoved(const Tp::ReceivedMessage &) ));

    //! @HACK and memory leak here. We should have a contact object from Connection object!
    ChatSessionParticipant* p = new ChatSessionParticipant( new Contact(tp_text_channel_->initiatorContact()) );
    participants_.push_back(p);

    HandlePendingMessage();
    state_ = STATE_OPEN;
    emit Ready(this);
    emit Opened(this);
    for (QStringList::iterator i = send_buffer_.begin(); i != send_buffer_.end(); ++i)
        SendChatMessage( *i);
}
Exemple #2
0
DualErr 
VolFile::Mount(
	LPCSTR		path, 
	PGPUInt8	drive, 
	PGPBoolean	mountReadOnly, 
	PAD_Mount	useThisPMNT)
{
	AD_Mount	MNT, *pMNT;
	DualErr		derr;

	pMNT = (useThisPMNT ? useThisPMNT : &MNT);

	pgpAssertAddrValid(pMNT, AD_Mount);
	pgpAssert(Unmounted());
	pgpAssert(!Opened());
	
	derr = SetPath(path);

	// Set the fields we are responsible for and call down.
	if (derr.IsntError())
	{
		pMNT->path		= path;
		pMNT->sizePath	= strlen(path) + 1;
		pMNT->drive		= drive;

		derr = Volume::Mount(mountReadOnly, pMNT);
	}

	if (derr.IsError())
	{
		ClearPath();
	}

	return derr;
}
void File::Open( int64_t newOpenId, PfmOpenAttribs* openAttribs, int64_t* parentFileId, const wchar_t** endName)
{
   if (!openPrev)
   {
      if (!openId)
      {
         openId = newOpenId;
      }
      openPrev = &volume->firstOpenFile;
      openNext = *openPrev;
      if (openNext)
      {
         ASSERT( openNext->openPrev == openPrev);
         openNext->openPrev = &openNext;
      }
      *openPrev = this;
      volume->CheckConsistency();
   }
   Opened( openAttribs);
   if (parentFileId && parent)
   {
      *parentFileId = parent->fileId;
   }
   if (endName && name)
   {
      *endName = name;
   }
}
// ---------------------------------------------------------------------------
void __fastcall TMultiViewAlertPresentation::UpdateSettings(void) {
	if (!Opened())
		FDetailOverlay->Opacity = 0;
	else
		FDetailOverlay->Opacity = MultiView->ShadowOptions->Opacity;
	FDetailOverlay->EnabledShadow = MultiView->ShadowOptions->Enabled;
	FDetailOverlay->Color = MultiView->ShadowOptions->Color;
}
void ChatSession::OnOutgoingTextChannelReady(Tp::PendingOperation* op)
{
    if (op->isError())
    {
        state_ = STATE_ERROR;
        QString message = "Text channel cannot become ready for ChatSession object.";
        LogError(message.toStdString());
        return;
    }
    LogDebug("Outgoing text channel is ready.");

    Tp::PendingReady *pr = qobject_cast<Tp::PendingReady *>(op);
    Tp::TextChannelPtr channel = Tp::TextChannelPtr(qobject_cast<Tp::TextChannel *>(pr->object()));
    tp_text_channel_ = channel;

    QStringList interfaces = tp_text_channel_->interfaces();
    for (QStringList::iterator i = interfaces.begin(); i != interfaces.end(); ++i)
    {
        QString line = "Text channel have interface: ";
        line.append(*i);
        LogDebug(line.toStdString());
    }

//        Tp::ContactPtr initiator = tp_text_channel_->initiatorContact();

    bool have_message_capabilities = tp_text_channel_->isReady(Tp::TextChannel::FeatureMessageCapabilities);
    bool have_message_queue = tp_text_channel_->isReady(Tp::TextChannel::FeatureMessageQueue);
    bool have_message_sent_signal = tp_text_channel_->isReady(Tp::TextChannel::FeatureMessageSentSignal);
    UNREFERENCED_PARAM(have_message_capabilities);
    UNREFERENCED_PARAM(have_message_queue);
    UNREFERENCED_PARAM(have_message_sent_signal);
    //if (!have_message_capabilities)
    //{
    //    LogError("Text channel doesn't have the message capabilities!");
    //    state_ = STATE_ERROR;
    //    return;
    //}

    connect(tp_text_channel_.data(),
            SIGNAL( messageReceived(const Tp::ReceivedMessage &) ),
            SLOT( OnMessageReceived(const Tp::ReceivedMessage &) ));

    connect(tp_text_channel_.data(),
            SIGNAL( pendingMessageRemoved(const Tp::ReceivedMessage &) ),
            SLOT( OnChannelPendingMessageRemoved(const Tp::ReceivedMessage &) ));

    HandlePendingMessage();
    state_ = STATE_OPEN;
    emit Opened(this);
    for (QStringList::iterator i = send_buffer_.begin(); i != send_buffer_.end(); ++i)
    {
        QString text = *i;
        SendChatMessage(text);
    }
}
  ctkXnatSession *XnatSessionTracker::AddingService(const ServiceReferenceType &reference)
  {
    ctkXnatSession *session = Superclass::AddingService(reference);
    if (session->isOpen())
    {
      emit Opened(session);
    }
    connect(session, SIGNAL(sessionOpened()), this, SLOT(SessionOpened()));
    connect(session, SIGNAL(sessionAboutToBeClosed()), this, SLOT(SessionAboutToBeClosed()));

    return session;
  }
void Project::Open(const std::string& path) {
    this->path = path;
    Worlds.Clear();
    
    RefreshSourceFiles();
    
    scriptWorld.SetWorldType(*world, [] (int componentType) {
        return !SystemHelper::IsComponentEditorSpecific(componentType);
    });
    
    scriptWorld.LoadLib();
    scriptWorld.AddGameWorld(*world);
    fileSystemWatcher.Start(path);
    Opened();
}
Exemple #8
0
DualErr 
VolFile::Mount(
	LPCSTR		path, 
	LPCSTR		deviceName, 
	PGPUInt64	blocksHeader, 
	PGPUInt64	blocksDisk, 
	PGPUInt8	drive, 
	PGPBoolean	mountReadOnly)
{
	DualErr derr;

	pgpAssertStrValid(path);
	pgpAssertStrValid(deviceName);

	pgpAssert(blocksDisk > 0);
	pgpAssert(Unmounted());

	// Initialize our data members.
	mBlocksDisk		= blocksDisk;
	mBlocksHeader	= blocksHeader;

	// Open the file.
	derr = Open(path, kOF_MustExist | kOF_DenyWrite | kOF_VirtualVolume | 
		(mountReadOnly ? kOF_ReadOnly : NULL));

	// Attempt the mount.
	if (derr.IsntError())
	{
		derr = Volume::Mount(deviceName, drive, mountReadOnly);
	}

	// Cleanup in case of error.
	if (derr.IsError())
	{
		if (Opened())
			Close();
	}

	return derr;
}
void PopupShadowNode::createView()
{
  Super::createView();

  auto popup = GetView().as<winrt::Popup>();
  auto wkinstance = GetViewManager()->GetReactInstance();
  m_touchEventHanadler = std::make_shared<TouchEventHandler>(wkinstance);

  popup.Closed([=](auto&&, auto&&)
  {
    auto instance = wkinstance.lock();
    if (!m_updating && instance != nullptr)
      OnPopupClosed(*instance, m_tag, false);
  });

  popup.Opened([=](auto&&, auto&&)
  {
    auto instance = wkinstance.lock();
    if (!m_updating && instance != nullptr)
      SetAnchorPosition(popup);
  });
}
Exemple #10
0
IE::rect
Door::Frame() const
{
	return Opened() ? OpenBox() : ClosedBox();
}
 void XnatSessionTracker::SessionOpened()
 {
   ctkXnatSession *session = dynamic_cast<ctkXnatSession *>(QObject::sender());
   emit Opened(session);
 }
Exemple #12
0
	/** 検索終了? */
	bool operator!() const {
		return !Opened();
	}
Exemple #13
0
	/** 検索中? */
	operator const void*() const {
		return Opened() ? this : NULL;
	}
bool
CZipIOAccess::IsValid( void )
{GUCEF_TRACE;

    return Opened();
}