diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2022-11-12 09:48:14 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2022-11-12 09:48:14 +0100 |
commit | 009e1b62f7130e8a05224963bc6b30a76c901928 (patch) | |
tree | 742de5b96a380c1f8e0ee0d684ae180ef2adc096 | |
parent | 47feef09024f8ab76985d118637e14454a46c71e (diff) | |
parent | f4bbf9dd45bfcb61021842e2be96d8a7a1287bb1 (diff) | |
download | ayatana-indicator-power-009e1b62f7130e8a05224963bc6b30a76c901928.tar.gz ayatana-indicator-power-009e1b62f7130e8a05224963bc6b30a76c901928.tar.bz2 ayatana-indicator-power-009e1b62f7130e8a05224963bc6b30a76c901928.zip |
Merge branch 'tari01-pr/fix-flashlight-toggle'
Attributes GH PR #68: https://github.com/AyatanaIndicators/ayatana-indicator-power/pull/68
-rw-r--r-- | src/service.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/service.c b/src/service.c index 3aec746..9f18825 100644 --- a/src/service.c +++ b/src/service.c @@ -682,13 +682,13 @@ create_phone_settings_section(IndicatorPowerService * self) if (flashlight_supported()) { - item = g_menu_item_new(_("Flashlight"), "indicator.flashlight"); + item = g_menu_item_new(_("Flashlight"), "indicator.flashlight(true)"); g_menu_item_set_attribute(item, "x-ayatana-type", "s", "org.ayatana.indicator.switch"); g_menu_append_item(section, item); g_object_unref(item); if (flashlight_activated()) { - item = g_menu_item_new(_("Warning: Heavy use can damage the LED!"), "indicator.flashlight"); + item = g_menu_item_new(_("Warning: Heavy use can damage the LED!"), "indicator.flashlight(true)"); g_menu_append_item(section, item); g_object_unref(item); } @@ -933,7 +933,9 @@ init_gactions (IndicatorPowerService * self) g_action_map_add_action(G_ACTION_MAP(p->actions), G_ACTION(a)); /* add the flashlight action */ - a = g_simple_action_new_stateful("flashlight", NULL, g_variant_new_boolean(FALSE)); + GVariantType *pType = g_variant_type_new ("b"); + 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); |