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); }
static void on_simple_search_dialog_response (GtkDialog *dialog, gint responseId, gpointer user_data) { SimpleSearchDialog *ssd = (SimpleSearchDialog *)user_data; const gchar *searchString; vfolderPtr vfolder = ssd->priv->vfolder; searchString = gtk_entry_get_text (GTK_ENTRY (ssd->priv->query)); if (1 == responseId) { /* Search */ search_clean_results (vfolder); /* Create new search... */ ssd->priv->vfolder = vfolder = vfolder_new (node_new (vfolder_get_node_type ())); node_set_title (vfolder->node, searchString); itemset_add_rule (vfolder->itemset, "exact", searchString, TRUE); search_load_results (vfolder); } if (2 == responseId) /* Advanced... */ search_dialog_open (searchString); /* Do not close the dialog when "just" searching. The user should click "Close" to close the dialog to be able to do subsequent searches... */ if (1 != responseId) g_object_unref (ssd); }
static void on_simple_search_dialog_response (GtkDialog *dialog, gint responseId, gpointer user_data) { SimpleSearchDialog *ssd = (SimpleSearchDialog *)user_data; const gchar *searchString; searchString = gtk_entry_get_text (GTK_ENTRY (ssd->priv->query)); if (1 == responseId) { /* Search */ /* Clean up old search result data and display... */ if (ssd->priv->searchResult) { if (ssd->priv->searchResult == itemlist_get_displayed_node ()) itemlist_unload (FALSE); node_free (ssd->priv->searchResult); } /* Create new search... */ ssd->priv->searchResult = node_new (vfolder_get_node_type ()); ssd->priv->vfolder = vfolder_new (ssd->priv->searchResult); node_set_title (ssd->priv->searchResult, searchString); itemset_add_rule (ssd->priv->vfolder->itemset, "exact", searchString, TRUE); vfolder_reset (ssd->priv->vfolder); search_load_results (ssd->priv->searchResult, searchString); } if (2 == responseId) /* Advanced... */ search_dialog_open (searchString); /* Do not close the dialog when "just" searching. The user should click "Close" to close the dialog to be able to do subsequent searches... */ if (1 != responseId) g_object_unref (ssd); }