aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2007-03-29 04:55:52 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2007-03-29 04:55:52 +0000
commit4c2aee3cf95ec99d367b9e003cf7ee0da42f1ccb (patch)
treecd54167ae32f112fb9d9a34ae173cc65ac3ec88d /src
parent308d6594df4088ed00e41a7c533377521da8928a (diff)
disable --compose, --receive, --send remote commands when a modal dialog exists.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1584 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src')
-rw-r--r--src/inc.c3
-rw-r--r--src/main.c35
2 files changed, 26 insertions, 12 deletions
diff --git a/src/inc.c b/src/inc.c
index 4d791a68..78e47675 100644
--- a/src/inc.c
+++ b/src/inc.c
@@ -204,6 +204,7 @@ void inc_mail(MainWindow *mainwin)
gint new_msgs = 0;
if (inc_lock_count) return;
+ if (inc_is_active()) return;
if (!main_window_toggle_online_if_offline(mainwin))
return;
@@ -378,6 +379,7 @@ gint inc_account_mail(MainWindow *mainwin, PrefsAccount *account)
gint new_msgs;
if (inc_lock_count) return 0;
+ if (inc_is_active()) return 0;
if (!main_window_toggle_online_if_offline(mainwin))
return 0;
@@ -402,6 +404,7 @@ void inc_all_account_mail(MainWindow *mainwin, gboolean autocheck)
gint new_msgs = 0;
if (inc_lock_count) return;
+ if (inc_is_active()) return;
if (!main_window_toggle_online_if_offline(mainwin))
return;
diff --git a/src/main.c b/src/main.c
index b3b8c552..04020cd0 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1063,10 +1063,12 @@ static gboolean lock_socket_input_cb(GIOChannel *source, GIOCondition condition,
#endif
} else if (!strncmp(buf, "receive_all", 11)) {
main_window_popup(mainwin);
- inc_all_account_mail(mainwin, FALSE);
+ if (!gtkut_window_modal_exist())
+ inc_all_account_mail(mainwin, FALSE);
} else if (!strncmp(buf, "receive", 7)) {
main_window_popup(mainwin);
- inc_mail(mainwin);
+ if (!gtkut_window_modal_exist())
+ inc_mail(mainwin);
} else if (!strncmp(buf, "compose_attach", 14)) {
GPtrArray *files;
gchar *mailto;
@@ -1121,22 +1123,26 @@ static void remote_command_exec(void)
folderview_select(mainwin->folderview, item);
}
- if (cmd.receive_all)
- inc_all_account_mail(mainwin, FALSE);
- else if (prefs_common.chk_on_startup)
- inc_all_account_mail(mainwin, TRUE);
- else if (cmd.receive)
- inc_mail(mainwin);
+ if (!gtkut_window_modal_exist()) {
+ if (cmd.receive_all)
+ inc_all_account_mail(mainwin, FALSE);
+ else if (prefs_common.chk_on_startup)
+ inc_all_account_mail(mainwin, TRUE);
+ else if (cmd.receive)
+ inc_mail(mainwin);
+
+ if (cmd.compose)
+ open_compose_new(cmd.compose_mailto, cmd.attach_files);
+
+ if (cmd.send)
+ send_queue();
+ }
- if (cmd.compose)
- open_compose_new(cmd.compose_mailto, cmd.attach_files);
if (cmd.attach_files) {
ptr_array_free_strings(cmd.attach_files);
g_ptr_array_free(cmd.attach_files, TRUE);
cmd.attach_files = NULL;
}
- if (cmd.send)
- send_queue();
if (cmd.status_folders) {
g_ptr_array_free(cmd.status_folders, TRUE);
cmd.status_folders = NULL;
@@ -1236,6 +1242,9 @@ static void open_compose_new(const gchar *address, GPtrArray *attach_files)
GPtrArray *utf8files = NULL;
#endif
+ if (gtkut_window_modal_exist())
+ return;
+
if (address) {
utf8addr = g_locale_to_utf8(address, -1, NULL, NULL, NULL);
if (utf8addr)
@@ -1272,6 +1281,8 @@ static void send_queue(void)
{
GList *list;
+ if (gtkut_window_modal_exist())
+ return;
if (!main_window_toggle_online_if_offline(main_window_get()))
return;