From a5846772414786ab179c47a477c72817abba8073 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Sun, 28 Jan 2024 17:18:17 -0800 Subject: [PATCH 1/3] SystemUpdate: optionally update automatically (#118) --- data/io.elementary.settings-daemon.gschema.xml | 5 +++++ src/Backends/SystemUpdate.vala | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/data/io.elementary.settings-daemon.gschema.xml b/data/io.elementary.settings-daemon.gschema.xml index 12aa9c28..506e381b 100644 --- a/data/io.elementary.settings-daemon.gschema.xml +++ b/data/io.elementary.settings-daemon.gschema.xml @@ -72,6 +72,11 @@ + + false + Automatic updates + Whether to automatically download updates + 0 When updates were last refreshed diff --git a/src/Backends/SystemUpdate.vala b/src/Backends/SystemUpdate.vala index 2902caaf..8cbc4e8e 100644 --- a/src/Backends/SystemUpdate.vala +++ b/src/Backends/SystemUpdate.vala @@ -120,6 +120,13 @@ public class SettingsDaemon.Backends.SystemUpdate : Object { package_info }; + update_state (AVAILABLE); + + if (!force && settings.get_boolean ("automatic-updates")) { + update.begin (); + return; + } + if (notify) { var notification = new Notification (_("Update available")); notification.set_default_action (Application.ACTION_PREFIX + Application.SHOW_UPDATES_ACTION); @@ -135,8 +142,6 @@ public class SettingsDaemon.Backends.SystemUpdate : Object { GLib.Application.get_default ().send_notification (NOTIFICATION_ID, notification); } - - update_state (AVAILABLE); } catch (Error e) { warning ("Failed to get available updates: %s", e.message); update_state (UP_TO_DATE); From 979fe54a3ca4667d0c0e32c17d8f3ad495f111eb Mon Sep 17 00:00:00 2001 From: lenemter Date: Sun, 28 Jan 2024 22:51:24 +0000 Subject: [PATCH 2/3] Translated using Weblate (Russian) Currently translated at 100.0% (59 of 59 strings) Translation: Desktop/Settings Daemon Translate-URL: https://l10n.elementary.io/projects/desktop/settings-daemon/ru/ --- po/ru.po | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/po/ru.po b/po/ru.po index 01ada64c..a60190ce 100644 --- a/po/ru.po +++ b/po/ru.po @@ -8,16 +8,16 @@ msgstr "" "Project-Id-Version: extra\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2024-01-28 22:41+0000\n" -"PO-Revision-Date: 2024-01-28 22:41+0000\n" +"PO-Revision-Date: 2024-01-29 04:55+0000\n" "Last-Translator: lenemter \n" -"Language-Team: Russian \n" +"Language-Team: Russian \n" "Language: ru\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" -"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && " +"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" "X-Generator: Weblate 5.0.2\n" #: data/settings-daemon.metainfo.xml.in:10 @@ -114,10 +114,8 @@ msgid "Update available" msgstr "Доступны обновления" #: src/Backends/SystemUpdate.vala:128 -#, fuzzy -#| msgid "A system update is available" msgid "A system security update is available" -msgstr "Доступны обновления системы" +msgstr "Доступны обновления безопасности" #: src/Backends/SystemUpdate.vala:132 msgid "A system update is available" From 5dddde89332bd718646811ab6e9685c89a5512be Mon Sep 17 00:00:00 2001 From: Leo Date: Mon, 29 Jan 2024 17:05:45 +0900 Subject: [PATCH 3/3] Modernize meson (#124) --- data/meson.build | 6 +++--- meson.build | 8 +++++--- meson/post_install.py | 19 ------------------- 3 files changed, 8 insertions(+), 25 deletions(-) delete mode 100644 meson/post_install.py diff --git a/data/meson.build b/data/meson.build index bab61fe8..f0fdf839 100644 --- a/data/meson.build +++ b/data/meson.build @@ -24,13 +24,13 @@ act_interfacesdir = act_dep.get_variable('interfacesdir', pkgconfig_define: ['da meson.add_install_script( symlink, - join_paths(dbus_interfaces_dir, 'io.elementary.SettingsDaemon.AccountsService.xml'), - join_paths(act_interfacesdir, 'io.elementary.SettingsDaemon.AccountsService.xml'), + dbus_interfaces_dir / 'io.elementary.SettingsDaemon.AccountsService.xml', + act_interfacesdir / 'io.elementary.SettingsDaemon.AccountsService.xml', ) install_data( 'io.elementary.settings-daemon.gschema.xml', - install_dir: join_paths(datadir, 'glib-2.0', 'schemas') + install_dir: datadir / 'glib-2.0' / 'schemas' ) i18n.merge_file( diff --git a/meson.build b/meson.build index 595df763..15c2bc71 100644 --- a/meson.build +++ b/meson.build @@ -2,9 +2,11 @@ project('io.elementary.settings-daemon', 'c', 'vala', version: '1.3.1', license: 'GPL3', - meson_version: '>=0.58.0' + meson_version: '>=0.59.0' ) +gnome = import('gnome') + fwupd_dep = dependency('fwupd') gio_dep = dependency ('gio-2.0') glib_dep = dependency('glib-2.0') @@ -45,11 +47,11 @@ config_dep = declare_dependency( include_directories: include_directories('.') ) -symlink = join_paths(meson.current_source_dir (), 'meson', 'create-symlink.sh') +symlink = meson.current_source_dir () / 'meson' / 'create-symlink.sh' subdir('data') subdir('po') subdir('src') subdir('settings-portal') -meson.add_install_script('meson/post_install.py') +gnome.post_install(glib_compile_schemas: true, gtk_update_icon_cache: true, update_desktop_database: true) diff --git a/meson/post_install.py b/meson/post_install.py deleted file mode 100644 index 3b485435..00000000 --- a/meson/post_install.py +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env python3 - -import os -import subprocess - -prefix = os.environ.get('MESON_INSTALL_PREFIX', '/usr/local') -datadir = os.path.join(prefix, 'share') - -# Packaging tools define DESTDIR and this isn't needed for them -if 'DESTDIR' not in os.environ: - print('Compiling gsettings schemas...') - subprocess.call(['glib-compile-schemas', os.path.join(datadir, 'glib-2.0', 'schemas')]) - - print('Updating icon cache...') - subprocess.call(['gtk-update-icon-cache', '-qtf', os.path.join(datadir, 'icons', 'hicolor')]) - - print('Updating desktop database...') - subprocess.call(['update-desktop-database', '-q', os.path.join(datadir, 'applications')]) -