#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"
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);
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);
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. */
folder_item_scan(new_item);
folder_write_list();
+
+ if (edit_properties)
+ rssyl_gtk_prop(ritem);
+
folder_item_update_thaw();
return TRUE;
#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
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);
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);