Commit 91fe11d2 authored by claes's avatar claes

Fix in xnav close cb

parent 6e40797b
...@@ -380,10 +380,10 @@ static void xtt_close_ok( void *ctx, void *data) ...@@ -380,10 +380,10 @@ static void xtt_close_ok( void *ctx, void *data)
exit(0); exit(0);
} }
static void xtt_close( void *ctx) static void xtt_close( void *ctx, int terminate)
{ {
Xtt *xtt = (Xtt *) ctx; Xtt *xtt = (Xtt *) ctx;
if ( !xtt->xnav->op) { if ( terminate) {
wow_DisplayQuestion( xtt, xtt->toplevel, "Confirm", wow_DisplayQuestion( xtt, xtt->toplevel, "Confirm",
"Do you want to close", xtt_close_ok, 0, 0); "Do you want to close", xtt_close_ok, 0, 0);
// delete xtt->xnav; // delete xtt->xnav;
...@@ -509,7 +509,7 @@ static void xtt_activate_command( Widget w, Xtt *xtt, XmAnyCallbackStruct *data) ...@@ -509,7 +509,7 @@ static void xtt_activate_command( Widget w, Xtt *xtt, XmAnyCallbackStruct *data)
static void xtt_activate_exit( Widget w, Xtt *xtt, XmAnyCallbackStruct *data) static void xtt_activate_exit( Widget w, Xtt *xtt, XmAnyCallbackStruct *data)
{ {
xtt_close( xtt); xtt_close( xtt, xtt->xnav->op ? 0 : 1);
} }
static void xtt_activate_print( Widget w, Xtt *xtt, XmAnyCallbackStruct *data) static void xtt_activate_print( Widget w, Xtt *xtt, XmAnyCallbackStruct *data)
...@@ -1099,7 +1099,7 @@ Xtt::Xtt( int argc, char *argv[], int *return_sts) : ...@@ -1099,7 +1099,7 @@ Xtt::Xtt( int argc, char *argv[], int *return_sts) :
(XtCallbackProc)xtt_activate_exit, this); (XtCallbackProc)xtt_activate_exit, this);
if ( xnav->op) if ( xnav->op)
xtt_close( this); xtt_close( this, 0);
// Start timer to check for qcom events // Start timer to check for qcom events
timerid = XtAppAddTimeOut( timerid = XtAppAddTimeOut(
......
...@@ -264,7 +264,7 @@ class XNav { ...@@ -264,7 +264,7 @@ class XNav {
XtIntervalId trace_timerid; XtIntervalId trace_timerid;
int trace_started; int trace_started;
void (*message_cb)( void *, char, char *); void (*message_cb)( void *, char, char *);
void (*close_cb)( void *); void (*close_cb)( void *, int);
void (*map_cb)( void *); void (*map_cb)( void *);
void (*change_value_cb)( void *); void (*change_value_cb)( void *);
void (*set_dimension_cb)( void *, int, int); void (*set_dimension_cb)( void *, int, int);
......
...@@ -2744,7 +2744,7 @@ static int xnav_close_func( void *client_data, ...@@ -2744,7 +2744,7 @@ static int xnav_close_func( void *client_data,
else if ( strncmp( arg1_str, "NAVIGATOR", strlen( arg1_str)) == 0) else if ( strncmp( arg1_str, "NAVIGATOR", strlen( arg1_str)) == 0)
{ {
if ( xnav->close_cb) if ( xnav->close_cb)
(xnav->close_cb)( xnav->parent_ctx); (xnav->close_cb)( xnav->parent_ctx, xnav->op ? 0 : 1);
} }
else if ( strncmp( arg1_str, "ALL", strlen( arg1_str)) == 0) else if ( strncmp( arg1_str, "ALL", strlen( arg1_str)) == 0)
{ {
...@@ -2829,7 +2829,7 @@ static int xnav_close_func( void *client_data, ...@@ -2829,7 +2829,7 @@ static int xnav_close_func( void *client_data,
} }
if ( !keep) { if ( !keep) {
if ( xnav->close_cb) if ( xnav->close_cb)
(xnav->close_cb)( xnav->parent_ctx); (xnav->close_cb)( xnav->parent_ctx, 0);
} }
// Close alarmlist // Close alarmlist
...@@ -3355,7 +3355,7 @@ static int xnav_exit_func( void *client_data, ...@@ -3355,7 +3355,7 @@ static int xnav_exit_func( void *client_data,
XNav *xnav = (XNav *)client_data; XNav *xnav = (XNav *)client_data;
if ( xnav->close_cb) if ( xnav->close_cb)
(xnav->close_cb)( xnav->parent_ctx); (xnav->close_cb)( xnav->parent_ctx, xnav->op ? 0 : 1);
else else
exit(1); exit(1);
return 1; return 1;
...@@ -5383,10 +5383,10 @@ static void xnav_op_map_cb( void *ctx) ...@@ -5383,10 +5383,10 @@ static void xnav_op_map_cb( void *ctx)
static void xnav_op_close_cb( void *ctx) static void xnav_op_close_cb( void *ctx)
{ {
XNav *xnav = (XNav *)ctx; XNav *xnav = (XNav *)ctx;
delete xnav->op; // delete xnav->op;
xnav->op = 0; // xnav->op = 0;
if ( xnav->close_cb) if ( xnav->close_cb)
(xnav->close_cb)( xnav->parent_ctx); (xnav->close_cb)( xnav->parent_ctx, 1);
} }
static void xnav_op_help_cb( void *ctx, char *key) static void xnav_op_help_cb( void *ctx, char *key)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment