当前位置: 首页>>代码示例>>C++>>正文


C++ QSessionManager类代码示例

本文整理汇总了C++中QSessionManager的典型用法代码示例。如果您正苦于以下问题:C++ QSessionManager类的具体用法?C++ QSessionManager怎么用?C++ QSessionManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了QSessionManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: saveState

void Application::saveState (QSessionManager& sm)
{
	if (Arguments_.contains ("-restart"))
		sm.setRestartHint (QSessionManager::RestartImmediately);

	sm.release ();
}
开发者ID:Beliaf,项目名称:leechcraft,代码行数:7,代码来源:application.cpp

示例2: commitData

void Application::commitData (QSessionManager& sm)
{
	if (Arguments_.contains ("-autorestart"))
		sm.setRestartHint (QSessionManager::RestartImmediately);

	sm.release ();
}
开发者ID:generatorglukoff,项目名称:leechcraft,代码行数:7,代码来源:application.cpp

示例3: saveState

void Traverso::saveState( QSessionManager &  manager)
{
	manager.setRestartHint(QSessionManager::RestartIfRunning);
	QStringList command;
	command << "traverso" << "-session" <<  QApplication::sessionId();
	manager.setRestartCommand(command);
}
开发者ID:ErwanLegrand,项目名称:Traverso-DAW,代码行数:7,代码来源:Traverso.cpp

示例4: commitData

 virtual void commitData(QSessionManager &manager) {
     if (!m_mainWindow) return;
     bool mayAskUser = manager.allowsInteraction();
     bool success = m_mainWindow->commitData(mayAskUser);
     manager.release();
     if (!success) manager.cancel();
 }
开发者ID:dafx,项目名称:sonic-visualizer,代码行数:7,代码来源:main.cpp

示例5: commitData

void MainWindow::commitData(QSessionManager &manager)
{
    // Play nice with session management and cancel shutdown process when user
    // requests this
    if (manager.allowsInteraction())
        if (!confirmAllSave())
            manager.cancel();
}
开发者ID:ChicoTeam,项目名称:tiled,代码行数:8,代码来源:mainwindow.cpp

示例6: commitData

/**
	reimplementing QApplication::commitData().
	This function deals with session management. It is invoked when the QSessionManager wants the application to commit all its data.
 */
void MyApplication::commitData(QSessionManager& manager)
{
	debugQt("MyApplication::commitData()");
	if (manager.allowsInteraction())
	{
		manager.release();
		emit quitMyApp();
	}
}
开发者ID:danielrocher,项目名称:qtsmbstatus,代码行数:13,代码来源:mainwindows.cpp

示例7: commitData

void JavaScriptInterpreter::commitData(QSessionManager &manager)
{
	if (manager.allowsInteraction()) {
		if (!maybeSave())
			manager.cancel();
	}
	else {
		if (TextEdit_input->document()->isModified())
			save();
	}
}
开发者ID:nurfet,项目名称:world,代码行数:11,代码来源:javascriptinterpreter.cpp

示例8: saveState

 bool saveState( QSessionManager&sm) {
     QStringList restartCommand = sm.restartCommand();
     if (has_noxft)
         restartCommand.append("--noxft");
     if (login_shell)
         restartCommand.append("--ls");
     if (full_script)
         restartCommand.append("--script");
     if (!auto_close)
         restartCommand.append("--noclose");
     if (fixed_size)
         restartCommand.append("--noresize");
     sm.setRestartCommand(restartCommand);
     return true;
 }
开发者ID:,项目名称:,代码行数:15,代码来源:

示例9: commitData

void Application::commitData(QSessionManager &sessionManager)
{
    if (ticTacToe->gameInProgress()
            && sessionManager.allowsInteraction()) {
        int ret = QMessageBox::warning(ticTacToe, tr("Tic-Tac-Toe"),
                     tr("The game hasn't finished.\n"
                        "Do you really want to quit?"),
                     QMessageBox::Yes | QMessageBox::Default,
                     QMessageBox::No | QMessageBox::Escape);
        if (ret == QMessageBox::Yes)
            sessionManager.release();
        else
            sessionManager.cancel();
    }
}
开发者ID:EleVenPerfect,项目名称:OTHERS,代码行数:15,代码来源:application.cpp

