Skip to content
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
2 changes: 2 additions & 0 deletions docs/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ curated-config-paths:
- /run/host/etc/bazaar/curated.yaml
# Make the app start on the curated page instead of the explore page, try to only use if you have an interesting news section
start-on-curated: true
# Hide the auto update options in the preferences dialog, useful when you want to avoid confusion if your distro handles auto-updates of Flatpaks already.
hide-auto-update-options: true
```

### EOL Overrides
Expand Down
1 change: 1 addition & 0 deletions src/bz-main-config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ property=hooks GListModel G_TYPE_LIST_MODEL object
property=search_biases GListModel G_TYPE_LIST_MODEL object

property=start_on_curated gboolean G_TYPE_BOOLEAN boolean
property=hide_auto_update_options gboolean G_TYPE_BOOLEAN boolean
4 changes: 3 additions & 1 deletion src/bz-preferences-dialog.blp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ template $BzPreferencesDialog: Adw.PreferencesDialog {
action-name: "app.sync-remotes";
};

Adw.PreferencesGroup {
Adw.PreferencesGroup auto_updates_group {
title: _("App Updates");
visible: bind try {$logical_or($invert_boolean(template.state as <$BzStateInfo>.main-config as <$BzMainConfig>.hide-auto-update-options) as <bool>, automatic_updates_check.active), true};

[header-suffix]
MenuButton {
Expand Down Expand Up @@ -73,6 +74,7 @@ template $BzPreferencesDialog: Adw.PreferencesDialog {
}

Adw.PreferencesGroup {
visible: bind auto_updates_group.visible;
Adw.SwitchRow auto_notif_switch {
use-underline: true;
title: _("Automatic Update _Notifications");
Expand Down
12 changes: 4 additions & 8 deletions src/bz-preferences-dialog.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*/

#include "bz-preferences-dialog.h"
#include "template-callbacks.h"
#include <glib/gi18n.h>

typedef struct
Expand Down Expand Up @@ -241,13 +242,6 @@ bz_preferences_dialog_set_property (GObject *object,
}
}

static gboolean
invert_boolean (gpointer object,
gboolean value)
{
return !value;
}

static void
bz_preferences_dialog_class_init (BzPreferencesDialogClass *klass)
{
Expand All @@ -269,14 +263,15 @@ bz_preferences_dialog_class_init (BzPreferencesDialogClass *klass)

gtk_widget_class_set_template_from_resource (widget_class, "/io/github/kolunmi/Bazaar/bz-preferences-dialog.ui");

bz_widget_class_bind_all_util_callbacks (widget_class);

gtk_widget_class_bind_template_child (widget_class, BzPreferencesDialog, only_foss_switch);
gtk_widget_class_bind_template_child (widget_class, BzPreferencesDialog, only_flathub_switch);
gtk_widget_class_bind_template_child (widget_class, BzPreferencesDialog, only_verified_switch);
gtk_widget_class_bind_template_child (widget_class, BzPreferencesDialog, flag_buttons_box);
gtk_widget_class_bind_template_child (widget_class, BzPreferencesDialog, hide_eol_switch);
gtk_widget_class_bind_template_child (widget_class, BzPreferencesDialog, automatic_updates_check);
gtk_widget_class_bind_template_child (widget_class, BzPreferencesDialog, auto_notif_switch);
gtk_widget_class_bind_template_callback (widget_class, invert_boolean);
}

static void
Expand All @@ -298,5 +293,6 @@ bz_preferences_dialog_new (BzStateInfo *state)
g_object_get (state, "settings", &dialog->settings, NULL);
bind_settings (dialog);

g_object_notify_by_pspec (G_OBJECT (dialog), props[PROP_STATE]);
return ADW_DIALOG (dialog);
}