Exemplo n.º 1
0
void KSMServer::saveCurrentSession()
{
    if ( state != Idle || dialogActive )
        return;

    if ( currentSession().isEmpty() || currentSession() == SESSION_PREVIOUS_LOGOUT )
        sessionGroup = QString("Session: ") + SESSION_BY_USER;

    state = Checkpoint;
    wmPhase1WaitingCount = 0;
    saveType = SmSaveLocal;
    saveSession = true;
    performLegacySessionSave();
    for ( KSMClient* c = clients.first(); c; c = clients.next() ) {
        c->resetState();
        if( isWM( c )) {
            ++wmPhase1WaitingCount;
            SmsSaveYourself( c->connection(), saveType, false, SmInteractStyleNone, false );
        }
    }
    if( wmPhase1WaitingCount == 0 ) {
        for ( KSMClient* c = clients.first(); c; c = clients.next() )
            SmsSaveYourself( c->connection(), saveType, false, SmInteractStyleNone, false );
    }
    if ( clients.isEmpty() )
        completeShutdownOrCheckpoint();
}
void LoginForm::authenticationComplete()
{
    if (m_Greeter.isAuthenticated()) {
        Cache().setLastUser(ui->userInput->text());
        Cache().setLastSession(ui->userInput->text(), currentSession());
        Cache().sync();
        m_Greeter.startSessionSync(currentSession());
    }
    else  {
        ui->passwordInput->clear();
        userChanged();
    }
}
void PlatformMediaSessionManager::didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType command)
{
    PlatformMediaSession* activeSession = currentSession();
    if (!activeSession || !activeSession->canReceiveRemoteControlCommands())
        return;
    activeSession->didReceiveRemoteControlCommand(command);
}
Exemplo n.º 4
0
void Variable::attachMaybe(QObject *callback, const char *callbackMethod)
{
    DebugSession* session = currentSession();
    if (session) {
        QVariantMap args;
        args["frame"] = session->frameStackModel()->currentFrame();
        args["expression"] = expression();
        session->sendCommand("evaluate", args, new EvaluateCallback(this, callback, callbackMethod));
    }
}
Exemplo n.º 5
0
void StackedChatWidget::onAboutToChangeIndex(int index)
{
	if (index != m_stack->indexOf(m_chatWidget)) {
		if (m_unitActions) {
			//FIXME Symbian workaround
			m_chatWidget->removeAction(m_unitActions);
			m_unitActions->deleteLater();
		}
		if (currentSession())
			currentSession()->setActive(false);
	} else  {
		if (!m_unitActions && currentSession()) {
			//FIXME Symbian workaround
			m_unitActions = new QAction (tr("Actions"), m_chatWidget);
			m_unitActions->setMenu(currentSession()->getUnit()->menu());
			m_unitActions->setSoftKeyRole(QAction::PositiveSoftKey);
			m_chatWidget->addAction(m_unitActions);
		}
	}
}
Exemplo n.º 6
0
void Variable::fetchMoreChildren()
{
    Q_ASSERT(m_ref);
    DebugSession* session = currentSession();
    if (session) {
        QVariantMap args;
        args["handle"] = m_ref;
        Callback<Variable>* cb = new Callback<Variable>(this, &Variable::handleLookup);
        session->sendCommand("lookup", args, cb);
    }
}
Variable* Watches::add(const QString& expression)
{
    if (!hasStartedSession()) return 0;

    Variable* v = currentSession()->variableController()->createVariable(
        model(), this, expression);
    appendChild(v);
    v->attachMaybe();
    if (childCount() == 1 && !isExpanded()) {
        setExpanded(true);
    }
    return v;
}
Variable *Watches::addFinishResult(const QString& convenienceVarible)
{
    if( finishResult_ )
    {
        removeFinishResult();
    }
    finishResult_ = currentSession()->variableController()->createVariable(
        model(), this, convenienceVarible, "$ret");
    appendChild(finishResult_);
    finishResult_->attachMaybe();
    if (childCount() == 1 && !isExpanded()) {
        setExpanded(true);
    }
    return finishResult_;
}
Exemplo n.º 9
0
void Variable::setChildValues(const QVariantMap& data)
{
    deleteChildren();
    QMapIterator<QString, QVariant> i(data);
    while (i.hasNext()) {
        i.next();
        kDebug() << i.key() << i.value();
        KDevelop::Variable* xvar = currentSession()->variableController()->
            createVariable(model(), this,
                            i.key());
        Variable* var = static_cast<Variable*>(xvar);
        var->setTopLevel(false);
        appendChild(var);
        if (i.value().canConvert(QVariant::Map)) {
            var->setCrossfireValue(i.value().toMap());
        } else {
            var->setValue(i.value().toString());
        }
    }
}
Exemplo n.º 10
0
QList<Variable*> Locals::updateLocals(QStringList locals)
{
    QSet<QString> existing, current;
    for (int i = 0; i < childItems.size(); i++)
    {
        Q_ASSERT(dynamic_cast<KDevelop::Variable*>(child(i)));
        Variable* var= static_cast<KDevelop::Variable*>(child(i));
        existing << var->expression();
    }

    foreach (const QString& var, locals) {
        current << var;
        // If we currently don't display this local var, add it.
        if( !existing.contains( var ) ) {
            // FIXME: passing variableCollection this way is awkward.
            // In future, variableCollection probably should get a
            // method to create variable.
            Variable* v = 
                currentSession()->variableController()->createVariable(
                    ICore::self()->debugController()->variableCollection(),
                    this, var );
            appendChild( v, false );
        }
    }
Exemplo n.º 11
0
void SessionView::cloneCurrentSession()
{
    m_sessionModel.cloneSession(this, currentSession());
}
Exemplo n.º 12
0
void SessionView::deleteCurrentSession()
{
    m_sessionModel.deleteSession(currentSession());
}
Exemplo n.º 13
0
void SessionView::switchToCurrentSession()
{
    m_sessionModel.switchToSession(currentSession());
}
Exemplo n.º 14
0
void SessionView::renameCurrentSession()
{
    m_sessionModel.renameSession(this, currentSession());
}
Exemplo n.º 15
0
void SessionListWidget::onCloseSessionTriggered()
{
	ChatSessionImpl *s = currentSession();
	if(s)
		removeSession(s);
}
Exemplo n.º 16
0
IDebugSession::DebuggerState currentSessionState()
{
    if (!currentSession()) return IDebugSession::NotStartedState;
    return currentSession()->state();
}