示例10: onSaveState

void ClipboardServer::onSaveState(QSessionManager &sessionManager)
{
    COPYQ_LOG("Got save state request from session manager.");

    QSettings settings(QSettings::IniFormat, QSettings::UserScope, "copyq", "copyq_no_session");
    const auto sessionNameKey = "session_" + sessionManager.sessionId();
    const auto sessionName = qApp->property("CopyQ_session_name").toString();
    settings.setValue(sessionNameKey, sessionName);

    const QString lastSessionIdPrefix = "last_session_id_for_";
    const auto lastSessionIdKey = lastSessionIdPrefix + sessionName;
    const auto lastSessionId = settings.value(lastSessionIdKey).toString();
    const auto lastSessionNameKey = "session_" + lastSessionId;
    settings.setValue(lastSessionIdKey, sessionNameKey);

    // Remove no longer valid sessions from configuration.
    QSet<QString> validSessions;
    for (const QString &key : settings.childKeys()) {
        if ( key.startsWith(lastSessionIdPrefix) )
            validSessions.insert( settings.value(key).toString() );
    }

    for (const QString &key : settings.childKeys()) {
        if ( !key.startsWith(lastSessionIdPrefix) && !validSessions.contains(key) )
            settings.remove(key);
    }
}
开发者ID:hluk,项目名称:CopyQ,代码行数:27,代码来源:clipboardserver.cpp

示例11: saveState

void MobileUiApplication::saveState(QSessionManager & manager) {
  //qDebug() << QString("saving session state to id %1").arg(manager.sessionId());
  AccountId activeCore = Client::currentCoreAccount().accountId(); // FIXME store this!
  SessionSettings s(manager.sessionId());
  s.setSessionAge(0);
  QtUi::mainWindow()->saveStateToSettings(s);
}
开发者ID:ginggs,项目名称:quassel2go,代码行数:7,代码来源:mobileuiapplication.cpp

示例12: commitData

void GUIApplication::commitData(QSessionManager &manager)
{
    if (manager.allowsInteraction()) {
        if (!Gui::getMainWindow()->close()) {
            // cancel the shutdown
            manager.release();
            manager.cancel();
        }
    }
    else {
        // no user interaction allowed, thus close all documents and
        // the main window
        App::GetApplication().closeAllDocuments();
        Gui::getMainWindow()->close();
    }
}
开发者ID:needtogettomit,项目名称:FreeCAD,代码行数:16,代码来源:GuiApplication.cpp

示例13: saveState

void Application::saveState(QSessionManager &sessionManager)
{
    QString fileName = ticTacToe->saveState();

    QStringList discardCommand;
    discardCommand << "rm" << fileName;
    sessionManager.setDiscardCommand(discardCommand);
}
开发者ID:EleVenPerfect,项目名称:OTHERS,代码行数:8,代码来源:application.cpp

示例14: onCommitData

void ClipboardServer::onCommitData(QSessionManager &sessionManager)
{
    COPYQ_LOG("Got commit data request from session manager.");

    const bool cancel = sessionManager.allowsInteraction() && !askToQuit();
    sessionManager.release();

    if (cancel) {
        sessionManager.cancel();
        startMonitoring();
    } else {
        m_wnd->saveTabs();

        // WORKAROUND: This is required to exit application from
        //             installer, otherwise main window is only
        //             minimized after this when tray is disabled.
        m_wnd->hide();
        exit();
    }
}
开发者ID:hluk,项目名称:CopyQ,代码行数:20,代码来源:clipboardserver.cpp

示例15: commitData

 void commitData(QSessionManager &sm)
 {
     if(mainWidget()->isHidden())
     {
         sm.setRestartHint(QSessionManager::RestartNever);
         return;
     }
     closed_by_sm = true;
     KUniqueApplication::commitData(sm);
     closed_by_sm = false;
 }
开发者ID:serghei,项目名称:kde3-kdebase,代码行数:11,代码来源:main.cpp


注:本文中的QSessionManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。