In simple calendar and normal mode, treat SPECIAL COLOR the same as MSG

This commit is contained in:
dfs
2007-06-29 02:11:02 +00:00
parent ebb4ebea97
commit 6bb71ee5e3
3 changed files with 37 additions and 7 deletions

View File

@@ -11,7 +11,7 @@
/***************************************************************/
#include "config.h"
static char const RCSID[] = "$Id: calendar.c,v 1.15 2007-06-05 02:44:30 dfs Exp $";
static char const RCSID[] = "$Id: calendar.c,v 1.16 2007-06-29 02:11:02 dfs Exp $";
#include <stdio.h>
#include <string.h>
@@ -638,7 +638,22 @@ static int DoCalRem(ParsePtr p, int col)
strcpy(trig.passthru, "PSFile");
trig.typ = PASSTHRU_TYPE;
}
if (!PsCal && trig.typ == PASSTHRU_TYPE) return OK;
if (!PsCal) {
if (trig.typ == PASSTHRU_TYPE) {
if (strcmp(trig.passthru, "COLOR")) return OK;
/* Strip off the three color numbers */
DBufFree(&buf);
r=ParseToken(p, &buf);
DBufFree(&buf);
if (r) return r;
r=ParseToken(p, &buf);
DBufFree(&buf);
if (r) return r;
r=ParseToken(p, &buf);
DBufFree(&buf);
if (r) return r;
}
}
/* Remove any "at" times from PS or PSFILE reminders */
if (trig.typ == PASSTHRU_TYPE && strcmp(trig.passthru, "COLOR")) {

View File

@@ -13,7 +13,7 @@
/***************************************************************/
#include "config.h"
static char const RCSID[] = "$Id: dorem.c,v 1.15 2007-06-29 01:52:36 dfs Exp $";
static char const RCSID[] = "$Id: dorem.c,v 1.16 2007-06-29 02:11:02 dfs Exp $";
#include <stdio.h>
#include <ctype.h>
@@ -535,7 +535,7 @@ static int ParseScanFrom(ParsePtr s, Trigger *t)
/* Trigger the reminder if it's a RUN or MSG type. */
/* */
/***************************************************************/
int TriggerReminder(ParsePtr p, Trigger *t, TimeTrig *tim, int jul)
int TriggerReminder(ParsePtr p, Trigger *t, TimeTrig *tim, int jul)
{
int r, y, m, d;
char PrioExpr[25];
@@ -547,11 +547,25 @@ static int ParseScanFrom(ParsePtr s, Trigger *t)
DBufInit(&buf);
DBufInit(&calRow);
if (t->typ == RUN_TYPE && RunDisabled) return E_RUN_DISABLED;
if (t->typ == PASSTHRU_TYPE ||
if ((t->typ == PASSTHRU_TYPE && strcmp(t->passthru, "COLOR")) ||
t->typ == CAL_TYPE ||
t->typ == PS_TYPE ||
t->typ == PSF_TYPE)
return OK;
/* Handle COLOR types */
if (t->typ == PASSTHRU_TYPE && !strcmp(t->passthru, "COLOR")) {
/* Strip off three tokens */
r = ParseToken(p, &buf);
DBufFree(&buf);
if (r) return r;
r = ParseToken(p, &buf);
DBufFree(&buf);
if (r) return r;
r = ParseToken(p, &buf);
DBufFree(&buf);
if (r) return r;
}
/* If it's a MSG-type reminder, and no -k option was used, issue the banner. */
if ((t->typ == MSG_TYPE || t->typ == MSF_TYPE)
&& !NumTriggered && !NextMode && !MsgCommand) {
@@ -676,6 +690,7 @@ static int ParseScanFrom(ParsePtr s, Trigger *t)
reminder now. */
switch(t->typ) {
case MSG_TYPE:
case PASSTHRU_TYPE:
if (MsgCommand) {
DoMsgCommand(MsgCommand, DBufValue(&buf));
} else {

View File

@@ -12,7 +12,7 @@
/***************************************************************/
#include "config.h"
static char const RCSID[] = "$Id: var.c,v 1.10 2005-09-30 03:29:32 dfs Exp $";
static char const RCSID[] = "$Id: var.c,v 1.11 2007-06-29 02:11:02 dfs Exp $";
#include <stdio.h>
#include <string.h>
@@ -446,7 +446,7 @@ static SysVar SysVarArr[] = {
{ "NumQueued", 0, INT_TYPE, &NumQueued, 0, 0 },
{ "NumTrig", 0, INT_TYPE, &NumTriggered, 0, 0 },
{ "PrefixLineNo", 0, INT_TYPE, &DoPrefixLineNo,0, 0 },
{ "PSCal", 0, INT_TYPE, &PsCal, 0, 0 },
{ "PSCal", 0, INT_TYPE, &PsCal, 0, 0 },
{ "RunOff", 0, INT_TYPE, &RunDisabled, 0, 0 },
{ "SimpleCal", 0, INT_TYPE, &DoSimpleCalendar, 0, 0 },
{ "SortByDate", 0, INT_TYPE, &SortByDate, 0, 0},