aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2011-12-26 06:12:51 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2011-12-26 06:12:51 +0000
commit38ef392ab8529c3a0a766fae47cb539dcb5f0543 (patch)
tree209b99ce863d8eead36c25ca08d26eb928b13f55
parentfe9a7c9c4b7ee50461d8376cf894b1461f22a23d (diff)
src/rpop3.c: added refresh (reload) menu.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2996 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r--ChangeLog4
-rw-r--r--src/rpop3.c23
2 files changed, 26 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index c89f3b09..0236f37b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-12-26
+
+ * src/rpop3.c: added refresh (reload) menu.
+
2011-12-22
* src/rpop3.c: implemented reloading after the loading stopped.
diff --git a/src/rpop3.c b/src/rpop3.c
index 93019e0c..a02b691f 100644
--- a/src/rpop3.c
+++ b/src/rpop3.c
@@ -95,6 +95,7 @@ static struct RPop3Window {
GtkAction *recv_action;
GtkAction *open_action;
GtkAction *delete_action;
+ GtkAction *update_action;
GtkAction *stop_action;
Pop3Session *session;
@@ -115,6 +116,8 @@ static const gchar *ui_def =
" <menuitem name='Receive' action='ReceiveAction'/>"
" <menuitem name='Open' action='OpenAction'/>"
" <menuitem name='Delete' action='DeleteAction'/>"
+ " <separator />"
+ " <menuitem name='Update' action='UpdateAction'/>"
" <menuitem name='Stop' action='StopAction'/>"
" <separator />"
" <menuitem name='Close' action='CloseAction'/>"
@@ -222,6 +225,7 @@ static void rpop3_close (GtkButton *button,
static void rpop3_recv_cb (void);
static void rpop3_open_cb (void);
static void rpop3_delete_cb (void);
+static void rpop3_update_cb (void);
static void rpop3_stop_cb (void);
static void rpop3_close_cb (void);
static void rpop3_about_cb (void);
@@ -244,6 +248,7 @@ static GtkActionEntry action_entries[] = {
{"ReceiveAction", NULL, N_("_Get"), "<Control>G", NULL, rpop3_recv_cb},
{"OpenAction", GTK_STOCK_OPEN, NULL, NULL, NULL, rpop3_open_cb},
{"DeleteAction", GTK_STOCK_DELETE, NULL, "<Shift>Delete", NULL, rpop3_delete_cb},
+ {"UpdateAction", GTK_STOCK_REFRESH, NULL, NULL, NULL, rpop3_update_cb},
{"StopAction", GTK_STOCK_STOP, NULL, NULL, NULL, rpop3_stop_cb},
{"CloseAction", GTK_STOCK_CLOSE, NULL, NULL, NULL, rpop3_close_cb},
{"HelpAction", NULL, N_("_Help"), NULL, NULL, NULL},
@@ -468,6 +473,10 @@ static void rpop3_window_create(PrefsAccount *account)
g_object_set(action, "sensitive", FALSE, NULL);
rpop3_window.delete_action = action;
+ action = gtk_ui_manager_get_action(ui, "/RPop3Menu/File/Update");
+ g_object_set(action, "sensitive", FALSE, NULL);
+ rpop3_window.update_action = action;
+
stop_btn = gtk_button_new_from_stock(GTK_STOCK_STOP);
gtk_box_pack_start(GTK_BOX(hbbox), stop_btn, FALSE, FALSE, 0);
gtk_widget_set_sensitive(stop_btn, FALSE);
@@ -992,6 +1001,8 @@ static gint rpop3_session_recv_data_finished(Session *session, guchar *data,
pop3_session->cur_msg = pop3_session->count;
gtk_widget_set_sensitive(rpop3_window.stop_btn,
TRUE);
+ g_object_set(rpop3_window.update_action,
+ "sensitive", FALSE, NULL);
g_object_set(rpop3_window.stop_action,
"sensitive", TRUE, NULL);
rpop3_top_send(pop3_session);
@@ -1075,8 +1086,12 @@ static gint rpop3_session_recv_data_as_file_finished(Session *session,
"sensitive", TRUE, NULL);
g_object_set(rpop3_window.delete_action,
"sensitive", TRUE, NULL);
+ g_object_set(rpop3_window.stop_action,
+ "sensitive", FALSE, NULL);
if (pop3_session->cur_msg == 1)
- g_object_set(rpop3_window.stop_action, "sensitive", FALSE, NULL);
+ g_object_set(rpop3_window.update_action, "sensitive", FALSE, NULL);
+ else
+ g_object_set(rpop3_window.update_action, "sensitive", TRUE, NULL);
rpop3_idle(TRUE);
}
} else
@@ -1261,6 +1276,7 @@ static void rpop3_read_next(GtkButton *button, gpointer data)
gtk_button_set_label(GTK_BUTTON(rpop3_window.stop_btn), GTK_STOCK_STOP);
gtk_widget_set_sensitive(rpop3_window.stop_btn, TRUE);
+ g_object_set(rpop3_window.update_action, "sensitive", FALSE, NULL);
g_object_set(rpop3_window.stop_action, "sensitive", TRUE, NULL);
rpop3_idle(FALSE);
rpop3_top_send(rpop3_window.session);
@@ -1302,6 +1318,11 @@ static void rpop3_delete_cb(void)
rpop3_delete(NULL, NULL);
}
+static void rpop3_update_cb(void)
+{
+ rpop3_stop(NULL, NULL);
+}
+
static void rpop3_stop_cb(void)
{
rpop3_stop(NULL, NULL);