summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/inventorywindow.cpp6
-rw-r--r--src/gui/widgets/inventoryfilter.cpp9
-rw-r--r--src/gui/widgets/inventoryfilter.h2
3 files changed, 12 insertions, 5 deletions
diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp
index dfa7ce11f..978bfcecf 100644
--- a/src/gui/inventorywindow.cpp
+++ b/src/gui/inventorywindow.cpp
@@ -107,9 +107,9 @@ InventoryWindow::InventoryWindow(Inventory *inventory):
for (unsigned f = 0; f < tags.size(); f ++)
mFilter->add(tags[f]);
- mSorter->add("na");
- mSorter->add("az");
- mSorter->add("id");
+ mSorter->add(_("na"), "na");
+ mSorter->add(_("az"), "az");
+ mSorter->add(_("id"), "id");
if (isMainInventory())
{
diff --git a/src/gui/widgets/inventoryfilter.cpp b/src/gui/widgets/inventoryfilter.cpp
index aa2f2a5e4..7de7457ea 100644
--- a/src/gui/widgets/inventoryfilter.cpp
+++ b/src/gui/widgets/inventoryfilter.cpp
@@ -33,10 +33,15 @@ InventoryFilter::InventoryFilter(std::string group, int height, int spacing):
void InventoryFilter::add(std::string tag)
{
- if (tag.empty())
+ add(tag, tag);
+}
+
+void InventoryFilter::add(std::string text, std::string tag)
+{
+ if (text.empty() || tag.empty())
return;
- RadioButton *radio = new RadioButton(tag, mGroup, mCount == 0);
+ RadioButton *radio = new RadioButton(text, mGroup, mCount == 0);
radio->adjustSize();
radio->setActionEventId(mActionEventId + tag);
radio->addActionListener(this);
diff --git a/src/gui/widgets/inventoryfilter.h b/src/gui/widgets/inventoryfilter.h
index 42f51c895..aa71bb419 100644
--- a/src/gui/widgets/inventoryfilter.h
+++ b/src/gui/widgets/inventoryfilter.h
@@ -40,6 +40,8 @@ class InventoryFilter : public HorizontContainer, public gcn::ActionListener
void add(std::string tag);
+ void add(std::string text, std::string tag);
+
void action(const gcn::ActionEvent &event);
private: