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

Fix "No active internet connection" For Some Devices #527

Merged
merged 4 commits into from
Aug 6, 2023
Merged
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
116 changes: 0 additions & 116 deletions NickvisionTubeConverter.GNOME/Controls/MessageDialog.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<ItemGroup>
<PackageReference Include="GirCore.Adw-1" Version="0.4.0" />
<PackageReference Include="Nickvision.Aura" Version="2023.8.1" />
<PackageReference Include="Nickvision.Aura" Version="2023.8.2" />
<PackageReference Include="Nickvision.GirExt" Version="2023.7.1" />
</ItemGroup>

Expand Down
3 changes: 2 additions & 1 deletion NickvisionTubeConverter.GNOME/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ public Program(string[] args)
_mainWindow = null;
_mainWindowController = new MainWindowController();
_mainWindowController.AppInfo.Changelog =
@"* Added the option to prevent suspend while downloads are in progress
@"* Added the option to prevent suspend while using Parabolic
* Improved bitrate used for audio-only downloads with the best quality
* Parabolic will now prefer videos with the h264 codec when downloading in the mp4 format. If space is a concern, users are recommended to download in the webm format which uses the vp* codec
* Fixed an issue where downloads with specific timeframes would download incorrectly
* Fixed an issue where Parabolic would be unusable on systems without NetworkManager installed
* Fixed an issue where Parabolic would say no active internet connection even though there was a connection established
* Updated translations (Thanks everyone on Weblate!)";
_application.OnActivate += OnActivate;
if (File.Exists(Path.GetFullPath(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)) + "/org.nickvision.tubeconverter.gresource"))
Expand Down
13 changes: 9 additions & 4 deletions NickvisionTubeConverter.GNOME/Views/KeyringDialog.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Nickvision.Keyring.Controllers;
using Nickvision.Keyring.Models;
using NickvisionTubeConverter.GNOME.Controls;
using NickvisionTubeConverter.GNOME.Helpers;
using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -283,10 +282,16 @@ private async void AddCredential(Gtk.Button sender, EventArgs e)
/// <param name="e">EventArgs</param>
private void DeleteCredential(Gtk.Button sender, EventArgs e)
{
var disableDialog = new MessageDialog(this, _appID, _("Delete Credential?"), _("This action is irreversible. Are you sure you want to delete it?"), _("No"), _("Yes"));
disableDialog.OnResponse += async (sender, e) =>
var disableDialog = Adw.MessageDialog.New(this, _("Delete Credential?"), _("This action is irreversible. Are you sure you want to delete it?"));
disableDialog.SetIconName(_appID);
disableDialog.AddResponse("no", _("No"));
disableDialog.SetDefaultResponse("no");
disableDialog.SetCloseResponse("no");
disableDialog.AddResponse("yes", _("Yes"));
disableDialog.SetResponseAppearance("yes", Adw.ResponseAppearance.Destructive);
disableDialog.OnResponse += async (s, ex) =>
{
if(disableDialog.Response == MessageDialogResponse.Destructive)
if(ex.Response == "yes")
{
await _controller.DeleteCredentialAsync(_editId!.Value);
await LoadHomePageAsync();
Expand Down
20 changes: 17 additions & 3 deletions NickvisionTubeConverter.GNOME/Views/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,22 @@ private bool OnCloseRequested(Gtk.Window sender, EventArgs e)
SetVisible(false);
return true;
}
var closeDialog = new MessageDialog(this, _controller.AppInfo.ID, _("Close and Stop Downloads?"), _("Some downloads are still in progress.\nAre you sure you want to close Parabolic and stop the running downloads?"), _("No"), _("Yes"));
if (closeDialog.Run() == MessageDialogResponse.Cancel)
var response = "";
var closeDialog = Adw.MessageDialog.New(this, _("Close and Stop Downloads?"), _("Some downloads are still in progress.\nAre you sure you want to close Parabolic and stop the running downloads?"));
closeDialog.SetIconName(_controller.AppInfo.ID);
closeDialog.AddResponse("no", _("No"));
closeDialog.SetDefaultResponse("no");
closeDialog.SetCloseResponse("no");
closeDialog.AddResponse("yes", _("Yes"));
closeDialog.SetResponseAppearance("yes", Adw.ResponseAppearance.Destructive);
closeDialog.OnResponse += (s, ex) => response = ex.Response;
closeDialog.Present();
while (closeDialog.GetVisible())
{
GLib.Internal.MainContext.Iteration(GLib.Internal.MainContext.Default(), false);
}
closeDialog.Destroy();
if (response == "no")
{
return true;
}
Expand Down Expand Up @@ -367,7 +381,7 @@ private void Preferences(Gio.SimpleAction sender, EventArgs e)
private void KeyboardShortcuts(Gio.SimpleAction sender, EventArgs e)
{
var builder = Builder.FromFile("shortcuts_dialog.ui");
var shortcutsWindow = (Gtk.ShortcutsWindow)builder.GetObject("_shortcuts");
var shortcutsWindow = (Gtk.ShortcutsWindow)builder.GetObject("_shortcuts")!;
shortcutsWindow.SetTransientFor(this);
shortcutsWindow.SetIconName(_controller.AppInfo.ID);
shortcutsWindow.Present();
Expand Down
6 changes: 3 additions & 3 deletions NickvisionTubeConverter.GNOME/nuget-sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@
},
{
"type": "file",
"url": "https://api.nuget.org/v3-flatcontainer/nickvision.aura/2023.8.1/nickvision.aura.2023.8.1.nupkg",
"sha512": "6cebe684785f29e6f32e6aa5b639ee0d5e38a152fd25562b8863544bd3e19f0f05ed88dfc356ec79ce6da5bfab9c3617eb7338ab63b8ede775cd9b2231c4de86",
"url": "https://api.nuget.org/v3-flatcontainer/nickvision.aura/2023.8.2/nickvision.aura.2023.8.2.nupkg",
"sha512": "e86dee781f4b1d48a2a8eda5249da314248b980959a9a2dcff8e4b034c85bd18390b43a9ea362ed623e3ed0f3836a3d9299a334378353e6fb5757b5bac25c586",
"dest": "nuget-sources",
"dest-filename": "nickvision.aura.2023.8.1.nupkg"
"dest-filename": "nickvision.aura.2023.8.2.nupkg"
},
{
"type": "file",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public async Task StartupAsync()
_netmon = await NetworkMonitor.NewAsync();
_netmon.StateChanged += (sender, state) =>
{
if (state == NetworkState.ConnectedGlobal)
if (state)
{
NotificationSent?.Invoke(this, new NotificationSentEventArgs("", NotificationSeverity.Success, "network-restored"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<ItemGroup>
<PackageReference Include="GetText.NET" Version="1.8.7" />
<PackageReference Include="Microsoft.NETCore.Targets" Version="5.0.0" />
<PackageReference Include="Nickvision.Aura" Version="2023.8.1" />
<PackageReference Include="Nickvision.Aura" Version="2023.8.2" />
<PackageReference Include="pythonnet" Version="3.0.1" />
<PackageReference Include="Nickvision.Keyring" Version="2023.6.5" />
</ItemGroup>
Expand Down
Loading