+2006-04-19 [colin] 2.1.1cvs15
+
+ * src/compose.c
+ * src/compose.h
+ * src/gtk/gtkaspell.c
+ * src/gtk/gtkaspell.h
+ Put back Options menu in Spelling/
+ * src/gtk/quicksearch.c
+ Don't search, and show error, if the
+ advanced search has a syntax error
+
2006-04-18 [colin] 2.1.1cvs14
* src/textview.c
( cvs diff -u -r 1.382.2.264 -r 1.382.2.265 src/compose.c; cvs diff -u -r 1.179.2.105 -r 1.179.2.106 src/imap.c; cvs diff -u -r 1.105.2.52 -r 1.105.2.53 src/prefs_account.c; cvs diff -u -r 1.49.2.18 -r 1.49.2.19 src/prefs_account.h; cvs diff -u -r 1.150.2.60 -r 1.150.2.61 src/procmsg.c; ) > 2.1.1cvs12.patchset
( cvs diff -u -r 1.1.4.15 -r 1.1.4.16 src/gtk/gtksctree.c; ) > 2.1.1cvs13.patchset
( cvs diff -u -r 1.96.2.111 -r 1.96.2.112 src/textview.c; ) > 2.1.1cvs14.patchset
+( cvs diff -u -r 1.382.2.265 -r 1.382.2.266 src/compose.c; cvs diff -u -r 1.50.2.23 -r 1.50.2.24 src/compose.h; cvs diff -u -r 1.9.2.38 -r 1.9.2.39 src/gtk/gtkaspell.c; cvs diff -u -r 1.5.2.5 -r 1.5.2.6 src/gtk/gtkaspell.h; cvs diff -u -r 1.1.2.39 -r 1.1.2.40 src/gtk/quicksearch.c; ) > 2.1.1cvs15.patchset
MICRO_VERSION=1
INTERFACE_AGE=0
BINARY_AGE=0
-EXTRA_VERSION=14
+EXTRA_VERSION=15
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=
NULL, compose_check_backwards , 0, NULL},
{N_("/_Spelling/_Forward to next misspelled word"),
NULL, compose_check_forwards_go, 0, NULL},
+ {N_("/_Spelling/---"), NULL, NULL, 0, "<Separator>"},
+ {N_("/_Spelling/Options"),
+ NULL, NULL, 0, "<Branch>"},
#endif
{N_("/_Options"), NULL, NULL, 0, "<Branch>"},
{N_("/_Options/Privacy System"), NULL, NULL, 0, "<Branch>"},
return FALSE;
}
+#if USE_ASPELL
+static void compose_spell_menu_changed(void *data)
+{
+ Compose *compose = (Compose *)data;
+ GSList *items;
+ GtkWidget *menuitem;
+ GtkWidget *parent_item;
+ GtkMenu *menu = gtk_menu_new();
+ GtkItemFactory *ifactory = gtk_item_factory_from_widget(compose->menubar);
+ GSList *spell_menu;
+
+ parent_item = gtk_item_factory_get_item(ifactory,
+ "/Spelling/Options");
+
+ /* setting the submenu removes /Spelling/Options from the factory
+ * so we need to save it */
+
+ if (parent_item == NULL) {
+ parent_item = compose->aspell_options_menu;
+ gtk_menu_item_remove_submenu(GTK_MENU_ITEM(parent_item));
+ } else
+ compose->aspell_options_menu = parent_item;
+
+ spell_menu = gtkaspell_make_config_menu(compose->gtkaspell);
+
+ spell_menu = g_slist_reverse(spell_menu);
+ for (items = spell_menu;
+ items; items = items->next) {
+ menuitem = GTK_MENU_ITEM(items->data);
+ gtk_menu_shell_prepend(GTK_MENU_SHELL(menu), GTK_WIDGET(menuitem));
+ gtk_widget_show(GTK_WIDGET(menuitem));
+ }
+ g_slist_free(spell_menu);
+
+ gtk_menu_item_set_submenu(GTK_MENU_ITEM(parent_item), GTK_WIDGET(menu));
+
+}
+#endif
+
static Compose *compose_create(PrefsAccount *account, ComposeMode mode,
gboolean batch)
{
prefs_common.recheck_when_changing_dict,
prefs_common.use_alternate,
GTK_TEXT_VIEW(text),
- GTK_WINDOW(compose->window));
+ GTK_WINDOW(compose->window),
+ compose_spell_menu_changed,
+ compose);
if (!gtkaspell) {
alertpanel_error(_("Spell checker could not "
"be started.\n%s"),
}
}
compose->gtkaspell = gtkaspell;
+ compose_spell_menu_changed(compose);
#endif
compose_select_account(compose, account, TRUE);
#if USE_ASPELL
/* GNU/aspell spell checker */
GtkAspell *gtkaspell;
+ GtkWidget *aspell_options_menu;
#endif
/* Priority */
GtkTextView *gtktext;
GdkColor highlight;
GtkAccelGroup *accel_group;
+ void (*menu_changed_cb)(void *data);
+ void *menu_changed_data;
};
typedef AspellConfig GtkAspellConfig;
/* Menu creation */
static GSList* make_sug_menu (GtkAspell *gtkaspell);
static GSList * populate_submenu (GtkAspell *gtkaspell);
-static GSList* make_config_menu (GtkAspell *gtkaspell);
+GSList* gtkaspell_make_config_menu (GtkAspell *gtkaspell);
static void set_menu_pos (GtkMenu *menu,
gint *x,
gint *y,
gboolean recheck_when_changing_dict,
gboolean use_alternate,
GtkTextView *gtktext,
- GtkWindow *parent_win)
+ GtkWindow *parent_win,
+ void (*spell_menu_cb)(void *data),
+ void *data)
{
Dictionary *dict;
GtkAspell *gtkaspell;
gtkaspell->suggestions_list = NULL;
gtkaspell->use_alternate = use_alternate;
gtkaspell->parent_window = GTK_WIDGET(parent_win);
-
+ gtkaspell->menu_changed_cb = spell_menu_cb;
+ gtkaspell->menu_changed_data = data;
+
allocate_color(gtkaspell, misspelled_color);
g_signal_connect_after(G_OBJECT(buffer), "insert-text",
}
}
if (!spell_menu)
- spell_menu = make_config_menu(gtkaspell);
+ spell_menu = gtkaspell_make_config_menu(gtkaspell);
spell_menu = g_slist_reverse(spell_menu);
for (items = spell_menu;
set_real_sug_mode(gtkaspell, themode);
g_free(themode);
+ if (gtkaspell->menu_changed_cb)
+ gtkaspell->menu_changed_cb(gtkaspell->menu_changed_data);
}
static void set_real_sug_mode(GtkAspell *gtkaspell, const char *themode)
if (!gtkaspell->check_while_typing)
gtkaspell_uncheck_all(gtkaspell);
+ if (gtkaspell->menu_changed_cb)
+ gtkaspell->menu_changed_cb(gtkaspell->menu_changed_data);
}
static GSList *create_empty_dictionary_list(void)
return list;
}
-static GSList *make_config_menu(GtkAspell *gtkaspell)
+GSList *gtkaspell_make_config_menu(GtkAspell *gtkaspell)
{
return populate_submenu(gtkaspell);
}
if (gtkaspell->recheck_when_changing_dict) {
gtkaspell_highlight_all(gtkaspell);
}
+ if (gtkaspell->menu_changed_cb)
+ gtkaspell->menu_changed_cb(gtkaspell->menu_changed_data);
}
static void switch_to_alternate_cb(GtkWidget *w,
{
GtkAspell *gtkaspell = (GtkAspell *) data;
use_alternate_dict(gtkaspell);
+ if (gtkaspell->menu_changed_cb)
+ gtkaspell->menu_changed_cb(gtkaspell->menu_changed_data);
}
/* Misc. helper functions */
gboolean recheck_when_changing_dict,
gboolean use_alternate,
GtkTextView *gtktext,
- GtkWindow *parent_win);
+ GtkWindow *parent_win,
+ void (*spell_menu_cb)(void *data),
+ void *data);
void gtkaspell_delete (GtkAspell *gtkaspell);
gint sugmode);
gint gtkaspell_get_sugmode_from_option_menu (GtkOptionMenu *optmenu);
+GSList* gtkaspell_make_config_menu (GtkAspell *gtkaspell);
#endif /* USE_ASPELL */
#endif /* __GTKASPELL_H__ */
"T", N_("marked messages"),
"U", N_("unread messages"),
"x S", N_("messages which contain S in References header"),
- "X cmd", N_("messages returning 0 when passed to command"),
+ "X \"cmd args\"", N_("messages returning 0 when passed to command - %F is message file"),
"y S", N_("messages which contain S in X-Label header"),
"", "" ,
"&", N_("logical AND operator"),
gboolean quicksearch_is_active(QuickSearch *quicksearch)
{
- return quicksearch->active;
+ return quicksearch->active && (quicksearch->matcher_list != NULL);
}
static void quicksearch_set_active(QuickSearch *quicksearch, gboolean active)
{
static GdkColor yellow;
+ static GdkColor red;
static GdkColor black;
- static gboolean yellow_initialised = FALSE;
+ static gboolean colors_initialised = FALSE;
+ gboolean error = FALSE;
- if (!yellow_initialised) {
+ if (!colors_initialised) {
gdk_color_parse("#f5f6be", &yellow);
gdk_color_parse("#000000", &black);
- yellow_initialised = gdk_colormap_alloc_color(
+ gdk_color_parse("#ff7070", &red);
+ colors_initialised = gdk_colormap_alloc_color(
gdk_colormap_get_system(), &yellow, FALSE, TRUE);
- yellow_initialised &= gdk_colormap_alloc_color(
+ colors_initialised &= gdk_colormap_alloc_color(
gdk_colormap_get_system(), &black, FALSE, TRUE);
-
+ colors_initialised &= gdk_colormap_alloc_color(
+ gdk_colormap_get_system(), &red, FALSE, TRUE);
}
+
quicksearch->active = active;
+ if (active && quicksearch->matcher_list == NULL)
+ error = TRUE;
+
if (active) {
gtk_widget_set_sensitive(quicksearch->clear_search, TRUE);
- if (yellow_initialised)
+ if (colors_initialised) {
gtk_widget_modify_base(
GTK_COMBO(quicksearch->search_string_entry)->entry,
- GTK_STATE_NORMAL, &yellow);
+ GTK_STATE_NORMAL, error ? &red : &yellow);
gtk_widget_modify_text(
GTK_COMBO(quicksearch->search_string_entry)->entry,
GTK_STATE_NORMAL, &black);
+ }
} else {
gtk_widget_set_sensitive(quicksearch->clear_search, FALSE);
- if (yellow_initialised)
+ if (colors_initialised) {
gtk_widget_modify_base(
GTK_COMBO(quicksearch->search_string_entry)->entry,
GTK_STATE_NORMAL, NULL);
gtk_widget_modify_text(
GTK_COMBO(quicksearch->search_string_entry)->entry,
GTK_STATE_NORMAL, NULL);
+ }
}
if (!active) {