int show_flagged;
int sender_personal;
int sender_mbox;
+ int hotkey;
};
struct option_node {
o->show_flagged = -1;
o->sender_personal = -1;
o->sender_mbox = -1;
+ o->hotkey = -1;
}
static void
MERGE(show_flagged);
MERGE(sender_personal);
MERGE(sender_mbox);
+ MERGE(hotkey);
}
}
int hi = b->o.highlight;
attrset(attrs[cc][hi][M_IDLE]);
- if (cc)
+ if (b->o.hotkey)
+ printw("%c ", b->o.hotkey);
+ else if (cc)
printw("> ");
else
printw(" ");
move_cursor(besti);
}
+static void
+mbox_run(struct mbox *b)
+{
+ char cmd[strlen(run_cmd) + strlen(b->path) + 16];
+ sprintf(cmd, run_cmd, b->path);
+ term_cleanup();
+ system(cmd);
+ term_init();
+ redraw_all();
+ refresh();
+ b->force_refresh = 1;
+ scan_and_redraw();
+}
+
#define STR2(c) #c
#define STR(c) STR2(c)
p\t\t\tShow personal info (full name) of the sender\n\
s\t\t\tShow message snippets\n\
t\t\t\tHighlight the entry\n\
+!<key>\t\t\tSet hot key\n\
\n\
CheckMail " STR(VERSION) ", (c) " STR(YEAR) " Martin Mares <mj@ucw.cz>\n\
It can be freely distributed and used according to the GNU GPL v2.\n\
while (x = *c++)
if (x >= '0' && x <= '9')
o->priority = x - '0';
+ else if (x == '!' && *c)
+ o->hotkey = *c++;
else
{
int value = !!islower(x);
next_active(0, 1);
int should_exit = 0;
+restart:
while (!should_exit)
{
time_t now = time(NULL);
remains *= 10;
halfdelay((remains > 255) ? 255 : remains);
int ch = getch();
+ for (int i=0; i<num_mboxes; i++)
+ if (ch == mbox_array[i]->o.hotkey)
+ {
+ if (i < cursor_max)
+ cursor_at = i;
+ mbox_run(mbox_array[i]);
+ goto restart;
+ }
switch (ch)
{
case 'q':
case '\r':
case '\n':
if (cursor_at < cursor_max)
- {
- struct mbox *b = mbox_array[cursor_at];
- char cmd[strlen(run_cmd) + strlen(b->path) + 16];
- sprintf(cmd, run_cmd, b->path);
- term_cleanup();
- system(cmd);
- term_init();
- redraw_all();
- refresh();
- b->force_refresh = 1;
- scan_and_redraw();
- }
+ mbox_run(mbox_array[cursor_at]);
break;
case 'l' & 0x1f:
clearok(stdscr, TRUE);