Fix #3376
The UI layout should be improved, but functionality and translatable strings are there as needed.
This commit is contained in:
parent
354410dbd2
commit
ad8ef2df11
@ -37,11 +37,12 @@
|
|||||||
</tabs>
|
</tabs>
|
||||||
|
|
||||||
<box proportion="1" width="98%" align="center" layout="vertical-row" padding="6">
|
<box proportion="1" width="98%" align="center" layout="vertical-row" padding="6">
|
||||||
<div layout="horizontal-row" width="100%" height="8%">
|
<div layout="horizontal-row" width="100%" height="2f">
|
||||||
<checkbox id="show_possessed"/>
|
|
||||||
<spacer width="1%" />
|
<spacer width="1%" />
|
||||||
<label height="100%" I18N="In the addons screen, above the list of addons to be installed"
|
<label text="Installed" align="center" I18N="In addons screen, above the list of addons to be installed"/>
|
||||||
text="Show only possessed" word_wrap="true"/>
|
<spacer width="1%" />
|
||||||
|
<spinner id="filter_installation" proportion="5" align="center" min_value="0" wrap_around="true"/>
|
||||||
|
<spacer width="50%" />
|
||||||
</div>
|
</div>
|
||||||
<list id="list_addons" x="0" y="0" width="100%" height="92%" word_wrap="true" alternate_bg="true"/>
|
<list id="list_addons" x="0" y="0" width="100%" height="92%" word_wrap="true" alternate_bg="true"/>
|
||||||
</box>
|
</box>
|
||||||
|
@ -127,6 +127,14 @@ void AddonsScreen::beforeAddingWidget()
|
|||||||
{
|
{
|
||||||
w_filter_rating->addLabel(StringUtils::toWString(n / 2.0));
|
w_filter_rating->addLabel(StringUtils::toWString(n / 2.0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GUIEngine::SpinnerWidget* w_filter_installation =
|
||||||
|
getWidget<GUIEngine::SpinnerWidget>("filter_installation");
|
||||||
|
w_filter_installation->m_properties[GUIEngine::PROP_MIN_VALUE] = "0";
|
||||||
|
w_filter_installation->m_properties[GUIEngine::PROP_MAX_VALUE] = "2";
|
||||||
|
w_filter_installation->addLabel(_("All"));
|
||||||
|
w_filter_installation->addLabel(_("Installed"));
|
||||||
|
w_filter_installation->addLabel(_("Not installed"));
|
||||||
}
|
}
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -167,9 +175,9 @@ void AddonsScreen::init()
|
|||||||
getWidget<GUIEngine::SpinnerWidget>("filter_rating");
|
getWidget<GUIEngine::SpinnerWidget>("filter_rating");
|
||||||
w_filter_rating->setValue(0);
|
w_filter_rating->setValue(0);
|
||||||
|
|
||||||
GUIEngine::CheckBoxWidget* w_show_possessed =
|
GUIEngine::SpinnerWidget* w_filter_installation =
|
||||||
getWidget<GUIEngine::CheckBoxWidget>("show_possessed");
|
getWidget<GUIEngine::SpinnerWidget>("filter_installation");
|
||||||
w_show_possessed->setState(false);
|
w_filter_installation->setValue(0);
|
||||||
|
|
||||||
// Set the default sort order
|
// Set the default sort order
|
||||||
Addon::setSortOrder(Addon::SO_DEFAULT);
|
Addon::setSortOrder(Addon::SO_DEFAULT);
|
||||||
@ -217,8 +225,8 @@ void AddonsScreen::loadList()
|
|||||||
getWidget<GUIEngine::SpinnerWidget>("filter_rating");
|
getWidget<GUIEngine::SpinnerWidget>("filter_rating");
|
||||||
float rating = w_filter_rating->getValue() / 2.0f;
|
float rating = w_filter_rating->getValue() / 2.0f;
|
||||||
|
|
||||||
GUIEngine::CheckBoxWidget* w_show_possessed =
|
GUIEngine::SpinnerWidget* w_filter_installation =
|
||||||
getWidget<GUIEngine::CheckBoxWidget>("show_possessed");
|
getWidget<GUIEngine::SpinnerWidget>("filter_installation");
|
||||||
|
|
||||||
// First create a list of sorted entries
|
// First create a list of sorted entries
|
||||||
PtrVector<const Addon, REF> sorted_list;
|
PtrVector<const Addon, REF> sorted_list;
|
||||||
@ -226,7 +234,8 @@ void AddonsScreen::loadList()
|
|||||||
{
|
{
|
||||||
const Addon & addon = addons_manager->getAddon(i);
|
const Addon & addon = addons_manager->getAddon(i);
|
||||||
// Ignore not installed addons if the checkbox is enabled
|
// Ignore not installed addons if the checkbox is enabled
|
||||||
if(w_show_possessed->getState() && !addon.isInstalled())
|
if( (w_filter_installation->getValue() == 1 && !addon.isInstalled())
|
||||||
|
|| (w_filter_installation->getValue() == 2 && addon.isInstalled()))
|
||||||
continue;
|
continue;
|
||||||
// Ignore addons of a different type
|
// Ignore addons of a different type
|
||||||
if(addon.getType()!=m_type) continue;
|
if(addon.getType()!=m_type) continue;
|
||||||
@ -463,7 +472,7 @@ void AddonsScreen::eventCallback(GUIEngine::Widget* widget,
|
|||||||
loadList();
|
loadList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (name == "filter_search" || name == "show_possessed")
|
else if (name == "filter_search" || name == "filter_installation")
|
||||||
{
|
{
|
||||||
loadList();
|
loadList();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user