Commit 6b6d0fb9 authored by Claes Sjofors's avatar Claes Sjofors

wb_ge, execution of wtt initfile to get history log enable/disable setup added

parent 7be1ef6d
...@@ -2321,7 +2321,7 @@ int WNav::save_settnings( ofstream& fp) ...@@ -2321,7 +2321,7 @@ int WNav::save_settnings( ofstream& fp)
fp << " set noshowalias /local" << endl; fp << " set noshowalias /local" << endl;
if ( gbl.show_descrip) if ( gbl.show_descrip)
fp << " set show description/local" << endl; fp << " set showdescription/local" << endl;
else else
fp << " set noshowdescription /local" << endl; fp << " set noshowdescription /local" << endl;
......
...@@ -34,6 +34,7 @@ typedef void *ldh_tSesContext; ...@@ -34,6 +34,7 @@ typedef void *ldh_tSesContext;
#include "cow_xhelp_gtk.h" #include "cow_xhelp_gtk.h"
#include "wb_log_gtk.h" #include "wb_log_gtk.h"
#define wnav_cInitFile "$pwrp_login/wtt_init"
/* Fallback resources */ /* Fallback resources */
...@@ -60,6 +61,8 @@ int main( int argc, char *argv[]) ...@@ -60,6 +61,8 @@ int main( int argc, char *argv[])
char graph_name[80]; char graph_name[80];
int sts; int sts;
unsigned int opt = ge_mOption_EnableComment; unsigned int opt = ge_mOption_EnableComment;
Ge *gectx;
pwr_tFileName fname;
gtk_init( &argc, &argv); gtk_init( &argc, &argv);
...@@ -94,7 +97,6 @@ int main( int argc, char *argv[]) ...@@ -94,7 +97,6 @@ int main( int argc, char *argv[])
if ( file[0] == '@') { if ( file[0] == '@') {
// Execute script // Execute script
Ge *gectx;
pwr_tStatus sts; pwr_tStatus sts;
gectx = new GeGtk( NULL, toplevel, 0, 1, 0, NULL); gectx = new GeGtk( NULL, toplevel, 0, 1, 0, NULL);
...@@ -102,16 +104,21 @@ int main( int argc, char *argv[]) ...@@ -102,16 +104,21 @@ int main( int argc, char *argv[])
if ( EVEN(sts)) if ( EVEN(sts))
gectx->message( sts); gectx->message( sts);
} }
else { else {
// Open graph // Open graph
strcpy( graph_name, file); strcpy( graph_name, file);
new GeGtk( NULL, mainwindow, 0, 1, opt, graph_name); gectx = new GeGtk( NULL, mainwindow, 0, 1, opt, graph_name);
sprintf( fname, "@%s.pwr_com", wnav_cInitFile);
gectx->command( fname);
} }
} }
else else {
new GeGtk( NULL, mainwindow, 0, 1, opt, NULL); gectx = new GeGtk( NULL, mainwindow, 0, 1, opt, NULL);
sprintf( fname, "@%s.pwr_com", wnav_cInitFile);
gectx->command( fname);
}
gtk_widget_show_all( toplevel); gtk_widget_show_all( toplevel);
g_object_set( toplevel, "visible", FALSE, NULL); g_object_set( toplevel, "visible", FALSE, NULL);
......
...@@ -168,7 +168,7 @@ Graph::Graph( ...@@ -168,7 +168,7 @@ Graph::Graph(
graph_object_scan(0), graph_object_close(0), local_db(0), graph_object_scan(0), graph_object_close(0), local_db(0),
use_default_access(xn_use_default_access), use_default_access(xn_use_default_access),
default_access(xn_default_access), keep_mode(false), default_access(xn_default_access), keep_mode(false),
subgraph_dyn(0), was_subgraph(0), disable_log(0) subgraph_dyn(0), was_subgraph(0), disable_log(1)
{ {
cdh_StrncpyCutOff( name, xn_name, sizeof(name), 1); cdh_StrncpyCutOff( name, xn_name, sizeof(name), 1);
strcpy( default_path, xn_default_path); strcpy( default_path, xn_default_path);
......
...@@ -95,6 +95,8 @@ static int graph_disable_func(void *client_data, ...@@ -95,6 +95,8 @@ static int graph_disable_func(void *client_data,
void *client_flag); void *client_flag);
static int graph_convert_func( void *client_data, static int graph_convert_func( void *client_data,
void *client_flag); void *client_flag);
static int graph_two_func( void *client_data,
void *client_flag);
dcli_tCmdTable graph_command_table[] = { dcli_tCmdTable graph_command_table[] = {
{ {
...@@ -207,6 +209,11 @@ dcli_tCmdTable graph_command_table[] = { ...@@ -207,6 +209,11 @@ dcli_tCmdTable graph_command_table[] = {
&graph_disable_func, &graph_disable_func,
{"dcli_arg1", ""} {"dcli_arg1", ""}
}, },
{
"TWO",
&graph_two_func,
{""}
},
{"",}}; {"",}};
static void graph_store_graph( Graph *graph) static void graph_store_graph( Graph *graph)
...@@ -1306,6 +1313,41 @@ static int graph_set_func( void *client_data, ...@@ -1306,6 +1313,41 @@ static int graph_set_func( void *client_data,
return GE__SYNTAX; return GE__SYNTAX;
} }
} }
else if ( cdh_NoCaseStrcmp( arg1_str, "ADVANCEDUSER") == 0 ||
cdh_NoCaseStrcmp( arg1_str, "NOADVANCEDUSER") == 0 ||
cdh_NoCaseStrcmp( arg1_str, "ALLTOPLEVEL") == 0 ||
cdh_NoCaseStrcmp( arg1_str, "NOALLTOPLEVEL") == 0 ||
cdh_NoCaseStrcmp( arg1_str, "SHOWCLASS") == 0 ||
cdh_NoCaseStrcmp( arg1_str, "NOSHOWCLASS") == 0 ||
cdh_NoCaseStrcmp( arg1_str, "SHOWALIAS") == 0 ||
cdh_NoCaseStrcmp( arg1_str, "NOSHOWALIAS") == 0 ||
cdh_NoCaseStrcmp( arg1_str, "SHOWDESCRIPTION") == 0 ||
cdh_NoCaseStrcmp( arg1_str, "NOSHOWDESCRIPTION") == 0 ||
cdh_NoCaseStrcmp( arg1_str, "SHOWOBJREF") == 0 ||
cdh_NoCaseStrcmp( arg1_str, "NOSHOWOBJREF") == 0 ||
cdh_NoCaseStrcmp( arg1_str, "SHOWOBJXREF") == 0 ||
cdh_NoCaseStrcmp( arg1_str, "NOSHOWOBJXREF") == 0 ||
cdh_NoCaseStrcmp( arg1_str, "SHOWATTRREF") == 0 ||
cdh_NoCaseStrcmp( arg1_str, "NOSHOWATTRREF") == 0 ||
cdh_NoCaseStrcmp( arg1_str, "SHOWATTRXREF") == 0 ||
cdh_NoCaseStrcmp( arg1_str, "NOSHOWATTRXREF") == 0 ||
cdh_NoCaseStrcmp( arg1_str, "BUILDCROSSREF") == 0 ||
cdh_NoCaseStrcmp( arg1_str, "NOBUILDCROSSREF") == 0 ||
cdh_NoCaseStrcmp( arg1_str, "BUILDMANUAL") == 0 ||
cdh_NoCaseStrcmp( arg1_str, "NOBUILDMANUAL") == 0 ||
cdh_NoCaseStrcmp( arg1_str, "WINDOW") == 0 ||
cdh_NoCaseStrcmp( arg1_str, "INPUTFOCUS") == 0)
{
// Compatible with xnav init file
}
else if ( cdh_NoCaseStrncmp( arg1_str, "ENABLECOMMENT", strlen( arg1_str)) == 0)
{
graph->disable_log = 0;
}
else if ( cdh_NoCaseStrncmp( arg1_str, "NOENABLECOMMENT", strlen( arg1_str)) == 0)
{
graph->disable_log = 1;
}
else else
{ {
graph->message('E', "Syntax error"); graph->message('E', "Syntax error");
...@@ -1314,6 +1356,12 @@ static int graph_set_func( void *client_data, ...@@ -1314,6 +1356,12 @@ static int graph_set_func( void *client_data,
return GE__SUCCESS; return GE__SUCCESS;
} }
static int graph_two_func( void *client_data,
void *client_flag)
{
return GE__SUCCESS;
}
static int graph_add_func( void *client_data, static int graph_add_func( void *client_data,
void *client_flag) void *client_flag)
{ {
...@@ -2746,6 +2794,40 @@ static int graph_setintern_func( ...@@ -2746,6 +2794,40 @@ static int graph_setintern_func(
return 1; return 1;
} }
static int graph_true_func(
void *filectx,
ccm_sArg *arg_list,
int arg_count,
int *return_decl,
ccm_tFloat *return_float,
ccm_tInt *return_int,
char *return_string)
{
if ( arg_count != 0)
return CCM__ARGMISM;
*return_int = 1;
*return_decl = CCM_DECL_INT;
return 1;
}
static int graph_false_func(
void *filectx,
ccm_sArg *arg_list,
int arg_count,
int *return_decl,
ccm_tFloat *return_float,
ccm_tInt *return_int,
char *return_string)
{
if ( arg_count != 0)
return CCM__ARGMISM;
*return_int = 0;
*return_decl = CCM_DECL_INT;
return 1;
}
static int graph_ccm_deffilename_func( char *outfile, char *infile, void *client_data) static int graph_ccm_deffilename_func( char *outfile, char *infile, void *client_data)
{ {
...@@ -2855,6 +2937,10 @@ int Graph::readcmdfile( char *incommand) ...@@ -2855,6 +2937,10 @@ int Graph::readcmdfile( char *incommand)
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
sts = ccm_register_function( "SetIntern", graph_setintern_func); sts = ccm_register_function( "SetIntern", graph_setintern_func);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
sts = ccm_register_function( "IsW1", graph_true_func);
if ( EVEN(sts)) return sts;
sts = ccm_register_function( "IsW2", graph_false_func);
if ( EVEN(sts)) return sts;
ccm_func_registred = 1; ccm_func_registred = 1;
// Register wb standard functions // Register wb standard functions
......
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