talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit c32d69a972c9ff076bfc4f5c4e2833f0996786bc
parent bdb6c66e72851721e6ee6c82b2e274c8bfb9353d
Author: paul <paul@claws-mail.org>
Date:   Thu, 15 Apr 2021 11:54:25 +0100

oauth2: add a 'Copy link' button

Diffstat:
Msrc/prefs_account.c | 13++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/prefs_account.c b/src/prefs_account.c @@ -213,6 +213,7 @@ typedef struct Oauth2Page GtkWidget *oauth2_authcode_entry; GtkWidget *oauth2_auth_optmenu; GtkWidget *oauth2_link_button; + GtkWidget *oauth2_link_copy_button; gpointer *protocol_optmenu; GtkWidget *oauth2_customid_checkbtn; GtkWidget *oauth2_cust_client_id_entry; @@ -2217,6 +2218,7 @@ static void oauth2_create_widget_func(PrefsPage * _page, GtkWidget *oauth2_authcode_entry; GtkWidget *oauth2_auth_optmenu; GtkWidget *oauth2_link_button; + GtkWidget *oauth2_link_copy_button; GtkWidget *oauth2_customid_checkbtn; GtkWidget *oauth2_cust_client_id_entry; GtkWidget *oauth2_cust_client_secret_entry; @@ -2341,6 +2343,13 @@ static void oauth2_create_widget_func(PrefsPage * _page, gtk_widget_show (oauth2_link_button); gtk_box_pack_start (GTK_BOX (hbox), oauth2_link_button, FALSE, FALSE, 0); + oauth2_link_copy_button = gtk_button_new_with_label(_("Copy link")); + g_signal_connect(G_OBJECT(oauth2_link_copy_button), "clicked", G_CALLBACK(prefs_account_oauth2_copy_url), NULL); + gtk_widget_set_sensitive(oauth2_link_copy_button, TRUE); + gtk_widget_set_margin_bottom(oauth2_link_copy_button, 8); + gtk_widget_show (oauth2_link_copy_button); + gtk_box_pack_start (GTK_BOX (hbox), oauth2_link_copy_button, FALSE, FALSE, 0); + /* Authorisation code */ hbox = gtk_hbox_new (FALSE, 8); gtk_widget_show (hbox); @@ -2374,6 +2383,7 @@ static void oauth2_create_widget_func(PrefsPage * _page, /* Add items to page struct */ page->oauth2_link_button = oauth2_link_button; + page->oauth2_link_copy_button = oauth2_link_copy_button; page->oauth2_authcode_entry = oauth2_authcode_entry; page->oauth2_auth_optmenu = oauth2_auth_optmenu; page->protocol_optmenu = (gpointer)protocol_optmenu; @@ -5149,7 +5159,8 @@ static void prefs_account_oauth2_copy_url(GtkButton *button, gpointer data) gtk_clipboard_set_text (clip, url, len); gtk_clipboard_set_text (clip2, url, len); - open_uri(url, prefs_common_get_uri_cmd()); + if (!strcmp(gtk_button_get_label(button), "Copy link") == 0) + open_uri(url, prefs_common_get_uri_cmd()); g_free(url); }