From 264b421f2e390a877eb175fa797e695e99c81bad Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 19 Jul 2022 12:53:36 +0200 Subject: src/*.vala: make the 'silent mode' switch item & action QMenuModel compatible QMenuModel, inheritting code from GTK, will consider the menu item not "activatable" if the item's "target" [1] doesn't match the corresponding action's parameter. Since we take a boolean as action's parameter (and we can't change action's parameter easily since it's semi-public), we instead have to pass "target". Taking a page from the slider menu items, pass "true" as the target will make QMenuModel considers the item activatable and reflect the right state. [1] i.e. the parameter to pass when activating the action. See https://wiki.gnome.org/Projects/GLib/GApplication/DBusAPI#Attributes Related: https://github.com/AyatanaIndicators/qmenumodel/issues/21 --- src/service.vala | 4 ++-- src/sound-menu.vala | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/service.vala b/src/service.vala index 31b6204..528cbf4 100644 --- a/src/service.vala +++ b/src/service.vala @@ -335,7 +335,7 @@ public class IndicatorSound.Service: Object { silentNow = this.accounts_service.silentMode; } - silent_action = new SimpleAction.stateful ("silent-mode", null, new Variant.boolean (silentNow)); + silent_action = new SimpleAction.stateful ("silent-mode", VariantType.BOOLEAN, new Variant.boolean (silentNow)); /* If we're not dealing with accounts service, we'll just always be out of silent mode and that's cool. */ @@ -349,7 +349,7 @@ public class IndicatorSound.Service: Object { }); silent_action.activate.connect ((action, param) => { - action.change_state (new Variant.boolean (!action.get_state().get_boolean())); + action.change_state (param); }); silent_action.change_state.connect ((action, val) => { diff --git a/src/sound-menu.vala b/src/sound-menu.vala index fc68f91..fe2b7ff 100644 --- a/src/sound-menu.vala +++ b/src/sound-menu.vala @@ -51,7 +51,7 @@ public class SoundMenu: Object if ((flags & DisplayFlags.SHOW_MUTE) != 0) volume_section.append (_("Mute"), "indicator.mute"); if ((flags & DisplayFlags.SHOW_SILENT_MODE) != 0) { - var item = new MenuItem(_("Silent Mode"), "indicator.silent-mode"); + var item = new MenuItem(_("Silent Mode"), "indicator.silent-mode(true)"); item.set_attribute("x-ayatana-type", "s", "org.ayatana.indicator.switch"); volume_section.append_item(item); } -- cgit v1.2.3 From 0e8d1212ad42a246693a9be73a12dcfb03033cec Mon Sep 17 00:00:00 2001 From: Artem Date: Tue, 21 Jun 2022 17:14:00 +0000 Subject: Translated using Weblate (Ukrainian) Currently translated at 100.0% (53 of 53 strings) Translation: Ayatana Indicators/Sound Applet Translate-URL: https://hosted.weblate.org/projects/ayatana-indicators/sound-applet/uk/ --- po/uk.po | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/po/uk.po b/po/uk.po index f65161f..c3d9ef6 100644 --- a/po/uk.po +++ b/po/uk.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-08-12 07:22+0200\n" -"PO-Revision-Date: 2022-04-23 12:18+0000\n" -"Last-Translator: Sergii Horichenko \n" +"PO-Revision-Date: 2022-06-21 17:19+0000\n" +"Last-Translator: Artem \n" "Language-Team: Ukrainian \n" "Language: uk\n" @@ -18,7 +18,7 @@ msgstr "" "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" -"X-Generator: Weblate 4.12.1-dev\n" +"X-Generator: Weblate 4.13.1-dev\n" #: ../data/org.ayatana.indicator.sound.AccountsService.policy:5 msgid "Set properties of own user" @@ -54,8 +54,8 @@ msgid "" msgstr "" "Кожен мультимедійний плеєр, який дотримується специфікації MPRIS2, " "автоматично з'явиться в меню. Цей масив повинен містити назви файлів " -"робочого столу (мінус суфікс .desktop) застосунків, які не хочуть бути " -"включеними в меню звуку." +"робочого столу (без суфіксу .desktop) застосунків, які не повинні бути " +"залученими в меню звуку." #: ../data/org.ayatana.indicator.sound.gschema.xml:3 msgid "" -- cgit v1.2.3 From fb9c48437b97ccf7eca64021da512740987664ad Mon Sep 17 00:00:00 2001 From: Teitei Date: Thu, 14 Jul 2022 19:55:48 +0000 Subject: Translated using Weblate (Burmese) Currently translated at 1.8% (1 of 53 strings) Translation: Ayatana Indicators/Sound Applet Translate-URL: https://hosted.weblate.org/projects/ayatana-indicators/sound-applet/my/ --- po/my.po | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/po/my.po b/po/my.po index 32cf3eb..df52bca 100644 --- a/po/my.po +++ b/po/my.po @@ -8,13 +8,16 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-08-12 07:22+0200\n" -"PO-Revision-Date: 2017-10-12 07:52+0200\n" -"Last-Translator: Automatically generated\n" -"Language-Team: none\n" +"PO-Revision-Date: 2022-07-15 20:20+0000\n" +"Last-Translator: Teitei \n" +"Language-Team: Burmese \n" "Language: my\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 4.14-dev\n" #: ../data/org.ayatana.indicator.sound.AccountsService.policy:5 msgid "Set properties of own user" @@ -222,7 +225,7 @@ msgstr "" #: ../src/sound-menu.vala:68 msgid "Sound Settings…" -msgstr "" +msgstr "အသံပြင်ဆင်ချက်များ…" #: ../src/sound-menu.vala:125 msgid "Microphone Volume" -- cgit v1.2.3 From c1fba3da3051b0dfb6776b27bb41991914db43fb Mon Sep 17 00:00:00 2001 From: Boyuan Yang <073plan@gmail.com> Date: Fri, 22 Jul 2022 16:24:12 +0000 Subject: Translated using Weblate (Chinese (Simplified)) Currently translated at 69.8% (37 of 53 strings) Translation: Ayatana Indicators/Sound Applet Translate-URL: https://hosted.weblate.org/projects/ayatana-indicators/sound-applet/zh_Hans/ --- po/zh_CN.po | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/po/zh_CN.po b/po/zh_CN.po index 2a7df95..5cab9ff 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-08-12 07:22+0200\n" -"PO-Revision-Date: 2021-07-17 14:32+0000\n" +"PO-Revision-Date: 2022-07-23 17:25+0000\n" "Last-Translator: Boyuan Yang <073plan@gmail.com>\n" "Language-Team: Chinese (Simplified) \n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 4.7.2-dev\n" +"X-Generator: Weblate 4.14-dev\n" #: ../data/org.ayatana.indicator.sound.AccountsService.policy:5 msgid "Set properties of own user" @@ -169,11 +169,11 @@ msgstr "" #: ../src/service.vala:331 ../src/service.vala:334 ../src/sound-menu.vala:59 #: ../src/sound-menu.vala:253 ../src/warn-notification.vala:31 msgid "Volume" -msgstr "" +msgstr "音量" #: ../src/info-notification.vala:55 msgid "Speakers" -msgstr "" +msgstr "扬声器" #: ../src/info-notification.vala:57 msgid "Headphones" @@ -185,23 +185,23 @@ msgstr "蓝牙耳机" #: ../src/info-notification.vala:61 msgid "Bluetooth speaker" -msgstr "" +msgstr "蓝牙扬声器" #: ../src/info-notification.vala:63 msgid "Usb speaker" -msgstr "" +msgstr "USB 扬声器" #: ../src/info-notification.vala:65 msgid "Usb headphones" -msgstr "" +msgstr "USB 耳机" #: ../src/info-notification.vala:67 msgid "HDMI speaker" -msgstr "" +msgstr "HDMI 扬声器" #: ../src/info-notification.vala:69 msgid "HDMI headphones" -msgstr "" +msgstr "HDMI 耳机" #: ../src/service.vala:295 msgid "Missing application" @@ -226,11 +226,11 @@ msgstr "声音" #: ../src/sound-menu.vala:52 msgid "Mute" -msgstr "" +msgstr "静音" #: ../src/sound-menu.vala:54 msgid "Silent Mode" -msgstr "" +msgstr "静音模式" #: ../src/sound-menu.vala:68 msgid "Sound Settings…" @@ -243,7 +243,7 @@ msgstr "麦克风音量" #. NOTE: Action doesn't really exist, just used to find below when removing #: ../src/sound-menu.vala:148 msgid "High volume can damage your hearing." -msgstr "" +msgstr "过高的音量可能会损伤听力。" #: ../src/sound-menu.vala:256 msgid "Volume (Headphones)" @@ -282,6 +282,8 @@ msgid "" "Allow volume above safe level?\n" "High volume can damage your hearing." msgstr "" +"要允许使用高于安全等级的音量吗?\n" +"过高的音量可能会损伤听力。" #: ../src/warn-notification.vala:49 msgid "OK" -- cgit v1.2.3