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

Method updateNewsLabel

launcher/ui/MainWindow.cpp:1499–1523  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1497}
1498
1499void MainWindow::updateNewsLabel()
1500{
1501 if (m_newsChecker->isLoadingNews())
1502 {
1503 newsLabel->setText(tr("Loading news..."));
1504 newsLabel->setEnabled(false);
1505 ui->actionMoreNews->setVisible(false);
1506 }
1507 else
1508 {
1509 QList<NewsEntryPtr> entries = m_newsChecker->getNewsEntries();
1510 if (entries.length() > 0)
1511 {
1512 newsLabel->setText(entries[0]->title);
1513 newsLabel->setEnabled(true);
1514 ui->actionMoreNews->setVisible(true);
1515 }
1516 else
1517 {
1518 newsLabel->setText(tr("No news available."));
1519 newsLabel->setEnabled(false);
1520 ui->actionMoreNews->setVisible(false);
1521 }
1522 }
1523}
1524
1525void MainWindow::updateAvailable(GoUpdate::Status status)
1526{

Callers

nothing calls this directly

Calls 6

isLoadingNewsMethod · 0.80
setEnabledMethod · 0.80
setVisibleMethod · 0.80
getNewsEntriesMethod · 0.80
lengthMethod · 0.80
setTextMethod · 0.45

Tested by

no test coverage detected