+2001-08-21
+
+ * src/pop.c: pop3_getsize_list_recv(), pop3_retr_recv(),
+ pop3_delete_recv(): don't try to receive messages which are not
+ exist.
+
+2001-08-21
+
+ * src/mainwindow.c: main_window_lock(), main_window_unlock():
+ removed the whole menubar locking.
+ main_window_set_menu_sensitive(): process the sensitivity change
+ with a table, and deal with locking.
+
+2001-08-20
+
+ * src/summaryview.[ch]: summary_get_selection_type(): new.
+ It returns the current selection state of summary view.
+ summary_key_pressed(): abort on some commands if main window
+ is locked.
+ * src/mainwindow.[ch]: main_window_lock(), main_window_unlock():
+ increase/decrease the lock count.
+
+2001-08-19
+
+ * src/prefs_filter.c: prefs_filter_create(): added List-Id to the
+ default header list.
+ * src/prefs_common.[ch]: added the option for receive dialog mode
+ to the Interface tab.
+ * src/inc.[ch]: inc_progress_dialog_create(): don't make the dialog
+ transient, and show dialog only if the setting is
+ RECV_DIALOG_ALWAYS, or RECV_DIALOG_ACTIVE and a window is active.
+ * src/mainwindow.[ch]: main_window_lock(), main_window_unlock():
+ new. Lock / unlock the user-interface.
+ * src/progressdialog.c: progress_dialog_create(): don't make the
+ dialog modal.
+
+2001-08-18
+
+ * src/folderview.c: folderview_update_node(): suppressed unnecessary
+ recursive call.
+ * src/menu.[ch]: menu_button_position(): new. It calculates the
+ position of popup menu.
+ * src/mainwindow.c: toolbar_account_button_pressed(),
+ ac_label_button_pressed(): put the popup menu to the correct
+ position. Change the style of the button while opening the menu.
+ ac_menu_popup_closed(): new function called on selection_done
+ event.
+ * src/gtkutils.c: gtkut_ctree_node_next(): fixed a crash bug when
+ node == NULL.
+ * src/summaryview.c: applied the summary fix patch from Sergey Vlasov
+ (thanks!).
+ Fixed the bug that didn't select previous message in refresh mode
+ if threads were not expanded.
+ summary_select_node(): new.
+ * src/inc.c: applied the summary view update optimization patch from
+ Sergey Vlasov (thanks!).
+ If no new messages are received, don't perform summary refreshing.
+ In addition to the Vlasov's patch, POP3 receive information is
+ also used.
+ * src/inc.h: added a new member cur_total_num to Pop3State.
+ * src/pop.c: pop3_retr_recv(): increase state->cur_total_num.
+
2001-08-14
* version 0.5.3
+2001-08-22 [paul]
+
+ * configure.in
+ change version number to 0.5.3claws2
+
+ * sync with sylpheed 0.5.3cvs4
+
2001-08-21 [paul]
* src/summaryview.c
+2001-08-21
+
+ * src/pop.c: pop3_getsize_list_recv(), pop3_retr_recv(),
+ pop3_delete_recv(): ¸ºß¤·¤Ê¤¤¥á¥Ã¥»¡¼¥¸¤ò¼èÆÀ¤·¤è¤¦¤È¤·¤Ê¤¤¤è¤¦
+ ¤Ë¤·¤¿¡£
+
+2001-08-21
+
+ * src/mainwindow.c: main_window_lock(), main_window_unlock():
+ ¥á¥Ë¥å¡¼¥Ð¡¼Á´ÂΤΥí¥Ã¥¯¤òºï½ü¡£
+ main_window_set_menu_sensitive(): sensitivity ¤ÎÊѹ¹¤ò¥Æ¡¼¥Ö¥ë
+ ¤Ç¹Ô¤¦¤è¤¦¤Ë¤·¡¢¥í¥Ã¥¯¤ËÂбþ¡£
+
+2001-08-20
+
+ * src/summaryview.[ch]: summary_get_selection_type(): ¿·µ¬¡£¥µ¥Þ¥ê
+ ¥Ó¥å¡¼¤Î¸½ºß¤ÎÁªÂò¾õÂÖ¤òÊÖ¤¹¡£
+ summary_key_pressed(): ¥á¥¤¥ó¥¦¥£¥ó¥É¥¦¤¬¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤¿¤é
+ ¤¤¤¯¤Ä¤«¤Î¥³¥Þ¥ó¥É¤ÇÈ´¤±¤ë¤è¤¦¤Ë¤·¤¿¡£
+ * src/mainwindow.[ch]: main_window_lock(), main_window_unlock():
+ ¥í¥Ã¥¯¥«¥¦¥ó¥È¤òÁý²Ã/¸º¾¯¤µ¤»¤ë¤è¤¦¤Ë¤·¤¿¡£
+
+2001-08-19
+
+ * src/prefs_filter.c: prefs_filter_create(): ¥Ç¥Õ¥©¥ë¥È¤Î¥Ø¥Ã¥À
+ ¥ê¥¹¥È¤Ë List-Id ¤òÄɲá£
+ * src/prefs_common.[ch]: ¼õ¿®¥À¥¤¥¢¥í¥°¥â¡¼¥É¤Î¥ª¥×¥·¥ç¥ó¤ò
+ ¥¤¥ó¥¿¥Õ¥§¡¼¥¹¥¿¥Ö¤ËÄɲá£
+ * src/inc.[ch]: inc_progress_dialog_create(): ¥À¥¤¥¢¥í¥°¤ò transient
+ ¤Ë¤·¤Ê¤¤¤è¤¦¤Ë¤·¡¢ÀßÄ꤬ RECV_DIALOG_ALWAYS ¤«¡¢¤Þ¤¿¤Ï
+ RECV_DIALOG_ACTIVE ¤Ç¥¦¥£¥ó¥É¥¦¤¬¥¢¥¯¥Æ¥£¥Ö¤Î¤È¤¤Î¤ß¥À¥¤¥¢¥í¥°¤ò
+ ɽ¼¨¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+ * src/mainwindow.[ch]: main_window_lock(), main_window_unlock():
+ ¿·µ¬¡£¥æ¡¼¥¶¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ò¥í¥Ã¥¯/¥í¥Ã¥¯²ò½ü¤¹¤ë¡£
+ * src/progressdialog.c: progress_dialog_create(): ¥À¥¤¥¢¥í¥°¤ò
+ ¥â¡¼¥À¥ë¤Ë¤·¤Ê¤¤¤è¤¦¤Ë¤·¤¿¡£
+
+2001-08-18
+
+ * src/folderview.c: folderview_update_node(): ÉÔÍפʺƵ¢¸Æ¤Ó½Ð¤·¤ò
+ ÍÞÀ©¡£
+ * src/menu.[ch]: menu_button_position(): ¿·µ¬¡£¥Ý¥Ã¥×¥¢¥Ã¥×¥á¥Ë¥å¡¼
+ ¤Î°ÌÃÖ¤ò·×»»¤¹¤ë¡£
+ * src/mainwindow.c: toolbar_account_button_pressed(),
+ ac_label_button_pressed(): ¥Ý¥Ã¥×¥¢¥Ã¥×¥á¥Ë¥å¡¼¤òÀµ¤·¤¤°ÌÃÖ¤Ë
+ ÃÖ¤¯¤è¤¦¤Ë¤·¤¿¡£¥á¥Ë¥å¡¼¤ò³«¤¤¤Æ¤¤¤ë´Ö¥Ü¥¿¥ó¤Î¥¹¥¿¥¤¥ë¤òÊѲ½
+ ¤µ¤»¤ë¤è¤¦¤Ë¤·¤¿¡£
+ ac_menu_popup_closed(): selection_done ¥¤¥Ù¥ó¥È»þ¤Ë¸Æ¤Ð¤ì¤ë¿·µ¬
+ ´Ø¿ô¡£
+ * src/gtkutils.c: gtkut_ctree_node_next(): node == NULL ¤Î¤È¤¤Ë
+ ¥¯¥é¥Ã¥·¥å¤¹¤ë¥Ð¥°¤ò½¤Àµ¡£
+ * src/summaryview.c: Sergey Vlasov ¤µ¤ó¤«¤é¤Î¥µ¥Þ¥ê½¤Àµ¥Ñ¥Ã¥Á¤ò
+ ŬÍÑ(thanks!)¡£
+ ¥¹¥ì¥Ã¥É¤òŸ³«¤·¤Ê¤¤¾ì¹ç¤Ë¹¹¿·¥â¡¼¥É¤Ç°ÊÁ°¤Î¥á¥Ã¥»¡¼¥¸¤òÁªÂò
+ ¤Ç¤¤Ê¤¤¥Ð¥°¤ò½¤Àµ¡£
+ summary_select_node(): ¿·µ¬¡£
+ * src/inc.c: Sergey Vlasov ¤µ¤ó¤«¤é¤Î¥µ¥Þ¥ê¥Ó¥å¡¼¹¹¿·ºÇŬ²½¥Ñ¥Ã¥Á
+ ¤òŬÍÑ(thanks!)¡£
+ ¿·Ãå¥á¥Ã¥»¡¼¥¸¤¬¼õ¿®¤µ¤ì¤Ê¤±¤ì¤Ð¡¢¥µ¥Þ¥ê¤Î¹¹¿·¤ò¹Ô¤ï¤Ê¤¤¤è¤¦¤Ë¤·¤¿¡£
+ Vlasov »á¤Î¥Ñ¥Ã¥Á¤Ë²Ã¤¨¡¢ POP3 ¤Î¼õ¿®¾ðÊó¤âƱÍͤ˻ÈÍÑ¡£
+ * src/inc.h: Pop3State ¤Ë¿·¥á¥ó¥Ð cur_total_num ¤òÄɲá£
+ * src/pop.c: pop3_retr_recv(): state->cur_total_num ¤òÁý²Ã¤µ¤»¤ë¡£
+
2001-08-14
* version 0.5.3
o POP before SMTP
o full-text search of messages (plain, or hooking up with Namazu)
o original icons and logos
+o autosave
o template function
o speed-up of filtering
o regular expression support at filtering
o POP before SMTP
o ¥á¥Ã¥»¡¼¥¸¤ÎÁ´Ê¸¸¡º÷ (¥Ù¥¿¡¢ Namazu ¤È¤ÎÏ¢·È)
o ¥ª¥ê¥¸¥Ê¥ë¤Î¥¢¥¤¥³¥ó¤È¥í¥´
+o ¼«Æ°Êݸµ¡Ç½
o ¥Æ¥ó¥×¥ì¡¼¥Èµ¡Ç½
o ¿¶¤êʬ¤±½èÍý¤Î¶¯²½
o ¿¶¤êʬ¤±¤ÇÀµµ¬É½¸½¤ËÂбþ¤¹¤ë
MICRO_VERSION=3
INTERFACE_AGE=0
BINARY_AGE=0
-EXTRA_VERSION=claws1
+EXTRA_VERSION=claws2
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
dnl
{
GtkCTree *ctree = GTK_CTREE(folderview->ctree);
GtkStyle *style = NULL;
- GtkCTreeNode *parent;
FolderItem *item;
GdkPixmap *xpm, *openxpm;
GdkBitmap *mask, *openmask;
}
if (item->stype == F_TRASH) return;
-
+ use_bold = use_color = FALSE;
if (item->stype == F_QUEUE) {
/* highlight queue folder if there are any messages */
use_bold = use_color = (item->total > 0);
gtk_ctree_node_set_row_style(ctree, node, style);
- parent = node;
- while ((parent = gtkut_ctree_find_collapsed_parent(ctree, parent))
- != NULL)
- folderview_update_node(folderview, parent);
+ if ((node = gtkut_ctree_find_collapsed_parent(ctree, node)) != NULL)
+ folderview_update_node(folderview, node);
}
void folderview_update_item(FolderItem *item, gboolean update_summary)
{
GtkCTreeNode *parent;
+ if (!node) return NULL;
+
if (GTK_CTREE_ROW(node)->children)
return GTK_CTREE_ROW(node)->children;
#define MSGBUFSIZE 8192
-static void inc_finished (MainWindow *mainwin);
-static void inc_account_mail (PrefsAccount *account,
+static void inc_finished (MainWindow *mainwin,
+ gboolean new_messages);
+static gint inc_account_mail (PrefsAccount *account,
MainWindow *mainwin);
static IncProgressDialog *inc_progress_dialog_create (void);
static void inc_session_destroy (IncSession *session);
static Pop3State *inc_pop3_state_new (PrefsAccount *account);
static void inc_pop3_state_destroy (Pop3State *state);
-static void inc_start (IncProgressDialog *inc_dialog);
+static gint inc_start (IncProgressDialog *inc_dialog);
static IncState inc_pop3_session_do (IncSession *session);
static gint pop3_automaton_terminate (SockInfo *source,
Automaton *atm);
static gint inc_autocheck_func (gpointer data);
-static void inc_finished(MainWindow *mainwin)
+/**
+ * inc_finished:
+ * @mainwin: Main window.
+ * @new_messages: TRUE if some messages have been received.
+ *
+ * Update the folder view and the summary view after receiving
+ * messages. If @new_messages is FALSE, this function avoids unneeded
+ * updating.
+ **/
+static void inc_finished(MainWindow *mainwin, gboolean new_messages)
{
FolderItem *item;
/* XXX: filtering_happened is reset by summary_show() */
+ if (!new_messages && !prefs_common.scan_all_after_inc) return;
if (prefs_common.open_inbox_on_inc) {
item = cur_account && cur_account->inbox
void inc_mail(MainWindow *mainwin)
{
+ gint new_msgs = 0;
+
inc_autocheck_timer_remove();
summary_write_cache(mainwin->summaryview);
+ main_window_lock(mainwin);
if (prefs_common.use_extinc && prefs_common.extinc_path) {
gint pid;
/* external incorporating program */
if ((pid = fork()) < 0) {
perror("fork");
+ main_window_unlock(mainwin);
inc_autocheck_timer_set();
return;
}
/* wait until child process is terminated */
waitpid(pid, NULL, 0);
- if (prefs_common.inc_local) inc_spool();
- inc_all_spool();
+ if (prefs_common.inc_local)
+ new_msgs = inc_spool();
} else {
- if (prefs_common.inc_local) inc_spool();
- inc_all_spool();
+ if (prefs_common.inc_local)
+ new_msgs = inc_spool();
- inc_account_mail(cur_account, mainwin);
+ new_msgs += inc_account_mail(cur_account, mainwin);
}
- inc_finished(mainwin);
+ inc_finished(mainwin, new_msgs > 0);
+ main_window_unlock(mainwin);
inc_autocheck_timer_set();
}
-static void inc_account_mail(PrefsAccount *account, MainWindow *mainwin)
+static gint inc_account_mail(PrefsAccount *account, MainWindow *mainwin)
{
IncProgressDialog *inc_dialog;
IncSession *session;
gchar *text[3];
session = inc_session_new(account);
- if (!session) return;
+ if (!session) return 0;
inc_dialog = inc_progress_dialog_create();
inc_dialog->queue_list = g_list_append(inc_dialog->queue_list, session);
text[2] = _("Standby");
gtk_clist_append(GTK_CLIST(inc_dialog->dialog->clist), text);
- inc_start(inc_dialog);
+ return inc_start(inc_dialog);
}
void inc_all_account_mail(MainWindow *mainwin)
{
GList *list, *queue_list = NULL;
IncProgressDialog *inc_dialog;
+ gint new_msgs = 0;
inc_autocheck_timer_remove();
summary_write_cache(mainwin->summaryview);
+ main_window_lock(mainwin);
- if (prefs_common.inc_local) inc_spool();
+ if (prefs_common.inc_local)
+ new_msgs = inc_spool();
list = account_get_list();
if (!list) {
- inc_finished(mainwin);
+ inc_finished(mainwin, new_msgs > 0);
+ main_window_unlock(mainwin);
inc_autocheck_timer_set();
return;
}
}
if (!queue_list) {
- inc_finished(mainwin);
+ inc_finished(mainwin, new_msgs > 0);
+ main_window_unlock(mainwin);
inc_autocheck_timer_set();
return;
}
gtk_clist_append(GTK_CLIST(inc_dialog->dialog->clist), text);
}
- inc_start(inc_dialog);
+ new_msgs += inc_start(inc_dialog);
- inc_finished(mainwin);
+ inc_finished(mainwin, new_msgs > 0);
+ main_window_unlock(mainwin);
inc_autocheck_timer_set();
}
GTK_SIGNAL_FUNC(inc_cancel), dialog);
gtk_signal_connect(GTK_OBJECT(progress->window), "delete_event",
GTK_SIGNAL_FUNC(gtk_true), NULL);
- if((prefs_common.receive_dialog == RECVDIALOG_ALWAYS) ||
- ((prefs_common.receive_dialog == RECVDIALOG_WINDOW_ACTIVE) && focus_window)) {
- manage_window_set_transient(GTK_WINDOW(progress->window));
- }
progress_dialog_set_value(progress, 0.0);
- if((prefs_common.receive_dialog == RECVDIALOG_ALWAYS) ||
- ((prefs_common.receive_dialog == RECVDIALOG_WINDOW_ACTIVE) && focus_window)) {
- gtk_widget_show(progress->window);
- }
-
PIXMAP_CREATE(progress->clist, okxpm, okxpmmask, complete_xpm);
PIXMAP_CREATE(progress->clist,
currentxpm, currentxpmmask, continue_xpm);
PIXMAP_CREATE(progress->clist, errorxpm, errorxpmmask, error_xpm);
- if((prefs_common.receive_dialog == RECVDIALOG_ALWAYS) ||
- ((prefs_common.receive_dialog == RECVDIALOG_WINDOW_ACTIVE) && focus_window)) {
+ if (prefs_common.recv_dialog_mode == RECV_DIALOG_ALWAYS ||
+ (prefs_common.recv_dialog_mode == RECV_DIALOG_ACTIVE &&
+ manage_window_get_focus_window())) {
+ dialog->show_dialog = TRUE;
gtk_widget_show_now(progress->window);
}
g_free(state);
}
-static void inc_start(IncProgressDialog *inc_dialog)
+static gint inc_start(IncProgressDialog *inc_dialog)
{
IncSession *session;
GtkCList *clist = GTK_CLIST(inc_dialog->dialog->clist);
IncState inc_state;
gint num = 0;
gint error_num = 0;
+ gint new_msgs = 0;
while (inc_dialog->queue_list != NULL) {
session = inc_dialog->queue_list->data;
inc_progress_dialog_clear(inc_dialog);
- gtk_clist_moveto(clist, num, 0, 1.0, 0.0);
-
pop3_state->user = g_strdup(pop3_state->ac_prefs->userid);
if (pop3_state->ac_prefs->passwd)
pop3_state->pass =
pass = input_dialog_with_invisible(_("Input password"),
message, NULL);
g_free(message);
- if((prefs_common.receive_dialog == RECVDIALOG_ALWAYS) ||
- ((prefs_common.receive_dialog == RECVDIALOG_WINDOW_ACTIVE) && focus_window)) {
- manage_window_focus_in(inc_dialog->mainwin->window,
- NULL, NULL);
- }
+ if (inc_dialog->show_dialog)
+ manage_window_focus_in
+ (inc_dialog->mainwin->window,
+ NULL, NULL);
if (pass) {
pop3_state->ac_prefs->tmp_pass = g_strdup(pass);
pop3_state->pass = pass;
if (pop3_state->error_val == PS_AUTHFAIL) {
if(!prefs_common.noerrorpanel) {
- if((prefs_common.receive_dialog == RECVDIALOG_ALWAYS) ||
- ((prefs_common.receive_dialog == RECVDIALOG_WINDOW_ACTIVE) && focus_window)) {
+ if((prefs_common.recv_dialog_mode == RECV_DIALOG_ALWAYS) ||
+ ((prefs_common.recv_dialog_mode == RECV_DIALOG_ACTIVE) && focus_window)) {
manage_window_focus_in(inc_dialog->dialog->window, NULL, NULL);
}
alertpanel_error
}
statusbar_pop_all();
- if((prefs_common.receive_dialog == RECVDIALOG_ALWAYS) ||
- ((prefs_common.receive_dialog == RECVDIALOG_WINDOW_ACTIVE) && focus_window)) {
- manage_window_focus_in(inc_dialog->mainwin->window, NULL, NULL);
- }
-
+
+ new_msgs += pop3_state->cur_total_num;
+
if (!prefs_common.scan_all_after_inc) {
folder_item_scan_foreach(pop3_state->folder_table);
folderview_update_item_foreach
}
if (error_num) {
- manage_window_focus_in(inc_dialog->dialog->window, NULL, NULL);
+ if (inc_dialog->show_dialog)
+ manage_window_focus_in(inc_dialog->dialog->window,
+ NULL, NULL);
alertpanel_error(_("Some errors occured while getting mail."));
- manage_window_focus_out(inc_dialog->dialog->window, NULL, NULL);
+ if (inc_dialog->show_dialog)
+ manage_window_focus_out(inc_dialog->dialog->window,
+ NULL, NULL);
}
while (inc_dialog->queue_list != NULL) {
}
inc_progress_dialog_destroy(inc_dialog);
+
+ return new_msgs;
}
log_warning(_("Can't connect to POP3 server: %s:%d\n"),
server, port);
if(!prefs_common.noerrorpanel) {
- if((prefs_common.receive_dialog == RECVDIALOG_ALWAYS) ||
- ((prefs_common.receive_dialog == RECVDIALOG_WINDOW_ACTIVE) && focus_window)) {
+ if((prefs_common.recv_dialog_mode == RECV_DIALOG_ALWAYS) ||
+ ((prefs_common.recv_dialog_mode == RECV_DIALOG_ACTIVE) && focus_window)) {
manage_window_focus_in(inc_dialog->dialog->window, NULL, NULL);
}
alertpanel_error(_("Can't connect to POP3 server: %s:%d"),
log_warning(_("Can't connect to POP3 server: %s:%d\n"),
sockinfo->hostname, sockinfo->port);
if(!prefs_common.noerrorpanel) {
- if((prefs_common.receive_dialog == RECVDIALOG_ALWAYS) ||
- ((prefs_common.receive_dialog == RECVDIALOG_WINDOW_ACTIVE) && focus_window)) {
+ if((prefs_common.recv_dialog_mode == RECV_DIALOG_ALWAYS) ||
+ ((prefs_common.recv_dialog_mode == RECV_DIALOG_ACTIVE) && focus_window)) {
manage_window_focus_in(inc_dialog->dialog->window, NULL, NULL);
}
alertpanel_error(_("Can't connect to POP3 server: %s:%d"),
MainWindow *mainwin;
+ gboolean show_dialog;
+
GList *queue_list; /* list of IncSession */
};
gint new;
gint total_bytes;
gint cur_msg;
+ gint cur_total_num;
gint cur_total_bytes;
gint *sizes;
static void ac_label_button_pressed (GtkWidget *widget,
GdkEventButton *event,
gpointer data);
+static void ac_menu_popup_closed (GtkMenuShell *menu_shell,
+ gpointer data);
static gint main_window_close_cb (GtkWidget *widget,
GdkEventAny *event,
/* set account selection menu */
ac_menu = gtk_item_factory_get_widget
(ifactory, "/Configuration/Change current account");
+ gtk_signal_connect(GTK_OBJECT(ac_menu), "selection_done",
+ GTK_SIGNAL_FUNC(ac_menu_popup_closed), mainwin);
mainwin->ac_menu = ac_menu;
main_window_set_toolbar_sensitive(mainwin, FALSE);
header_window_init(mainwin->headerwin);
log_window_init(mainwin->logwin);
+ mainwin->lock_count = 0;
mainwin->cursor_count = 0;
if (!watch_cursor)
void main_window_cursor_wait(MainWindow *mainwin)
{
+
if (mainwin->cursor_count == 0)
gdk_window_set_cursor(mainwin->window->window, watch_cursor);
gdk_flush();
}
+/* lock / unlock the user-interface */
+void main_window_lock(MainWindow *mainwin)
+{
+ if (mainwin->lock_count == 0) {
+ gtk_widget_set_sensitive(mainwin->toolbar, FALSE);
+ gtk_widget_set_sensitive(mainwin->ac_button, FALSE);
+ }
+
+ mainwin->lock_count++;
+
+ main_window_set_menu_sensitive(mainwin);
+}
+
+void main_window_unlock(MainWindow *mainwin)
+{
+ if (mainwin->lock_count)
+ mainwin->lock_count--;
+
+ main_window_set_menu_sensitive(mainwin);
+
+ if (mainwin->lock_count == 0) {
+ gtk_widget_set_sensitive(mainwin->toolbar, TRUE);
+ gtk_widget_set_sensitive(mainwin->ac_button, TRUE);
+ }
+}
+
void main_window_reflect_prefs_all(void)
{
GList *cur;
gtk_widget_set_sensitive(mainwin->delete_btn, sensitive);
}
-void main_window_set_menu_sensitive(MainWindow *mainwin, gint selection)
+typedef enum
+{
+ M_UNLOCKED = 1 << 0,
+ M_MSG_EXIST = 1 << 1,
+ M_TARGET_EXIST = 1 << 2,
+ M_SINGLE_TARGET_EXIST = 1 << 3,
+ M_EXEC = 1 << 4,
+ M_ALLOW_REEDIT = 1 << 5
+} MenuItemSensitiveCond;
+
+void main_window_set_menu_sensitive(MainWindow *mainwin)
{
GtkItemFactory *ifactory;
- gboolean sens;
- gboolean exec;
+ SummarySelection selection;
+ MenuItemSensitiveCond state = 0;
+ gboolean sensitive;
+ gint i;
- ifactory = gtk_item_factory_from_widget(mainwin->menubar);
+ static const struct {
+ gchar *const entry;
+ MenuItemSensitiveCond cond;
+ } entry[] = {
+ {"/File/Add mailbox..." , M_UNLOCKED},
+ {"/File/Update folder tree" , M_UNLOCKED},
+ {"/File/Folder" , M_UNLOCKED},
+ {"/File/Import mbox file..." , M_UNLOCKED},
+ {"/File/Export to mbox file...", M_UNLOCKED},
+ {"/File/Empty trash" , M_UNLOCKED},
+ {"/File/Save as...", M_SINGLE_TARGET_EXIST|M_UNLOCKED},
+ {"/File/Print..." , M_TARGET_EXIST|M_UNLOCKED},
+ {"/File/Close", M_UNLOCKED},
+ {"/File/Exit" , M_UNLOCKED},
+
+ {"/Message/Get new mail" , M_UNLOCKED},
+ {"/Message/Get from all accounts", M_UNLOCKED},
+ {"/Message/Reply" , M_SINGLE_TARGET_EXIST},
+ {"/Message/Reply to sender" , M_SINGLE_TARGET_EXIST},
+ {"/Message/Reply to all" , M_SINGLE_TARGET_EXIST},
+ {"/Message/Forward" , M_SINGLE_TARGET_EXIST},
+ {"/Message/Forward as attachment", M_SINGLE_TARGET_EXIST},
+ {"/Message/Open in new window" , M_SINGLE_TARGET_EXIST},
+ {"/Message/Show all header" , M_SINGLE_TARGET_EXIST},
+ {"/Message/View source" , M_SINGLE_TARGET_EXIST},
+ {"/Message/Move...", M_TARGET_EXIST|M_EXEC|M_UNLOCKED},
+ {"/Message/Copy...", M_TARGET_EXIST|M_EXEC|M_UNLOCKED},
+ {"/Message/Delete" , M_TARGET_EXIST|M_EXEC|M_UNLOCKED},
+ {"/Message/Mark" , M_TARGET_EXIST},
+ {"/Message/Re-edit", M_ALLOW_REEDIT},
+
+ {"/Summary/Delete duplicated messages", M_MSG_EXIST|M_EXEC|M_UNLOCKED},
+ {"/Summary/Filter messages", M_MSG_EXIST|M_EXEC|M_UNLOCKED},
+ {"/Summary/Execute" , M_MSG_EXIST|M_UNLOCKED},
+ {"/Summary/Prev message" , M_MSG_EXIST},
+ {"/Summary/Next message" , M_MSG_EXIST},
+ {"/Summary/Next unread message", M_MSG_EXIST},
+ {"/Summary/Sort" , M_MSG_EXIST},
+
+ {"/Configuration", M_UNLOCKED},
+
+ {NULL, 0}
+ };
- if (selection == SUMMARY_SELECTED_SINGLE)
- sens = TRUE;
- else
- sens = FALSE;
- if (!mainwin->summaryview->folder_item ||
- mainwin->summaryview->folder_item->folder->type == F_NEWS)
- exec = FALSE;
- else
- exec = TRUE;
-
- menu_set_sensitive(ifactory, "/File/Save as...", sens);
- menu_set_sensitive(ifactory, "/Message/Reply", sens);
- menu_set_sensitive(ifactory, "/Message/Reply to sender", sens);
- menu_set_sensitive(ifactory, "/Message/Reply to all", sens);
- menu_set_sensitive(ifactory, "/Message/Forward", TRUE);
- menu_set_sensitive(ifactory, "/Message/Forward as attachment", TRUE);
- menu_set_sensitive(ifactory, "/Message/Open in new window", sens);
- menu_set_sensitive(ifactory, "/Message/Show all header", sens);
- menu_set_sensitive(ifactory, "/Message/View source", sens);
- if (sens && (!mainwin->summaryview->folder_item ||
- mainwin->summaryview->folder_item->stype != F_DRAFT))
- sens = FALSE;
- menu_set_sensitive(ifactory, "/Message/Re-edit", sens);
+ ifactory = gtk_item_factory_from_widget(mainwin->menubar);
+ selection = summary_get_selection_type(mainwin->summaryview);
+ if (mainwin->lock_count == 0)
+ state |= M_UNLOCKED;
+ if (selection != SUMMARY_NONE)
+ state |= M_MSG_EXIST;
if (selection == SUMMARY_SELECTED_SINGLE ||
selection == SUMMARY_SELECTED_MULTIPLE)
- sens = TRUE;
- else
- sens = FALSE;
-
- menu_set_sensitive(ifactory, "/File/Print..." , sens);
- menu_set_sensitive(ifactory, "/Message/Move...", sens && exec);
- menu_set_sensitive(ifactory, "/Message/Copy...", sens && exec);
- menu_set_sensitive(ifactory, "/Message/Delete" , sens && exec);
- menu_set_sensitive(ifactory, "/Message/Mark" , sens);
-
- if (selection != SUMMARY_NONE)
- sens = TRUE;
- else
- sens = FALSE;
-
- menu_set_sensitive(ifactory, "/Summary/Delete duplicated messages", sens && exec);
- menu_set_sensitive(ifactory, "/Summary/Filter messages", sens && exec);
- menu_set_sensitive(ifactory, "/Summary/Execute", sens);
- menu_set_sensitive(ifactory, "/Summary/Prev message", sens);
- menu_set_sensitive(ifactory, "/Summary/Next message", sens);
- menu_set_sensitive(ifactory, "/Summary/Next unread message", sens);
- menu_set_sensitive(ifactory, "/Summary/Sort", sens);
-
+ state |= M_TARGET_EXIST;
+ if (selection == SUMMARY_SELECTED_SINGLE)
+ state |= M_SINGLE_TARGET_EXIST;
if (mainwin->summaryview->folder_item &&
- mainwin->summaryview->folder_item->folder->account)
- sens = mainwin->summaryview->folder_item->folder->account->protocol == A_NNTP;
- else
- sens = FALSE;
- menu_set_sensitive(ifactory, "/Message/Follow-up and reply to", sens);
+ mainwin->summaryview->folder_item->folder->type != F_NEWS)
+ state |= M_EXEC;
+ if (selection == SUMMARY_SELECTED_SINGLE &&
+ (mainwin->summaryview->folder_item &&
+ mainwin->summaryview->folder_item->stype == F_DRAFT))
+ state |= M_ALLOW_REEDIT;
+
+ for (i = 0; entry[i].entry != NULL; i++) {
+ sensitive = ((entry[i].cond & state) == entry[i].cond);
+ menu_set_sensitive(ifactory, entry[i].entry, sensitive);
+ }
}
void main_window_popup(MainWindow *mainwin)
if (!event) return;
if (event->button != 3) return;
- gtk_menu_popup(GTK_MENU(mainwin->ac_menu), NULL, NULL, NULL, NULL,
+ gtk_button_set_relief(GTK_BUTTON(widget), GTK_RELIEF_NORMAL);
+ gtk_object_set_data(GTK_OBJECT(mainwin->ac_menu), "menu_button",
+ widget);
+
+ gtk_menu_popup(GTK_MENU(mainwin->ac_menu), NULL, NULL,
+ menu_button_position, widget,
event->button, event->time);
}
if (!event) return;
- gtk_menu_popup(GTK_MENU(mainwin->ac_menu), NULL, NULL, NULL, NULL,
+ gtk_button_set_relief(GTK_BUTTON(widget), GTK_RELIEF_NORMAL);
+ gtk_object_set_data(GTK_OBJECT(mainwin->ac_menu), "menu_button",
+ widget);
+
+ gtk_menu_popup(GTK_MENU(mainwin->ac_menu), NULL, NULL,
+ menu_button_position, widget,
event->button, event->time);
}
+static void ac_menu_popup_closed(GtkMenuShell *menu_shell, gpointer data)
+{
+ MainWindow *mainwin = (MainWindow *)data;
+ GtkWidget *button;
+
+ button = gtk_object_get_data(GTK_OBJECT(menu_shell), "menu_button");
+ gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
+ gtk_object_remove_data(GTK_OBJECT(mainwin->ac_menu), "menu_button");
+}
+
static gint main_window_close_cb(GtkWidget *widget, GdkEventAny *event,
gpointer data)
{
menu_set_sensitive(ifactory, "/Summary/Thread view", TRUE);
menu_set_sensitive(ifactory, "/Summary/Unthread view", FALSE);
}
-
}
static void set_display_item_cb(MainWindow *mainwin, guint action,
GtkWidget *vbox;
GtkWidget *menubar;
- /* tool bar */
+ /* toolbar */
GtkWidget *handlebox;
GtkWidget *toolbar;
GtkWidget *get_btn;
ToolbarStyle toolbar_style;
+ guint lock_count;
guint cursor_count;
FolderView *folderview;
};
MainWindow *main_window_create (SeparateType type);
+
void main_window_cursor_wait (MainWindow *mainwin);
void main_window_cursor_normal (MainWindow *mainwin);
+
+void main_window_lock (MainWindow *mainwin);
+void main_window_unlock (MainWindow *mainwin);
+
void main_window_reflect_prefs_all (void);
void main_window_set_account_menu (GList *account_list);
void main_window_separation_change (MainWindow *mainwin,
SeparateType type);
+
void main_window_get_size (MainWindow *mainwin);
void main_window_get_position (MainWindow *mainwin);
+
void main_window_empty_trash (MainWindow *mainwin,
gboolean confirm);
void main_window_add_mailbox (MainWindow *mainwin);
void main_window_set_toolbar_sensitive (MainWindow *mainwin,
gboolean sensitive);
-void main_window_set_menu_sensitive (MainWindow *mainwin,
- gint selection);
+void main_window_set_menu_sensitive (MainWindow *mainwin);
+
void main_window_popup (MainWindow *mainwin);
/*void main_window_set_thread_option (MainWindow *mainwin);*/
if (window && focus_window)
gtk_window_set_transient_for(window, GTK_WINDOW(focus_window));
}
+
+GtkWidget *manage_window_get_focus_window(void)
+{
+ return focus_window;
+}
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999,2000 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2001 Hiroyuki Yamamoto
*
* 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
extern GtkWidget *focus_window;
+GtkWidget *manage_window_get_focus_window (void);
+
+
#endif /* __MANAGE_WINDOW_H__ */
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999,2000 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2001 Hiroyuki Yamamoto
*
* 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/gtkmenubar.h>
#include <gtk/gtkitemfactory.h>
#include <gtk/gtkcheckmenuitem.h>
+#include <gtk/gtkbutton.h>
+
#include "intl.h"
#include "menu.h"
widget = gtk_item_factory_get_item(ifactory, path);
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM(widget), active);
-}
\ No newline at end of file
+}
+
+void menu_button_position(GtkMenu *menu, gint *x, gint *y, gpointer user_data)
+{
+ GtkWidget *button;
+ GtkRequisition requisition;
+ gint button_xpos, button_ypos;
+ gint xpos, ypos;
+ gint width, height;
+ gint scr_width, scr_height;
+
+ g_return_if_fail(user_data != NULL);
+ g_return_if_fail(GTK_IS_BUTTON(user_data));
+
+ button = GTK_WIDGET(user_data);
+
+ gtk_widget_get_child_requisition(GTK_WIDGET(menu), &requisition);
+ width = requisition.width;
+ height = requisition.height;
+ gdk_window_get_origin(button->window, &button_xpos, &button_ypos);
+
+ xpos = button_xpos;
+ ypos = button_ypos + button->allocation.height;
+
+ scr_width = gdk_screen_width();
+ scr_height = gdk_screen_height();
+
+ if (xpos + width > scr_width)
+ xpos -= (xpos + width) - scr_width;
+ if (ypos + height > scr_height)
+ ypos = button_ypos - height;
+ if (xpos < 0)
+ xpos = 0;
+ if (ypos < 0)
+ ypos = 0;
+
+ *x = xpos;
+ *y = ypos;
+}
void menu_set_toggle (GtkItemFactory *ifactory,
const gchar *path,
gboolean active);
+void menu_button_position (GtkMenu *menu,
+ gint *x,
+ gint *y,
+ gpointer user_data);
#endif /* __MENU_H__ */
state->cur_total_bytes = 0;
while (sock_gets(sock, buf, sizeof(buf)) >= 0) {
- gint num, size;
+ guint num, size;
if (buf[0] == '.') break;
if (sscanf(buf, "%u %u", &num, &size) != 2)
- break;
+ return -1;
if (num > 0 && num <= state->count)
state->sizes[num] = size;
state->cur_total_bytes += size;
}
+ while (state->sizes[state->cur_msg] == 0) {
+ if (state->cur_msg == state->count)
+ return POP3_LOGOUT_SEND;
+ else
+ state->cur_msg++;
+ }
+
return POP3_RETR_SEND;
}
return -1;
}
- state->cur_total_bytes += state->sizes[state->cur_msg];
-
if ((drop_ok = inc_drop_message(file, state)) < 0) {
state->inc_state = INC_ERROR;
return -1;
}
+
+ state->cur_total_bytes += state->sizes[state->cur_msg];
+ state->cur_total_num++;
+
if (drop_ok == 0 && state->ac_prefs->rmmail)
return POP3_DELETE_SEND;
if (state->cur_msg < state->count) {
state->cur_msg++;
+ while (state->sizes[state->cur_msg] == 0) {
+ if (state->cur_msg == state->count)
+ return POP3_LOGOUT_SEND;
+ else
+ state->cur_msg++;
+ }
return POP3_RETR_SEND;
} else
return POP3_LOGOUT_SEND;
if ((ok = pop3_ok(sock, NULL)) == PS_SUCCESS) {
if (state->cur_msg < state->count) {
state->cur_msg++;
+ while (state->sizes[state->cur_msg] == 0) {
+ if (state->cur_msg == state->count)
+ return POP3_LOGOUT_SEND;
+ else
+ state->cur_msg++;
+ }
return POP3_RETR_SEND;
} else
return POP3_LOGOUT_SEND;
#endif
static struct Interface {
- GtkWidget *checkbtn_emacs;
+ /* GtkWidget *checkbtn_emacs; */
GtkWidget *checkbtn_openunread;
GtkWidget *checkbtn_openinbox;
GtkWidget *checkbtn_immedexec;
GtkWidget *checkbtn_askonclean;
GtkWidget *checkbtn_warnqueued;
GtkWidget *checkbtn_addaddrbyclick;
- GtkWidget *recvdialog_optmenu;
+ GtkWidget *optmenu_recvdialog;
} interface;
static struct Other {
(PrefParam *pparam);
static void prefs_common_default_signkey_set_optmenu (PrefParam *pparam);
#endif
-static void prefs_recvdialog_set_data_from_optmenu(PrefParam *pparam);
-static void prefs_recvdialog_set_optmenu(PrefParam *pparam);
+static void prefs_common_recv_dialog_set_data_from_optmenu(PrefParam *pparam);
+static void prefs_common_recv_dialog_set_optmenu(PrefParam *pparam);
static void prefs_dictionary_set_data_from_optmenu(PrefParam *param);
static void prefs_dictionary_set_optmenu(PrefParam *pparam);
{"separate_message", "FALSE", &prefs_common.sep_msg, P_BOOL,
NULL, NULL, NULL},
- {"emulate_emacs", "FALSE", &prefs_common.emulate_emacs, P_BOOL,
- NULL, NULL, NULL},
+ /* {"emulate_emacs", "FALSE", &prefs_common.emulate_emacs, P_BOOL,
+ NULL, NULL, NULL}, */
{"open_unread_on_enter", "FALSE", &prefs_common.open_unread_on_enter,
P_BOOL, &interface.checkbtn_openunread,
{"immediate_execution", "TRUE", &prefs_common.immediate_exec, P_BOOL,
&interface.checkbtn_immedexec,
prefs_set_data_from_toggle, prefs_set_toggle},
+ {"receive_dialog_mode", "1", &prefs_common.recv_dialog_mode, P_ENUM,
+ &interface.optmenu_recvdialog,
+ prefs_common_recv_dialog_set_data_from_optmenu,
+ prefs_common_recv_dialog_set_optmenu},
+
{"add_address_by_click", "FALSE", &prefs_common.add_address_by_click,
P_BOOL, &interface.checkbtn_addaddrbyclick,
prefs_set_data_from_toggle, prefs_set_toggle},
- {"receive_dialog", NULL, &prefs_common.receive_dialog, P_ENUM,
- &interface.recvdialog_optmenu,
- prefs_recvdialog_set_data_from_optmenu,
- prefs_recvdialog_set_optmenu},
-
{"confirm_on_exit", "TRUE", &prefs_common.confirm_on_exit, P_BOOL,
&interface.checkbtn_confonexit,
prefs_set_data_from_toggle, prefs_set_toggle},
GtkWidget *vbox1;
GtkWidget *vbox2;
GtkWidget *vbox3;
- GtkWidget *checkbtn_emacs;
+ /* GtkWidget *checkbtn_emacs; */
GtkWidget *checkbtn_openunread;
GtkWidget *checkbtn_openinbox;
GtkWidget *checkbtn_immedexec;
- GtkWidget *checkbtn_addaddrbyclick;
- GtkWidget *hbox;
- GtkWidget *recvdialog_optmenu;
- GtkWidget *recvdialog_optmenu_menu;
- GtkWidget *recvdialog_menuitem;
+ GtkWidget *hbox1;
GtkWidget *label;
+ GtkWidget *optmenu_recvdialog;
+ GtkWidget *menu;
+ GtkWidget *menuitem;
+
+ GtkWidget *frame_addr;
+ GtkWidget *vbox_addr;
+ GtkWidget *checkbtn_addaddrbyclick;
GtkWidget *frame_exit;
GtkWidget *vbox_exit;
- GtkWidget *hbox1;
GtkWidget *checkbtn_confonexit;
GtkWidget *checkbtn_cleanonexit;
GtkWidget *checkbtn_askonclean;
gtk_widget_show (vbox2);
gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
- PACK_CHECK_BUTTON (vbox2, checkbtn_emacs,
+ /* PACK_CHECK_BUTTON (vbox2, checkbtn_emacs,
_("Emulate the behavior of mouse operation of\n"
"Emacs-based mailer"));
gtk_label_set_justify (GTK_LABEL (GTK_BIN (checkbtn_emacs)->child),
- GTK_JUSTIFY_LEFT);
+ GTK_JUSTIFY_LEFT); */
PACK_CHECK_BUTTON
(vbox2, checkbtn_openunread,
gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 8);
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
+ hbox1 = gtk_hbox_new (FALSE, 8);
+ gtk_widget_show (hbox1);
+ gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, FALSE, 0);
+
+ label = gtk_label_new (_("Show receive dialog"));
+ gtk_widget_show (label);
+ gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
+
+ optmenu_recvdialog = gtk_option_menu_new ();
+ gtk_widget_show (optmenu_recvdialog);
+ gtk_box_pack_start (GTK_BOX (hbox1), optmenu_recvdialog,
+ FALSE, FALSE, 0);
+
+ menu = gtk_menu_new ();
+ MENUITEM_ADD (menu, menuitem, _("Always"), RECV_DIALOG_ALWAYS);
+ MENUITEM_ADD (menu, menuitem, _("Only if a window is active"),
+ RECV_DIALOG_ACTIVE);
+ MENUITEM_ADD (menu, menuitem, _("Never"), RECV_DIALOG_NEVER);
+
+ gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu_recvdialog), menu);
+
+ PACK_FRAME (vbox1, frame_addr, _("Address book"));
+
+ vbox_addr = gtk_vbox_new (FALSE, VSPACING_NARROW);
+ gtk_widget_show (vbox_addr);
+ gtk_container_add (GTK_CONTAINER (frame_addr), vbox_addr);
+ gtk_container_set_border_width (GTK_CONTAINER (vbox_addr), 8);
+
PACK_CHECK_BUTTON
- (vbox2, checkbtn_addaddrbyclick,
+ (vbox_addr, checkbtn_addaddrbyclick,
_("Add address to destination when double-clicked"));
-
/* Receive Dialog */
- hbox = gtk_hbox_new (FALSE, 8);
+/* hbox = gtk_hbox_new (FALSE, 8);
gtk_widget_show (hbox);
gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
MENUITEM_ADD (recvdialog_optmenu_menu, recvdialog_menuitem, _("Only if a sylpheed window is active"), RECVDIALOG_WINDOW_ACTIVE);
MENUITEM_ADD (recvdialog_optmenu_menu, recvdialog_menuitem, _("Never"), RECVDIALOG_NEVER);
- gtk_option_menu_set_menu (GTK_OPTION_MENU (recvdialog_optmenu), recvdialog_optmenu_menu);
+ gtk_option_menu_set_menu (GTK_OPTION_MENU (recvdialog_optmenu), recvdialog_optmenu_menu); */
/* On Exit */
PACK_FRAME (vbox1, frame_exit, _("On exit"));
PACK_CHECK_BUTTON (vbox_exit, checkbtn_warnqueued,
_("Warn if there are queued messages"));
- interface.checkbtn_emacs = checkbtn_emacs;
+ /* interface.checkbtn_emacs = checkbtn_emacs; */
interface.checkbtn_openunread = checkbtn_openunread;
interface.checkbtn_openinbox = checkbtn_openinbox;
interface.checkbtn_immedexec = checkbtn_immedexec;
+ interface.optmenu_recvdialog = recvdialog_optmenu;
interface.checkbtn_addaddrbyclick = checkbtn_addaddrbyclick;
- interface.recvdialog_optmenu = recvdialog_optmenu;
interface.checkbtn_confonexit = checkbtn_confonexit;
interface.checkbtn_cleanonexit = checkbtn_cleanonexit;
interface.checkbtn_askonclean = checkbtn_askonclean;
prefs_common_charset_set_data_from_optmenu(pparam);
}
+static void prefs_common_recv_dialog_set_data_from_optmenu(PrefParam *pparam)
+{
+ GtkWidget *menu;
+ GtkWidget *menuitem;
+
+ menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
+ menuitem = gtk_menu_get_active(GTK_MENU(menu));
+ *((RecvDialogMode *)pparam->data) = GPOINTER_TO_INT
+ (gtk_object_get_user_data(GTK_OBJECT(menuitem)));
+}
+
+static void prefs_common_recv_dialog_set_optmenu(PrefParam *pparam)
+{
+ RecvDialogMode mode = *((RecvDialogMode *)pparam->data);
+ GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
+ GtkWidget *menu;
+ GtkWidget *menuitem;
+
+ switch (mode) {
+ case RECV_DIALOG_ALWAYS:
+ gtk_option_menu_set_history(optmenu, 0);
+ break;
+ case RECV_DIALOG_ACTIVE:
+ gtk_option_menu_set_history(optmenu, 1);
+ break;
+ case RECV_DIALOG_NEVER:
+ gtk_option_menu_set_history(optmenu, 2);
+ break;
+ default:
+ }
+
+ menu = gtk_option_menu_get_menu(optmenu);
+ menuitem = gtk_menu_get_active(GTK_MENU(menu));
+ gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));
+}
+
static gint prefs_common_deleted(GtkWidget *widget, GdkEventAny *event,
gpointer data)
{
}
}
-static void prefs_recvdialog_set_data_from_optmenu(PrefParam *pparam)
+/* static void prefs_recvdialog_set_data_from_optmenu(PrefParam *pparam)
{
GtkWidget *menu;
GtkWidget *menuitem;
menuitem = gtk_menu_get_active(GTK_MENU(menu));
*((RecvDialogShow *)pparam->data) = GPOINTER_TO_INT
(gtk_object_get_user_data(GTK_OBJECT(menuitem)));
-}
+} */
-static void prefs_recvdialog_set_optmenu(PrefParam *pparam)
+/* static void prefs_recvdialog_set_optmenu(PrefParam *pparam)
{
RecvDialogShow dialog_show;
GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
menu = gtk_option_menu_get_menu(optmenu);
menuitem = gtk_menu_get_active(GTK_MENU(menu));
gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));
-}
+} */
typedef struct _PrefsCommon PrefsCommon;
-typedef enum
-{
- RECVDIALOG_ALWAYS,
- RECVDIALOG_WINDOW_ACTIVE,
- RECVDIALOG_NEVER
-} RecvDialogShow;
+typedef enum {
+ RECV_DIALOG_ALWAYS,
+ RECV_DIALOG_ACTIVE,
+ RECV_DIALOG_NEVER
+} RecvDialogMode;
struct _PrefsCommon
{
gboolean open_unread_on_enter;
gboolean open_inbox_on_inc;
gboolean immediate_exec;
+ RecvDialogMode recv_dialog_mode;
gboolean add_address_by_click;
- RecvDialogShow receive_dialog;
gboolean confirm_on_exit;
gboolean clean_on_exit;
gtk_widget_set_usize (hdr_combo1, 96, -1);
gtkut_combo_set_items (GTK_COMBO (hdr_combo1),
"Subject", "From", "To", "Cc", "Reply-To",
- "Sender", "X-ML-Name", "X-List", "X-Sequence",
- "X-Mailer",
+ "Sender", "List-Id",
+ "X-ML-Name", "X-List", "X-Sequence", "X-Mailer",
NULL);
hdr_combo2 = gtk_combo_new ();
gtk_widget_set_usize (hdr_combo2, 96, -1);
gtkut_combo_set_items (GTK_COMBO (hdr_combo2), _("(none)"),
"Subject", "From", "To", "Cc", "Reply-To",
- "Sender", "X-ML-Name", "X-List", "X-Sequence",
- "X-Mailer",
+ "Sender", "List-Id",
+ "X-ML-Name", "X-List", "X-Sequence", "X-Mailer",
NULL);
key_label = gtk_label_new (_("Keyword"));
gtk_widget_set_usize(window, 450, -1);
gtk_container_set_border_width(GTK_CONTAINER(window), 8);
gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
- gtk_window_set_modal(GTK_WINDOW(window), TRUE);
gtk_window_set_policy(GTK_WINDOW(window), FALSE, TRUE, TRUE);
+ gtk_widget_realize(window);
vbox = gtk_vbox_new(FALSE, 8);
gtk_container_add(GTK_CONTAINER(window), vbox);
GTK_SIGNAL_FUNC(send_cancel), dialog);
gtk_signal_connect(GTK_OBJECT(progress->window), "delete_event",
GTK_SIGNAL_FUNC(gtk_true), NULL);
+ gtk_window_set_modal(GTK_WINDOW(progress->window), TRUE);
manage_window_set_transient(GTK_WINDOW(progress->window));
progress_dialog_set_value(progress, 0.0);
static void summary_set_menu_sensitive (SummaryView *summaryview);
static void summary_set_add_sender_menu (SummaryView *summaryview);
+static void summary_select_node (SummaryView *summaryview,
+ GtkCTreeNode *node,
+ gboolean display_msg);
+
static guint summary_get_msgnum (SummaryView *summaryview,
GtkCTreeNode *node);
gboolean is_refresh;
guint selected_msgnum = 0;
guint displayed_msgnum = 0;
-
GtkCTreeNode *selected_node = summaryview->folderview->selected;
GSList *cur;
gint sort_mode;
gint sort_type;
+ static gboolean locked = FALSE;
+
+ if (locked) {
+ g_print("Summary view is locked, waiting...\n");
+ return FALSE;
+ /* while (locked)
+ gtk_main_iteration();
+ g_print("unlocked.\n"); */
+ }
+ locked = TRUE;
STATUSBAR_POP(summaryview->mainwin);
summary_execute(summaryview);
else if (G_ALERTALTERNATE == val)
summary_write_cache(summaryview);
- else
- return FALSE;
+ else {
+ locked = FALSE;
+ return FALSE;
+ }
folder_update_op_count();
}
else if (!summaryview->filtering_happened) {
summary_clear_all(summaryview);
summaryview->folder_item = item;
gtk_clist_thaw(GTK_CLIST(ctree));
+ locked = FALSE;
return TRUE;
}
g_free(buf);
if (!summaryview->displayed)
messageview_clear(summaryview->messageview);
summary_select_by_msgnum(summaryview, selected_msgnum);
+ if (!summaryview->selected) {
+ /* no selected message - select first unread
+ message, but do not display it */
+ node = summary_find_next_unread_msg(summaryview, NULL);
+ if (node == NULL && GTK_CLIST(ctree)->row_list != NULL)
+ node = GTK_CTREE_NODE
+ (GTK_CLIST(ctree)->row_list_end);
+ summary_select_node(summaryview, node, FALSE);
+ }
} else {
/* select first unread message */
if (sort_mode == SORT_BY_SCORE)
if (node == NULL && GTK_CLIST(ctree)->row_list != NULL)
node = GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list_end);
- if (node) {
- GTK_EVENTS_FLUSH();
- gtkut_ctree_expand_parent_all(ctree, node);
- gtk_ctree_node_moveto(ctree, node, -1, 0.5, 0);
- gtk_widget_grab_focus(GTK_WIDGET(ctree));
- if (prefs_common.open_unread_on_enter)
- summaryview->display_msg = TRUE;
- gtk_sctree_select(GTK_SCTREE(ctree), node);
- }
+ summary_select_node(summaryview, node,
+ prefs_common.open_unread_on_enter);
}
summary_status_show(summaryview);
STATUSBAR_PUSH(summaryview->mainwin, _("Done."));
main_window_cursor_normal(summaryview->mainwin);
+ locked = FALSE;
return TRUE;
}
summary_status_show(summaryview);
}
-static void summary_set_menu_sensitive(SummaryView *summaryview)
+SummarySelection summary_get_selection_type(SummaryView *summaryview)
{
- GtkItemFactory *ifactory = summaryview->popupfactory;
GtkCList *clist = GTK_CLIST(summaryview->ctree);
- gboolean sens;
SummarySelection selection;
if (!clist->row_list)
else
selection = SUMMARY_SELECTED_MULTIPLE;
- main_window_set_menu_sensitive(summaryview->mainwin, selection);
+ return selection;
+}
+
+static void summary_set_menu_sensitive(SummaryView *summaryview)
+{
+ GtkItemFactory *ifactory = summaryview->popupfactory;
+ SummarySelection selection;
+ gboolean sens;
+
+ selection = summary_get_selection_type(summaryview);
+ main_window_set_menu_sensitive(summaryview->mainwin);
if (selection == SUMMARY_NONE) {
GtkWidget *submenu;
void summary_select_by_msgnum(SummaryView *summaryview, guint msgnum)
{
GtkCTreeNode *node;
- GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
node = summary_find_msg_by_msgnum(summaryview, msgnum);
+ summary_select_node(summaryview, node, FALSE);
+}
+
+/**
+ * summary_select_node:
+ * @summaryview: Summary view.
+ * @node: Summary tree node.
+ * @display_msg: TRUE to display the selected message.
+ *
+ * Select @node (bringing it into view by scrolling and expanding its
+ * thread, if necessary) and unselect all others. If @display_msg is
+ * TRUE, display the corresponding message in the message view.
+ **/
+static void summary_select_node(SummaryView *summaryview, GtkCTreeNode *node,
+ gboolean display_msg)
+{
+ GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
if (node) {
GTK_EVENTS_FLUSH();
gtk_ctree_node_moveto(ctree, node, -1, 0.5, 0);
gtk_widget_grab_focus(GTK_WIDGET(ctree));
gtk_sctree_unselect_all(GTK_SCTREE(ctree));
- summaryview->display_msg = FALSE;
+ summaryview->display_msg = display_msg;
gtk_sctree_select(GTK_SCTREE(ctree), node);
}
}
node = GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list);
- for (; node != NULL; node = GTK_CTREE_NODE_NEXT(node)) {
+ for (; node != NULL; node = gtkut_ctree_node_next(ctree, node)) {
msginfo = gtk_ctree_node_get_row_data(ctree, node);
if (msginfo->msgnum == msgnum) break;
}
summaryview->deleted = summaryview->moved = summaryview->copied = 0;
for (node = GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list);
- node != NULL; node = GTK_CTREE_NODE_NEXT(node)) {
+ node != NULL; node = gtkut_ctree_node_next(ctree, node)) {
msginfo = GTKUT_CTREE_NODE_GET_ROW_DATA(node);
if (MSG_IS_NEW(msginfo->flags) /*&& !MSG_IS_IGNORE_THREAD(msginfo->flags)*/)
node = GTK_CTREE_NODE(clist->row_list);
while (node != NULL) {
- next = GTK_CTREE_NODE_NEXT(node);
+ next = gtkut_ctree_node_next(ctree, node);
if (gtk_ctree_node_get_row_data(ctree, node) == NULL) {
if (node == summaryview->displayed) {
messageview_clear(summaryview->messageview);
#define BREAK_ON_MODIFIER_KEY() \
if ((event->state & (GDK_MOD1_MASK|GDK_CONTROL_MASK)) != 0) break
+#define RETURN_IF_LOCKED() \
+ if (summaryview->mainwin->lock_count) return
+
#define KEY_PRESS_EVENT_STOP() \
if (gtk_signal_n_emissions_by_name \
(GTK_OBJECT(ctree), "key_press_event") > 0) { \
switch (event->keyval) {
case GDK_g: /* Go */
case GDK_G:
+ RETURN_IF_LOCKED();
BREAK_ON_MODIFIER_KEY();
KEY_PRESS_EVENT_STOP();
to_folder = foldersel_folder_sel(NULL, NULL);
compose_new(NULL);
return;
case GDK_D: /* Empty trash */
+ RETURN_IF_LOCKED();
BREAK_ON_MODIFIER_KEY();
KEY_PRESS_EVENT_STOP();
main_window_empty_trash(summaryview->mainwin, TRUE);
return;
case GDK_Q: /* Quit */
+ RETURN_IF_LOCKED();
BREAK_ON_MODIFIER_KEY();
if (prefs_common.confirm_on_exit) {
summary_mark_as_unread(summaryview);
break;
case GDK_d: /* Delete */
+ RETURN_IF_LOCKED();
BREAK_ON_MODIFIER_KEY();
summary_delete(summaryview);
break;
summary_unmark(summaryview);
break;
case GDK_o: /* Move */
+ RETURN_IF_LOCKED();
BREAK_ON_MODIFIER_KEY();
summary_move_to(summaryview);
break;
case GDK_O: /* Copy */
+ RETURN_IF_LOCKED();
BREAK_ON_MODIFIER_KEY();
summary_copy_to(summaryview);
break;
case GDK_x: /* Execute */
case GDK_X:
+ RETURN_IF_LOCKED();
BREAK_ON_MODIFIER_KEY();
KEY_PRESS_EVENT_STOP();
summary_execute(summaryview);
}
#undef BREAK_ON_MODIFIER_KEY
+#undef RETURN_IF_LOCKED
#undef KEY_PRESS_EVENT_STOP
static void summary_open_row(GtkSCTree *sctree, SummaryView *summaryview)
SummaryView *summary_create(void);
void summary_init (SummaryView *summaryview);
-
gboolean summary_show (SummaryView *summaryview,
FolderItem *fitem,
gboolean update_cache);
-
-
void summary_clear_list (SummaryView *summaryview);
void summary_clear_all (SummaryView *summaryview);
+SummarySelection summary_get_selection_type (SummaryView *summaryview);
+
void summary_select_next_unread (SummaryView *summaryview);
void summary_select_next_marked (SummaryView *summaryview);
void summary_select_prev_marked (SummaryView *summaryview);
guint msgnum);
guint summary_get_current_msgnum (SummaryView *summaryview);
void summary_thread_build (SummaryView *summaryview,
- gboolean init);
+ gboolean init);
void summary_unthread (SummaryView *summaryview);
void summary_filter (SummaryView *summaryview);
void summary_sort (SummaryView *summaryview,