2006-08-11 [colin] 2.4.0cvs41
* src/compose.c * src/mainwindow.c * src/mainwindow.h * src/procmsg.c * src/procmsg.h * src/summaryview.c * src/toolbar.c Grey out the Send button if - Queue folders are empty, or - We're sending already
This commit is contained in:
parent
a0c6c020f9
commit
936207855d
10 changed files with 108 additions and 27 deletions
13
ChangeLog
13
ChangeLog
|
@ -1,3 +1,16 @@
|
|||
2006-08-11 [colin] 2.4.0cvs41
|
||||
|
||||
* src/compose.c
|
||||
* src/mainwindow.c
|
||||
* src/mainwindow.h
|
||||
* src/procmsg.c
|
||||
* src/procmsg.h
|
||||
* src/summaryview.c
|
||||
* src/toolbar.c
|
||||
Grey out the Send button if
|
||||
- Queue folders are empty, or
|
||||
- We're sending already
|
||||
|
||||
2006-08-11 [wwp] 2.4.0cvs40
|
||||
|
||||
* src/main.c
|
||||
|
|
|
@ -1732,3 +1732,4 @@
|
|||
( cvs diff -u -r 1.274.2.135 -r 1.274.2.136 src/mainwindow.c; cvs diff -u -r 1.39.2.18 -r 1.39.2.19 src/mainwindow.h; ) > 2.4.0cvs38.patchset
|
||||
( cvs diff -u -r 1.179.2.127 -r 1.179.2.128 src/imap.c; cvs diff -u -r 1.115.2.100 -r 1.115.2.101 src/main.c; cvs diff -u -r 1.1.4.46 -r 1.1.4.47 src/etpan/imap-thread.c; cvs diff -u -r 1.1.4.10 -r 1.1.4.11 src/etpan/imap-thread.h; ) > 2.4.0cvs39.patchset
|
||||
( cvs diff -u -r 1.115.2.101 -r 1.115.2.102 src/main.c; ) > 2.4.0cvs40.patchset
|
||||
( cvs diff -u -r 1.382.2.299 -r 1.382.2.300 src/compose.c; cvs diff -u -r 1.274.2.136 -r 1.274.2.137 src/mainwindow.c; cvs diff -u -r 1.39.2.19 -r 1.39.2.20 src/mainwindow.h; cvs diff -u -r 1.150.2.70 -r 1.150.2.71 src/procmsg.c; cvs diff -u -r 1.60.2.30 -r 1.60.2.31 src/procmsg.h; cvs diff -u -r 1.395.2.228 -r 1.395.2.229 src/summaryview.c; cvs diff -u -r 1.43.2.48 -r 1.43.2.49 src/toolbar.c; ) > 2.4.0cvs41.patchset
|
||||
|
|
|
@ -11,7 +11,7 @@ MINOR_VERSION=4
|
|||
MICRO_VERSION=0
|
||||
INTERFACE_AGE=0
|
||||
BINARY_AGE=0
|
||||
EXTRA_VERSION=40
|
||||
EXTRA_VERSION=41
|
||||
EXTRA_RELEASE=
|
||||
EXTRA_GTK2_VERSION=
|
||||
|
||||
|
|
|
@ -4153,12 +4153,14 @@ gint compose_send(Compose *compose)
|
|||
return -1;
|
||||
}
|
||||
|
||||
toolbar_main_set_sensitive(mainwindow_get_mainwindow());
|
||||
return 0;
|
||||
|
||||
bail:
|
||||
compose_allow_user_actions (compose, TRUE);
|
||||
compose->sending = FALSE;
|
||||
compose->modified = TRUE;
|
||||
toolbar_main_set_sensitive(mainwindow_get_mainwindow());
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
@ -7541,9 +7543,9 @@ static void compose_send_later_cb(gpointer data, guint action,
|
|||
gint val;
|
||||
|
||||
val = compose_queue_sub(compose, NULL, NULL, NULL, TRUE, TRUE);
|
||||
if (!val)
|
||||
if (!val) {
|
||||
compose_close(compose);
|
||||
else if (val == -1) {
|
||||
} else if (val == -1) {
|
||||
alertpanel_error(_("Could not queue message."));
|
||||
} else if (val == -2) {
|
||||
alertpanel_error(_("Could not queue message:\n\n%s."), strerror(errno));
|
||||
|
@ -7555,6 +7557,7 @@ static void compose_send_later_cb(gpointer data, guint action,
|
|||
alertpanel_error(_("Could not queue message for sending:\n\n"
|
||||
"Charset conversion failed."));
|
||||
}
|
||||
toolbar_main_set_sensitive(mainwindow_get_mainwindow());
|
||||
}
|
||||
|
||||
void compose_draft (gpointer data)
|
||||
|
|
|
@ -2057,7 +2057,7 @@ SensitiveCond main_window_get_current_state(MainWindow *mainwin)
|
|||
|
||||
if ((selection == SUMMARY_NONE && item->hide_read_msgs)
|
||||
|| selection != SUMMARY_NONE)
|
||||
state |= M_HIDE_READ_MSG;
|
||||
state |= M_HIDE_READ_MSG;
|
||||
}
|
||||
if (mainwin->summaryview->threaded)
|
||||
state |= M_THREADED;
|
||||
|
@ -2076,6 +2076,9 @@ SensitiveCond main_window_get_current_state(MainWindow *mainwin)
|
|||
if (prefs_common.actions_list && g_slist_length(prefs_common.actions_list))
|
||||
state |= M_ACTIONS_EXIST;
|
||||
|
||||
if (procmsg_have_queued_mails_fast() && !procmsg_is_sending())
|
||||
state |= M_HAVE_QUEUED_MAILS;
|
||||
|
||||
if (selection == SUMMARY_SELECTED_SINGLE &&
|
||||
(item &&
|
||||
(folder_has_parent_of_type(item, F_DRAFT) ||
|
||||
|
|
|
@ -50,7 +50,8 @@ typedef enum
|
|||
M_DELAY_EXEC = 1 << 14,
|
||||
M_NOT_NEWS = 1 << 15,
|
||||
M_CAN_LEARN_SPAM = 1 << 16,
|
||||
M_ACTIONS_EXIST = 1 << 17
|
||||
M_ACTIONS_EXIST = 1 << 17,
|
||||
M_HAVE_QUEUED_MAILS = 1 << 18
|
||||
} SensitiveCond;
|
||||
|
||||
typedef enum
|
||||
|
|
|
@ -879,6 +879,7 @@ static gboolean procmsg_is_last_for_account(FolderItem *queue, MsgInfo *msginfo,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean send_queue_lock = FALSE;
|
||||
/*!
|
||||
*\brief Send messages in queue
|
||||
*
|
||||
|
@ -894,7 +895,6 @@ gint procmsg_send_queue(FolderItem *queue, gboolean save_msgs, gchar **errstr)
|
|||
GSList *list, *elem;
|
||||
GSList *sorted_list = NULL;
|
||||
GNode *node, *next;
|
||||
static gboolean send_queue_lock = FALSE;
|
||||
|
||||
if (send_queue_lock) {
|
||||
log_error(_("Already trying to send\n"));
|
||||
|
@ -902,12 +902,19 @@ gint procmsg_send_queue(FolderItem *queue, gboolean save_msgs, gchar **errstr)
|
|||
if (*errstr) g_free(*errstr);
|
||||
*errstr = g_strdup_printf(_("Already trying to send."));
|
||||
}
|
||||
toolbar_main_set_sensitive(mainwindow_get_mainwindow());
|
||||
return -1;
|
||||
}
|
||||
send_queue_lock = TRUE;
|
||||
if (!queue)
|
||||
queue = folder_get_default_queue();
|
||||
g_return_val_if_fail(queue != NULL, -1);
|
||||
|
||||
if (queue == NULL) {
|
||||
send_queue_lock = FALSE;
|
||||
return -1;
|
||||
}
|
||||
|
||||
toolbar_main_set_sensitive(mainwindow_get_mainwindow());
|
||||
|
||||
folder_item_scan(queue);
|
||||
list = folder_item_get_msg_list(queue);
|
||||
|
@ -959,9 +966,16 @@ gint procmsg_send_queue(FolderItem *queue, gboolean save_msgs, gchar **errstr)
|
|||
}
|
||||
}
|
||||
send_queue_lock = FALSE;
|
||||
toolbar_main_set_sensitive(mainwindow_get_mainwindow());
|
||||
|
||||
return (err != 0 ? -err : sent);
|
||||
}
|
||||
|
||||
gboolean procmsg_is_sending(void)
|
||||
{
|
||||
return send_queue_lock;
|
||||
}
|
||||
|
||||
/*!
|
||||
*\brief Determine if a queue folder is empty
|
||||
*
|
||||
|
@ -1739,7 +1753,9 @@ send_mail:
|
|||
|
||||
gint procmsg_send_message_queue(const gchar *file, gchar **errstr)
|
||||
{
|
||||
return procmsg_send_message_queue_full(file, FALSE, errstr);
|
||||
gint result = procmsg_send_message_queue_full(file, FALSE, errstr);
|
||||
toolbar_main_set_sensitive(mainwindow_get_mainwindow());
|
||||
return result;
|
||||
}
|
||||
|
||||
static void update_folder_msg_counts(FolderItem *item, MsgInfo *msginfo, MsgPermFlags old_flags)
|
||||
|
@ -2180,3 +2196,19 @@ FolderItem *procmsg_spam_get_folder (void)
|
|||
FolderItem *item = spam_folder_item ? folder_find_item_from_identifier(spam_folder_item) : NULL;
|
||||
return item ? item : folder_get_default_trash();
|
||||
}
|
||||
|
||||
static void item_has_queued_mails(FolderItem *item, gpointer data)
|
||||
{
|
||||
gboolean *result = (gboolean *)data;
|
||||
if (*result == TRUE)
|
||||
return;
|
||||
if (folder_has_parent_of_type(item, F_QUEUE) && item->total_msgs > 0)
|
||||
*result = TRUE;
|
||||
}
|
||||
|
||||
gboolean procmsg_have_queued_mails_fast (void)
|
||||
{
|
||||
gboolean result = FALSE;
|
||||
folder_func_to_all_folders(item_has_queued_mails, &result);
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -342,5 +342,7 @@ gboolean procmsg_spam_can_learn (void);
|
|||
void procmsg_spam_set_folder (const char *item_identifier);
|
||||
FolderItem *procmsg_spam_get_folder (void);
|
||||
int procmsg_spam_learner_learn (MsgInfo *msginfo, GSList *msglist, gboolean spam);
|
||||
gboolean procmsg_have_queued_mails_fast (void);
|
||||
gboolean procmsg_is_sending(void);
|
||||
|
||||
#endif /* __PROCMSG_H__ */
|
||||
|
|
|
@ -2070,6 +2070,7 @@ static void summary_status_show(SummaryView *summaryview)
|
|||
gtk_label_set_text(GTK_LABEL(summaryview->statlabel_folder), "");
|
||||
gtk_label_set_text(GTK_LABEL(summaryview->statlabel_select), "");
|
||||
gtk_label_set_text(GTK_LABEL(summaryview->statlabel_msgs), "");
|
||||
toolbar_main_set_sensitive(summaryview->mainwin);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2161,6 +2162,7 @@ static void summary_status_show(SummaryView *summaryview)
|
|||
to_human_readable(n_size));
|
||||
gtk_label_set_text(GTK_LABEL(summaryview->statlabel_msgs), str);
|
||||
g_free(str);
|
||||
toolbar_main_set_sensitive(summaryview->mainwin);
|
||||
}
|
||||
|
||||
static void summary_set_column_titles(SummaryView *summaryview)
|
||||
|
|
|
@ -1862,43 +1862,61 @@ void toolbar_main_set_sensitive(gpointer data)
|
|||
entry_list = g_slist_append(entry_list, e); \
|
||||
}
|
||||
|
||||
SET_WIDGET_COND(toolbar->get_btn, M_HAVE_ACCOUNT|M_UNLOCKED);
|
||||
SET_WIDGET_COND(toolbar->getall_btn, M_HAVE_ACCOUNT|M_UNLOCKED);
|
||||
if (toolbar->getall_btn)
|
||||
|
||||
if (toolbar->get_btn)
|
||||
SET_WIDGET_COND(toolbar->get_btn,
|
||||
M_HAVE_ACCOUNT|M_UNLOCKED);
|
||||
|
||||
if (toolbar->getall_btn) {
|
||||
SET_WIDGET_COND(toolbar->getall_btn,
|
||||
M_HAVE_ACCOUNT|M_UNLOCKED);
|
||||
SET_WIDGET_COND(GTK_WIDGET_PTR(toolbar->getall_combo),
|
||||
M_HAVE_ACCOUNT|M_UNLOCKED);
|
||||
if (toolbar->compose_mail_btn)
|
||||
}
|
||||
if (toolbar->send_btn) {
|
||||
SET_WIDGET_COND(toolbar->send_btn,
|
||||
M_HAVE_QUEUED_MAILS);
|
||||
}
|
||||
if (toolbar->compose_mail_btn) {
|
||||
SET_WIDGET_COND(GTK_WIDGET_PTR(toolbar->compose_combo),
|
||||
M_HAVE_ACCOUNT);
|
||||
SET_WIDGET_COND(toolbar->compose_news_btn, M_HAVE_ACCOUNT);
|
||||
SET_WIDGET_COND(toolbar->reply_btn,
|
||||
SET_WIDGET_COND(toolbar->compose_news_btn,
|
||||
M_HAVE_ACCOUNT);
|
||||
}
|
||||
if (toolbar->reply_btn) {
|
||||
SET_WIDGET_COND(toolbar->reply_btn,
|
||||
M_HAVE_ACCOUNT|M_TARGET_EXIST);
|
||||
if (toolbar->reply_btn)
|
||||
SET_WIDGET_COND(GTK_WIDGET_PTR(toolbar->reply_combo),
|
||||
M_HAVE_ACCOUNT|M_TARGET_EXIST);
|
||||
if (toolbar->replyall_btn)
|
||||
}
|
||||
if (toolbar->replyall_btn) {
|
||||
SET_WIDGET_COND(toolbar->replyall_btn,
|
||||
M_HAVE_ACCOUNT|M_TARGET_EXIST);
|
||||
if (toolbar->replyall_btn)
|
||||
SET_WIDGET_COND(GTK_WIDGET_PTR(toolbar->replyall_combo),
|
||||
M_HAVE_ACCOUNT|M_TARGET_EXIST);
|
||||
SET_WIDGET_COND(toolbar->replylist_btn,
|
||||
}
|
||||
if (toolbar->replylist_btn) {
|
||||
SET_WIDGET_COND(toolbar->replylist_btn,
|
||||
M_HAVE_ACCOUNT|M_TARGET_EXIST);
|
||||
if (toolbar->replylist_btn)
|
||||
SET_WIDGET_COND(GTK_WIDGET_PTR(toolbar->replylist_combo),
|
||||
M_HAVE_ACCOUNT|M_TARGET_EXIST);
|
||||
SET_WIDGET_COND(toolbar->replysender_btn,
|
||||
}
|
||||
if (toolbar->replysender_btn) {
|
||||
SET_WIDGET_COND(toolbar->replysender_btn,
|
||||
M_HAVE_ACCOUNT|M_TARGET_EXIST);
|
||||
if (toolbar->replysender_btn)
|
||||
SET_WIDGET_COND(GTK_WIDGET_PTR(toolbar->replysender_combo),
|
||||
M_HAVE_ACCOUNT|M_TARGET_EXIST);
|
||||
SET_WIDGET_COND(toolbar->fwd_btn, M_HAVE_ACCOUNT|M_TARGET_EXIST);
|
||||
if (toolbar->fwd_btn)
|
||||
}
|
||||
if (toolbar->fwd_btn) {
|
||||
SET_WIDGET_COND(toolbar->fwd_btn,
|
||||
M_HAVE_ACCOUNT|M_TARGET_EXIST);
|
||||
SET_WIDGET_COND(GTK_WIDGET_PTR(toolbar->fwd_combo),
|
||||
M_HAVE_ACCOUNT|M_TARGET_EXIST);
|
||||
}
|
||||
if (toolbar->fwd_combo) {
|
||||
GtkWidget *submenu = gtk_item_factory_get_widget(toolbar->fwd_combo->factory, "/Redirect");
|
||||
SET_WIDGET_COND(submenu, M_HAVE_ACCOUNT|M_TARGET_EXIST);
|
||||
SET_WIDGET_COND(submenu,
|
||||
M_HAVE_ACCOUNT|M_TARGET_EXIST);
|
||||
}
|
||||
|
||||
if (prefs_common.next_unread_msg_dialog == NEXTUNREADMSGDIALOG_ASSUME_NO) {
|
||||
|
@ -1910,16 +1928,22 @@ void toolbar_main_set_sensitive(gpointer data)
|
|||
if (toolbar->trash_btn)
|
||||
SET_WIDGET_COND(toolbar->trash_btn,
|
||||
M_TARGET_EXIST|M_ALLOW_DELETE);
|
||||
|
||||
if (toolbar->delete_btn)
|
||||
SET_WIDGET_COND(toolbar->delete_btn,
|
||||
M_TARGET_EXIST|M_ALLOW_DELETE);
|
||||
|
||||
if (toolbar->exec_btn)
|
||||
SET_WIDGET_COND(toolbar->exec_btn, M_DELAY_EXEC);
|
||||
SET_WIDGET_COND(toolbar->exec_btn,
|
||||
M_DELAY_EXEC);
|
||||
|
||||
if (toolbar->learn_ham_btn)
|
||||
SET_WIDGET_COND(toolbar->learn_ham_btn, M_TARGET_EXIST|M_CAN_LEARN_SPAM);
|
||||
SET_WIDGET_COND(toolbar->learn_ham_btn,
|
||||
M_TARGET_EXIST|M_CAN_LEARN_SPAM);
|
||||
|
||||
if (toolbar->learn_spam_btn)
|
||||
SET_WIDGET_COND(toolbar->learn_spam_btn, M_TARGET_EXIST|M_CAN_LEARN_SPAM);
|
||||
SET_WIDGET_COND(toolbar->learn_spam_btn,
|
||||
M_TARGET_EXIST|M_CAN_LEARN_SPAM);
|
||||
|
||||
for (cur = toolbar->action_list; cur != NULL; cur = cur->next) {
|
||||
ToolbarSylpheedActions *act = (ToolbarSylpheedActions*)cur->data;
|
||||
|
|
Loading…
Reference in a new issue