2023-05-23 15:05:38 +02:00
|
|
|
// Copyright (C) 2023 The Qt Company Ltd.
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2016-09-26 12:44:25 +02:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "sessionmodel.h"
|
|
|
|
|
|
2017-03-30 20:51:27 +02:00
|
|
|
#include <utils/itemviews.h>
|
|
|
|
|
|
2016-09-26 12:44:25 +02:00
|
|
|
#include <QAbstractTableModel>
|
|
|
|
|
|
2023-05-23 15:05:38 +02:00
|
|
|
namespace Core::Internal {
|
2016-09-26 12:44:25 +02:00
|
|
|
|
2022-08-01 12:46:43 +02:00
|
|
|
class SessionView : public Utils::TreeView
|
|
|
|
|
{
|
2016-09-26 12:44:25 +02:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2017-02-20 15:37:21 +01:00
|
|
|
explicit SessionView(QWidget *parent = nullptr);
|
2016-09-26 12:44:25 +02:00
|
|
|
|
|
|
|
|
void createNewSession();
|
2019-05-09 16:21:42 +02:00
|
|
|
void deleteSelectedSessions();
|
2016-09-26 12:44:25 +02:00
|
|
|
void cloneCurrentSession();
|
|
|
|
|
void renameCurrentSession();
|
|
|
|
|
void switchToCurrentSession();
|
|
|
|
|
|
|
|
|
|
QString currentSession();
|
|
|
|
|
SessionModel* sessionModel();
|
|
|
|
|
void selectActiveSession();
|
2016-09-27 12:40:46 +02:00
|
|
|
void selectSession(const QString &sessionName);
|
2016-09-26 12:44:25 +02:00
|
|
|
|
|
|
|
|
signals:
|
2020-11-17 14:18:49 +01:00
|
|
|
void sessionActivated(const QString &session);
|
|
|
|
|
void sessionsSelected(const QStringList &sessions);
|
2016-09-26 12:44:25 +02:00
|
|
|
void sessionSwitched();
|
|
|
|
|
|
|
|
|
|
private:
|
2019-05-09 15:17:31 +02:00
|
|
|
void showEvent(QShowEvent* event) override;
|
|
|
|
|
void keyPressEvent(QKeyEvent *event) override;
|
|
|
|
|
|
2019-05-09 16:21:42 +02:00
|
|
|
void deleteSessions(const QStringList &sessions);
|
|
|
|
|
QStringList selectedSessions() const;
|
|
|
|
|
|
2016-09-26 12:44:25 +02:00
|
|
|
SessionModel m_sessionModel;
|
|
|
|
|
};
|
|
|
|
|
|
2023-05-23 15:05:38 +02:00
|
|
|
} // namespace Core::Internal
|