This repository was archived by the owner on Feb 27, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff 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+ }
Original file line number Diff line number Diff 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
9192private slots:
9293 /* UI events */
You can’t perform that action at this time.
0 commit comments