static void summary_searchbar_pressed (GtkWidget *ctree,
GdkEventKey *event,
SummaryView *summaryview);
+static void summary_searchbar_focus_evt (GtkWidget *ctree,
+ GdkEventFocus *event,
+ SummaryView *summaryview);
static void summary_searchtype_changed (GtkMenuItem *widget,
gpointer data);
static void summary_open_row (GtkSCTree *sctree,
debug_print("Creating summary view...\n");
summaryview = g_new0(SummaryView, 1);
- vbox = gtk_vbox_new(FALSE, 3);
+#define SUMMARY_VBOX_SPACING 3
+ vbox = gtk_vbox_new(FALSE, SUMMARY_VBOX_SPACING);
/* create status label */
hbox = gtk_hbox_new(FALSE, 0);
summaryview);
gtk_option_menu_set_menu(GTK_OPTION_MENU(search_type_opt), search_type);
+
+ gtk_option_menu_set_history(GTK_OPTION_MENU(search_type_opt), prefs_common.summary_quicksearch_type);
+
gtk_widget_show(search_type);
search_string = gtk_entry_new();
GTK_SIGNAL_FUNC(summary_searchbar_pressed),
summaryview);
+ gtk_signal_connect(GTK_OBJECT(search_string), "focus_in_event",
+ GTK_SIGNAL_FUNC(summary_searchbar_focus_evt),
+ summaryview);
+
+ gtk_signal_connect(GTK_OBJECT(search_string), "focus_out_event",
+ GTK_SIGNAL_FUNC(summary_searchbar_focus_evt),
+ summaryview);
+
gtk_signal_connect (GTK_OBJECT(toggle_search), "toggled",
- GTK_SIGNAL_FUNC(tog_searchbar_cb), hbox_search);
+ GTK_SIGNAL_FUNC(tog_searchbar_cb), summaryview);
/* create popup menu */
n_entries = sizeof(summary_popup_entries) /
MatcherList * tmp_list = NULL;
if (search_type == S_SEARCH_EXTENDED) {
- char *newstr;
+ char *newstr = NULL;
newstr = expand_search_string(search_string);
if (newstr) {
else
procmsg_msginfo_free(msginfo);
} else {
- if (tmp_list != NULL && matcherlist_match(tmp_list, msginfo))
+ if ((tmp_list != NULL) && matcherlist_match(tmp_list, msginfo))
not_killed = g_slist_append(not_killed, msginfo);
else
procmsg_msginfo_free(msginfo);
}
}
-
if (search_type == S_SEARCH_EXTENDED && tmp_list != NULL) {
matcherlist_free(tmp_list);
tmp_list = NULL;
if (MSG_IS_MOVE(msginfo->flags)) {
summaryview->moved--;
changed = TRUE;
+ msginfo->to_folder->op_count--;
+ if (msginfo->to_folder->op_count == 0)
+ folder_update_item(msginfo->to_folder, FALSE);
}
if (MSG_IS_COPY(msginfo->flags)) {
summaryview->copied--;
changed = TRUE;
- }
- changed |= summary_update_unread_children (summaryview, msginfo, TRUE);
-
- if (changed && !prefs_common.immediate_exec) {
msginfo->to_folder->op_count--;
if (msginfo->to_folder->op_count == 0)
folder_update_item(msginfo->to_folder, FALSE);
}
+ changed |= summary_update_unread_children (summaryview, msginfo, TRUE);
+
msginfo->to_folder = NULL;
procmsg_msginfo_unset_flags(msginfo, MSG_DELETED, MSG_MOVE | MSG_COPY);
procmsg_msginfo_set_flags(msginfo, MSG_MARKED, 0);
if (MSG_IS_MOVE(msginfo->flags)) {
summaryview->moved--;
changed = TRUE;
+ msginfo->to_folder->op_count--;
+ if (msginfo->to_folder->op_count == 0)
+ folder_update_item(msginfo->to_folder, FALSE);
}
if (MSG_IS_COPY(msginfo->flags)) {
summaryview->copied--;
changed = TRUE;
- }
- changed |= summary_update_unread_children (summaryview, msginfo, FALSE);
-
- if (changed && !prefs_common.immediate_exec) {
msginfo->to_folder->op_count--;
if (msginfo->to_folder->op_count == 0)
folder_update_item(msginfo->to_folder, FALSE);
}
+ changed |= summary_update_unread_children (summaryview, msginfo, FALSE);
+
msginfo->to_folder = NULL;
procmsg_msginfo_unset_flags(msginfo, MSG_MARKED, MSG_MOVE | MSG_COPY);
procmsg_msginfo_set_flags(msginfo, MSG_DELETED, 0);
if (MSG_IS_DELETED(msginfo->flags))
summaryview->deleted--;
if (MSG_IS_MOVE(msginfo->flags)) {
+ if (!prefs_common.immediate_exec) {
+ msginfo->to_folder->op_count--;
+ if (msginfo->to_folder->op_count == 0)
+ folder_update_item(msginfo->to_folder, FALSE);
+ }
summaryview->moved--;
changed = TRUE;
}
if (MSG_IS_COPY(msginfo->flags)) {
+ if (!prefs_common.immediate_exec) {
+ msginfo->to_folder->op_count--;
+ if (msginfo->to_folder->op_count == 0)
+ folder_update_item(msginfo->to_folder, FALSE);
+ }
summaryview->copied--;
changed = TRUE;
}
changed |= summary_update_unread_children (summaryview, msginfo, FALSE);
- if (changed && !prefs_common.immediate_exec) {
- msginfo->to_folder->op_count--;
- if (msginfo->to_folder->op_count == 0)
- folder_update_item(msginfo->to_folder, FALSE);
- }
msginfo->to_folder = NULL;
procmsg_msginfo_unset_flags(msginfo, MSG_MARKED | MSG_DELETED, MSG_MOVE | MSG_COPY);
summary_set_row_marks(summaryview, row);
summary_show(summaryview, summaryview->folder_item);
}
+static void summary_searchbar_focus_evt(GtkWidget *widget, GdkEventFocus *event,
+ SummaryView *summaryview)
+{
+ if (event != NULL && event->in)
+ gtk_signal_handler_block_by_func(GTK_OBJECT(summaryview->mainwin->window),
+ GTK_SIGNAL_FUNC(mainwindow_key_pressed),
+ summaryview->mainwin);
+ else
+ gtk_signal_handler_unblock_by_func(GTK_OBJECT(summaryview->mainwin->window),
+ GTK_SIGNAL_FUNC(mainwindow_key_pressed),
+ summaryview->mainwin);
+}
+
static void summary_searchtype_changed(GtkMenuItem *widget, gpointer data)
{
SummaryView *sw = (SummaryView *)data;
+ prefs_common.summary_quicksearch_type = GPOINTER_TO_INT(gtk_object_get_user_data(
+ GTK_OBJECT(GTK_MENU_ITEM(gtk_menu_get_active(
+ GTK_MENU(sw->search_type))))));
+
if (gtk_entry_get_text(GTK_ENTRY(sw->search_string)))
summary_show(sw, sw->folder_item);
}
static void tog_searchbar_cb(GtkWidget *w, gpointer data)
{
+ SummaryView *summaryview = (SummaryView *)data;
+ GtkWidget *hbox= summaryview->hbox_search;
+ GtkAllocation size = hbox->allocation;
+ GtkAllocation msgview_size = summaryview->messageview->vbox->allocation;
+ GtkAllocation parent_size = summaryview->vbox->allocation;
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))) {
prefs_common.show_searchbar = TRUE;
- gtk_widget_show(GTK_WIDGET(data));
+ gtk_widget_show(hbox);
+ if (!prefs_common.sep_msg && messageview_is_visible(summaryview->messageview)
+ && msgview_size.height > 1 && parent_size.height > 1) {
+ gtk_widget_set_usize(GTK_WIDGET(summaryview->messageview->vbox),
+ -1,msgview_size.height - size.height - SUMMARY_VBOX_SPACING);
+ gtk_widget_set_usize(GTK_WIDGET(summaryview->vbox),
+ -1,parent_size.height + size.height + SUMMARY_VBOX_SPACING);
+ gtk_paned_set_position(GTK_PANED(summaryview->vbox->parent),-1);
+ }
} else {
prefs_common.show_searchbar = FALSE;
- gtk_widget_hide(GTK_WIDGET(data));
+ gtk_widget_hide(hbox);
+ if (!prefs_common.sep_msg && messageview_is_visible(summaryview->messageview)
+ && msgview_size.height > 1 && parent_size.height > 1) {
+ gtk_widget_set_usize(GTK_WIDGET(summaryview->messageview->vbox),
+ -1,msgview_size.height + size.height + SUMMARY_VBOX_SPACING);
+ gtk_widget_set_usize(GTK_WIDGET(summaryview->vbox),
+ -1,parent_size.height - size.height - SUMMARY_VBOX_SPACING);
+ gtk_paned_set_position(GTK_PANED(summaryview->vbox->parent),-1);
+ }
}
}