Пример #1
0
 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();
 }
Пример #2
0
void Application::saveState (QSessionManager& sm)
{
	if (Arguments_.contains ("-restart"))
		sm.setRestartHint (QSessionManager::RestartImmediately);

	sm.release ();
}
Пример #3
0
void Application::commitData (QSessionManager& sm)
{
	if (Arguments_.contains ("-autorestart"))
		sm.setRestartHint (QSessionManager::RestartImmediately);

	sm.release ();
}
Пример #4
0
/**
	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();
	}
}
Пример #5
0
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();
    }
}
Пример #6
0
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();
    }
}
Пример #7
0
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();
    }
}
void QManagedApplication::commitData(QSessionManager & manager) {
	QApplication::commitData(manager);
	ColorKeeperModel::deleteLockFile();
	ColorKeeperModel::logMessage("commitData");
	manager.release();
}