MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / disableVersionButton

Method disableVersionButton

launcher/ui/widgets/ModFilterWidget.cpp:88–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86}
87
88void ModFilterWidget::disableVersionButton(VersionButtonID id, QString reason)
89{
90 QAbstractButton* btn = nullptr;
91
92 switch(id){
93 case(VersionButtonID::Strict):
94 btn = ui->strictVersionButton;
95 break;
96 case(VersionButtonID::Major):
97 btn = ui->majorVersionButton;
98 break;
99 case(VersionButtonID::All):
100 btn = ui->allVersionsButton;
101 break;
102 case(VersionButtonID::Between):
103 default:
104 break;
105 }
106
107 if (btn) {
108 btn->setEnabled(false);
109 if (!reason.isEmpty())
110 btn->setText(btn->text() + QString(" (%1)").arg(reason));
111 }
112}
113
114void ModFilterWidget::onVersionFilterChanged(int id)
115{

Callers 1

createMethod · 0.80

Calls 5

QStringClass · 0.85
setEnabledMethod · 0.80
isEmptyMethod · 0.80
setTextMethod · 0.45
textMethod · 0.45

Tested by

no test coverage detected