CVS: sylpheed-claws/src/gtk gtkaspell.c,1.9.2.38,1.9.2.39 gtkaspell.h,1.5.2.5,1.5.2.6 quicksearch.c,1.1.2.39,1.1.2.40
Colin Leroy <[email protected]>
| Newsgroups | gmane.mail.sylpheed.claws.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/sylpheed-claws/sylpheed-claws/src/gtk
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12988/src/gtk
Modified Files:
Tag: gtk2
gtkaspell.c gtkaspell.h quicksearch.c
Log Message:
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
Index: gtkaspell.c
===================================================================
RCS file: /cvsroot/sylpheed-claws/sylpheed-claws/src/gtk/gtkaspell.c,v
retrieving revision 1.9.2.38
retrieving revision 1.9.2.39
diff -u -r1.9.2.38 -r1.9.2.39
--- gtkaspell.c 5 Apr 2006 06:19:16 -0000 1.9.2.38
+++ gtkaspell.c 19 Apr 2006 17:28:39 -0000 1.9.2.39
@@ -136,6 +136,8 @@
GtkTextView *gtktext;
GdkColor highlight;
GtkAccelGroup *accel_group;
+ void (*menu_changed_cb)(void *data);
+ void *menu_changed_data;
};
typedef AspellConfig GtkAspellConfig;
@@ -206,7 +208,7 @@
/* 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,
@@ -377,7 +379,9 @@
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;
@@ -424,7 +428,9 @@
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",
@@ -562,7 +568,7 @@
}
}
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;
@@ -808,6 +814,8 @@
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)
@@ -1610,6 +1618,8 @@
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)
@@ -2173,7 +2183,7 @@
return list;
}
-static GSList *make_config_menu(GtkAspell *gtkaspell)
+GSList *gtkaspell_make_config_menu(GtkAspell *gtkaspell)
{
return populate_submenu(gtkaspell);
}
@@ -2288,6 +2298,8 @@
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,
@@ -2295,6 +2307,8 @@
{
GtkAspell *gtkaspell = (GtkAspell *) data;
use_alternate_dict(gtkaspell);
+ if (gtkaspell->menu_changed_cb)
+ gtkaspell->menu_changed_cb(gtkaspell->menu_changed_data);
}
/* Misc. helper functions */
Index: gtkaspell.h
===================================================================
RCS file: /cvsroot/sylpheed-claws/sylpheed-claws/src/gtk/gtkaspell.h,v
retrieving revision 1.5.2.5
retrieving revision 1.5.2.6
diff -u -r1.5.2.5 -r1.5.2.6
--- gtkaspell.h 16 Feb 2006 16:01:44 -0000 1.5.2.5
+++ gtkaspell.h 19 Apr 2006 17:28:39 -0000 1.5.2.6
@@ -58,7 +58,9 @@
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);
@@ -98,6 +100,7 @@
gint sugmode);
gint gtkaspell_get_sugmode_from_option_menu (GtkOptionMenu *optmenu);
+GSList* gtkaspell_make_config_menu (GtkAspell *gtkaspell);
#endif /* USE_ASPELL */
#endif /* __GTKASPELL_H__ */
Index: quicksearch.c
===================================================================
RCS file: /cvsroot/sylpheed-claws/sylpheed-claws/src/gtk/quicksearch.c,v
retrieving revision 1.1.2.39
retrieving revision 1.1.2.40
diff -u -r1.1.2.39 -r1.1.2.40
--- quicksearch.c 9 Apr 2006 15:33:17 -0000 1.1.2.39
+++ quicksearch.c 19 Apr 2006 17:28:39 -0000 1.1.2.40
@@ -282,7 +282,7 @@
"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"),
@@ -550,44 +550,54 @@
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) {
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642