COMPOSE_CALL_GTK_STEXT_DELETE_TO_LINE_END
} ComposeCallGtkSTextAction;
+typedef enum
+{
+ PRIORITY_HIGHEST = 1,
+ PRIORITY_HIGH,
+ PRIORITY_NORMAL,
+ PRIORITY_LOW,
+ PRIORITY_LOWEST
+} PriorityLevel;
+
#define B64_LINE_SIZE 57
#define B64_BUFFSIZE 77
static void compose_create_header_entry (Compose *compose);
static void compose_add_header_entry (Compose *compose, gchar *header, gchar *text);
+static void compose_update_priority_menu_item(Compose * compose);
/* callback functions */
#endif
static void compose_toggle_return_receipt_cb(gpointer data, guint action,
GtkWidget *widget);
+static void compose_set_priority_cb (gpointer data,
+ guint action,
+ GtkWidget *widget);
static void compose_attach_drag_received_cb (GtkWidget *widget,
GdkDragContext *drag_context,
{N_("/_Message/Si_gn"), NULL, compose_toggle_sign_cb , 0, "<ToggleItem>"},
{N_("/_Message/_Encrypt"), NULL, compose_toggle_encrypt_cb, 0, "<ToggleItem>"},
#endif /* USE_GPGME */
+ {N_("/_Message/---"), NULL, NULL, 0, "<Separator>"},
+ {N_("/_Message/Priority"), NULL, NULL, 0, "<Branch>"},
+ {N_("/_Message/Priority/Highest"), NULL, compose_set_priority_cb, PRIORITY_HIGHEST, "<RadioItem>"},
+ {N_("/_Message/Priority/High"), NULL, compose_set_priority_cb, PRIORITY_HIGH, "/Message/Priority/Highest"},
+ {N_("/_Message/Priority/Normal"), NULL, compose_set_priority_cb, PRIORITY_NORMAL, "/Message/Priority/Highest"},
+ {N_("/_Message/Priority/Low"), NULL, compose_set_priority_cb, PRIORITY_LOW, "/Message/Priority/Highest"},
+ {N_("/_Message/Priority/Lowest"), NULL, compose_set_priority_cb, PRIORITY_LOWEST, "/Message/Priority/Highest"},
{N_("/_Message/---"), NULL, NULL, 0, "<Separator>"},
{N_("/_Message/_Request Return Receipt"), NULL, compose_toggle_return_receipt_cb, 0, "<ToggleItem>"},
{N_("/_Tools"), NULL, NULL, 0, "<Branch>"},
{"Followup-To:", NULL, FALSE},
{"X-Mailing-List:", NULL, FALSE},
{"X-BeenThere:", NULL, FALSE},
+ {"X-Priority:", NULL, FALSE},
{NULL, NULL, FALSE}};
enum
H_NEWSGROUPS = 4,
H_FOLLOWUP_TO = 5,
H_X_MAILING_LIST = 6,
- H_X_BEENTHERE = 7
+ H_X_BEENTHERE = 7,
+ H_X_PRIORITY = 8
};
FILE *fp;
hentry[H_FOLLOWUP_TO].body = NULL;
}
+ if (compose->mode == COMPOSE_REEDIT)
+ if (hentry[H_X_PRIORITY].body != NULL) {
+ gint priority;
+
+ priority = atoi(hentry[H_X_PRIORITY].body);
+ g_free(hentry[H_X_PRIORITY].body);
+
+ hentry[H_X_PRIORITY].body = NULL;
+
+ if (priority < PRIORITY_HIGHEST ||
+ priority > PRIORITY_LOWEST)
+ priority = PRIORITY_NORMAL;
+
+ compose->priority = priority;
+ }
+
if (compose->mode == COMPOSE_REEDIT && msginfo->inreplyto)
compose->inreplyto = g_strdup(msginfo->inreplyto);
else if (compose->mode != COMPOSE_REEDIT &&
SET_ADDRESS(COMPOSE_BCC, compose->bcc);
SET_ADDRESS(COMPOSE_REPLYTO, compose->replyto);
+ compose_update_priority_menu_item(compose);
+
compose_show_first_last_header(compose, TRUE);
#if 0 /* NEW COMPOSE GUI */
procmime_get_encoding_str(encoding));
}
+ /* PRIORITY */
+ switch (compose->priority) {
+ case PRIORITY_HIGHEST: fprintf(fp, "Importance: high\n"
+ "X-Priority: 1 (Highest)\n");
+ break;
+ case PRIORITY_HIGH: fprintf(fp, "Importance: high\n"
+ "X-Priority: 2 (High)\n");
+ break;
+ case PRIORITY_NORMAL: break;
+ case PRIORITY_LOW: fprintf(fp, "Importance: low\n"
+ "X-Priority: 4 (Low)\n");
+ break;
+ case PRIORITY_LOWEST: fprintf(fp, "Importance: low\n"
+ "X-Priority: 5 (Lowest)\n");
+ break;
+ default: debug_print(_("compose: priority unknown : %d\n"),
+ compose->priority);
+ }
+
/* Request Return Receipt */
if (!IS_IN_CUSTOM_HEADER("Disposition-Notification-To")) {
if (compose->return_receipt) {
if (!prefs_common.show_ruler)
gtk_widget_hide(ruler_hbox);
+ /* Priority */
+ compose->priority = PRIORITY_NORMAL;
+ compose_update_priority_menu_item(compose);
+
select_account(compose, account);
set_toolbar_style(compose);
return hbox;
}
+static void compose_set_priority_cb(gpointer data,
+ guint action,
+ GtkWidget *widget)
+{
+ Compose *compose = (Compose *) data;
+ compose->priority = action;
+}
+
+static void compose_update_priority_menu_item(Compose * compose)
+{
+ GtkItemFactory *ifactory;
+ GtkWidget *menuitem;
+
+ ifactory = gtk_item_factory_from_widget(compose->menubar);
+
+ switch (compose->priority) {
+ case PRIORITY_HIGHEST:
+ menuitem = gtk_item_factory_get_item
+ (ifactory, "/Message/Priority/Highest");
+ break;
+ case PRIORITY_HIGH:
+ menuitem = gtk_item_factory_get_item
+ (ifactory, "/Message/Priority/High");
+ break;
+ case PRIORITY_NORMAL:
+ menuitem = gtk_item_factory_get_item
+ (ifactory, "/Message/Priority/Normal");
+ break;
+ case PRIORITY_LOW:
+ menuitem = gtk_item_factory_get_item
+ (ifactory, "/Message/Priority/Low");
+ break;
+ case PRIORITY_LOWEST:
+ menuitem = gtk_item_factory_get_item
+ (ifactory, "/Message/Priority/Lowest");
+ break;
+ }
+ gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem), TRUE);
+}
+
static void compose_set_template_menu(Compose *compose)
{
GSList *tmpl_list, *cur;