Skip to content

Commit

Permalink
Moving check for internet before splash is displayed
Browse files Browse the repository at this point in the history
  • Loading branch information
zcobell committed Jul 1, 2019
1 parent e5c5387 commit 7397dd8
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions MetOceanViewer/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ int main(int argc, char *argv[]) {

QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);

//...Check for the internet connection
if (!Generic::isConnectedToNetwork()) {
QMessageBox::critical(nullptr,
QObject::tr("Internet Connection Not Detected"),
QObject::tr("No internet connection was detected.\n"
"The program will now be terminated."));
return 1;
}

Q_INIT_RESOURCE(resource_files);

//...Display the splash screen
Expand All @@ -46,15 +55,6 @@ int main(int argc, char *argv[]) {
//...Generate the config directory if required
Generic::createConfigDirectory();

//...Check for the internet connection
if (!Generic::isConnectedToNetwork()) {
QMessageBox::critical(nullptr,
QObject::tr("Internet Connection Not Detected"),
QObject::tr("No internet connection was detected.\n"
"The program will now be terminated."));
return 1;
}

// Check for drag/drop operations
if (argc == 2) {
sessionFile = QCoreApplication::arguments().at(1);
Expand Down

0 comments on commit 7397dd8

Please sign in to comment.