Internal
Public Access
Session UX: inline password prompt and terminal font size controls
Replace the modal RDP/SSH password dialog with an inline prompt bar embedded in the session tab instead of a separate popup window. Add per-tab terminal font size controls (increase/decrease/reset/set exact point size) via the tab context menu, with the chosen size persisted across sessions. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
+22
-1
@@ -8,6 +8,7 @@
|
||||
#include <QStringList>
|
||||
#include <QtGlobal>
|
||||
|
||||
#include <functional>
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
|
||||
@@ -19,12 +20,15 @@ class RdpDisplayWidget;
|
||||
class QToolButton;
|
||||
class QLineEdit;
|
||||
class QComboBox;
|
||||
class QLabel;
|
||||
class QPushButton;
|
||||
class KodoTerm;
|
||||
|
||||
struct SessionUiPreferences
|
||||
{
|
||||
QString terminalThemeName = QStringLiteral("Dark");
|
||||
bool eventsPanelExpanded = false;
|
||||
int terminalFontPointSize = 0;
|
||||
};
|
||||
|
||||
class SessionTab : public QWidget
|
||||
@@ -46,6 +50,12 @@ public:
|
||||
QString terminalThemeName() const;
|
||||
bool supportsThemeSelection() const;
|
||||
bool supportsClearAction() const;
|
||||
bool supportsZoom() const;
|
||||
void zoomIn();
|
||||
void zoomOut();
|
||||
void resetZoom();
|
||||
void setTerminalFontPointSize(int pointSize);
|
||||
int terminalFontPointSize() const;
|
||||
bool isEventsPanelExpanded() const;
|
||||
void setEventsPanelExpanded(bool expanded);
|
||||
void clearEvents();
|
||||
@@ -56,6 +66,7 @@ signals:
|
||||
void tabTitleChanged(const QString& title);
|
||||
void tabStateChanged(SessionState state);
|
||||
void terminalThemeChanged(const QString& themeName);
|
||||
void terminalFontSizeChanged(int pointSize);
|
||||
void eventsPanelVisibilityChanged(bool expanded);
|
||||
void requestConnect(const SessionConnectOptions& options);
|
||||
void requestDisconnect();
|
||||
@@ -88,6 +99,7 @@ private:
|
||||
QString m_lastError;
|
||||
SessionConnectOptions m_lastConnectOptions;
|
||||
QString m_terminalThemeName;
|
||||
int m_terminalFontPointSize;
|
||||
|
||||
KodoTerm* m_sshTerminal;
|
||||
RdpDisplayWidget* m_rdpDisplay;
|
||||
@@ -99,6 +111,12 @@ private:
|
||||
QToolButton* m_clearEventsButton;
|
||||
QToolButton* m_exportEventsButton;
|
||||
QWidget* m_eventsPanel;
|
||||
QWidget* m_passwordPromptBar;
|
||||
QLabel* m_passwordPromptLabel;
|
||||
QLineEdit* m_passwordPromptInput;
|
||||
QPushButton* m_passwordPromptConnectButton;
|
||||
QPushButton* m_passwordPromptCancelButton;
|
||||
std::function<void(std::optional<QString>)> m_passwordPromptCallback;
|
||||
enum class EventSeverity {
|
||||
Info,
|
||||
Warning,
|
||||
@@ -114,7 +132,10 @@ private:
|
||||
bool m_eventsPanelExpanded;
|
||||
|
||||
void setupUi();
|
||||
std::optional<SessionConnectOptions> buildConnectOptions();
|
||||
void requestConnectOptions(std::function<void(std::optional<SessionConnectOptions>)> callback);
|
||||
void showPasswordPrompt(const QString& labelText,
|
||||
std::function<void(std::optional<QString>)> callback);
|
||||
void hidePasswordPrompt();
|
||||
bool validateProfileForConnect();
|
||||
void appendEvent(const QString& message);
|
||||
void setState(SessionState state, const QString& message);
|
||||
|
||||
Reference in New Issue
Block a user