[Commits] [SCM] claws branch, master, updated. 3.10.1-132-g3a6a70c

ticho at claws-mail.org ticho at claws-mail.org
Sat Jul 26 15:47:32 CEST 2014


The branch, master has been updated
       via  3a6a70c7b3fa9288198c2aafc74b6d778b6320cb (commit)
      from  4f09c01265edb0f7c4cd3f8f205f960277900994 (commit)

Summary of changes:
 src/plugins/rssyl/rssyl_subscribe.c     |   14 ++++++++++++++
 src/plugins/rssyl/rssyl_subscribe_gtk.c |   22 ++++++++++++++--------
 src/plugins/rssyl/rssyl_subscribe_gtk.h |    2 +-
 3 files changed, 29 insertions(+), 9 deletions(-)


- Log -----------------------------------------------------------------
commit 3a6a70c7b3fa9288198c2aafc74b6d778b6320cb
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Sat Jul 26 15:46:49 2014 +0200

    RSSyl: Convenience checkbox allowing user to open feed properties window after subscribing a new feed.

diff --git a/src/plugins/rssyl/rssyl_subscribe.c b/src/plugins/rssyl/rssyl_subscribe.c
index 3bdbc73..ac5453d 100644
--- a/src/plugins/rssyl/rssyl_subscribe.c
+++ b/src/plugins/rssyl/rssyl_subscribe.c
@@ -40,6 +40,7 @@
 #include "rssyl.h"
 #include "rssyl_add_item.h"
 #include "rssyl_feed.h"
+#include "rssyl_gtk.h"
 #include "rssyl_update_feed.h"
 #include "rssyl_subscribe_gtk.h"
 #include "strutils.h"
@@ -64,6 +65,7 @@ gboolean rssyl_subscribe(FolderItem *parent, const gchar *url,
 	RFolderItem *ritem;
 	gint i = 1;
 	RSubCtx *sctx;
+	gboolean edit_properties = FALSE;
 
 	g_return_val_if_fail(parent != NULL, FALSE);
 	g_return_val_if_fail(url != NULL, FALSE);
@@ -94,6 +96,7 @@ gboolean rssyl_subscribe(FolderItem *parent, const gchar *url,
 	if (verbose) {
 		sctx = g_new0(RSubCtx, 1);
 		sctx->feed = ctx->feed;
+		sctx->edit_properties = FALSE;
 
 		debug_print("RSSyl: Calling subscribe dialog routine...\n");
 		rssyl_subscribe_dialog(sctx);
@@ -103,6 +106,13 @@ gboolean rssyl_subscribe(FolderItem *parent, const gchar *url,
 			g_free(sctx);
 			return FALSE;
 		}
+
+		edit_properties = sctx->edit_properties;
+		if (sctx->edit_properties)
+			debug_print("RSSyl: User wants to edit properties of the new feed.\n");
+		else
+			debug_print("RSSyl: User does not want to edit properties of the new feed.\n");
+		g_free(sctx);
 	}
 
 	/* OK, feed is succesfully fetched and correct, let's add it to CM. */
@@ -145,6 +155,10 @@ gboolean rssyl_subscribe(FolderItem *parent, const gchar *url,
 
 	folder_item_scan(new_item);
 	folder_write_list();
+
+	if (edit_properties)
+		rssyl_gtk_prop(ritem);
+
 	folder_item_update_thaw();
 
 	return TRUE;
diff --git a/src/plugins/rssyl/rssyl_subscribe_gtk.c b/src/plugins/rssyl/rssyl_subscribe_gtk.c
index 3f63440..73a6728 100644
--- a/src/plugins/rssyl/rssyl_subscribe_gtk.c
+++ b/src/plugins/rssyl/rssyl_subscribe_gtk.c
@@ -36,7 +36,7 @@
 #include "rssyl_subscribe_gtk.h"
 
 void rssyl_subscribe_dialog(RSubCtx *ctx) {
-	GtkWidget *win, *vbox, *titleframe, *titlelabel;
+	GtkWidget *win, *vbox, *title, *titleframe, *titlelabel, *editprops;
 #if !(GTK_CHECK_VERSION(2, 12, 0))
 	GtkTooltips *tooltips;
 #endif
@@ -74,19 +74,23 @@ void rssyl_subscribe_dialog(RSubCtx *ctx) {
 	gtk_misc_set_padding(GTK_MISC(titlelabel), 5, 0);
 	gtk_frame_set_label_widget(GTK_FRAME(titleframe), titlelabel);
 
-	ctx->title = gtk_entry_new();
-	gtk_entry_set_text(GTK_ENTRY(ctx->title), feed_get_title(ctx->feed));
-	gtk_entry_set_activates_default(GTK_ENTRY(ctx->title), TRUE);
+	title = gtk_entry_new();
+	gtk_entry_set_text(GTK_ENTRY(title), feed_get_title(ctx->feed));
+	gtk_entry_set_activates_default(GTK_ENTRY(title), TRUE);
 #if !(GTK_CHECK_VERSION(2, 12, 0))
-	gtk_tooltips_set_tip(tooltips, ctx->title,
+	gtk_tooltips_set_tip(tooltips, title,
 			_("Instead of using official title, you can enter a different folder "
 				"name for the feed."), NULL);
 #else
-	gtk_widget_set_tooltip_text(ctx->title,
+	gtk_widget_set_tooltip_text(title,
 			_("Instead of using official title, you can enter a different folder "
 				"name for the feed."));
 #endif
-	gtk_container_add(GTK_CONTAINER(titleframe), ctx->title);
+	gtk_container_add(GTK_CONTAINER(titleframe), title);
+
+	editprops = gtk_check_button_new_with_mnemonic(_("_Edit feed properties after subscribing"));
+	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(editprops), FALSE);
+	gtk_box_pack_start(GTK_BOX(vbox), editprops, FALSE, FALSE, 0);
 
 	gtk_widget_show_all(vbox);
 
@@ -94,11 +98,13 @@ void rssyl_subscribe_dialog(RSubCtx *ctx) {
 
 	if (ret == GTK_RESPONSE_ACCEPT) {
 		/* Modify ctx->feed based on user changes in dialog */
-		newtitle = (gchar *)gtk_entry_get_text(GTK_ENTRY(ctx->title));
+		newtitle = (gchar *)gtk_entry_get_text(GTK_ENTRY(title));
 		if (strcmp(feed_get_title(ctx->feed), newtitle)) {
 			debug_print("RSSyl: Using feed title '%s'\n", newtitle);
 			feed_set_title(ctx->feed, newtitle);
 		}
+		ctx->edit_properties =
+			gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(editprops));
 	} else {
 		/* Destroy the feed to signal outside that user cancelled subscribing */
 		feed_free(ctx->feed);
diff --git a/src/plugins/rssyl/rssyl_subscribe_gtk.h b/src/plugins/rssyl/rssyl_subscribe_gtk.h
index 2d40b13..e5c9e72 100644
--- a/src/plugins/rssyl/rssyl_subscribe_gtk.h
+++ b/src/plugins/rssyl/rssyl_subscribe_gtk.h
@@ -5,7 +5,7 @@
 
 struct _RSubCtx {
 	Feed *feed;
-	GtkWidget *title;
+	gboolean edit_properties;
 };
 
 typedef struct _RSubCtx RSubCtx;

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list