Internal
Public Access
Merge Profiles and Session windows into a single window
ProfilesWindow and SessionWindow were two independent top-level windows, coordinated through a QPointer and manual show/create-or-reuse logic, with duplicated Help menus and a path where Quit didn't actually quit if a SessionWindow happened to be open. ProfilesWindow is now an embedded QWidget shown as a permanent, unclosable "Profiles" tab inside SessionWindow's tab widget; SessionWindow is the app's sole top-level window. Double-clicking a profile opens a session tab in the same window instead of finding-or-creating a second one, and closing all session tabs falls back to the Profiles tab rather than closing the app. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "profile_repository.h"
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QWidget>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QtGlobal>
|
||||
@@ -11,7 +11,6 @@
|
||||
#include <memory>
|
||||
#include <map>
|
||||
#include <optional>
|
||||
#include <QPointer>
|
||||
#include <vector>
|
||||
#include <unordered_map>
|
||||
|
||||
@@ -21,10 +20,9 @@ class QLineEdit;
|
||||
class QPushButton;
|
||||
class QComboBox;
|
||||
class QPoint;
|
||||
class SessionWindow;
|
||||
class ProfilesTreeWidget;
|
||||
|
||||
class ProfilesWindow : public QMainWindow
|
||||
class ProfilesWindow : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -32,6 +30,12 @@ public:
|
||||
explicit ProfilesWindow(QWidget* parent = nullptr);
|
||||
~ProfilesWindow() override;
|
||||
|
||||
void createProfileInCurrentContext();
|
||||
void createFolderInCurrentContext();
|
||||
|
||||
signals:
|
||||
void connectRequested(const Profile& profile);
|
||||
|
||||
private:
|
||||
QLineEdit* m_searchBox;
|
||||
QComboBox* m_viewModeBox;
|
||||
@@ -42,7 +46,6 @@ private:
|
||||
QPushButton* m_newButton;
|
||||
QPushButton* m_editButton;
|
||||
QPushButton* m_deleteButton;
|
||||
QPointer<SessionWindow> m_sessionWindow;
|
||||
std::unique_ptr<ProfileRepository> m_repository;
|
||||
std::unordered_map<qint64, Profile> m_profileCache;
|
||||
QString m_pendingTagFilterPreference;
|
||||
|
||||
Reference in New Issue
Block a user