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

Method StoragePage

launcher/ui/pages/instance/StoragePage.cpp:41–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41StoragePage::StoragePage(BaseInstance* inst, QWidget* parent) : QWidget(parent), ui(new Ui::StoragePage), m_inst(inst)
42{
43 ui->setupUi(this);
44
45 m_confirmation_box = new QMessageBox(this);
46 m_confirmation_box->setWindowTitle("Confirmation");
47 m_confirmation_box->setIcon(QMessageBox::Warning);
48 m_confirmation_box->setText("Are you sure you want to proceed?");
49 m_confirmation_box->setStandardButtons(QMessageBox::Yes);
50 m_confirmation_box->addButton(QMessageBox::No);
51 m_confirmation_box->setDefaultButton(QMessageBox::No);
52
53 m_series = new QPieSeries(this);
54 m_series->setLabelsVisible();
55 m_series->setLabelsPosition(QPieSlice::LabelInsideHorizontal);
56 m_chart_view = new QChartView(this);
57 m_chart = new QChart();
58 m_chart->setParent(this);
59 m_chart->addSeries(m_series);
60 m_chart->setBackgroundVisible(false);
61 m_chart->setMargins(QMargins(0, 0, 0, 0));
62 m_chart->legend()->setAlignment(Qt::AlignLeft);
63 m_chart->legend()->setLabelColor(QApplication::palette().text().color());
64 m_chart_view->setRenderHint(QPainter::Antialiasing);
65 m_chart_view->installEventFilter(this);
66
67 ui->verticalLayout->addWidget(m_chart_view);
68 ui->retranslateUi(this);
69
70 updateCalculations();
71
72 connect(ui->button_goto_resouce_packs, &QPushButton::clicked, this, [&] { m_container->selectPage("resourcepacks"); });
73 connect(ui->button_goto_mods, &QPushButton::clicked, this, [&] { m_container->selectPage("mods"); });
74 connect(ui->button_goto_worlds, &QPushButton::clicked, this, [&] { m_container->selectPage("worlds"); });
75 connect(ui->button_goto_screenshots, &QPushButton::clicked, this, [&] { m_container->selectPage("screenshots"); });
76 connect(ui->button_goto_other_logs, &QPushButton::clicked, this, [&] { m_container->selectPage("logs"); });
77
78 connect(ui->button_clear_screenshots, &QPushButton::clicked, this, &StoragePage::handleClearScreenshotsButton);
79 connect(ui->button_clear_logs, &QPushButton::clicked, this, &StoragePage::handleClearLogsButton);
80 connect(ui->button_clear_all, &QPushButton::clicked, this, &StoragePage::handleClearAllButton);
81}
82
83StoragePage::~StoragePage()
84{

Callers

nothing calls this directly

Calls 6

setupUiMethod · 0.45
setIconMethod · 0.45
setTextMethod · 0.45
textMethod · 0.45
retranslateUiMethod · 0.45
selectPageMethod · 0.45

Tested by

no test coverage detected