MCPcopy Create free account
hub / github.com/CE-Programming/CEmu / keymapCustomSelected

Method keymapCustomSelected

gui/qt/settings.cpp:833–856  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

831}
832
833void MainWindow::keymapCustomSelected() {
834 QFileDialog dialog(this);
835
836 m_config->remove(SETTING_KEYPAD_CUSTOM_PATH);
837
838 dialog.setDirectory(m_dir);
839 dialog.setFileMode(QFileDialog::ExistingFile);
840 dialog.setNameFilter(tr("Keymap Config (*.ini);;All files (*.*)"));
841
842 if (!dialog.exec()) {
843 ui->radioCEmuKeys->setChecked(true);
844 return;
845 }
846
847 m_dir.setPath(dialog.directory().absolutePath());
848 const auto& selectedFiles = dialog.selectedFiles();
849 if (selectedFiles.empty()) {
850 ui->radioCEmuKeys->setChecked(true);
851 return;
852 }
853
854 m_config->setValue(SETTING_KEYPAD_CUSTOM_PATH, selectedFiles.first());
855 setKeymap(SETTING_KEYPAD_CUSTOM);
856}
857
858void MainWindow::keymapChanged() {
859 if (ui->radioNaturalKeys->isChecked()) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected