[keyboard] Move remaining variables to Config

- Config already *has* everythind, but drop the useless copies
  and duplicated code from the Page
- Plug the models model into the Page
- While here, document the model / layout / variant distinctions

The code doesn't fill the UI properly, and the drop-down
for the models combobox is not right, but at least the data
is shared.
This commit is contained in:
Adriaan de Groot 2020-10-28 01:10:05 +01:00
parent fe5757c7d1
commit d464e98e89
4 changed files with 34 additions and 58 deletions

View file

@ -44,6 +44,23 @@ public:
static AdditionalLayoutInfo getAdditionalLayoutInfo( const QString& layout );
/* A model is a physical configuration of a keyboard, e.g. 105-key PC
* or TKL 88-key physical size.
*/
KeyboardModelsModel* keyboardModels() const;
/* A layout describes the basic keycaps / language assigned to the
* keys of the physical keyboard, e.g. English (US) or Russian.
*/
KeyboardLayoutModel* keyboardLayouts() const;
/* A variant describes a variant of the basic keycaps; this can
* concern options (dead keys), or different placements of the keycaps
* (dvorak).
*/
KeyboardVariantsModel* keyboardVariants() const;
signals:
void prettyStatusChanged();
private:
void guessLayout( const QStringList& langParts );
void updateVariants( const QPersistentModelIndex& currentItem, QString currentVariant = QString() );
@ -65,16 +82,6 @@ private:
QString m_xOrgConfFileName;
QString m_convertedKeymapPath;
bool m_writeEtcDefaultKeyboard = true;
protected:
KeyboardModelsModel* keyboardModels() const;
KeyboardLayoutModel* keyboardLayouts() const;
KeyboardVariantsModel* keyboardVariants() const;
signals:
void prettyStatusChanged();
};