Esempio n. 1
0
void MDecoratorFrame::setManagedWindow(MCompositeWindow *cw, bool no_resize)
{    
    this->no_resize = no_resize;

    if (client == cw)
        return;
    if (client)
        disconnect(client, SIGNAL(destroyed()), this, SLOT(destroyClient()));
    client = cw;

    if (!decorator_item)
        return;
    sendManagedWindowId();
    if (cw)
        connect(cw, SIGNAL(destroyed()), SLOT(destroyClient()));
}
Esempio n. 2
0
void slm_client::closeEvent(QCloseEvent *event)
{
    event->type();
    this->setGuiKey(0); // set the gui key to zero to indicate it is closed
    outgoingSocket->disconnectFromHost();
    emit destroyClient(slmclientName);
}
Esempio n. 3
0
// main thread
void ServerSocket::update()
{
    addMtx.lock();
    if (addingClients.size() > 0)
    {
        allClients.insert(addingClients.begin(), addingClients.end());
        Log::d("%d client is connected. online=%d", addingClients.size(), allClients.size());
        addingClients.clear();
    }
    addMtx.unlock();

    std::chrono::steady_clock::time_point now = std::chrono::steady_clock::now();
    int numDisconnected(0);
    for (auto iter = allClients.begin(); iter != allClients.end();)
    {
        auto client = iter->second;
        if (client->isClosing)
        {
            ++numDisconnected;
            iter = allClients.erase(iter);
            destroyClient(client);
        }
        else
        {
            if (client->isUpdate)
            {
                client->isUpdate = false;
                client->lastActiveTime = now;
                client->onRecv();
            }
            else if (now - client->lastActiveTime > config.kickTime)
            {
                client->isClosing = true;
            }
            ++iter;
        }
    }
    if (numDisconnected > 0)
    {
        Log::d("%d client is disconnected. online=%d", numDisconnected, allClients.size());
    }
    numClients = allClients.size();
}
Esempio n. 4
0
void slm_machine::clientCreation(int buddyIndex)
{
    if(!activeClientAliasList.contains(buddies->AliasBuddyList[buddyIndex],Qt::CaseInsensitive))
    {
        if(checkBuddyOnline(buddies->AliasBuddyList[buddyIndex]))
        {
            clientList.append(new slm_client());
            clientList.last()->setEncryptionKey(buddies->getKey());
            clientList.last()->show();
            clientList.last()->setGuiKey(1); // set the gui key to one to indicate it is opened
            clientList.last()->initiateClient(buddies->AliasBuddyList[buddyIndex], buddies->IPBuddyList[buddyIndex]);
            connect(clientList.last(), SIGNAL(destroyClient(QString)), this, SLOT(clearClientFromActiveList(QString)));
            connect(clientList.last(),SIGNAL(showTrayMessageTransferCompleted()),this,SLOT(showTrayMessageFileSentCompleted()));
            connect(clientList.last(),SIGNAL(encryptingStarted()),this,SLOT(showTrayMessageEncryptionStarted()));
            connect(clientList.last(),SIGNAL(encryptingFinished()),this,SLOT(showTrayMessageEncryptionFinished()));
            connect(clientList.last(),SIGNAL(informUserWaitForPeer()),this,SLOT(showTrayMessageWaitingForUsertoAccept()));
            connect(clientList.last(),SIGNAL(informMainScreenForFileTransfer(bool)),this,SLOT(setOngoingTransferFlag(bool)));
            activeClientAliasList.append(clientList.last()->getClientName());
        }
        else
        {
Esempio n. 5
0
void QWaylandCompositor::destroyClientForSurface(QWaylandSurface *surface)
{
    destroyClient(surface->client());
}
Esempio n. 6
0
void Client::createDecor()
{
	qDebug() << "CREATE DECORATIONS FOR ROLE " << windowRole;
	if (windowRole == Atoms::Splash) {
		titlebar = NULL;
		return;
	}
	
	layout = new QGridLayout(this);
	layout->setContentsMargins(0, 0, 0, 0);
	layout->setSpacing(0);

	// center frame where client apps is shown
	Border *center = new Border(this);
	layout->addWidget(center, 1, 1);

    titlebar = new Titlebar(this->icon(16), clientName, windowRole);
	layout->addWidget(titlebar, 0, 0, 1, -1);
	// Window buttons actions
	if (windowRole != Atoms::Dialog) {
    	connect(qobject_cast <WinButton *>(titlebar->minBtn), SIGNAL(wMouseLeftPress()), SLOT(iconify()));
    	connect(qobject_cast <WinButton *>(titlebar->maxBtn), SIGNAL(wMouseLeftPress()), SLOT(maximize()));
    	connect(qobject_cast <WinButton *>(titlebar->closeBtn), SIGNAL(wMouseLeftPress()), SLOT(destroyClient()));
	}
	
	bottombar = new GenericBar();
	layout->addWidget(bottombar, 2, 0, 1, -1);

	// Titlebar actions
	connect(titlebar, SIGNAL(tMouseLeftPress(QMouseEvent *)), SLOT(titlebarMousePress(QMouseEvent *)));
	connect(titlebar, SIGNAL(tMouseMove(QMouseEvent *)), SLOT(titlebarMove(QMouseEvent *)));
	if (dblClickMinimize) {
		connect(titlebar, SIGNAL(tMouseDblClick()), SLOT(iconify()));
	}
	
	// Bottombar actions
	connect(bottombar, SIGNAL(tMouseLeftPress(QMouseEvent *)), SLOT(bottombarMousePress(QMouseEvent *)));
	connect(bottombar, SIGNAL(tMouseMove(QMouseEvent *)), SLOT(bottombarMove(QMouseEvent *)));
	connect(bottombar, SIGNAL(tMouseRelease()), SLOT(bottombarMouseRelease()));
	
	setLayout(layout);
}