From 8ec14e26e24b823f6be26ff36b428781a75c6bdf Mon Sep 17 00:00:00 2001 From: Robert Tari Date: Sat, 11 Feb 2023 01:27:40 +0100 Subject: Handle state changes for flashlight switch fixes https://gitlab.com/ubports/development/core/packaging/ayatana-indicators/ayatana-indicator-power/-/issues/5 --- src/flashlight.c | 4 +++- src/service.c | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/flashlight.c b/src/flashlight.c index 064bd31..0a68af2 100644 --- a/src/flashlight.c +++ b/src/flashlight.c @@ -1,5 +1,6 @@ /* * Copyright 2017 The UBports project + * Copyright 2023 Robert Tari * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published @@ -15,6 +16,7 @@ * * Authors: * Marius Gripsgard + * Robert Tari */ #include "flashlight.h" @@ -145,7 +147,7 @@ toggle_flashlight_action(GAction *action, toggled = toggle_flashlight_action_simple(); if (toggled) - g_action_change_state(action, g_variant_new_boolean(!activated)); + g_simple_action_set_state (G_SIMPLE_ACTION (action), g_variant_new_boolean(!activated)); } int diff --git a/src/service.c b/src/service.c index 2731508..293a983 100644 --- a/src/service.c +++ b/src/service.c @@ -1,6 +1,6 @@ /* * Copyright 2013-2016 Canonical Ltd. - * Copyright 2021-2022 Robert Tari + * Copyright 2021-2023 Robert Tari * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3, as published @@ -931,7 +931,7 @@ init_gactions (IndicatorPowerService * self) a = g_simple_action_new_stateful ("flashlight", pType, g_variant_new_boolean (FALSE)); g_variant_type_free (pType); g_action_map_add_action (G_ACTION_MAP(p->actions), G_ACTION(a)); - g_signal_connect(a, "activate", G_CALLBACK(toggle_flashlight_action), self); + g_signal_connect(a, "change-state", G_CALLBACK(toggle_flashlight_action), self); /* add the brightness action */ a = g_simple_action_new_stateful ("brightness", NULL, action_state_for_brightness (self)); -- cgit v1.2.3 From d2569c71afb8651db6199c73369b9d8ef771aab0 Mon Sep 17 00:00:00 2001 From: Luna Jernberg Date: Fri, 10 Feb 2023 12:19:34 +0000 Subject: Translated using Weblate (Swedish) Currently translated at 97.9% (48 of 49 strings) Translation: Ayatana Indicators/Power Applet Translate-URL: https://hosted.weblate.org/projects/ayatana-indicators/power-applet/sv/ --- po/sv.po | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/po/sv.po b/po/sv.po index c6e4804..4612674 100644 --- a/po/sv.po +++ b/po/sv.po @@ -8,16 +8,16 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-09-14 08:53+0200\n" -"PO-Revision-Date: 2019-10-24 14:53+0000\n" -"Last-Translator: Mattias Münster \n" -"Language-Team: Swedish \n" +"PO-Revision-Date: 2023-02-11 12:38+0000\n" +"Last-Translator: Luna Jernberg \n" +"Language-Team: Swedish \n" "Language: sv\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 3.9.1-dev\n" +"X-Generator: Weblate 4.16-dev\n" #: data/org.ayatana.indicator.power.gschema.xml:1 msgid "Show time in Menu Bar" @@ -228,7 +228,7 @@ msgstr "Batteriinställningar" #: src/service.c:458 msgid "Battery status and power management" -msgstr "" +msgstr "Batteristatus och energihantering" #: src/service.c:583 msgid "Charge level" -- cgit v1.2.3