aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2007-02-02 09:20:09 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2007-02-02 09:20:09 +0000
commit2196fd8bd137704f2642e06ab652aee29f3a0a5c (patch)
tree06c9d809f710762170f2c3ec6617938891e6f46c /src
parentb4f66f4dbf383904028bc127ff7adc8c9e9eff66 (diff)
disable 'Send' button when no queued messages exist.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1527 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src')
-rw-r--r--src/compose.c3
-rw-r--r--src/main.c2
-rw-r--r--src/mainwindow.c16
3 files changed, 19 insertions, 2 deletions
diff --git a/src/compose.c b/src/compose.c
index ff48c1c3..7d43ea10 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -3551,6 +3551,9 @@ static gint compose_queue(Compose *compose, const gchar *file)
folder_item_scan(queue);
folderview_update_item(queue, TRUE);
+ main_window_set_menu_sensitive(main_window_get());
+ main_window_set_toolbar_sensitive(main_window_get());
+
return 0;
}
diff --git a/src/main.c b/src/main.c
index 6739ee2a..13a97010 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1289,4 +1289,6 @@ static void send_queue(void)
}
folderview_update_all_updated(TRUE);
+ main_window_set_menu_sensitive(main_window_get());
+ main_window_set_toolbar_sensitive(main_window_get());
}
diff --git a/src/mainwindow.c b/src/mainwindow.c
index a4591a12..44872ac5 100644
--- a/src/mainwindow.c
+++ b/src/mainwindow.c
@@ -1770,6 +1770,8 @@ void main_window_send_queue(MainWindow *mainwin)
}
folderview_update_all_updated(TRUE);
+ main_window_set_menu_sensitive(mainwin);
+ main_window_set_toolbar_sensitive(mainwin);
}
typedef enum
@@ -1786,6 +1788,7 @@ typedef enum
M_ALLOW_DELETE = 1 << 9,
M_INC_ACTIVE = 1 << 10,
M_ENABLE_JUNK = 1 << 11,
+ M_HAVE_QUEUED_MSG = 1 << 12,
M_FOLDER_NEWOK = 1 << 17,
M_FOLDER_RENOK = 1 << 18,
@@ -1802,6 +1805,7 @@ static SensitiveCond main_window_get_current_state(MainWindow *mainwin)
{
SensitiveCond state = 0;
SummarySelection selection;
+ GList *list;
FolderItem *item = mainwin->summaryview->folder_item;
selection = summary_get_selection_type(mainwin->summaryview);
@@ -1838,6 +1842,14 @@ static SensitiveCond main_window_get_current_state(MainWindow *mainwin)
if (prefs_common.enable_junk)
state |= M_ENABLE_JUNK;
+ for (list = folder_get_list(); list != NULL; list = list->next) {
+ Folder *folder = list->data;
+ if (folder->queue && folder->queue->total > 0) {
+ state |= M_HAVE_QUEUED_MSG;
+ break;
+ }
+ }
+
item = folderview_get_selected_item(mainwin->folderview);
if (item) {
state |= M_FOLDER_NEWOK;
@@ -1887,7 +1899,7 @@ void main_window_set_toolbar_sensitive(MainWindow *mainwin)
SET_WIDGET_COND(mainwin->get_btn, M_HAVE_ACCOUNT|M_UNLOCKED);
SET_WIDGET_COND(mainwin->getall_btn, M_HAVE_ACCOUNT|M_UNLOCKED);
- SET_WIDGET_COND(mainwin->send_btn, M_HAVE_ACCOUNT);
+ SET_WIDGET_COND(mainwin->send_btn, M_HAVE_ACCOUNT|M_HAVE_QUEUED_MSG);
SET_WIDGET_COND(mainwin->compose_btn, M_HAVE_ACCOUNT);
SET_WIDGET_COND(mainwin->reply_btn,
M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST);
@@ -2026,7 +2038,7 @@ void main_window_set_menu_sensitive(MainWindow *mainwin)
, M_HAVE_ACCOUNT|M_UNLOCKED},
{"/Message/Receive/Cancel receiving"
, M_INC_ACTIVE},
- {"/Message/Send queued messages" , M_HAVE_ACCOUNT},
+ {"/Message/Send queued messages" , M_HAVE_ACCOUNT|M_HAVE_QUEUED_MSG},
{"/Message/Compose new message" , M_HAVE_ACCOUNT},
{"/Message/Reply" , M_HAVE_ACCOUNT|M_SINGLE_TARGET_EXIST},