Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for network access #140

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions po/POTFILES
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ src/Views/AppCenterView.vala
src/Views/EarlyAccessView.vala
src/Views/FinishView.vala
src/Views/HouseKeepingView.vala
src/Views/NetworkView.vala
src/Views/NightLightView.vala
src/Views/OnlineAccountsView.vala
src/Views/StyleView.vala
Expand Down
5 changes: 5 additions & 0 deletions src/MainWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ public class Onboarding.MainWindow : Hdy.ApplicationWindow {
var housekeeping_view = new HouseKeepingView ();
carousel.add (housekeeping_view);

if (!NetworkMonitor.get_default ().get_network_available ()) {
var network_view = new NetworkView ();
carousel.add (network_view);
}

var onlineaccounts_view = new OnlineAccountsView ();
carousel.add (onlineaccounts_view);

Expand Down
35 changes: 35 additions & 0 deletions src/Views/NetworkView.vala
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright (c) 2021 elementary, Inc. (https://elementary.io)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Marius Meisenzahl <[email protected]>
*/

public class Onboarding.NetworkView : AbstractOnboardingView {
public NetworkView () {
Object (
view_name: "network",
description: _("Manage network devices and connectivity."),
icon_name: "preferences-system-network",
title: _("Network")
);
}

construct {
var settings_link = new Gtk.LinkButton.with_label ("settings://network", _("Manage network devices…"));

custom_bin.add (settings_link);
}
}
1 change: 1 addition & 0 deletions src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ vala_files = [
'Views/EarlyAccessView.vala',
'Views/FinishView.vala',
'Views/HouseKeepingView.vala',
'Views/NetworkView.vala',
'Views/NightLightView.vala',
'Views/OnlineAccountsView.vala',
'Views/StyleView.vala',
Expand Down