X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=input_mapping_dialog.cpp;h=e26649d544fea217778145e1b0ea66daecaf019f;hb=refs%2Ftags%2F1.7.4;hp=f303280e62215059f246176e7db232ec2a161af8;hpb=cf7b9ee186d4ef8e5da0531b75854c97b821be44;p=nageru diff --git a/input_mapping_dialog.cpp b/input_mapping_dialog.cpp index f303280..e26649d 100644 --- a/input_mapping_dialog.cpp +++ b/input_mapping_dialog.cpp @@ -148,7 +148,8 @@ void InputMappingDialog::setup_channel_choices_from_bus(unsigned row, const Inpu QComboBox *channel_combo = new QComboBox; channel_combo->addItem(QString("(none)")); if (bus.device.type == InputSourceType::CAPTURE_CARD || - bus.device.type == InputSourceType::ALSA_INPUT) { + bus.device.type == InputSourceType::ALSA_INPUT || + bus.device.type == InputSourceType::FFMPEG_VIDEO_INPUT) { auto device_it = devices.find(bus.device); assert(device_it != devices.end()); unsigned num_device_channels = device_it->second.num_channels; @@ -159,6 +160,7 @@ void InputMappingDialog::setup_channel_choices_from_bus(unsigned row, const Inpu } channel_combo->setCurrentIndex(bus.source_channel[channel] + 1); } else { + assert(bus.device.type == InputSourceType::SILENCE); channel_combo->setCurrentIndex(0); } connect(channel_combo, static_cast(&QComboBox::currentIndexChanged), @@ -266,8 +268,14 @@ void InputMappingDialog::updown_clicked(int direction) void InputMappingDialog::save_clicked() { +#if HAVE_CEF + // The native file dialog uses GTK+, which interferes with CEF's use of the GLib main loop. + QFileDialog::Option options(QFileDialog::DontUseNativeDialog); +#else + QFileDialog::Option options; +#endif QString filename = QFileDialog::getSaveFileName(this, - "Save input mapping", QString(), tr("Mapping files (*.mapping)")); + "Save input mapping", QString(), tr("Mapping files (*.mapping)"), /*selectedFilter=*/nullptr, options); if (!filename.endsWith(".mapping")) { filename += ".mapping"; } @@ -280,8 +288,14 @@ void InputMappingDialog::save_clicked() void InputMappingDialog::load_clicked() { +#if HAVE_CEF + // The native file dialog uses GTK+, which interferes with CEF's use of the GLib main loop. + QFileDialog::Option options(QFileDialog::DontUseNativeDialog); +#else + QFileDialog::Option options; +#endif QString filename = QFileDialog::getOpenFileName(this, - "Load input mapping", QString(), tr("Mapping files (*.mapping)")); + "Load input mapping", QString(), tr("Mapping files (*.mapping)"), /*selectedFilter=*/nullptr, options); InputMapping new_mapping; if (!load_input_mapping_from_file(devices, filename.toStdString(), &new_mapping)) { QMessageBox box;