Branch: refs/heads/master Author: Colomban Wendling ban@herbesfolles.org Committer: Colomban Wendling ban@herbesfolles.org Date: Sun, 05 Feb 2023 22:10:45 UTC Commit: 83f6b88daf0b3911052056593141e291b67f7b64 https://github.com/geany/geany-plugins/commit/83f6b88daf0b3911052056593141e2...
Log Message: ----------- webhelper: Use the right type for GSimpleAction
Modified Paths: -------------- webhelper/src/gwh-browser.c webhelper/src/gwh-plugin.c
Modified: webhelper/src/gwh-browser.c 21 lines changed, 11 insertions(+), 10 deletions(-) =================================================================== @@ -654,7 +654,7 @@ on_web_view_context_menu (WebKitWebView *view, { WebKitContextMenuItem *item; WebKitContextMenu *submenu; - GAction *action; + GSimpleAction *action; GVariant *action_state;
webkit_context_menu_append (context_menu, @@ -669,16 +669,16 @@ on_web_view_context_menu (WebKitWebView *view, action = g_simple_action_new ("zoom-in", NULL); g_signal_connect_swapped (action, "activate", G_CALLBACK (web_view_zoom_in), view); - item = webkit_context_menu_item_new_from_gaction (action, _("Zoom _In"), - NULL); + item = webkit_context_menu_item_new_from_gaction (G_ACTION (action), + _("Zoom _In"), NULL); webkit_context_menu_append (submenu, item);
/* zoom out */ action = g_simple_action_new ("zoom-out", NULL); g_signal_connect_swapped (action, "activate", G_CALLBACK (web_view_zoom_out), view); - item = webkit_context_menu_item_new_from_gaction (action, _("Zoom _Out"), - NULL); + item = webkit_context_menu_item_new_from_gaction (G_ACTION (action), + _("Zoom _Out"), NULL); webkit_context_menu_append (submenu, item);
/* zoom 1:1 */ @@ -687,8 +687,8 @@ on_web_view_context_menu (WebKitWebView *view, action = g_simple_action_new ("zoom-reset", NULL); g_signal_connect_swapped (action, "activate", G_CALLBACK (on_item_zoom_100_activate), view); - item = webkit_context_menu_item_new_from_gaction (action, _("_Reset Zoom"), - NULL); + item = webkit_context_menu_item_new_from_gaction (G_ACTION (action), + _("_Reset Zoom"), NULL); webkit_context_menu_append (submenu, item);
/* full content zoom */ @@ -702,7 +702,7 @@ on_web_view_context_menu (WebKitWebView *view, NULL, action_state ); - item = webkit_context_menu_item_new_from_gaction (action, + item = webkit_context_menu_item_new_from_gaction (G_ACTION (action), _("Full-_content zoom"), NULL); g_simple_action_set_enabled (action, TRUE); @@ -717,8 +717,9 @@ on_web_view_context_menu (WebKitWebView *view, g_signal_connect_swapped (action, "activate", G_CALLBACK (on_item_flip_orientation_activate), view); - item = webkit_context_menu_item_new_from_gaction ( - action, _("_Flip panes orientation"), NULL); + item = webkit_context_menu_item_new_from_gaction (G_ACTION (action), + _("_Flip panes orientation"), + NULL); webkit_context_menu_append (context_menu, item); if (! INSPECTOR_VISIBLE (self) || INSPECTOR_DETACHED (self)) { g_simple_action_set_enabled (action, FALSE);
Modified: webhelper/src/gwh-plugin.c 17 lines changed, 8 insertions(+), 9 deletions(-) =================================================================== @@ -250,15 +250,16 @@ on_item_auto_reload_toggled (GAction *action, "browser-auto-reload", &browser_auto_reload, NULL); g_object_set (G_OBJECT (G_settings), "browser-auto-reload", !browser_auto_reload, NULL); - g_simple_action_set_state (action, g_variant_new_boolean (browser_auto_reload)); + g_simple_action_set_state (G_SIMPLE_ACTION (action), + g_variant_new_boolean (browser_auto_reload)); }
static void on_browser_populate_popup (GwhBrowser *browser, WebKitContextMenu *menu, gpointer dummy) { - GAction *action; + GSimpleAction *action; gboolean auto_reload = FALSE; GVariant *action_state; WebKitContextMenuItem *item; @@ -269,13 +270,11 @@ on_browser_populate_popup (GwhBrowser *browser, g_object_get (G_OBJECT (G_settings), "browser-auto-reload", &auto_reload, NULL); action_state = g_variant_new_boolean (auto_reload); - action = g_simple_action_new_stateful ( - "browser-auto-reload", - NULL, - action_state - ); - item = webkit_context_menu_item_new_from_gaction ( - action, _("Reload upon document saving"), NULL); + action = g_simple_action_new_stateful ("browser-auto-reload", + NULL, action_state); + item = webkit_context_menu_item_new_from_gaction (G_ACTION (action), + _("Reload upon document saving"), + NULL); webkit_context_menu_append (menu, item); g_signal_connect (action, "activate", on_item_auto_reload_toggled, NULL);
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).