mirror of
https://github.com/edisionnano/QDiskInfo.git
synced 2026-03-25 14:10:51 +03:00
Add a refresh button
This commit is contained in:
@@ -237,7 +237,9 @@ void MainWindow::scanDevices()
|
||||
}
|
||||
}
|
||||
}
|
||||
horizontalLayout->addStretch();
|
||||
|
||||
buttonStretch = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
||||
horizontalLayout->addSpacerItem(buttonStretch);
|
||||
|
||||
if (globalIsNvme) {
|
||||
populateWindow(globalObj, globalHealth, globalNvmeSmartOrdered);
|
||||
@@ -710,3 +712,16 @@ void MainWindow::on_actionGitHub_triggered()
|
||||
QDesktopServices::openUrl(QUrl("https://github.com/edisionnano/KDiskInfo"));
|
||||
}
|
||||
|
||||
|
||||
void MainWindow::on_actionRescan_Refresh_triggered()
|
||||
{
|
||||
QList<QAbstractButton*> buttons = buttonGroup->buttons();
|
||||
for (QAbstractButton* button : buttons) {
|
||||
buttonGroup->removeButton(button);
|
||||
delete button;
|
||||
}
|
||||
horizontalLayout->removeItem(buttonStretch);
|
||||
delete buttonStretch;
|
||||
scanDevices();
|
||||
}
|
||||
|
||||
|
||||
@@ -41,6 +41,8 @@ private slots:
|
||||
|
||||
void on_actionGitHub_triggered();
|
||||
|
||||
void on_actionRescan_Refresh_triggered();
|
||||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
QButtonGroup *buttonGroup;
|
||||
@@ -53,6 +55,7 @@ private:
|
||||
QColor goodColor, cautionColor, badColor, naColor;
|
||||
|
||||
QJsonObject deviceJson;
|
||||
QSpacerItem *buttonStretch;
|
||||
|
||||
void onNextButtonClicked();
|
||||
void onPrevButtonClicked();
|
||||
|
||||
Reference in New Issue
Block a user