Move SessionManager to Core plugin

Sessions are independent from projects, and this allows for removal of
e.g. the dependency from Bookmarks to ProjectExplorer.

Includes moving the command line arguments (-lastsession, <session>) to
Core plugin.

Change-Id: I6c578fd15c4990902e7196501de20f39376e90e8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Eike Ziller
2023-05-23 15:05:38 +02:00
parent 53aeaa1ca4
commit edd1a89807
43 changed files with 216 additions and 187 deletions

View File

@@ -0,0 +1,56 @@
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#pragma once
#include <QString>
#include <QDialog>
QT_BEGIN_NAMESPACE
class QCheckBox;
class QLineEdit;
class QPushButton;
QT_END_NAMESPACE
namespace Core::Internal {
class SessionDialog : public QDialog
{
Q_OBJECT
public:
explicit SessionDialog(QWidget *parent = nullptr);
void setAutoLoadSession(bool);
bool autoLoadSession() const;
private:
void updateActions(const QStringList &sessions);
QPushButton *m_openButton;
QPushButton *m_renameButton;
QPushButton *m_cloneButton;
QPushButton *m_deleteButton;
QCheckBox *m_autoLoadCheckBox;
};
class SessionNameInputDialog : public QDialog
{
Q_OBJECT
public:
explicit SessionNameInputDialog(QWidget *parent);
void setActionText(const QString &actionText, const QString &openActionText);
void setValue(const QString &value);
QString value() const;
bool isSwitchToRequested() const;
private:
QLineEdit *m_newSessionLineEdit = nullptr;
QPushButton *m_switchToButton = nullptr;
QPushButton *m_okButton = nullptr;
bool m_usedSwitchTo = false;
};
} // namespace Core::Internal