mirror of
https://github.com/epasveer/seer.git
synced 2026-08-29 08:34:42 +08:00
New console startup modes.
Detached Detached and minimized Attached inside Seer's tab view.
This commit is contained in:
@@ -4,6 +4,10 @@
|
||||
## [2.5beta] - 2024-XX-XX
|
||||
* Starting the 2.5 development cycle.
|
||||
* Console now supports a subset of ANSI color codes.
|
||||
* Console can be started in these modes:
|
||||
- Detached
|
||||
- Detached and minimized
|
||||
- Attached in Seer's tab view (with gdb logs and seer logs).
|
||||
|
||||
## [2.4] - 2024-03-18
|
||||
* Changed main icon to a more license friendly one.
|
||||
|
||||
+18
-54
@@ -25,7 +25,6 @@ SeerConsoleWidget::SeerConsoleWidget (QWidget* parent) : QWidget(parent) {
|
||||
_ttyDeviceName = "";
|
||||
_ptsFD = -1;
|
||||
_ptsListener = 0;
|
||||
_mode = "attached";
|
||||
_enableStdout = false;
|
||||
_enableWrap = false;
|
||||
|
||||
@@ -399,49 +398,6 @@ int SeerConsoleWidget::scrollLines () const {
|
||||
return textEdit->maximumBlockCount();
|
||||
}
|
||||
|
||||
void SeerConsoleWidget::setMode (const QString& mode) {
|
||||
|
||||
//qDebug() << mode;
|
||||
|
||||
if (mode == "attached") {
|
||||
|
||||
_mode = mode;
|
||||
|
||||
setWindowState(Qt::WindowNoState);
|
||||
|
||||
}else if (mode == "detached") {
|
||||
|
||||
_mode = mode;
|
||||
|
||||
setWindowState(Qt::WindowNoState);
|
||||
|
||||
}else if (mode == "detachedminimized") {
|
||||
|
||||
_mode = mode;
|
||||
|
||||
setWindowState(Qt::WindowMinimized);
|
||||
|
||||
}else if (mode == "") {
|
||||
|
||||
_mode = "attached";
|
||||
|
||||
setWindowState(Qt::WindowNoState);
|
||||
}
|
||||
|
||||
writeModeSettings();
|
||||
|
||||
emit modeChanged(_mode);
|
||||
}
|
||||
|
||||
QString SeerConsoleWidget::mode () const {
|
||||
|
||||
if (_mode == "") {
|
||||
return "attached";
|
||||
}
|
||||
|
||||
return _mode;
|
||||
}
|
||||
|
||||
void SeerConsoleWidget::enableStdout (bool flag) {
|
||||
|
||||
_enableStdout = flag;
|
||||
@@ -464,6 +420,24 @@ bool SeerConsoleWidget::isWrapEnabled () const {
|
||||
return _enableWrap;
|
||||
}
|
||||
|
||||
void SeerConsoleWidget::resetSize () {
|
||||
|
||||
// If there's a parent, don't reset the size.
|
||||
// This means the console is attached in the
|
||||
// tab bar and its size has been shrunk. We
|
||||
// only want to resize if the console
|
||||
// has been detached, ie: no parent.
|
||||
if (parent() != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
QSettings settings;
|
||||
|
||||
settings.beginGroup("consolewindow"); {
|
||||
resize(settings.value("size", QSize(800, 600)).toSize());
|
||||
} settings.endGroup();
|
||||
}
|
||||
|
||||
void SeerConsoleWidget::writeSettings() {
|
||||
|
||||
QSettings settings;
|
||||
@@ -474,15 +448,6 @@ void SeerConsoleWidget::writeSettings() {
|
||||
}settings.endGroup();
|
||||
}
|
||||
|
||||
void SeerConsoleWidget::writeModeSettings() {
|
||||
|
||||
QSettings settings;
|
||||
|
||||
settings.beginGroup("consolewindow"); {
|
||||
settings.setValue("mode", mode());
|
||||
}settings.endGroup();
|
||||
}
|
||||
|
||||
void SeerConsoleWidget::writeFontSettings() {
|
||||
|
||||
QSettings settings;
|
||||
@@ -516,7 +481,6 @@ void SeerConsoleWidget::readSettings() {
|
||||
|
||||
settings.beginGroup("consolewindow"); {
|
||||
|
||||
setMode(settings.value("mode", "attached").toString());
|
||||
resize(settings.value("size", QSize(800, 600)).toSize());
|
||||
enableStdout(settings.value("stdout", false).toBool());
|
||||
enableWrap(settings.value("wrap", false).toBool());
|
||||
|
||||
@@ -22,21 +22,18 @@ class SeerConsoleWidget : public QWidget, protected Ui::SeerConsoleWidgetForm {
|
||||
void setScrollLines (int count);
|
||||
int scrollLines () const;
|
||||
|
||||
void setMode (const QString& mode);
|
||||
QString mode () const;
|
||||
void enableStdout (bool flag);
|
||||
bool isStdoutEnabled () const;
|
||||
void enableWrap (bool flag);
|
||||
bool isWrapEnabled () const;
|
||||
|
||||
void resetSize ();
|
||||
|
||||
public slots:
|
||||
void handleChangeWindowTitle (QString title);
|
||||
void handleTabDetached (QWidget* widget);
|
||||
void handleTabReattached (QWidget* widget);
|
||||
|
||||
signals:
|
||||
void modeChanged (QString mode);
|
||||
|
||||
protected slots:
|
||||
void handleClearButton ();
|
||||
void handlePrintButton ();
|
||||
@@ -52,14 +49,12 @@ class SeerConsoleWidget : public QWidget, protected Ui::SeerConsoleWidgetForm {
|
||||
void createConsole ();
|
||||
void deleteConsole ();
|
||||
void writeSettings ();
|
||||
void writeModeSettings ();
|
||||
void writeFontSettings ();
|
||||
void writeSizeSettings ();
|
||||
void readSettings ();
|
||||
void resizeEvent (QResizeEvent* event);
|
||||
|
||||
private:
|
||||
QString _mode;
|
||||
QString _ttyDeviceName;
|
||||
int _ptsFD;
|
||||
QSocketNotifier* _ptsListener;
|
||||
|
||||
+25
-26
@@ -2822,22 +2822,31 @@ void SeerGdbWidget::handleGdbProcessErrored (QProcess::ProcessError errorStatus)
|
||||
}
|
||||
}
|
||||
|
||||
void SeerGdbWidget::handleConsoleModeChanged (QString mode) {
|
||||
|
||||
qDebug() << "XXX: " << mode;
|
||||
void SeerGdbWidget::handleConsoleModeChanged () {
|
||||
|
||||
if (_consoleIndex < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
qDebug() << "YYY: " << mode;
|
||||
if (_consoleWidget == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mode == "detached") {
|
||||
logsTabWidget->detachTab(_consoleIndex, Qt::WindowNoState);
|
||||
}else if (mode == "detachedminimized") {
|
||||
logsTabWidget->detachTab(_consoleIndex, Qt::WindowMinimized);
|
||||
}else if (mode == "attached") {
|
||||
logsTabWidget->reattachTab(_consoleIndex, Qt::WindowNoState);
|
||||
if (_consoleMode == "detached") {
|
||||
logsTabWidget->detachTab(_consoleIndex);
|
||||
_consoleWidget->setWindowState(Qt::WindowNoState);
|
||||
_consoleWidget->raise();
|
||||
_consoleWidget->resetSize();
|
||||
}else if (_consoleMode == "detachedminimized") {
|
||||
logsTabWidget->detachTab(_consoleIndex);
|
||||
_consoleWidget->setWindowState(Qt::WindowMinimized);
|
||||
_consoleWidget->resetSize();
|
||||
}else if (_consoleMode == "attached") {
|
||||
logsTabWidget->reattachTab(_consoleIndex);
|
||||
_consoleWidget->setWindowState(Qt::WindowNoState);
|
||||
}else{
|
||||
logsTabWidget->reattachTab(_consoleIndex);
|
||||
_consoleWidget->setWindowState(Qt::WindowNoState);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3221,11 +3230,6 @@ void SeerGdbWidget::createConsole () {
|
||||
if (_consoleWidget == 0) {
|
||||
_consoleWidget = new SeerConsoleWidget(0);
|
||||
|
||||
QObject::connect(_consoleWidget, &SeerConsoleWidget::modeChanged, this, &SeerGdbWidget::handleConsoleModeChanged);
|
||||
|
||||
setConsoleMode(consoleMode());
|
||||
setConsoleScrollLines(consoleScrollLines());
|
||||
|
||||
// Connect window title changes.
|
||||
QObject::connect(this, &SeerGdbWidget::changeWindowTitle, _consoleWidget, &SeerConsoleWidget::handleChangeWindowTitle);
|
||||
|
||||
@@ -3235,9 +3239,10 @@ void SeerGdbWidget::createConsole () {
|
||||
|
||||
_consoleIndex = logsTabWidget->addTab(_consoleWidget, "Console output");
|
||||
|
||||
writeLogsSettings();
|
||||
setConsoleMode(consoleMode());
|
||||
setConsoleScrollLines(consoleScrollLines());
|
||||
|
||||
handleConsoleModeChanged(_consoleWidget->mode());
|
||||
writeLogsSettings();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3276,20 +3281,14 @@ void SeerGdbWidget::disconnectConsole () {
|
||||
|
||||
void SeerGdbWidget::setConsoleMode (const QString& mode) {
|
||||
|
||||
qDebug() << "XXX: " << mode;
|
||||
_consoleMode = mode;
|
||||
|
||||
if (_consoleWidget != 0) {
|
||||
_consoleWidget->setMode(mode);
|
||||
}
|
||||
handleConsoleModeChanged();
|
||||
}
|
||||
|
||||
QString SeerGdbWidget::consoleMode () const {
|
||||
|
||||
if (_consoleWidget != 0) {
|
||||
return _consoleWidget->mode();
|
||||
}
|
||||
|
||||
return "attached";
|
||||
return _consoleMode;
|
||||
}
|
||||
|
||||
void SeerGdbWidget::setConsoleScrollLines (int count) {
|
||||
|
||||
+1
-1
@@ -344,7 +344,7 @@ class SeerGdbWidget : public QWidget, protected Ui::SeerGdbWidgetForm {
|
||||
void handleGdbProcessFinished (int exitCode, QProcess::ExitStatus exitStatus);
|
||||
void handleGdbProcessErrored (QProcess::ProcessError errorStatus);
|
||||
|
||||
void handleConsoleModeChanged (QString mode);
|
||||
void handleConsoleModeChanged ();
|
||||
|
||||
signals:
|
||||
void stoppingPointReached ();
|
||||
|
||||
Reference in New Issue
Block a user