diff --git a/vkconfig_core/configuration.cpp b/vkconfig_core/configuration.cpp index b584b6f163..83804f2876 100644 --- a/vkconfig_core/configuration.cpp +++ b/vkconfig_core/configuration.cpp @@ -57,7 +57,7 @@ static void AddApplicationEnabledParameters(std::vector& parameters) applications_enabled_layers_api.key = ::GetLabel(LAYER_BUILTIN_API); applications_enabled_layers_api.builtin = LAYER_BUILTIN_API; applications_enabled_layers_api.control = LAYER_CONTROL_DISCARD; // Until the Vulkan Loader is fixed - applications_enabled_layers_api.overridden_rank = 998; + applications_enabled_layers_api.overridden_rank = Parameter::NO_RANK; parameters.push_back(applications_enabled_layers_api); } @@ -76,7 +76,7 @@ static void AddApplicationEnabledParameters(std::vector& parameters) applications_enabled_layers_env.key = ::GetLabel(LAYER_BUILTIN_ENV); applications_enabled_layers_env.builtin = LAYER_BUILTIN_ENV; applications_enabled_layers_env.control = LAYER_CONTROL_DISCARD; // Until the Vulkan Loader is fixed - applications_enabled_layers_env.overridden_rank = 999; + applications_enabled_layers_env.overridden_rank = Parameter::NO_RANK; parameters.push_back(applications_enabled_layers_env); } } @@ -87,8 +87,6 @@ Configuration Configuration::Create(const LayerManager& layers, const std::strin result.key = configuration_key; result.GatherParameters(layers); - AddApplicationEnabledParameters(result.parameters); - return result; } @@ -101,8 +99,6 @@ Configuration Configuration::CreateDisabled(const LayerManager& layers) { result.parameters[i].control = LAYER_CONTROL_OFF; } - AddApplicationEnabledParameters(result.parameters); - return result; } @@ -249,8 +245,6 @@ bool Configuration::Load(const Path& full_path, const LayerManager& layers) { this->GatherParameters(layers); - AddApplicationEnabledParameters(this->parameters); - return true; } @@ -379,7 +373,7 @@ void Configuration::Reset(const LayerManager& layers) { const bool result = this->Load(builtin_configuration_files[i], layers); assert(result); - OrderParameter(this->parameters, layers); + // OrderParameter(this->parameters, layers); return; } } @@ -393,7 +387,7 @@ void Configuration::Reset(const LayerManager& layers) { const bool result = this->Load(full_path, layers); assert(result); - OrderParameter(this->parameters, layers); + // OrderParameter(this->parameters, layers); return; } @@ -407,7 +401,7 @@ void Configuration::Reset(const LayerManager& layers) { } } - OrderParameter(this->parameters, layers); + // OrderParameter(this->parameters, layers); } } @@ -421,27 +415,31 @@ bool Configuration::HasMissingLayer(const LayerManager& layers, std::vectorcontrol == LAYER_CONTROL_OFF) { - continue; // If excluded are missing, it doesn't matter + if (it->control != LAYER_CONTROL_ON) { + continue; // If not on, let's say it doesn't matter so it's not notified to the users } - if (layers.Find(it->key, it->api_version) == nullptr) { - missing_layers.push_back(it->key); - continue; - } /* + if (layers.Find(it->key, it->api_version) == nullptr) { + missing_layers.push_back(it->key); + continue; + } + */ + if (layers.FindFromManifest(it->manifest) == nullptr) { missing_layers.push_back(it->key); continue; } - */ } return !missing_layers.empty(); } void Configuration::SwitchLayerVersion(const LayerManager& layers, const std::string& layer_key, const Path& manifest_path) { - assert(!manifest_path.Empty()); + if (manifest_path.Empty()) { + this->SwitchLayerLatest(layers, layer_key); + return; + } Parameter* parameter = this->Find(layer_key); assert(parameter != nullptr); @@ -497,7 +495,9 @@ void Configuration::GatherParameters(const LayerManager& layers) { gathered_parameters.push_back(parameter); } - // OrderParameter(gathered_parameters, layers); + ::AddApplicationEnabledParameters(gathered_parameters); + + ::OrderParameter(gathered_parameters, layers); this->parameters = gathered_parameters; } diff --git a/vkconfig_core/configuration_manager.cpp b/vkconfig_core/configuration_manager.cpp index 770ba1a119..2829b33123 100644 --- a/vkconfig_core/configuration_manager.cpp +++ b/vkconfig_core/configuration_manager.cpp @@ -167,10 +167,12 @@ void ConfigurationManager::LoadConfigurationsPath(const LayerManager &layers) { continue; } + /* std::string missing_layer; if (!HasMissingLayer(configuration.parameters, layers, missing_layer)) { - OrderParameter(configuration.parameters, layers); + //OrderParameter(configuration.parameters, layers); } + */ available_configurations.push_back(configuration); } diff --git a/vkconfig_core/layer_manager.cpp b/vkconfig_core/layer_manager.cpp index 2ccbb0255e..bbd18b40d0 100644 --- a/vkconfig_core/layer_manager.cpp +++ b/vkconfig_core/layer_manager.cpp @@ -176,9 +176,10 @@ bool LayerManager::Save(QJsonObject &json_root_object) const { QJsonObject json_paths_object; for (int paths_type_index = LAYERS_PATHS_FIRST; paths_type_index <= LAYERS_PATHS_LAST; ++paths_type_index) { - for (std::size_t i = 0, n = this->paths[paths_type_index].size(); i < n; ++i) { - json_paths_object.insert(this->paths[paths_type_index][i].path.RelativePath().c_str(), - this->paths[paths_type_index][i].enabled); + const std::vector &path_infos = this->paths[paths_type_index]; + + for (std::size_t i = 0, n = path_infos.size(); i < n; ++i) { + json_paths_object.insert(path_infos[i].path.RelativePath().c_str(), path_infos[i].enabled); } } @@ -341,8 +342,12 @@ const Layer *LayerManager::FindLastModified(const std::string &layer_name, const return result; } -const Layer *LayerManager::FindFromManifest(const Path &manifest_path) const { +const Layer *LayerManager::FindFromManifest(const Path &manifest_path, bool find_disabled_layers) const { for (std::size_t i = 0, n = this->selected_layers.size(); i < n; ++i) { + if (!find_disabled_layers && this->selected_layers[i].enabled == false) { + continue; + } + if (this->selected_layers[i].manifest_path == manifest_path) { return &this->selected_layers[i]; } @@ -350,8 +355,12 @@ const Layer *LayerManager::FindFromManifest(const Path &manifest_path) const { return nullptr; } -Layer *LayerManager::FindFromManifest(const Path &manifest_path) { +Layer *LayerManager::FindFromManifest(const Path &manifest_path, bool find_disabled_layers) { for (std::size_t i = 0, n = this->selected_layers.size(); i < n; ++i) { + if (!find_disabled_layers && this->selected_layers[i].enabled == false) { + continue; + } + if (this->selected_layers[i].manifest_path == manifest_path) { return &this->selected_layers[i]; } @@ -369,6 +378,7 @@ void LayerManager::LoadAllInstalledLayers() { const std::vector &paths_group = this->paths[group_index]; for (std::size_t i = 0, n = paths_group.size(); i < n; ++i) { this->LoadLayersFromPath(paths_group[i].path, paths_group[i].type); + this->UpdatePathEnabled(paths_group[i]); } } } @@ -457,7 +467,7 @@ void LayerManager::UpdatePathEnabled(const LayersPathInfo &path_info) { const std::vector &layers_paths = CollectFilePaths(path_info.path); for (std::size_t i = 0, n = layers_paths.size(); i < n; ++i) { - Layer *layer = this->FindFromManifest(layers_paths[i]); + Layer *layer = this->FindFromManifest(layers_paths[i], true); if (layer == nullptr) { continue; } @@ -470,6 +480,10 @@ std::vector LayerManager::BuildLayerNameList() const { std::vector result; for (std::size_t i = 0, n = this->selected_layers.size(); i < n; ++i) { + if (this->selected_layers[i].enabled == false) { + continue; + } + if (std::find(result.begin(), result.end(), this->selected_layers[i].key) != result.end()) { continue; } diff --git a/vkconfig_core/layer_manager.h b/vkconfig_core/layer_manager.h index a9b27c5809..2327325732 100644 --- a/vkconfig_core/layer_manager.h +++ b/vkconfig_core/layer_manager.h @@ -43,8 +43,8 @@ class LayerManager : public Serialize { std::vector GatherVersions(const std::string& layer_name) const; const Layer* Find(const std::string& layer_name, const Version& version = Version::LATEST) const; const Layer* FindLastModified(const std::string& layer_name, const Version& version) const; - const Layer* FindFromManifest(const Path& manifest_path) const; - Layer* FindFromManifest(const Path& manifest_path); + const Layer* FindFromManifest(const Path& manifest_path, bool find_disabled_layers = false) const; + Layer* FindFromManifest(const Path& manifest_path, bool find_disabled_layers = false); void LoadAllInstalledLayers(); void LoadLayersFromPath(const Path& layers_path, LayerType type = LAYER_TYPE_EXPLICIT); diff --git a/vkconfig_core/parameter.cpp b/vkconfig_core/parameter.cpp index 53c2a40f71..67076c20ad 100644 --- a/vkconfig_core/parameter.cpp +++ b/vkconfig_core/parameter.cpp @@ -59,21 +59,19 @@ ParameterRank GetParameterOrdering(const LayerManager& layers, const Parameter& assert(!parameter.key.empty()); const Layer* layer = layers.Find(parameter.key, parameter.api_version); - if (layer == nullptr) { - return PARAMETER_RANK_MISSING; - } else if (parameter.control == LAYER_CONTROL_OFF) { - return PARAMETER_RANK_EXCLUDED; - } else if (parameter.control == LAYER_CONTROL_AUTO && layer->type == LAYER_TYPE_IMPLICIT) { - return PARAMETER_RANK_IMPLICIT_AVAILABLE; - } else if (parameter.control == LAYER_CONTROL_ON && layer->type == LAYER_TYPE_IMPLICIT) { - return PARAMETER_RANK_IMPLICIT_OVERRIDDEN; - } else if (parameter.control == LAYER_CONTROL_ON && layer->type != LAYER_TYPE_IMPLICIT) { - return PARAMETER_RANK_EXPLICIT_OVERRIDDEN; - } else if (parameter.control == LAYER_CONTROL_AUTO && layer->type != LAYER_TYPE_IMPLICIT) { - return PARAMETER_RANK_EXPLICIT_AVAILABLE; + if (parameter.builtin == LAYER_BUILTIN_ENV) { + return PARAMETER_RANK_APPPLICATION_ENV; + } else if (parameter.builtin == LAYER_BUILTIN_API) { + return PARAMETER_RANK_APPPLICATION_API; + } else if (layer == nullptr) { + return PARAMETER_RANK_MISSING_LAYER; + } else if (layer->type == LAYER_TYPE_IMPLICIT) { + return PARAMETER_RANK_IMPLICIT_LAYER; + } else if (layer->type == LAYER_TYPE_EXPLICIT) { + return PARAMETER_RANK_EXPLICIT_LAYER; } else { assert(0); // Unknown ordering - return PARAMETER_RANK_MISSING; + return PARAMETER_RANK_MISSING_LAYER; } } @@ -85,31 +83,23 @@ void OrderParameter(std::vector& parameters, const LayerManager& laye const ParameterRank rankA = GetParameterOrdering(layers, a); const ParameterRank rankB = GetParameterOrdering(layers, b); - const bool both_ranked = a.overridden_rank != Parameter::NO_RANK && b.overridden_rank != Parameter::NO_RANK; + const bool both_overridden = a.overridden_rank != Parameter::NO_RANK && b.overridden_rank != Parameter::NO_RANK; - if (rankA == rankB && a.control == LAYER_CONTROL_ON) - if (a.overridden_rank != Parameter::NO_RANK && b.overridden_rank != Parameter::NO_RANK) - return a.overridden_rank < b.overridden_rank; - else if (a.key == VK_LAYER_KHRONOS_PROFILES_NAME) - return false; - else if (b.key == VK_LAYER_KHRONOS_PROFILES_NAME) - return true; - else if (a.key == VK_LAYER_KHRONOS_VALIDATION_NAME && b.key == VK_LAYER_KHRONOS_PROFILES_NAME) + if (both_overridden) + return a.overridden_rank < b.overridden_rank; + else if (rankA == rankB) + if (a.key == VK_LAYER_KHRONOS_VALIDATION_NAME && b.key == VK_LAYER_KHRONOS_PROFILES_NAME) return true; + else if (a.key == VK_LAYER_KHRONOS_PROFILES_NAME && b.key == VK_LAYER_KHRONOS_VALIDATION_NAME) + return false; else if (a.key == VK_LAYER_KHRONOS_VALIDATION_NAME) + return true; + else if (b.key == VK_LAYER_KHRONOS_VALIDATION_NAME) return false; else return a.key < b.key; - else if (both_ranked && rankA == PARAMETER_RANK_IMPLICIT_OVERRIDDEN && rankB == PARAMETER_RANK_EXPLICIT_OVERRIDDEN) - return a.overridden_rank < b.overridden_rank; - else if (both_ranked && rankA == PARAMETER_RANK_EXPLICIT_OVERRIDDEN && rankB == PARAMETER_RANK_IMPLICIT_OVERRIDDEN) - return a.overridden_rank < b.overridden_rank; - else if (rankA == rankB && a.control != LAYER_CONTROL_ON) - return a.key < b.key; - else if (rankA != rankB) - return rankA < rankB; else - return a.key < b.key; + return rankA < rankB; } const LayerManager& layers; @@ -127,6 +117,10 @@ void OrderParameter(std::vector& parameters, const LayerManager& laye bool HasMissingLayer(const std::vector& parameters, const LayerManager& layers, std::string& missing_layer) { for (auto it = parameters.begin(), end = parameters.end(); it != end; ++it) { + if (it->builtin != LAYER_BUILTIN_NONE) { + continue; // If application API or ENV layers + } + if (it->control == LAYER_CONTROL_OFF) { continue; // If excluded are missing, it doesn't matter } diff --git a/vkconfig_core/parameter.h b/vkconfig_core/parameter.h index b5ea51fb48..1ab01a57cf 100644 --- a/vkconfig_core/parameter.h +++ b/vkconfig_core/parameter.h @@ -28,12 +28,11 @@ #include enum ParameterRank { - PARAMETER_RANK_MISSING = 0, - PARAMETER_RANK_EXCLUDED, - PARAMETER_RANK_IMPLICIT_AVAILABLE, - PARAMETER_RANK_IMPLICIT_OVERRIDDEN, - PARAMETER_RANK_EXPLICIT_OVERRIDDEN, - PARAMETER_RANK_EXPLICIT_AVAILABLE + PARAMETER_RANK_MISSING_LAYER = 0, + PARAMETER_RANK_IMPLICIT_LAYER, + PARAMETER_RANK_EXPLICIT_LAYER, + PARAMETER_RANK_APPPLICATION_ENV, + PARAMETER_RANK_APPPLICATION_API, }; struct Parameter { diff --git a/vkconfig_core/test/Configuration 3.0.0.json b/vkconfig_core/test/Configuration 3.0.0.json index 1198e73b97..3b1c89e179 100644 --- a/vkconfig_core/test/Configuration 3.0.0.json +++ b/vkconfig_core/test/Configuration 3.0.0.json @@ -12,7 +12,6 @@ "layers": [ { "name": "VK_LAYER_LUNARG_reference_1_2_1", - "rank": 8, "version": "latest", "settings": [ { diff --git a/vkconfig_core/test/test_parameter.cpp b/vkconfig_core/test/test_parameter.cpp index 16d4ff5ec4..04956dc529 100644 --- a/vkconfig_core/test/test_parameter.cpp +++ b/vkconfig_core/test/test_parameter.cpp @@ -130,9 +130,9 @@ TEST(test_parameter, apply_settings) { TEST(test_parameter, ordering_no_layers) { LayerManager layer_manager; - EXPECT_EQ(PARAMETER_RANK_MISSING, GetParameterOrdering(layer_manager, Parameter("Layer", LAYER_CONTROL_AUTO))); - EXPECT_EQ(PARAMETER_RANK_MISSING, GetParameterOrdering(layer_manager, Parameter("Layer", LAYER_CONTROL_ON))); - EXPECT_EQ(PARAMETER_RANK_MISSING, GetParameterOrdering(layer_manager, Parameter("Layer", LAYER_CONTROL_OFF))); + EXPECT_EQ(PARAMETER_RANK_MISSING_LAYER, GetParameterOrdering(layer_manager, Parameter("Layer", LAYER_CONTROL_AUTO))); + EXPECT_EQ(PARAMETER_RANK_MISSING_LAYER, GetParameterOrdering(layer_manager, Parameter("Layer", LAYER_CONTROL_ON))); + EXPECT_EQ(PARAMETER_RANK_MISSING_LAYER, GetParameterOrdering(layer_manager, Parameter("Layer", LAYER_CONTROL_OFF))); } /* TEST(test_parameter, ordering_found_custom_layers) { diff --git a/vkconfig_gui/settings_tree.cpp b/vkconfig_gui/settings_tree.cpp index e77d981870..0cd6c07dcc 100644 --- a/vkconfig_gui/settings_tree.cpp +++ b/vkconfig_gui/settings_tree.cpp @@ -68,8 +68,16 @@ void SettingsTreeManager::CreateGUI() { Parameter *parameter = configuration != nullptr ? configuration->GetActiveParameter() : nullptr; const bool no_selected_layer = configuration != nullptr ? configuration->selected_layer_name.empty() : false; + if (parameter != nullptr) { + if (parameter->manifest.Empty()) { + configuration->SwitchLayerLatest(configurator.layers, configuration->GetActiveParameter()->key); + } else { + configuration->SwitchLayerVersion(configurator.layers, configuration->GetActiveParameter()->key, parameter->manifest); + } + } + // Group box things - const Layer *layer = parameter != nullptr ? configurator.layers.Find(parameter->key, parameter->api_version) : nullptr; + const Layer *layer = parameter != nullptr ? configurator.layers.FindFromManifest(parameter->manifest) : nullptr; if (no_selected_layer) { this->ui->configurations_group_box_settings->setTitle("Select a layer to display settings"); @@ -93,10 +101,10 @@ void SettingsTreeManager::CreateGUI() { this->ui->configurations_presets->setVisible(!layer->presets.empty()); } - const std::vector &layer_version = configurator.layers.GatherManifests(parameter->key); - this->layer_version->setVisible(layer_version.size() > 1); - if (layer_version.size() > 1) { - this->layer_version->Init(*parameter, layer_version); + const std::vector &layer_versions = configurator.layers.GatherManifests(parameter->key); + this->layer_version->setVisible(!layer_versions.empty()); + if (!layer_versions.empty()) { + this->layer_version->Init(*parameter, layer_versions); } // preset combobox diff --git a/vkconfig_gui/tab_configurations.cpp b/vkconfig_gui/tab_configurations.cpp index da4b5bc241..18eabc9b24 100644 --- a/vkconfig_gui/tab_configurations.cpp +++ b/vkconfig_gui/tab_configurations.cpp @@ -139,9 +139,9 @@ void TabConfigurations::UpdateUI_Configurations(UpdateUIMode ui_update_mode) { const bool has_missing_layer = configuration.HasMissingLayer(configurator.layers, missing_layers); // Hide built-in configuration when the layer is missing. The Vulkan user may have not installed the necessary layer - if (configuration.IsBuiltIn() && has_missing_layer) { - continue; - } + // if (configuration.IsBuiltIn() && has_missing_layer) { + // continue; + //} ListItem *item = new ListItem(configuration.key.c_str()); item->setFlags(item->flags() | Qt::ItemIsEditable); diff --git a/vkconfig_gui/tab_layers.cpp b/vkconfig_gui/tab_layers.cpp index 3351669117..9611497d75 100644 --- a/vkconfig_gui/tab_layers.cpp +++ b/vkconfig_gui/tab_layers.cpp @@ -65,7 +65,7 @@ void TabLayers::UpdateUI_LayersPaths(UpdateUIMode ui_update_mode) { item_state->setFlags(item_state->flags() | Qt::ItemIsSelectable); item_state->setSizeHint(0, QSize(0, 32)); LayersPathWidget *layer_path_widget = new LayersPathWidget(&paths_group[i], group_path); - this->connect(layer_path_widget, SIGNAL(toggled(bool)), this, SLOT(on_check_box_paths_toggled(bool))); + this->connect(layer_path_widget, SIGNAL(itemChanged()), this, SLOT(on_check_box_paths_changed())); ui->layers_paths_tree->addTopLevelItem(item_state); ui->layers_paths_tree->setItemWidget(item_state, 0, layer_path_widget); @@ -75,7 +75,7 @@ void TabLayers::UpdateUI_LayersPaths(UpdateUIMode ui_update_mode) { for (std::size_t manifest_index = 0, manifest_count = manifest_paths.size(); manifest_index < manifest_count; ++manifest_index) { - const Layer *layer = configurator.layers.FindFromManifest(manifest_paths[manifest_index]); + const Layer *layer = configurator.layers.FindFromManifest(manifest_paths[manifest_index], true); if (layer == nullptr) { continue; // When the directory has JSON files that are not layer manifest } @@ -95,7 +95,7 @@ void TabLayers::UpdateUI_LayersPaths(UpdateUIMode ui_update_mode) { QTreeWidgetItem *item = new QTreeWidgetItem; item->setText(0, label.c_str()); item->setToolTip(0, layer->manifest_path.AbsolutePath().c_str()); - item->setDisabled(!layer->enabled); + item->setDisabled(!paths_group[i].enabled); item_state->addChild(item); } } @@ -115,11 +115,7 @@ void TabLayers::CleanUI() {} bool TabLayers::EventFilter(QObject *target, QEvent *event) { return false; } -void TabLayers::on_check_box_paths_toggled(bool checked) { - (void)checked; - - this->UpdateUI_LayersPaths(UPDATE_REBUILD_UI); -} +void TabLayers::on_check_box_paths_changed() { this->UpdateUI_LayersPaths(UPDATE_REBUILD_UI); } void TabLayers::on_layers_validate_checkBox_toggled(bool checked) { Configurator &configurator = Configurator::Get(); diff --git a/vkconfig_gui/tab_layers.h b/vkconfig_gui/tab_layers.h index 53110ff4a9..0db3775977 100644 --- a/vkconfig_gui/tab_layers.h +++ b/vkconfig_gui/tab_layers.h @@ -36,7 +36,7 @@ class TabLayers : public Tab { void UpdateUI_LayersPaths(UpdateUIMode ui_update_mode); public Q_SLOTS: - void on_check_box_paths_toggled(bool checked); + void on_check_box_paths_changed(); void on_layers_validate_checkBox_toggled(bool checked); void on_layers_append_pressed(); void on_layers_browse_pressed(); diff --git a/vkconfig_gui/widget_layer_version.cpp b/vkconfig_gui/widget_layer_version.cpp index 3c87ea208d..36929c3da2 100644 --- a/vkconfig_gui/widget_layer_version.cpp +++ b/vkconfig_gui/widget_layer_version.cpp @@ -37,6 +37,8 @@ void LayerVersionComboBox::Init(const Parameter ¶meter, const std::vectorblockSignals(true); + this->data.clear(); + this->clear(); this->addItem("Latest"); this->setItemData(0, layer_latest->manifest_path.AbsolutePath().c_str(), Qt::ToolTipRole); @@ -80,11 +82,7 @@ void LayerVersionComboBox::on_layer_version_combobox_currentIndexChanged(int ind Configurator &configurator = Configurator::Get(); Configuration *configuration = configurator.GetActiveConfiguration(); - if (index == 0) { // latest - configuration->SwitchLayerLatest(configurator.layers, configuration->GetActiveParameter()->key); - } else { - configuration->SwitchLayerVersion(configurator.layers, configuration->GetActiveParameter()->key, path); - } + configuration->SwitchLayerVersion(configurator.layers, configuration->GetActiveParameter()->key, path); const Layer *layer = configurator.layers.FindFromManifest(this->data[index]); assert(layer != nullptr); diff --git a/vkconfig_gui/widget_tab_configurations_layer.cpp b/vkconfig_gui/widget_tab_configurations_layer.cpp index 2cc76baf2c..9728c00b8d 100644 --- a/vkconfig_gui/widget_tab_configurations_layer.cpp +++ b/vkconfig_gui/widget_tab_configurations_layer.cpp @@ -57,6 +57,9 @@ ConfigurationLayerWidget::ConfigurationLayerWidget(TabConfigurations *tab, const this->connect(this->layer_state, SIGNAL(currentIndexChanged(int)), this, SLOT(on_layer_state_currentIndexChanged(int))); + const bool layer_found = layer != nullptr || parameter.builtin != LAYER_BUILTIN_NONE; + this->setEnabled(layer_found); + std::string decorated_name = parameter.key; if (layer != nullptr) { @@ -69,6 +72,8 @@ ConfigurationLayerWidget::ConfigurationLayerWidget(TabConfigurations *tab, const if (layer->status != STATUS_STABLE) { decorated_name += format(" (%s)", GetToken(layer->status)); } + } else if (!layer_found) { + decorated_name += " (Missing)"; } /* if (layer_versions.empty()) { @@ -83,8 +88,7 @@ ConfigurationLayerWidget::ConfigurationLayerWidget(TabConfigurations *tab, const if (parameter.builtin != LAYER_BUILTIN_NONE) { this->setToolTip(::GetDescription(parameter.builtin)); - } else { - assert(!parameter.manifest.Empty()); + } else if (!parameter.manifest.Empty()) { this->setToolTip(parameter.manifest.AbsolutePath().c_str()); } } diff --git a/vkconfig_gui/widget_tab_layers_path.cpp b/vkconfig_gui/widget_tab_layers_path.cpp index a57a186f21..4d9cd125dd 100644 --- a/vkconfig_gui/widget_tab_layers_path.cpp +++ b/vkconfig_gui/widget_tab_layers_path.cpp @@ -112,5 +112,7 @@ void LayersPathWidget::on_toggled(bool checked) { Configurator& configurator = Configurator::Get(); configurator.layers.UpdatePathEnabled(*this->path_info); + + itemChanged(); } } diff --git a/vkconfig_gui/widget_tab_layers_path.h b/vkconfig_gui/widget_tab_layers_path.h index 2eabd2f416..c452304113 100644 --- a/vkconfig_gui/widget_tab_layers_path.h +++ b/vkconfig_gui/widget_tab_layers_path.h @@ -40,6 +40,9 @@ class LayersPathWidget : public QCheckBox { void on_buttom_remove_clicked(bool checked = false); void on_toggled(bool checked); + Q_SIGNALS: + void itemChanged(); + public: LayersPathInfo *path_info = nullptr; QPushButton *buttom_remove = nullptr;