summaryrefslogtreecommitdiff
path: root/src/option.c
diff options
context:
space:
mode:
authorArx Cruz <arxcruz@gnome.org>2014-10-21 18:30:35 +0200
committerArx Cruz <arxcruz@gnome.org>2014-10-21 18:30:35 +0200
commit15e2759668a1d17bb1570a890bf294aaa796cbf5 (patch)
tree76450a9da365aa5cdd497a093583cf619a87a5e7 /src/option.c
parentFixing g_timeout_add calls (diff)
downloadzenity-15e2759668a1d17bb1570a890bf294aaa796cbf5.tar.gz
zenity-15e2759668a1d17bb1570a890bf294aaa796cbf5.tar.bz2
zenity-15e2759668a1d17bb1570a890bf294aaa796cbf5.zip
Bug #685051 Adding --mid-search option to --list
This will enable users to find a row with a text matching the middle of the row. Consider the following list: Little piggy one Little piggy two Little piggy three As a user I would expect that entering 'th' would focus the last row, because it's the first one that contains 'th'
Diffstat (limited to 'src/option.c')
-rw-r--r--src/option.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/option.c b/src/option.c
index c1e3a77f..e11c1ba9 100644
--- a/src/option.c
+++ b/src/option.c
@@ -83,6 +83,7 @@ static gchar *zenity_list_print_column;
static gchar *zenity_list_hide_column;
static gboolean zenity_list_hide_header;
static gboolean zenity_list_imagelist;
+static gboolean zenity_list_mid_search;
#ifdef HAVE_LIBNOTIFY
/* Notification Dialog Options */
@@ -651,6 +652,15 @@ static GOptionEntry list_options[] = {
N_("Hides the column headers"),
NULL
},
+ {
+ "mid-search",
+ '\0',
+ G_OPTION_FLAG_NOALIAS,
+ G_OPTION_ARG_NONE,
+ &zenity_list_mid_search,
+ N_("Change list default search function searching for text in the middle, not on the beginning"),
+ NULL
+ },
{
NULL
}
@@ -1531,6 +1541,7 @@ zenity_list_pre_callback (GOptionContext *context,
zenity_list_hide_header = FALSE;
zenity_list_print_column = NULL;
zenity_list_hide_column = NULL;
+ zenity_list_mid_search = FALSE;
return TRUE;
}
@@ -1876,6 +1887,7 @@ zenity_list_post_callback (GOptionContext *context,
results->tree_data->hide_column = zenity_list_hide_column;
results->tree_data->hide_header = zenity_list_hide_header;
results->tree_data->separator = zenity_general_separator;
+ results->tree_data->mid_search = zenity_list_mid_search;
} else {
if (zenity_list_columns)
zenity_option_error (zenity_option_get_name (list_options, &zenity_list_columns),
@@ -1904,6 +1916,9 @@ zenity_list_post_callback (GOptionContext *context,
if (zenity_list_hide_header)
zenity_option_error (zenity_option_get_name (list_options, &zenity_list_hide_header),
ERROR_SUPPORT);
+ if (zenity_list_mid_search)
+ zenity_option_error (zenity_option_get_name (list_options, &zenity_list_mid_search),
+ ERROR_SUPPORT);
}
return TRUE;
bgstack15