feat: Visiblity toggle for the log on the main window

This commit is contained in:
sithlord48 2024-12-05 16:32:01 -05:00 committed by Nick Bolton
parent 98eb89255d
commit 638970d65e
5 changed files with 174 additions and 71 deletions

View file

@ -112,6 +112,16 @@ MainWindow::MainWindow(ConfigScopes &configScopes, AppConfig &appConfig)
m_actionStartCore->setShortcut(QKeySequence(tr("Ctrl+S"))); m_actionStartCore->setShortcut(QKeySequence(tr("Ctrl+S")));
m_actionStopCore->setShortcut(QKeySequence(tr("Ctrl+T"))); m_actionStopCore->setShortcut(QKeySequence(tr("Ctrl+T")));
#ifdef Q_OS_MAC
ui->btnToggleLog->setFixedHeight(ui->lblLog->font().pixelSize());
#endif
ui->btnToggleLog->setStyleSheet(QStringLiteral("background:rgba(0,0,0,0);"));
if (m_AppConfig.logExpanded())
ui->btnToggleLog->click();
toggleLogVisible(m_AppConfig.logExpanded());
createMenuBar(); createMenuBar();
setupControls(); setupControls();
connectSlots(); connectSlots();
@ -127,6 +137,8 @@ MainWindow::MainWindow(ConfigScopes &configScopes, AppConfig &appConfig)
restoreWindow(); restoreWindow();
qDebug().noquote() << "active settings path:" << m_ConfigScopes.activeFilePath(); qDebug().noquote() << "active settings path:" << m_ConfigScopes.activeFilePath();
updateSize();
} }
MainWindow::~MainWindow() MainWindow::~MainWindow()
@ -306,6 +318,8 @@ void MainWindow::connectSlots()
connect(ui->rbModeServer, &QRadioButton::clicked, this, &MainWindow::setModeServer); connect(ui->rbModeServer, &QRadioButton::clicked, this, &MainWindow::setModeServer);
connect(ui->rbModeClient, &QRadioButton::clicked, this, &MainWindow::setModeClient); connect(ui->rbModeClient, &QRadioButton::clicked, this, &MainWindow::setModeClient);
connect(ui->btnToggleLog, &QAbstractButton::toggled, this, &MainWindow::toggleLogVisible);
} }
void MainWindow::onAppAboutToQuit() void MainWindow::onAppAboutToQuit()
@ -315,6 +329,22 @@ void MainWindow::onAppAboutToQuit()
} }
} }
void MainWindow::toggleLogVisible(bool visible)
{
if (visible) {
ui->btnToggleLog->setArrowType(Qt::DownArrow);
ui->textLog->setVisible(true);
m_AppConfig.setLogExpanded(true);
} else {
ui->btnToggleLog->setArrowType(Qt::RightArrow);
m_expandedSize = size();
ui->textLog->setVisible(false);
m_AppConfig.setLogExpanded(false);
}
// 10 ms is long enough to process events and quick enough to not see the visual change.
QTimer::singleShot(10, this, &MainWindow::updateSize);
}
void MainWindow::onShown() void MainWindow::onShown()
{ {
// if a critical error was shown just before the main window (i.e. on app // if a critical error was shown just before the main window (i.e. on app
@ -465,6 +495,26 @@ void MainWindow::resetCore()
m_CoreProcess.restart(); m_CoreProcess.restart();
} }
void MainWindow::updateSize()
{
#ifdef Q_OS_MAC
// On mac os the titlebar is part of the height so we need to adjust our Y coord to avoid moving the window up
const auto kTitleBarOffset = 28
#else
const auto kTitleBarOffset = 0;
#endif
if (ui->textLog->isVisible()) {
setMaximumHeight(16777215);
setMaximumWidth(16777215);
setGeometry(x(), y() + kTitleBarOffset , m_expandedSize.width(), m_expandedSize.height());
} else {
adjustSize();
// Prevent Resize with log collapsed
setMaximumHeight(height());
setMaximumWidth(width());
}
}
void MainWindow::showMyFingerprint() void MainWindow::showMyFingerprint()
{ {
QMessageBox::information(this, "TLS fingerprint", TlsFingerprint::local().readFirst()); QMessageBox::information(this, "TLS fingerprint", TlsFingerprint::local().readFirst());
@ -661,18 +711,18 @@ void MainWindow::handleLogLine(const QString &line)
{ {
const int kScrollBottomThreshold = 2; const int kScrollBottomThreshold = 2;
QScrollBar *verticalScroll = ui->m_pLogOutput->verticalScrollBar(); QScrollBar *verticalScroll = ui->textLog->verticalScrollBar();
int currentScroll = verticalScroll->value(); int currentScroll = verticalScroll->value();
int maxScroll = verticalScroll->maximum(); int maxScroll = verticalScroll->maximum();
const auto scrollAtBottom = qAbs(currentScroll - maxScroll) <= kScrollBottomThreshold; const auto scrollAtBottom = qAbs(currentScroll - maxScroll) <= kScrollBottomThreshold;
// only trim end instead of the whole line to prevent tab-indented debug // only trim end instead of the whole line to prevent tab-indented debug
// filenames from losing their indentation. // filenames from losing their indentation.
ui->m_pLogOutput->appendPlainText(trimEnd(line)); ui->textLog->appendPlainText(trimEnd(line));
if (scrollAtBottom) { if (scrollAtBottom) {
verticalScroll->setValue(verticalScroll->maximum()); verticalScroll->setValue(verticalScroll->maximum());
ui->m_pLogOutput->horizontalScrollBar()->setValue(0); ui->textLog->horizontalScrollBar()->setValue(0);
} }
updateFromLogLine(line); updateFromLogLine(line);

View file

@ -101,6 +101,7 @@ public slots:
void onAppAboutToQuit(); void onAppAboutToQuit();
private slots: private slots:
void toggleLogVisible(bool visible);
// //
// Manual slots // Manual slots
// //
@ -137,6 +138,7 @@ private slots:
private: private:
std::unique_ptr<Ui::MainWindow> ui; std::unique_ptr<Ui::MainWindow> ui;
void updateSize();
AppConfig &appConfig() AppConfig &appConfig()
{ {
return m_AppConfig; return m_AppConfig;
@ -200,6 +202,7 @@ private:
deskflow::gui::ClientConnection m_ClientConnection; deskflow::gui::ClientConnection m_ClientConnection;
deskflow::gui::TlsUtility m_TlsUtility; deskflow::gui::TlsUtility m_TlsUtility;
QTimer m_WindowSaveTimer; QTimer m_WindowSaveTimer;
QSize m_expandedSize = QSize();
// Window Actions // Window Actions
QAction *m_actionAbout = nullptr; QAction *m_actionAbout = nullptr;

View file

@ -6,22 +6,16 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>800</width> <width>883</width>
<height>600</height> <height>690</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred"> <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize">
<size>
<width>750</width>
<height>550</height>
</size>
</property>
<property name="windowTitle"> <property name="windowTitle">
<string>Deskflow</string> <string>Deskflow</string>
</property> </property>
@ -32,8 +26,17 @@
</property> </property>
<item> <item>
<layout class="QHBoxLayout" name="m_layoutName"> <layout class="QHBoxLayout" name="m_layoutName">
<property name="sizeConstraint">
<enum>QLayout::SizeConstraint::SetMinAndMaxSize</enum>
</property>
<item> <item>
<widget class="QLabel" name="lblComputerName"> <widget class="QLabel" name="lblComputerName">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text"> <property name="text">
<string notr="true">This computer's name:</string> <string notr="true">This computer's name:</string>
</property> </property>
@ -42,7 +45,7 @@
<item> <item>
<spacer name="m_pSpacerUpdate"> <spacer name="m_pSpacerUpdate">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Orientation::Horizontal</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
@ -54,6 +57,12 @@
</item> </item>
<item> <item>
<widget class="QLabel" name="m_pLabelUpdate"> <widget class="QLabel" name="m_pLabelUpdate">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text"> <property name="text">
<string notr="true">m_pLabelUpdate</string> <string notr="true">m_pLabelUpdate</string>
</property> </property>
@ -66,6 +75,12 @@
</item> </item>
<item> <item>
<widget class="QLabel" name="m_pLabelIpAddresses"> <widget class="QLabel" name="m_pLabelIpAddresses">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip"> <property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The highlighted IP is the one we think you should use. The server listens on all IPs, so the other IPs may work as well.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;The highlighted IP is the one we think you should use. The server listens on all IPs, so the other IPs may work as well.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
@ -110,7 +125,7 @@
<property name="spacing"> <property name="spacing">
<number>15</number> <number>15</number>
</property> </property>
<item alignment="Qt::AlignTop"> <item alignment="Qt::AlignmentFlag::AlignTop">
<widget class="QWidget" name="m_pWidgetServerRadio" native="true"> <widget class="QWidget" name="m_pWidgetServerRadio" native="true">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@ -154,7 +169,7 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item alignment="Qt::AlignTop"> <item alignment="Qt::AlignmentFlag::AlignTop">
<widget class="QWidget" name="m_pWidgetServer" native="true"> <widget class="QWidget" name="m_pWidgetServer" native="true">
<layout class="QVBoxLayout" name="m_pLayoutServer"> <layout class="QVBoxLayout" name="m_pLayoutServer">
<property name="spacing"> <property name="spacing">
@ -236,7 +251,7 @@
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;TLS enabled (&lt;a href=&quot;#&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#4285f4;&quot;&gt;fingerprint&lt;/span&gt;&lt;/a&gt;)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;TLS enabled (&lt;a href=&quot;#&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#4285f4;&quot;&gt;fingerprint&lt;/span&gt;&lt;/a&gt;)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
<property name="textFormat"> <property name="textFormat">
<enum>Qt::RichText</enum> <enum>Qt::TextFormat::RichText</enum>
</property> </property>
<property name="indent"> <property name="indent">
<number>20</number> <number>20</number>
@ -246,7 +261,7 @@
<item> <item>
<spacer name="verticalSpacer_2"> <spacer name="verticalSpacer_2">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Orientation::Vertical</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
@ -261,7 +276,7 @@
<item> <item>
<spacer name="spacer_2"> <spacer name="spacer_2">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Orientation::Horizontal</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
@ -298,7 +313,7 @@
<property name="spacing"> <property name="spacing">
<number>15</number> <number>15</number>
</property> </property>
<item alignment="Qt::AlignTop"> <item alignment="Qt::AlignmentFlag::AlignTop">
<widget class="QWidget" name="m_pWidgetClientRadio" native="true"> <widget class="QWidget" name="m_pWidgetClientRadio" native="true">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@ -342,7 +357,7 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item alignment="Qt::AlignTop"> <item alignment="Qt::AlignmentFlag::AlignTop">
<widget class="QWidget" name="m_pWidgetClientInput" native="true"> <widget class="QWidget" name="m_pWidgetClientInput" native="true">
<layout class="QVBoxLayout" name="m_pLayoutClient"> <layout class="QVBoxLayout" name="m_pLayoutClient">
<property name="spacing"> <property name="spacing">
@ -410,19 +425,6 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>1</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
@ -430,31 +432,55 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QGroupBox" name="m_pGroupLog"> <widget class="QFrame" name="frameLog">
<property name="minimumSize"> <property name="sizePolicy">
<size> <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<width>0</width> <horstretch>0</horstretch>
<height>0</height> <verstretch>0</verstretch>
</size> </sizepolicy>
</property> </property>
<property name="title"> <property name="frameShape">
<string>Logs</string> <enum>QFrame::Shape::StyledPanel</enum>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_4"> <property name="frameShadow">
<property name="leftMargin"> <enum>QFrame::Shadow::Raised</enum>
<number>8</number> </property>
</property> <layout class="QVBoxLayout" name="verticalLayout_2">
<property name="topMargin">
<number>8</number>
</property>
<property name="rightMargin">
<number>8</number>
</property>
<property name="bottomMargin">
<number>8</number>
</property>
<item> <item>
<widget class="QPlainTextEdit" name="m_pLogOutput"> <layout class="QHBoxLayout" name="horizontalLayout">
<property name="sizeConstraint">
<enum>QLayout::SizeConstraint::SetMinAndMaxSize</enum>
</property>
<item>
<widget class="QToolButton" name="btnToggleLog">
<property name="text">
<string>...</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="arrowType">
<enum>Qt::ArrowType::RightArrow</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lblLog">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Log</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QPlainTextEdit" name="textLog">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding"> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -471,7 +497,7 @@
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="lineWrapMode"> <property name="lineWrapMode">
<enum>QPlainTextEdit::NoWrap</enum> <enum>QPlainTextEdit::LineWrapMode::NoWrap</enum>
</property> </property>
<property name="readOnly"> <property name="readOnly">
<bool>true</bool> <bool>true</bool>
@ -490,19 +516,13 @@
<number>6</number> <number>6</number>
</property> </property>
<property name="sizeConstraint"> <property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum> <enum>QLayout::SizeConstraint::SetDefaultConstraint</enum>
</property> </property>
<item> <item>
<widget class="QLabel" name="m_pLabelPadlock"> <widget class="QLabel" name="m_pLabelPadlock">
<property name="enabled"> <property name="enabled">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../../../../res/gui/deskflow.qrc">:/icons/64x64/padlock.png</pixmap>
</property>
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>32</width> <width>32</width>
@ -515,10 +535,16 @@
<height>32</height> <height>32</height>
</size> </size>
</property> </property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../res/deskflow.qrc">:/icons/64x64/padlock.png</pixmap>
</property>
<property name="scaledContents"> <property name="scaledContents">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="m_pStatusLabel"> <widget class="QLabel" name="m_pStatusLabel">
@ -530,7 +556,7 @@
<item> <item>
<spacer name="spacer"> <spacer name="spacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Orientation::Horizontal</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
@ -549,7 +575,7 @@
<string notr="true">m_pLabelNotice</string> <string notr="true">m_pLabelNotice</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> <set>Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignVCenter</set>
</property> </property>
<property name="margin"> <property name="margin">
<number>0</number> <number>0</number>
@ -562,10 +588,10 @@
<item> <item>
<spacer name="horizontalSpacer"> <spacer name="horizontalSpacer">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Orientation::Horizontal</enum>
</property> </property>
<property name="sizeType"> <property name="sizeType">
<enum>QSizePolicy::Fixed</enum> <enum>QSizePolicy::Policy::Fixed</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
@ -614,14 +640,19 @@
</customwidgets> </customwidgets>
<tabstops> <tabstops>
<tabstop>rbModeServer</tabstop> <tabstop>rbModeServer</tabstop>
<tabstop>rmModeClient</tabstop>
<tabstop>lineClientIp</tabstop> <tabstop>lineClientIp</tabstop>
<tabstop>btnConnectToClient</tabstop> <tabstop>btnConnectToClient</tabstop>
<tabstop>m_pButtonConfigureServer</tabstop> <tabstop>btnConfigureServer</tabstop>
<tabstop>rbModeClient</tabstop>
<tabstop>lineHostname</tabstop> <tabstop>lineHostname</tabstop>
<tabstop>btnConnect</tabstop> <tabstop>btnConnect</tabstop>
<tabstop>m_pLogOutput</tabstop> <tabstop>btnToggleLog</tabstop>
<tabstop>textLog</tabstop>
<tabstop>btnApplySettings</tabstop> <tabstop>btnApplySettings</tabstop>
<tabstop>btnToggleCore</tabstop> <tabstop>btnToggleCore</tabstop>
</tabstops> </tabstops>
<resources>
<include location="../res/deskflow.qrc"/>
</resources>
<connections/>
</ui> </ui>

View file

@ -86,6 +86,7 @@ const char *const AppConfig::m_SettingsName[] = {
"", // 41 = Show dev thanks, obsolete "", // 41 = Show dev thanks, obsolete
"showCloseReminder", "showCloseReminder",
"enableUpdateCheck", "enableUpdateCheck",
"logExpanded",
}; };
AppConfig::AppConfig(deskflow::gui::IConfigScopes &scopes, std::shared_ptr<Deps> deps) AppConfig::AppConfig(deskflow::gui::IConfigScopes &scopes, std::shared_ptr<Deps> deps)
@ -151,6 +152,7 @@ void AppConfig::recallFromCurrentScope()
m_MainWindowSize = getFromCurrentScope<QSize>(kMainWindowSize, [](const QVariant &v) { return v.toSize(); }); m_MainWindowSize = getFromCurrentScope<QSize>(kMainWindowSize, [](const QVariant &v) { return v.toSize(); });
m_ShowCloseReminder = getFromCurrentScope(kShowCloseReminder, m_ShowCloseReminder).toBool(); m_ShowCloseReminder = getFromCurrentScope(kShowCloseReminder, m_ShowCloseReminder).toBool();
m_EnableUpdateCheck = getFromCurrentScope<bool>(kEnableUpdateCheck, [](const QVariant &v) { return v.toBool(); }); m_EnableUpdateCheck = getFromCurrentScope<bool>(kEnableUpdateCheck, [](const QVariant &v) { return v.toBool(); });
m_logExpanded = getFromCurrentScope(kLogExpanded, m_logExpanded).toBool();
} }
void AppConfig::recallScreenName() void AppConfig::recallScreenName()
@ -208,6 +210,7 @@ void AppConfig::commit()
setInCurrentScope(kMainWindowPosition, m_MainWindowPosition); setInCurrentScope(kMainWindowPosition, m_MainWindowPosition);
setInCurrentScope(kShowCloseReminder, m_ShowCloseReminder); setInCurrentScope(kShowCloseReminder, m_ShowCloseReminder);
setInCurrentScope(kEnableUpdateCheck, m_EnableUpdateCheck); setInCurrentScope(kEnableUpdateCheck, m_EnableUpdateCheck);
setInCurrentScope(kLogExpanded, m_logExpanded);
} }
if (m_TlsChanged) { if (m_TlsChanged) {
@ -584,6 +587,11 @@ std::optional<bool> AppConfig::enableUpdateCheck() const
return m_EnableUpdateCheck; return m_EnableUpdateCheck;
} }
bool AppConfig::logExpanded() const
{
return m_logExpanded;
}
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// End getters // End getters
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
@ -757,6 +765,13 @@ void AppConfig::setEnableUpdateCheck(bool value)
m_EnableUpdateCheck = value; m_EnableUpdateCheck = value;
} }
void AppConfig::setLogExpanded(bool expanded)
{
if (expanded == m_logExpanded)
return;
m_logExpanded = expanded;
}
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// End setters // End setters
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////

