refactor Security8021x to compatible QML classes

issue - #15

CmakeFiles

For the new editor, i have created a new module that will contain all the new C++ backend classes and QML files. Here is an overview image

The new EditorQML will only be built if BUILD_EDITORQML is enabled.

Security8081x Security8021xSetting is a QObject with QML_ELEMENT. Each EAP method is a separate QML file (EapTls.qml, EapPeap.qml, etc.) that is only visible when the properties setting.showTls / setting.showPeap etc. is true. The securityType property drives which EAP methods appear in the menu by loading that specific qml. List of properties that is refactored/added from old Widget file security802-1x.cpp

Property Type Replaces
eapMethod EapMethod (enum) m_ui->auth->currentData().toInt()
securityType SecurityType (enum) Constructor Type parameter
PasswordOption `PasswordOption (enum) passwordOption that inherits PasswordField
showMd5 bool currentAuthChanged()setRowVisible(md5UserName, true)
showTls bool currentAuthChanged()setRowVisible(tlsIdentity, true)
showLeap bool currentAuthChanged()setRowVisible(leapUsername, true)
showPwd bool currentAuthChanged()setRowVisible(pwdUsername, true)
showFast bool currentAuthChanged()setRowVisible(fastAnonIdentity, true)
showTtls bool currentAuthChanged()setRowVisible(ttlsAnonIdentity, true)
showPeap bool currentAuthChanged()setRowVisible(peapAnonIdentity, true)
valid bool isValid()

Similarly, for each EAP, i have created its own properties. Few examples -

MD5

Property Replaces
md5Username m_ui->md5UserName->text()
md5Password m_ui->md5Password->text()
md5PasswordOption m_ui->md5Password->passwordOption()

Key design changes

  • The Security8021x constructor is completely removed.
  • The new backend sets m_securityType which shows which items to be shown.
  • currentAuthChanged(int) changed to QML show properties.
  • Every setRowVisible() call in currentAuthChanged is replaced by a QML property.
  • Remaining static methods are kept intact.

Functions that are directly imported from old code

Edited by Tushar Gupta

Merge request reports

Loading