aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2012-02-26 15:47:03 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2012-02-26 15:47:03 +0000
commit28e3d782b668cf2d1b993b48415052459777b41c (patch)
tree9bf6c09cc504b5bca463dd6450dca359ed02b0a3
parent29581410e2fce5719f24295beb0793e268a0cd2e (diff)
downloadpaludis-28e3d782b668cf2d1b993b48415052459777b41c.tar.gz
paludis-28e3d782b668cf2d1b993b48415052459777b41c.tar.xz
Show added and changed choices even if they're hidden
-rwxr-xr-xsrc/clients/cave/cmd_display_resolution.cc61
1 files changed, 41 insertions, 20 deletions
diff --git a/src/clients/cave/cmd_display_resolution.cc b/src/clients/cave/cmd_display_resolution.cc
index b0cd10c..bd56ea0 100755
--- a/src/clients/cave/cmd_display_resolution.cc
+++ b/src/clients/cave/cmd_display_resolution.cc
@@ -570,15 +570,52 @@ namespace
for (Choices::ConstIterator k(choices->begin()), k_end(choices->end()) ;
k != k_end ; ++k)
{
- if ((*k)->hidden())
- continue;
+ if ((*k)->hidden() && (*k)->consider_added_or_changed() && old_choices)
+ {
+ /* ignore the hide if anything has changed */
+ bool show_anyway(false);
+ for (Choice::ConstIterator i((*k)->begin()), i_end((*k)->end()) ;
+ i != i_end && ! show_anyway ; ++i)
+ {
+ std::shared_ptr<const ChoiceValue> old_choice(
+ old_choices->find_by_name_with_prefix((*i)->name_with_prefix()));
+ if (! old_choice)
+ show_anyway = true;
+ else if (old_choice->enabled() != (*i)->enabled())
+ show_anyway = true;
+ }
+
+ if (! show_anyway)
+ continue;
+ }
bool shown_prefix_changed(false), shown_prefix_unchanged(false);
for (Choice::ConstIterator i((*k)->begin()), i_end((*k)->end()) ;
i != i_end ; ++i)
{
- if (co_implicit == (*i)->origin())
- continue;
+ bool changed(false), added(false);
+ if ((*k)->consider_added_or_changed())
+ {
+ if (old_choices)
+ {
+ std::shared_ptr<const ChoiceValue> old_choice(
+ old_choices->find_by_name_with_prefix((*i)->name_with_prefix()));
+ if (! old_choice)
+ added = true;
+ else if (old_choice->enabled() != (*i)->enabled())
+ changed = true;
+ }
+ else
+ added = true;
+ }
+
+ if ((! added) && (! changed))
+ {
+ if (co_implicit == (*i)->origin())
+ continue;
+ if ((*k)->hidden())
+ continue;
+ }
Tribool changed_state(indeterminate);
if (changed_choices)
@@ -618,22 +655,6 @@ namespace
t = printer.prettify_choice_value_disabled(*i);
}
- bool changed(false), added(false);
- if ((*k)->consider_added_or_changed())
- {
- if (old_choices)
- {
- std::shared_ptr<const ChoiceValue> old_choice(
- old_choices->find_by_name_with_prefix((*i)->name_with_prefix()));
- if (! old_choice)
- added = true;
- else if (old_choice->enabled() != (*i)->enabled())
- changed = true;
- }
- else
- added = true;
- }
-
if (changed)
t = t + "*";
else if (added)