Mercurial > minori
diff src/gui/dialog/information.cc @ 258:862d0d8619f6
*: HUUUGE changes
animia has been renamed to animone, so instead of thinking of a
health condition, you think of a beautiful flower :)
I've also edited some of the code for animone, but I have no idea
if it even works or not because I don't have a mac or windows
machine lying around. whoops!
... anyway, all of the changes divergent from Anisthesia are now
licensed under BSD. it's possible that I could even rewrite most
of the code to where I don't even have to keep the MIT license,
but that's thinking too far into the future
I've been slacking off on implementing the anime seasons page,
mostly out of laziness. I think I'd have to create another db file
specifically for the seasons
anyway, this code is being pushed *primarily* because the hard drive
it's on is failing! yay :)
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Mon, 01 Apr 2024 02:43:44 -0400 |
parents | b3549da699a6 |
children | 9a88e1725fd2 |
line wrap: on
line diff
--- a/src/gui/dialog/information.cc Sun Feb 18 16:02:14 2024 -0500 +++ b/src/gui/dialog/information.cc Mon Apr 01 02:43:44 2024 -0400 @@ -1,8 +1,8 @@ #include "gui/dialog/information.h" #include "core/anime.h" #include "core/anime_db.h" +#include "core/session.h" #include "core/strings.h" -#include "core/session.h" #include "gui/pages/anime_list.h" #include "gui/translate/anime.h" #include "gui/widgets/anime_info.h" @@ -10,6 +10,7 @@ #include "gui/widgets/poster.h" #include "gui/widgets/text.h" #include "gui/window.h" + #include <QCheckBox> #include <QComboBox> #include <QDateEdit> @@ -22,9 +23,10 @@ #include <QStringList> #include <QTextStream> #include <QVBoxLayout> + #include <functional> #ifdef WIN32 -#include "sys/win32/dark_theme.h" +# include "sys/win32/dark_theme.h" #endif /* TODO: Taiga disables rendering of the tab widget entirely when the anime is not part of a list, @@ -42,9 +44,10 @@ anime.SetUserDateCompleted(_completed); } -InformationDialog::InformationDialog(Anime::Anime& anime, std::function<void()> accept, enum Pages page, QWidget* parent) +InformationDialog::InformationDialog(Anime::Anime& anime, std::function<void()> accept, enum Pages page, + QWidget* parent) : QDialog(parent) { - /* ack. lots of brackets here, but MUCH, MUCH MUCH better than what it used to be */ + /* ack. lots of brackets here, but MUCH, MUCH MUCH better than what it used to be */ setFixedSize(842, 613); setWindowTitle(tr("Anime Information")); setWindowFlags(Qt::Dialog | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint); @@ -114,8 +117,8 @@ QWidget* sg_anime_list_content = new QWidget(settings_widget); constexpr int LAYOUT_HORIZ_SPACING = 25; - constexpr int LAYOUT_VERT_SPACING = 5; - constexpr int LAYOUT_ITEM_WIDTH = 175; + constexpr int LAYOUT_VERT_SPACING = 5; + constexpr int LAYOUT_ITEM_WIDTH = 175; QVBoxLayout* al_layout = new QVBoxLayout(sg_anime_list_content); al_layout->setSpacing(LAYOUT_VERT_SPACING); @@ -132,13 +135,14 @@ parent->layout()->addWidget(section); }; - CREATE_SECTION(sg_anime_list_content, [this, &anime](QWidget* section, QGridLayout* layout){ + CREATE_SECTION(sg_anime_list_content, [this, &anime](QWidget* section, QGridLayout* layout) { { /* Episodes watched... */ layout->addWidget(new QLabel(tr("Episodes watched:"), section), 0, 0); QSpinBox* spin_box = new QSpinBox(section); - connect(spin_box, QOverload<int>::of(&QSpinBox::valueChanged), this, [this](int i) { _progress = i; }); + connect(spin_box, QOverload<int>::of(&QSpinBox::valueChanged), this, + [this](int i) { _progress = i; }); spin_box->setRange(0, anime.GetEpisodes()); spin_box->setSingleStep(1); spin_box->setValue(_progress = anime.GetUserProgress()); @@ -151,14 +155,15 @@ QCheckBox* checkbox = new QCheckBox(tr("Rewatching")); connect(checkbox, QOverload<int>::of(&QCheckBox::stateChanged), this, [this](int state) { _rewatching = (state == Qt::Checked); }); - checkbox->setCheckState((_rewatching = anime.GetUserIsRewatching()) ? Qt::Checked : Qt::Unchecked); + checkbox->setCheckState((_rewatching = anime.GetUserIsRewatching()) ? Qt::Checked + : Qt::Unchecked); checkbox->setFixedWidth(LAYOUT_ITEM_WIDTH); layout->addWidget(checkbox, 1, 1); } layout->setColumnStretch(layout->columnCount(), 1); }); - CREATE_SECTION(sg_anime_list_content, [this, &anime](QWidget* section, QGridLayout* layout){ + CREATE_SECTION(sg_anime_list_content, [this, &anime](QWidget* section, QGridLayout* layout) { { /* Status */ layout->addWidget(new QLabel(tr("Status:"), section), 0, 0); @@ -166,11 +171,13 @@ QComboBox* combo_box = new QComboBox(section); for (unsigned int i = 0; i < Anime::ListStatuses.size(); i++) - combo_box->addItem(Strings::ToQString(Translate::ToString(Anime::ListStatuses[i])), static_cast<int>(Anime::ListStatuses[i])); + combo_box->addItem(Strings::ToQString(Translate::ToString(Anime::ListStatuses[i])), + static_cast<int>(Anime::ListStatuses[i])); - connect(combo_box, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [this, combo_box](int) { - _status = static_cast<Anime::ListStatus>(combo_box->currentData().toInt()); - }); + connect(combo_box, QOverload<int>::of(&QComboBox::currentIndexChanged), this, + [this, combo_box](int) { + _status = static_cast<Anime::ListStatus>(combo_box->currentData().toInt()); + }); /* this should NEVER, EVER, be NOT_IN_LIST */ combo_box->setCurrentIndex(static_cast<int>(_status = anime.GetUserStatus()) - 1); @@ -183,9 +190,8 @@ layout->addWidget(new QLabel(tr("Score:"), section), 0, 1); QSpinBox* spin_box = new QSpinBox(section); - connect(spin_box, QOverload<int>::of(&QSpinBox::valueChanged), this, [this](int i) { - _score = i; - }); + connect(spin_box, QOverload<int>::of(&QSpinBox::valueChanged), this, + [this](int i) { _score = i; }); spin_box->setRange(0, 100); spin_box->setSingleStep(5); spin_box->setValue(_score = anime.GetUserScore()); @@ -195,7 +201,7 @@ layout->setColumnStretch(layout->columnCount(), 1); }); - CREATE_SECTION(sg_anime_list_content, [this, &anime](QWidget* section, QGridLayout* layout){ + CREATE_SECTION(sg_anime_list_content, [this, &anime](QWidget* section, QGridLayout* layout) { layout->addWidget(new QLabel(tr("Notes:"), section), 0, 0); QLineEdit* line_edit = new QLineEdit(section); @@ -208,7 +214,7 @@ layout->addWidget(line_edit, 1, 0); }); - CREATE_SECTION(sg_anime_list_content, [this, &anime](QWidget* section, QGridLayout* layout){ + CREATE_SECTION(sg_anime_list_content, [this, &anime](QWidget* section, QGridLayout* layout) { /* Started */ { layout->addWidget(new QLabel(tr("Date started:"), section), 0, 0); @@ -250,28 +256,28 @@ /* { - // commenting this out until it actually gets implemented :) + // commenting this out until it actually gets implemented :) - settings_layout->addWidget(new TextWidgets::Header(tr("Local settings"), settings_widget)); + settings_layout->addWidget(new TextWidgets::Header(tr("Local settings"), settings_widget)); - QWidget* sg_local_content = new QWidget(settings_widget); - QVBoxLayout* sg_local_layout = new QVBoxLayout(sg_local_content); - sg_local_layout->setSpacing(5); - sg_local_layout->setContentsMargins(12, 0, 0, 0); + QWidget* sg_local_content = new QWidget(settings_widget); + QVBoxLayout* sg_local_layout = new QVBoxLayout(sg_local_content); + sg_local_layout->setSpacing(5); + sg_local_layout->setContentsMargins(12, 0, 0, 0); - CREATE_SECTION(sg_local_content, [this, &anime](QWidget* section, QGridLayout* layout){ - layout->addWidget(new QLabel(tr("Alternative titles:"), section), 0, 0); + CREATE_SECTION(sg_local_content, [this, &anime](QWidget* section, QGridLayout* layout){ + layout->addWidget(new QLabel(tr("Alternative titles:"), section), 0, 0); - QLineEdit* line_edit = new QLineEdit("", section); - line_edit->setPlaceholderText( - tr("Enter alternative titles here, separated by a semicolon (i.e. Title 1; Title 2)")); - layout->addWidget(line_edit, 1, 0); + QLineEdit* line_edit = new QLineEdit("", section); + line_edit->setPlaceholderText( + tr("Enter alternative titles here, separated by a semicolon (i.e. Title 1; Title 2)")); + layout->addWidget(line_edit, 1, 0); - QCheckBox* checkbox = new QCheckBox(tr("Use the first alternative title to search for torrents")); - layout->addWidget(checkbox, 2, 0); - }); + QCheckBox* checkbox = new QCheckBox(tr("Use the first alternative title to search for + torrents")); layout->addWidget(checkbox, 2, 0); + }); - settings_layout->addWidget(sg_local_content); + settings_layout->addWidget(sg_local_content); } */