[Commits] [SCM] claws branch, master, updated. 3.17.8-64-gc32d69a97

paul at claws-mail.org paul at claws-mail.org
Thu Apr 15 13:09:28 CEST 2021


The branch, master has been updated
       via  c32d69a972c9ff076bfc4f5c4e2833f0996786bc (commit)
      from  bdb6c66e72851721e6ee6c82b2e274c8bfb9353d (commit)

Summary of changes:
 src/prefs_account.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)


- Log -----------------------------------------------------------------
commit c32d69a972c9ff076bfc4f5c4e2833f0996786bc
Author: paul <paul at claws-mail.org>
Date:   Thu Apr 15 11:54:25 2021 +0100

    oauth2: add a 'Copy link' button

diff --git a/src/prefs_account.c b/src/prefs_account.c
index 4b8455cfa..b3a02a4ad 100644
--- 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);
 }

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list