View file

@ -109,6 +109,7 @@ private:
// 41 = show dev thanks, obsolete // 41 = show dev thanks, obsolete
kShowCloseReminder = 42, kShowCloseReminder = 42,
kEnableUpdateCheck = 43, kEnableUpdateCheck = 43,
kLogExpanded = 44,
}; };
public: public:
@ -183,6 +184,7 @@ public:
std::optional<QPoint> mainWindowPosition() const; std::optional<QPoint> mainWindowPosition() const;
bool showCloseReminder() const; bool showCloseReminder() const;
std::optional<bool> enableUpdateCheck() const; std::optional<bool> enableUpdateCheck() const;
bool logExpanded() const;
// //
// Setters (overrides) // Setters (overrides)
@ -223,6 +225,7 @@ public:
void setMainWindowPosition(const QPoint &position); void setMainWindowPosition(const QPoint &position);
void setShowCloseReminder(bool show); void setShowCloseReminder(bool show);
void setEnableUpdateCheck(bool value); void setEnableUpdateCheck(bool value);
void setLogExpanded(bool expanded);
/// @brief Sets the user preference to load from SystemScope. /// @brief Sets the user preference to load from SystemScope.
/// @param [in] value /// @param [in] value
@ -328,6 +331,7 @@ private:
bool m_LoadFromSystemScope = false; bool m_LoadFromSystemScope = false;
bool m_ShowCloseReminder = true; bool m_ShowCloseReminder = true;
std::optional<bool> m_EnableUpdateCheck; std::optional<bool> m_EnableUpdateCheck;
bool m_logExpanded = true;
/** /**
* @brief Flag is set when any TLS is setting is changed, and is reset * @brief Flag is set when any TLS is setting is changed, and is reset