diff --git a/recovery/mainwindow.cpp b/recovery/mainwindow.cpp index babbf287..adce19aa 100644 --- a/recovery/mainwindow.cpp +++ b/recovery/mainwindow.cpp @@ -142,6 +142,7 @@ void MainWindow::populate() _qpd->setWindowFlags(Qt::Window | Qt::CustomizeWindowHint | Qt::WindowTitleHint); _qpd->show(); QTimer::singleShot(2000, this, SLOT(hideDialogIfNoNetwork())); + QTimer::singleShot(2000, this, SLOT(showMoreAvailableDialogIfNoNetwork())); } if (QFile::exists(SETTINGS_PARTITION)) @@ -1471,3 +1472,16 @@ void MainWindow::hideDialogIfNoNetwork() } } } + +void MainWindow::showMoreAvailableDialogIfNoNetwork() +{ + QByteArray carrier = getFileContents("/sys/class/net/eth0/carrier").trimmed(); + if (carrier != "1" && ui->list->count() > 0) /* We don't want to show this if hideDialogIfNoNetwork's messagebox showed too */ + { + /* No network cable inserted, but have local images */ + QMessageBox::information(this, + tr("More images are available online"), + 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."), + QMessageBox::Close); + } +} diff --git a/recovery/mainwindow.h b/recovery/mainwindow.h index da1e17d7..544ded7e 100644 --- a/recovery/mainwindow.h +++ b/recovery/mainwindow.h @@ -87,6 +87,7 @@ protected slots: void downloadMetaComplete(); void onQuery(const QString &msg, const QString &title, QMessageBox::StandardButton* answer); void hideDialogIfNoNetwork(); + void showMoreAvailableDialogIfNoNetwork(); private slots: /* UI events */