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:
@@ -7,23 +7,26 @@
|
||||
#include <QMainWindow>
|
||||
|
||||
class QTabWidget;
|
||||
class ProfilesWindow;
|
||||
|
||||
class SessionWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit SessionWindow(const Profile& profile, QWidget* parent = nullptr);
|
||||
explicit SessionWindow(QWidget* parent = nullptr);
|
||||
void openProfile(const Profile& profile);
|
||||
|
||||
private:
|
||||
QTabWidget* m_tabs;
|
||||
ProfilesWindow* m_profilesWidget;
|
||||
SessionUiPreferences m_preferences;
|
||||
|
||||
void addSessionTab(const Profile& profile);
|
||||
void updateTabTitle(SessionTab* tab, const QString& title);
|
||||
void loadUiPreferences();
|
||||
void saveUiPreferences() const;
|
||||
int sessionTabCount() const;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user