MCPcopy Create free account
hub / github.com/KikoPlayProject/KikoPlay / AnimeInfoEditor

Method AnimeInfoEditor

UI/animeinfoeditor.cpp:49–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49AnimeInfoEditor::AnimeInfoEditor(Anime *anime, QWidget *parent) :
50 CFramelessDialog(tr("Edit Anime Info - %1").arg(anime->name()), parent, true, true, false),
51 airDateChanged(false), epsChanged(false), staffChanged(false), descChanged(false), curAnime(anime)
52{
53 QLabel *airTimeLabel = new QLabel(tr("Air Date"), this);
54 dateEdit = new ElaCalendarPicker(this);
55 dateEdit->setSelectedDate(QDate::fromString(anime->airDate(), "yyyy-MM-dd"));
56 QLabel *epsLabel = new QLabel(tr("Episodes"), this);
57 epsSpin = new ElaSpinBox(this);
58 epsSpin->setRange(0, INT_MAX);
59 epsSpin->setValue(anime->epCount());
60
61 QHBoxLayout *hLayout = new QHBoxLayout;
62 hLayout->setContentsMargins(0, 0, 0, 0);
63 hLayout->addWidget(airTimeLabel);
64 hLayout->addWidget(dateEdit);
65 hLayout->addSpacing(20);
66 hLayout->addWidget(epsLabel);
67 hLayout->addWidget(epsSpin);
68 hLayout->addStretch(1);
69
70 QLabel *aliasLabel = new QLabel(tr("Alias"), this);
71 FontIconButton *addAliasBtn = new FontIconButton(QChar(0xe667), "", 12, 10, 0, this);
72 addAliasBtn->setObjectName(QStringLiteral("FontIconToolButton"));
73 QHBoxLayout *hAliasLayout = new QHBoxLayout;
74 hAliasLayout->setContentsMargins(0, 0, 0, 0);
75 hAliasLayout->addWidget(aliasLabel);
76 hAliasLayout->addWidget(addAliasBtn);
77 hAliasLayout->addStretch(1);
78 AliasPanel *aliasPanel = new AliasPanel(anime->name(), this);
79
80 QLabel *staffLabel = new QLabel(tr("Staff Info"), this);
81 QTreeView *staffView = new QTreeView(this);
82 staffView->setContextMenuPolicy(Qt::CustomContextMenu);
83 staffView->setEditTriggers(QAbstractItemView::DoubleClicked);
84 staffView->setRootIsDecorated(false);
85 staffView->setFont(QFont(GlobalObjects::normalFont, 11));
86 staffView->header()->setFont(QFont(GlobalObjects::normalFont, 12));
87 staffView->setItemDelegate(new StaffItemDelegate(staffView));
88 staffView->setAlternatingRowColors(true);
89 staffModel = new StaffModel(anime, this);
90 staffView->setModel(staffModel);
91
92 QLabel *descLabel = new QLabel(tr("Description"), this);
93 descEdit = new KTextEdit(this);
94 descEdit->setPlainText(anime->description());
95
96 QWidget *pageContainer = new QWidget(this);
97 QVBoxLayout *pageVLayout = new QVBoxLayout(pageContainer);
98 pageVLayout->setContentsMargins(0, 0, 0, 0);
99 pageVLayout->addLayout(hLayout);
100 pageVLayout->addLayout(hAliasLayout);
101 pageVLayout->addWidget(aliasPanel);
102 pageVLayout->addWidget(descLabel);
103 pageVLayout->addWidget(descEdit, 1);
104 pageVLayout->addWidget(staffLabel);
105 pageVLayout->addWidget(staffView, 1);
106 // pageVLayout->addStretch(1);

Callers

nothing calls this directly

Calls 15

QFontClass · 0.85
airDateMethod · 0.80
setRangeMethod · 0.80
setContentsMarginsMethod · 0.80
setFontMethod · 0.80
headerMethod · 0.80
setWidgetMethod · 0.80
hasAnimeMethod · 0.80
addStaffMethod · 0.80
removeStaffMethod · 0.80
nameMethod · 0.45
setSelectedDateMethod · 0.45

Tested by

no test coverage detected