Skip to content

Commit

Permalink
restart warning label when a setting is changed
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmo16 committed Apr 10, 2020
1 parent f5b3791 commit 32cca43
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/View/Components/SettingsDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace View
{
m_ui.setupUi( this );
setWindowFlag( Qt::WindowContextHelpButtonHint, false );
m_ui.restartWarningLabel->hide();

m_ui.logoffCheckBox->setChecked( m_pConfig->get( Model::Config::Keys::LOGOFF_ACTIVATED ).toBool() );
connect( m_ui.logoffCheckBox, &QCheckBox::stateChanged,
Expand All @@ -32,21 +33,25 @@ namespace View

void SettingsDialog::onLogonChanged( const QCheckBox& checkbox_ )
{
m_ui.restartWarningLabel->show();
m_pConfig->set( Model::Config::Keys::LOGON_ACTIVATED, checkbox_.isChecked() );
}

void SettingsDialog::onLogoffChanged( const QCheckBox& checkbox_ )
{
m_ui.restartWarningLabel->show();
m_pConfig->set( Model::Config::Keys::LOGOFF_ACTIVATED, checkbox_.isChecked() );
}

void SettingsDialog::onLockedChanged( const QCheckBox& checkbox_ )
{
m_ui.restartWarningLabel->show();
m_pConfig->set( Model::Config::Keys::LOCKED_ACTIVATED, checkbox_.isChecked() );
}

void SettingsDialog::onUnlockedChanged( const QCheckBox& checkbox_ )
{
m_ui.restartWarningLabel->show();
m_pConfig->set( Model::Config::Keys::UNLOCKED_ACTIVATED, checkbox_.isChecked() );
}
} // namespace View
16 changes: 16 additions & 0 deletions src/View/gui/SettingsDialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,22 @@
</item>
</layout>
</widget>
<widget class="QLabel" name="restartWarningLabel">
<property name="geometry">
<rect>
<x>20</x>
<y>130</y>
<width>251</width>
<height>21</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(255, 0, 0)</string>
</property>
<property name="text">
<string>*** Application restart required ***</string>
</property>
</widget>
</widget>
</item>
</layout>
Expand Down

0 comments on commit 32cca43

Please sign in to comment.