|
|
|
@ -70,8 +70,9 @@ KeyboardPage::KeyboardPage( Config* config, QWidget* parent )
|
|
|
|
|
cDebug() << "Variants now" << model->rowCount() << model->currentIndex();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
connect(
|
|
|
|
|
ui->buttonRestore, &QPushButton::clicked, [config = config] { config->keyboardModels()->setCurrentIndex(); } );
|
|
|
|
|
connect( ui->buttonRestore, &QPushButton::clicked, [ config = config ] {
|
|
|
|
|
config->keyboardModels()->setCurrentIndex();
|
|
|
|
|
} );
|
|
|
|
|
|
|
|
|
|
connect( ui->physicalModelSelector,
|
|
|
|
|
QOverload< int >::of( &QComboBox::currentIndexChanged ),
|
|
|
|
@ -82,18 +83,22 @@ KeyboardPage::KeyboardPage( Config* config, QWidget* parent )
|
|
|
|
|
ui->physicalModelSelector,
|
|
|
|
|
&QComboBox::setCurrentIndex );
|
|
|
|
|
|
|
|
|
|
connect( ui->layoutSelector->selectionModel(),
|
|
|
|
|
&QItemSelectionModel::currentChanged,
|
|
|
|
|
[this]( const QModelIndex& current ) { m_config->keyboardLayouts()->setCurrentIndex( current.row() ); } );
|
|
|
|
|
connect( config->keyboardLayouts(), &KeyboardLayoutModel::currentIndexChanged, [this]( int index ) {
|
|
|
|
|
connect(
|
|
|
|
|
ui->layoutSelector->selectionModel(),
|
|
|
|
|
&QItemSelectionModel::currentChanged,
|
|
|
|
|
[ this ]( const QModelIndex& current ) { m_config->keyboardLayouts()->setCurrentIndex( current.row() ); } );
|
|
|
|
|
connect( config->keyboardLayouts(), &KeyboardLayoutModel::currentIndexChanged, [ this ]( int index ) {
|
|
|
|
|
ui->layoutSelector->setCurrentIndex( m_config->keyboardLayouts()->index( index ) );
|
|
|
|
|
m_keyboardPreview->setLayout( m_config->keyboardLayouts()->key( index ) );
|
|
|
|
|
} );
|
|
|
|
|
|
|
|
|
|
connect( ui->variantSelector->selectionModel(),
|
|
|
|
|
&QItemSelectionModel::currentChanged,
|
|
|
|
|
[this]( const QModelIndex& current ) { m_config->keyboardVariants()->setCurrentIndex( current.row() ); } );
|
|
|
|
|
connect( config->keyboardVariants(), &KeyboardVariantsModel::currentIndexChanged, [this]( int index ) {
|
|
|
|
|
connect(
|
|
|
|
|
ui->variantSelector->selectionModel(),
|
|
|
|
|
&QItemSelectionModel::currentChanged,
|
|
|
|
|
[ this ]( const QModelIndex& current ) { m_config->keyboardVariants()->setCurrentIndex( current.row() ); } );
|
|
|
|
|
connect( config->keyboardVariants(), &KeyboardVariantsModel::currentIndexChanged, [ this ]( int index ) {
|
|
|
|
|
ui->variantSelector->setCurrentIndex( m_config->keyboardVariants()->index( index ) );
|
|
|
|
|
m_keyboardPreview->setVariant( m_config->keyboardVariants()->key( index ) );
|
|
|
|
|
} );
|
|
|
|
|
CALAMARES_RETRANSLATE_SLOT( &KeyboardPage::retranslate )
|
|
|
|
|
}
|
|
|
|
|