Ejemplo n.º 1
0
static void
on_propdialog_response (GtkDialog *dialog, gint response_id, gpointer user_data)
{
	SearchFolderDialog	*sfd = SEARCH_FOLDER_DIALOG (user_data);
	
	if (response_id == GTK_RESPONSE_OK) {	
		/* save new search folder settings */
		node_set_title (sfd->priv->node, gtk_entry_get_text (GTK_ENTRY (sfd->priv->nameEntry)));
		rule_editor_save (sfd->priv->re, sfd->priv->vfolder->itemset);
		sfd->priv->vfolder->itemset->anyMatch = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (liferea_dialog_lookup (GTK_WIDGET (dialog), "anyRuleRadioBtn")));

		/* update search folder */
		itemview_clear ();
		vfolder_reset (sfd->priv->vfolder);
		itemlist_unload (FALSE);
		
		/* If we are finished editing a new search folder add it to the feed list */
		if (!sfd->priv->node->parent)
			feedlist_node_added (sfd->priv->node);
			
		ui_node_update (sfd->priv->node->id);
	}
	
	gtk_widget_destroy (GTK_WIDGET (dialog));
}
Ejemplo n.º 2
0
static void
on_search_dialog_response (GtkDialog *dialog, gint responseId, gpointer user_data)
{
	SearchDialog	*sd = (SearchDialog *)user_data;
	
	if (1 == responseId) { /* Search */
		rule_editor_save (sd->priv->re, sd->priv->vfolder);
		sd->priv->vfolder->itemset->anyMatch = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (liferea_dialog_lookup (sd->priv->dialog, "anyRuleRadioBtn2")));
		
		vfolder_reset (sd->priv->vfolder);
		search_load_results (sd->priv->searchResult, NULL);
	}
	
	if (2 == responseId) { /* + Search Folder */
		rule_editor_save (sd->priv->re, sd->priv->vfolder);
		sd->priv->vfolder->itemset->anyMatch = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (liferea_dialog_lookup (sd->priv->dialog, "anyRuleRadioBtn2")));
		
		nodePtr node = sd->priv->searchResult;
		sd->priv->searchResult = NULL;
		sd->priv->vfolder = NULL;
		feedlist_node_added (node);
	}
	
	if (1 != responseId)
		g_object_unref (sd);
}
Ejemplo n.º 3
0
static nodePtr
default_source_add_folder (nodePtr node, const gchar *title)
{
	/* For the local feed list source folders are always 
	   real folders implemented by the folder node type... */
	nodePtr child = node_new (folder_get_node_type());
	node_set_title (child, title);
	feedlist_node_added (child);
	
	return child;
}
Ejemplo n.º 4
0
static nodePtr
default_source_add_subscription (nodePtr node, subscriptionPtr subscription)
{
	/* For the local feed list source subscriptions are always
	   feed subscriptions implemented by the feed node and 
	   subscription type... */
	nodePtr child = node_new (feed_get_node_type ());
	node_set_title (child, _("New Subscription"));
	node_set_data (child, feed_new ());
	node_set_subscription (child, subscription);	/* feed subscription type is implicit */
	feedlist_node_added (child);
	
	subscription_update (subscription, FEED_REQ_RESET_TITLE | FEED_REQ_PRIORITY_HIGH);
	return child;
}