Skip to content
This repository was archived by the owner on Feb 27, 2023. It is now read-only.

Commit e23a6f2

Browse files
committed
Inform the user if more images are available (they do not have a network connection)
1 parent bf295af commit e23a6f2

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

recovery/mainwindow.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ void MainWindow::populate()
142142
_qpd->setWindowFlags(Qt::Window | Qt::CustomizeWindowHint | Qt::WindowTitleHint);
143143
_qpd->show();
144144
QTimer::singleShot(2000, this, SLOT(hideDialogIfNoNetwork()));
145+
QTimer::singleShot(2000, this, SLOT(showMoreAvailableDialogIfNoNetwork()));
145146
}
146147

147148
if (QFile::exists(SETTINGS_PARTITION))
@@ -1471,3 +1472,16 @@ void MainWindow::hideDialogIfNoNetwork()
14711472
}
14721473
}
14731474
}
1475+
1476+
void MainWindow::showMoreAvailableDialogIfNoNetwork()
1477+
{
1478+
QByteArray carrier = getFileContents("/sys/class/net/eth0/carrier").trimmed();
1479+
if (carrier != "1" && ui->list->count() > 0) /* We don't want to show this if hideDialogIfNoNetwork's messagebox showed too */
1480+
{
1481+
/* No network cable inserted, but have local images */
1482+
QMessageBox::information(this,
1483+
tr("More images are available online"),
1484+
tr("A greater variety of more up to date images may be available online. Please insert a network cable in to the network port to access them."),
1485+
QMessageBox::Close);
1486+
}
1487+
}

recovery/mainwindow.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ protected slots:
8787
void downloadMetaComplete();
8888
void onQuery(const QString &msg, const QString &title, QMessageBox::StandardButton* answer);
8989
void hideDialogIfNoNetwork();
90+
void showMoreAvailableDialogIfNoNetwork();
9091

9192
private slots:
9293
/* UI events */

0 commit comments

Comments
 (0)