Mercurial > minori
diff src/gui/pages/seasons.cc @ 291:9a88e1725fd2
*: refactor lots of stuff
I forgot to put this into different commits, oops!
anyway, it doesn't really matter *that* much since this is an
unfinished hobby project anyway. once it starts getting stable
commit history will be more important, but for now it's not
that big of a deal
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Sun, 12 May 2024 16:31:07 -0400 |
parents | 657fda1b9cac |
children | b82841e76e79 |
line wrap: on
line diff
--- a/src/gui/pages/seasons.cc Wed May 08 17:32:28 2024 -0400 +++ b/src/gui/pages/seasons.cc Sun May 12 16:31:07 2024 -0400 @@ -48,7 +48,7 @@ toolbar->setMovable(false); { - /* hard-coded this value */ + /* todo: clean this up... this sucks... */ static constexpr Date::Year last_year = 1960; auto create_year_menu = [this](QWidget* parent, QMenu* parent_menu, Date::Year year){ @@ -72,12 +72,12 @@ }; /* we'll be extinct by the time this code breaks, so I guess it's fine :) */ - const Date::Year year = static_cast<Date::Year>(QDate::currentDate().year()); - const Date::Year year_before_collapse = GetClosestDecade(year) - 10; + const Date::Year current_year = static_cast<Date::Year>(QDate::currentDate().year()); + const Date::Year year_before_collapse = GetClosestDecade(current_year) - 10; season_button = new QToolButton(toolbar); QMenu* full_season_menu = new QMenu(season_button); - for (Date::Year c = year; c >= year_before_collapse; c--) + for (Date::Year c = current_year; c >= year_before_collapse; c--) create_year_menu(season_button, full_season_menu, c); full_season_menu->addSeparator(); @@ -103,15 +103,15 @@ { /* links */ QMenu* menu = new QMenu(button); - menu->addAction("Airing status"); - menu->addAction("List status"); - menu->addAction("Type"); + menu->addAction(tr("Airing status")); + menu->addAction(tr("List status")); + menu->addAction(tr("Type")); button->setMenu(menu); } button->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); button->setIcon(QIcon(":/icons/16x16/category.png")); - button->setText("Group by:"); + button->setText(tr("Group by:")); button->setPopupMode(QToolButton::InstantPopup); toolbar->addWidget(button); } @@ -122,17 +122,17 @@ { /* links */ QMenu* menu = new QMenu(button); - menu->addAction("Airing date"); - menu->addAction("Episodes"); - menu->addAction("Popularity"); - menu->addAction("Score"); - menu->addAction("Title"); + menu->addAction(tr("Airing date")); + menu->addAction(tr("Episodes")); + menu->addAction(tr("Popularity")); + menu->addAction(tr("Score")); + menu->addAction(tr("Title")); button->setMenu(menu); } button->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); button->setIcon(QIcon(":/icons/16x16/sort-quantity-descending.png")); - button->setText("Sort by:"); + button->setText(tr("Sort by:")); button->setPopupMode(QToolButton::InstantPopup); toolbar->addWidget(button); } @@ -143,14 +143,14 @@ { /* links */ QMenu* menu = new QMenu(button); - menu->addAction("Images"); - menu->addAction("Details"); + menu->addAction(tr("Images")); + menu->addAction(tr("Details")); button->setMenu(menu); } button->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); button->setIcon(QIcon(":/icons/16x16/ui-scroll-pane-detail.png")); - button->setText("View:"); + button->setText(tr("View:")); button->setPopupMode(QToolButton::InstantPopup); toolbar->addWidget(button); }