Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions src/calledit.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@
#include "ui_utils.h"


void calledit(void) {
int calledit(void) {

int i = 0, l, b;
int j = 0;
int x = 0;
int x = -1;
int cnt = 0, insertflg = 0;
char call1[30], call2[10];

Expand Down Expand Up @@ -79,7 +79,7 @@ void calledit(void) {
// Ctrl-A (^A) or <Home>, move to head of callsign field.
if (i == CTRL_A || i == KEY_HOME) {
b = 0;
x = 0;
i = 0;
}

// Ctrl-E (^E) or <End>, move to end of callsign field, exit edit mode.
Expand Down Expand Up @@ -140,6 +140,13 @@ void calledit(void) {
else
insertflg = 0;

// these keys terminate the callinput() loop so they should also
// terminate calledit(); pass them through
} else if (i == '\n' || i == KEY_ENTER || i == SPACE || i == TAB
|| i == CTRL_K || i == ',' || i == BACKSLASH) {
x = i;
break;

// Any character left other than <Escape>.
} else if (i != ESCAPE) {

Expand Down Expand Up @@ -177,7 +184,7 @@ void calledit(void) {

searchlog();

} else if (x != 0)
} else if (i != 0)
i = ESCAPE;

} else
Expand All @@ -194,6 +201,8 @@ void calledit(void) {

attron(A_STANDOUT);
searchlog();

return x;
}

int insert_char(int curposition) {
Expand Down
2 changes: 1 addition & 1 deletion src/calledit.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#ifndef CALLEDIT_H
#define CALLEDIT_H

void calledit(void);
int calledit(void);
int insert_char(int);

#endif /* CALLEDIT_H */
6 changes: 4 additions & 2 deletions src/callinput.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ int callinput(void) {
// <Home>, enter call edit when call field is not empty.
case KEY_HOME: {
if ((*current_qso.call != '\0') && (ungetch(x) == OK)) {
calledit();
x = calledit(); // pass through KEY_ENTER and friends from editing
}

break;
Expand All @@ -321,7 +321,7 @@ int callinput(void) {
// Left Arrow, enter call edit when call field is not empty, or band down.
case KEY_LEFT: {
if (*current_qso.call != '\0') {
calledit();
x = calledit(); // pass through KEY_ENTER and friends from editing
} else {
handle_bandswitch(BAND_DOWN);
}
Expand Down Expand Up @@ -827,6 +827,8 @@ int callinput(void) {
}
}

/* end call input */
/* keep this list of keys in sync with the list in calledit() */
if (x == '\n' || x == KEY_ENTER || x == SPACE || x == TAB
|| x == CTRL_K || x == ',' || x == BACKSLASH) {
break;
Expand Down
20 changes: 16 additions & 4 deletions src/getexchange.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
#include "getexchange.h"


void exchange_edit(void);
static int exchange_edit(void);

static void serial_up_down(char *exchange, int delta) {
/* length of serial part in "001" or "001 EU-001" */
Expand Down Expand Up @@ -176,7 +176,7 @@ int getexchange(void) {
x = KEY_LEFT;
continue;
}
case 19: { // Ctl+s (^S)--Open QTC panel for sending QTCs
case CTRL_S: { // Ctl+s (^S)--Open QTC panel for sending QTCs
if (qtcdirection == 2 || qtcdirection == 3) { // in case of QTC=SEND or QTC=BOTH
qtc_main_panel(SEND);
}
Expand Down Expand Up @@ -299,7 +299,7 @@ int getexchange(void) {

case KEY_LEFT: { /* Left Arrow--edit exchange field */
if (current_qso.comment[0] != '\0') {
exchange_edit();
x = exchange_edit(); // pass through KEY_ENTER and friends from editing
}
break;
}
Expand Down Expand Up @@ -348,6 +348,8 @@ int getexchange(void) {
}

/* <Enter>, <Tab>, Ctl-K, '\' */
/* end exchange input */
/* keep this list of keys in sync with the list in exchange_edit() */
if (x == '\n' || x == KEY_ENTER || x == TAB
|| x == CTRL_K || x == BACKSLASH) {

Expand Down Expand Up @@ -807,10 +809,11 @@ void checkexchange(struct qso_t *qso, bool interactive) {
/** Edit exchange field
*/

void exchange_edit(void) {
static int exchange_edit(void) {

int l, b;
int i = 0, j;
int x = -1;
char comment2[27];

l = strlen(current_qso.comment);
Expand Down Expand Up @@ -874,6 +877,13 @@ void exchange_edit(void) {
}
}

// these keys terminate the getexchange() loop so they should also
// terminate exchange_edit(); pass them through
} else if (i == '\n' || i == KEY_ENTER || i == TAB
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't comma also be listed here? There is an asymmetry now:

  • in call input/editing it opens the keyer window
  • same for exchange input
  • but a literal comma is inserted when editing exchange

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As TLF also has a non-contest qso/dxped comments there may well include a comma.

Maybe drop that special handling only when in contest mode.

|| i == CTRL_K || i == BACKSLASH) {
x = i;
break;

// <Escape> not received.
} else if (i != ESCAPE) {

Expand Down Expand Up @@ -903,4 +913,6 @@ void exchange_edit(void) {

attron(A_STANDOUT);
refresh_comment();

return x;
}