/*
* Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2018 Colin Leroy and the Claws Mail team
+ * Copyright (C) 1999-2020 the Claws Mail team and Colin Leroy
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
-#if !GTK_CHECK_VERSION(3, 0, 0)
#include "gtkcmoptionmenu.h"
-#endif
#include "utils.h"
#include "combobox.h"
#include "menu.h"
{
GtkWidget *hbox_search;
GtkWidget *search_type;
-#if !GTK_CHECK_VERSION(3, 0, 0)
GtkWidget *search_type_opt;
-#endif
GtkWidget *search_string_entry;
GtkWidget *search_condition_expression;
GtkWidget *search_description;
static void quicksearch_set_type(QuickSearch *quicksearch, gint type)
{
-#if !GTK_CHECK_VERSION(3, 0, 0)
gint index;
quicksearch->request.type = type;
index = menu_find_option_menu_index(GTK_CMOPTION_MENU(quicksearch->search_type_opt),
GINT_TO_POINTER(type),
NULL);
gtk_cmoption_menu_set_history(GTK_CMOPTION_MENU(quicksearch->search_type_opt), index);
-#endif
}
static gchar *quicksearch_get_text(QuickSearch * quicksearch)
"c S", N_("messages carbon-copied to S"),
"C S", N_("message is either To: or Cc: to S"),
"D", N_("deleted messages"), /** how I can filter deleted messages **/
+ "da \"YYYY-MM-dd HH:mm:ss\"", N_("messages whose date is after requested date "
+ "(time is optional)"),
+ "db \"YYYY-MM-dd HH:mm:ss\"", N_("messages whose date is before requested date "
+ "(time is optional)"),
"e S", N_("messages which contain S in the Sender field"),
"E S", N_("true if execute \"S\" succeeds"),
"f S", N_("messages originating from user S"),
{
QuickSearch *quicksearch = (QuickSearch *)data;
- if (!quicksearch->active)
- return TRUE;
-
quicksearch_set(quicksearch, prefs_common.summary_quicksearch_type, "");
return TRUE;
mainwindow_get_mainwindow()->summaryview->quicksearch != NULL,
FALSE);
- /* re-use the current quicksearch value if it's a condition expression,
- otherwise ignore it silently */
+ /* re-use the current quicksearch value, expanding it so it also works
+ * with extended symbols */
cond_str = quicksearch_get_text(mainwindow_get_mainwindow()->summaryview->quicksearch);
if (*cond_str != '\0') {
- matchers = matcher_parser_get_cond((gchar*)cond_str, NULL);
+ gchar *newstr = advsearch_expand_search_string(cond_str);
+
+ if (newstr && newstr[0] != '\0')
+ matchers = matcher_parser_get_cond(newstr, FALSE);
+ g_free(newstr);
}
prefs_matcher_open(matchers, search_condition_expr_done);
QuickSearch *quicksearch;
GtkWidget *hbox_search;
-#if !GTK_CHECK_VERSION(3, 0, 0)
GtkWidget *search_type_opt;
-#endif
GtkWidget *search_type;
GtkWidget *search_string_entry;
GtkWidget *search_hbox;
/* quick search */
hbox_search = gtk_hbox_new(FALSE, 0);
-#if !GTK_CHECK_VERSION(3, 0, 0)
search_type_opt = gtk_cmoption_menu_new();
gtk_widget_show(search_type_opt);
gtk_box_pack_start(GTK_BOX(hbox_search), search_type_opt, FALSE, FALSE, 0);
-#endif
search_type = gtk_menu_new();
MENUITEM_ADD (search_type, menuitem,
G_CALLBACK(searchtype_autorun_changed),
quicksearch);
-#if !GTK_CHECK_VERSION(3, 0, 0)
gtk_cmoption_menu_set_menu(GTK_CMOPTION_MENU(search_type_opt), search_type);
quicksearch->search_type_opt = search_type_opt;
-#endif
quicksearch_set_type(quicksearch, prefs_common.summary_quicksearch_type);
gtk_widget_show(search_type);
error = TRUE;
if (active) {
- gtk_widget_set_sensitive(quicksearch->clear_search, TRUE);
- gtk_widget_modify_base(
- gtk_bin_get_child(GTK_BIN((quicksearch->search_string_entry))),
- GTK_STATE_NORMAL, error ? &qs_error_bgcolor : &qs_active_bgcolor);
- gtk_widget_modify_text(
- gtk_bin_get_child(GTK_BIN((quicksearch->search_string_entry))),
- GTK_STATE_NORMAL, error ? &qs_error_color : &qs_active_color);
+ gtk_widget_modify_base(
+ gtk_bin_get_child(GTK_BIN((quicksearch->search_string_entry))),
+ GTK_STATE_NORMAL, error ? &qs_error_bgcolor : &qs_active_bgcolor);
+ gtk_widget_modify_text(
+ gtk_bin_get_child(GTK_BIN((quicksearch->search_string_entry))),
+ GTK_STATE_NORMAL, error ? &qs_error_color : &qs_active_color);
} else {
- gtk_widget_set_sensitive(quicksearch->clear_search, FALSE);
- gtk_widget_modify_base(
- gtk_bin_get_child(GTK_BIN((quicksearch->search_string_entry))),
- GTK_STATE_NORMAL, NULL);
- gtk_widget_modify_text(
- gtk_bin_get_child(GTK_BIN((quicksearch->search_string_entry))),
- GTK_STATE_NORMAL, NULL);
+ gtk_widget_modify_base(
+ gtk_bin_get_child(GTK_BIN((quicksearch->search_string_entry))),
+ GTK_STATE_NORMAL, NULL);
+ gtk_widget_modify_text(
+ gtk_bin_get_child(GTK_BIN((quicksearch->search_string_entry))),
+ GTK_STATE_NORMAL, NULL);
}
if (!active) {