[partition] Warn if the system won't support encryption in a useful way
This is the infrastructure bit; if someone can come up with a way of **meaningfully** detecting support, the detection function can be given a better implementation. FIXES #1725
This commit is contained in:
parent
88afcee37a
commit
95122fdcf5
@ -13,9 +13,26 @@
|
||||
|
||||
#include "ui_EncryptWidget.h"
|
||||
|
||||
#include "Branding.h"
|
||||
#include "utils/CalamaresUtilsGui.h"
|
||||
#include "utils/Retranslator.h"
|
||||
|
||||
/** @brief Does this system support whole-disk encryption?
|
||||
*
|
||||
* Returns @c true if the system is likely to support encryption
|
||||
* with sufficient performance to be usable. A machine that can't
|
||||
* doe hardware-assisted AES is **probably** too slow, so we could
|
||||
* warn the user that ticking the "encrypt system" box is a bad
|
||||
* idea.
|
||||
*
|
||||
* Since we don't have an oracle that can answer that question,
|
||||
* just pretend every system can do it.
|
||||
*/
|
||||
static inline bool systemSupportsEncryptionAcceptably()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
EncryptWidget::EncryptWidget( QWidget* parent )
|
||||
: QWidget( parent )
|
||||
, m_ui( new Ui::EncryptWidget )
|
||||
@ -27,6 +44,18 @@ EncryptWidget::EncryptWidget( QWidget* parent )
|
||||
m_ui->m_passphraseLineEdit->hide();
|
||||
m_ui->m_confirmLineEdit->hide();
|
||||
m_ui->m_iconLabel->hide();
|
||||
// TODO: this deserves better rendering, an icon or something, but that will
|
||||
// depend on having a non-bogus implementation of systemSupportsEncryptionAcceptably
|
||||
if ( systemSupportsEncryptionAcceptably() )
|
||||
{
|
||||
m_ui->m_encryptionUnsupportedLabel->hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
// This is really ugly, but the character is unicode "unlocked"
|
||||
m_ui->m_encryptionUnsupportedLabel->setText( QStringLiteral("🔓") );
|
||||
m_ui->m_encryptionUnsupportedLabel->show();
|
||||
}
|
||||
|
||||
connect( m_ui->m_encryptCheckBox, &QCheckBox::stateChanged, this, &EncryptWidget::onCheckBoxStateChanged );
|
||||
connect( m_ui->m_passphraseLineEdit, &QLineEdit::textEdited, this, &EncryptWidget::onPassphraseEdited );
|
||||
|
@ -37,6 +37,19 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="m_encryptionUnsupportedLabel">
|
||||
<property name="toolTip">
|
||||
<string>Your system does not seem to support encryption well enough to encrypt the entire system. You may enable encryption, but performance may suffer.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">🔓</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="m_passphraseLineEdit">
|
||||
<property name="echoMode">
|
||||
@ -57,6 +70,19 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="m_iconLabel">
|
||||
<property name="text">
|
||||
|
Loading…
Reference in New Issue
Block a user