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

Updated Aura with secret service support #570

Merged
merged 25 commits into from
Sep 10, 2023
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
24e4590
All - Use development version of Aura with libsecret support
fsobolev Sep 6, 2023
ed4af99
GNOME - Fix enabling keyring
fsobolev Sep 6, 2023
dd2d32f
All - Update Aura version
fsobolev Sep 7, 2023
badf089
GNOME - Don't freeze on enabling keyring
fsobolev Sep 7, 2023
1e40839
All - Update version and changelog
fsobolev Sep 7, 2023
4cc4ddc
Shared - Update po(t)
fsobolev Sep 7, 2023
72213c5
GNOME - Update flatpak sources
fsobolev Sep 7, 2023
20f011e
GNOME - Make download dialog resizable
fsobolev Sep 7, 2023
15c9013
Flatpak - Build libsecret with -Dgcrypt=false
fsobolev Sep 7, 2023
6419d15
Flatpak - Move libsecret json
fsobolev Sep 8, 2023
cd22b81
All - Update Changelog
nlogozzo Sep 9, 2023
33307ef
Docs - Update Keyring Page
nlogozzo Sep 9, 2023
d0c9a73
Shared - Update Po(t)
nlogozzo Sep 9, 2023
933d6a5
Docs - Update Translations
nlogozzo Sep 9, 2023
306def5
GNOME - Button to Docs in PasswordDialog
nlogozzo Sep 9, 2023
8dd413c
Merge branch 'main' into libsecret
nlogozzo Sep 9, 2023
7a7c9cd
All - Update Translations
nlogozzo Sep 9, 2023
454e5e0
GNOME - Use async methods from new Aura release
fsobolev Sep 10, 2023
b3e503a
All - Update changelog
fsobolev Sep 10, 2023
3007528
Shared - Use async methods from new Aura release
fsobolev Sep 10, 2023
6c14d90
Shared - Update docs
fsobolev Sep 10, 2023
cebc5e3
Snap - add password-manager-service plug
fsobolev Sep 10, 2023
91fe78f
All - Update Aura
nlogozzo Sep 10, 2023
9bca5e1
Merge branch 'main' into libsecret
nlogozzo Sep 10, 2023
1528ef2
All - Update Translations
nlogozzo Sep 10, 2023
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
168 changes: 82 additions & 86 deletions NickvisionTubeConverter.GNOME/Blueprints/add_download_dialog.blp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Adw.Window _root {
width-request: 360;
default-width: 420;
modal: true;
resizable: false;
resizable: true;

content: Gtk.Box {
orientation: vertical;
Expand Down Expand Up @@ -96,113 +96,109 @@ Adw.Window _root {
orientation: vertical;
spacing: 24;

Gtk.ScrolledWindow _scrolledWindow {
hscrollbar-policy: never;
propagate-natural-height: true;
child: Gtk.Box _downloadPage {
visible: false;
orientation: vertical;
hexpand: true;
margin-top: 12;
margin-bottom: 12;
spacing: 24;
Gtk.Box _downloadPage {
visible: false;
orientation: vertical;
hexpand: true;
margin-top: 12;
margin-bottom: 12;
spacing: 24;

Adw.PreferencesGroup {
margin-start: 24;
margin-end: 24;
Adw.PreferencesGroup {
margin-start: 24;
margin-end: 24;

Adw.ComboRow _fileTypeRow {
title: _("File Type");
model: Gtk.StringList {
strings ["MP4", "WEBM", "MP3", "M4A", "OPUS", "FLAC", "WAV"]
};
}
Adw.ComboRow _fileTypeRow {
title: _("File Type");
model: Gtk.StringList {
strings ["MP4", "WEBM", "MP3", "M4A", "OPUS", "FLAC", "WAV"]
};
}

Adw.ComboRow _qualityRow {
title: _("Quality");
model: Gtk.StringList {
strings [""]
};
}
Adw.ComboRow _qualityRow {
title: _("Quality");
model: Gtk.StringList {
strings [""]
};
}

Adw.ComboRow _audioLanguageRow {
title: _("Audio Language");
visible: false;
}
Adw.ComboRow _audioLanguageRow {
title: _("Audio Language");
visible: false;
}

Adw.ComboRow _subtitleRow {
title: _("Subtitle");
model: Gtk.StringList {
strings [C_("Subtitle", "None"), "VTT", "SRT"]
};
}
Adw.ComboRow _subtitleRow {
title: _("Subtitle");
model: Gtk.StringList {
strings [C_("Subtitle", "None"), "VTT", "SRT"]
};
}
}

Adw.PreferencesGroup {
margin-start: 24;
margin-end: 24;
Adw.PreferencesGroup {
margin-start: 24;
margin-end: 24;

Adw.EntryRow _saveFolderRow {
title: _("Save Folder");
editable: false;
Adw.EntryRow _saveFolderRow {
title: _("Save Folder");
editable: false;

[suffix]
Gtk.Button _selectSaveFolderButton {
valign: center;
icon-name: "folder-open-symbolic";
tooltip-text: _("Select Save Folder");
[suffix]
Gtk.Button _selectSaveFolderButton {
valign: center;
icon-name: "folder-open-symbolic";
tooltip-text: _("Select Save Folder");

styles ["flat"]
}
styles ["flat"]
}
}

Adw.ActionRow _openAdvancedRow {
title: _("Advanced Options");
activatable-widget: _openAdvancedImage;
Adw.ActionRow _openAdvancedRow {
title: _("Advanced Options");
activatable-widget: _openAdvancedImage;

[suffix]
Gtk.Image _openAdvancedImage {
valign: center;
icon-name: "go-next-symbolic";
}
[suffix]
Gtk.Image _openAdvancedImage {
valign: center;
icon-name: "go-next-symbolic";
}
}
}

Adw.PreferencesGroup _mediaGroup {
visible: false;
margin-start: 24;
margin-end: 24;
}
Adw.PreferencesGroup _mediaGroup {
visible: false;
margin-start: 24;
margin-end: 24;
}

Adw.PreferencesGroup _openPlaylistGroup {
visible: false;
margin-start: 24;
margin-end: 24;

Adw.ActionRow _openPlaylistRow {
subtitle: _("Select items to download or change file names.");
subtitle-lines: 1;
activatable-widget: _openPlaylistImage;

[suffix]
Gtk.Image _openPlaylistImage {
valign: center;
icon-name: "go-next-symbolic";
}
Adw.PreferencesGroup _openPlaylistGroup {
visible: false;
margin-start: 24;
margin-end: 24;

Adw.ActionRow _openPlaylistRow {
subtitle: _("Select items to download or change file names.");
subtitle-lines: 1;
activatable-widget: _openPlaylistImage;

[suffix]
Gtk.Image _openPlaylistImage {
valign: center;
icon-name: "go-next-symbolic";
}
}

Adw.ActionRow _numberTitlesRow {
title: _("Number Titles");
activatable-widget: _numberTitlesSwitch;
Adw.ActionRow _numberTitlesRow {
title: _("Number Titles");
activatable-widget: _numberTitlesSwitch;

[suffix]
Gtk.Switch _numberTitlesSwitch {
valign: center;
active: false;
}
[suffix]
Gtk.Switch _numberTitlesSwitch {
valign: center;
active: false;
}
}
};
}
}

Gtk.Button _addDownloadButton {
Expand Down
44 changes: 0 additions & 44 deletions NickvisionTubeConverter.GNOME/Blueprints/keyring_dialog.blp
Original file line number Diff line number Diff line change
Expand Up @@ -65,50 +65,6 @@ Adw.Window _root {
};
}

Adw.ViewStackPage {
name: "password";
child: Gtk.Box {
orientation: vertical;
spacing: 24;

Adw.PreferencesGroup {
margin-top: 12;
margin-start: 24;
margin-end: 24;

Adw.PasswordEntryRow _newPasswordEntry {
title: _("New Password");
activates-default: true;
}

Adw.PasswordEntryRow _confirmPasswordEntry {
title: _("Confirm Password");
activates-default: true;
}
}

Gtk.Label {
margin-start: 24;
margin-end: 24;
label: _("If the password is lost, there is no way to restore the keyring!");

styles ["warning"]
}

Gtk.Button _setPasswordButton {
halign: center;
valign: end;
vexpand: true;
margin-top: 24;
margin-bottom: 36;
sensitive: false;
label: _("Continue");

styles ["pill", "suggested-action"]
}
};
}

Adw.ViewStackPage {
name: "home";
child: Gtk.Box _mainBox {
Expand Down
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.4" />
<PackageReference Include="Nickvision.Aura" Version="2023.9.2" />
<PackageReference Include="Nickvision.GirExt" Version="2023.7.1" />
</ItemGroup>

Expand Down
5 changes: 4 additions & 1 deletion NickvisionTubeConverter.GNOME/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ public Program(string[] args)
_mainWindow = null;
_mainWindowController = new MainWindowController();
_mainWindowController.AppInfo.Changelog =
@"* Updated translations (Thanks everyone on Weblate!)";
@"* Added a new advanced download option to split chapters
* Added a new preference to enable SponsorBlock for YouTube downloads
* Keyring password is now saved in system keyring using libsecret
* 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
16 changes: 0 additions & 16 deletions NickvisionTubeConverter.GNOME/Views/AddDownloadDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public partial class AddDownloadDialog : Adw.Window
[Gtk.Connect] private readonly Gtk.Button _addDownloadButton;
[Gtk.Connect] private readonly Gtk.Box _downloadPage;
[Gtk.Connect] private readonly Gtk.Button _backButton;
[Gtk.Connect] private readonly Gtk.ScrolledWindow _scrolledWindow;
[Gtk.Connect] private readonly Adw.ComboRow _fileTypeRow;
[Gtk.Connect] private readonly Adw.ComboRow _qualityRow;
[Gtk.Connect] private readonly Adw.ComboRow _audioLanguageRow;
Expand Down Expand Up @@ -138,21 +137,6 @@ private AddDownloadDialog(Gtk.Builder builder, AddDownloadDialogController contr
}
}
};
var vadjustment = _scrolledWindow.GetVadjustment();
vadjustment.OnNotify += (sender, e) =>
{
if (e.Pspec.GetName() == "page-size")
{
if (vadjustment.GetPageSize() < vadjustment.GetUpper())
{
_scrolledWindow.AddCssClass("scrolled-window");
}
else
{
_scrolledWindow.RemoveCssClass("scrolled-window");
}
}
};
_fileTypeRow.OnNotify += (sender, e) =>
{
if (e.Pspec.GetName() == "selected-item")
Expand Down
40 changes: 9 additions & 31 deletions NickvisionTubeConverter.GNOME/Views/KeyringDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ public partial class KeyringDialog : Adw.Window
[Gtk.Connect] private readonly Adw.ViewStack _viewStack;
[Gtk.Connect] private readonly Adw.StatusPage _disabledPage;
[Gtk.Connect] private readonly Gtk.Button _enableKeyringButton;
[Gtk.Connect] private readonly Adw.EntryRow _newPasswordEntry;
[Gtk.Connect] private readonly Adw.EntryRow _confirmPasswordEntry;
[Gtk.Connect] private readonly Gtk.Button _setPasswordButton;
[Gtk.Connect] private readonly Gtk.Box _mainBox;
[Gtk.Connect] private readonly Adw.PreferencesGroup _credentialsGroup;
[Gtk.Connect] private readonly Gtk.Button _addCredentialButton;
Expand Down Expand Up @@ -61,31 +58,21 @@ private KeyringDialog(Gtk.Builder builder, KeyringDialogController controller, s
SetIconName(_appID);
//Build UI
builder.Connect(this);
_enableKeyringButton.OnClicked += (sender, e) =>
_enableKeyringButton.OnClicked += async (sender, e) =>
{
_titleLabel.SetVisible(true);
_titleLabel.SetLabel(_("Set Password"));
_viewStack.SetVisibleChildName("password");
};
_newPasswordEntry.OnNotify += (sender, e) =>
{
if (e.Pspec.GetName() == "text")
_enableKeyringButton.SetSensitive(false);
var success = false;
await Task.Run(() => success = _controller.EnableKeyring());
_enableKeyringButton.SetSensitive(true);
if (success)
{
ValidateNewPassword();
await LoadHomePageAsync();
}
};
_confirmPasswordEntry.OnNotify += (sender, e) =>
{
if (e.Pspec.GetName() == "text")
else
{
ValidateNewPassword();
_toastOverlay.AddToast(Adw.Toast.New(_("Failed to enable keyring.")));
}
};
_setPasswordButton.OnClicked += async (sender, e) =>
{
_controller.EnableKeyring(_newPasswordEntry.GetText());
await LoadHomePageAsync();
};
_disableKeyringButton.OnClicked += (sender, e) =>
{
_backButton.SetVisible(true);
Expand Down Expand Up @@ -129,15 +116,6 @@ public async Task PresentAsync()
}
}

private void ValidateNewPassword()
{
_setPasswordButton.SetSensitive(false);
if (_newPasswordEntry.GetText() == _confirmPasswordEntry.GetText() && !string.IsNullOrEmpty(_newPasswordEntry.GetText()))
{
_setPasswordButton.SetSensitive(true);
}
}

/// <summary>
/// Loads the Home page
/// </summary>
Expand Down
Loading