Commit 6a803dca authored by claes's avatar claes

Return status from save handled

parent a301056b
/*
* Proview $Id: ge.cpp,v 1.29 2008-01-24 09:28:01 claes Exp $
* Proview $Id: ge.cpp,v 1.30 2008-04-07 14:57:13 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -216,7 +216,10 @@ void Ge::save_graph( Ge *gectx, char *name)
strcat( filename, ".pwg");
sts = gectx->graph->save( filename);
if ( EVEN(sts)) return;
if ( EVEN(sts)) {
gectx->message( sts);
return;
}
gectx->message( 'I', "Graph saved");
gectx->set_title();
......@@ -238,13 +241,19 @@ void Ge::save_graph( Ge *gectx, char *name)
if ( ! strrchr( filename, '.'))
strcat( filename, ".pwsg");
sts = gectx->graph->save_subgraph( filename);
if ( EVEN(sts)) return;
if ( EVEN(sts)) {
gectx->message( sts);
return;
}
cdh_ToLower( filename, name);
if ( ! strrchr( filename, '.'))
strcat( filename, ".pwg");
sts = gectx->graph->save( filename);
if ( EVEN(sts)) return;
if ( EVEN(sts)) {
gectx->message( sts);
return;
}
// Store this to enable previous page later
gectx->graph->get_next_subgraph( next);
......@@ -302,7 +311,10 @@ void Ge::save_graph_and_close( Ge *gectx, char *name)
strcat( filename, ".pwg");
sts = gectx->graph->save( filename);
if ( EVEN(sts)) return;
if ( EVEN(sts)) {
gectx->message( sts);
return;
}
gectx->message( 'I', "Graph saved");
}
else
......@@ -310,6 +322,7 @@ void Ge::save_graph_and_close( Ge *gectx, char *name)
char filename[80];
char graphname[80];
char *s;
int sts;
cdh_ToLower( graphname, name);
if ( (s = strrchr( graphname, '.')))
......@@ -320,12 +333,19 @@ void Ge::save_graph_and_close( Ge *gectx, char *name)
if ( ! strrchr( filename, '.'))
strcat( filename, ".pwsg");
sts = gectx->graph->save_subgraph( filename);
if ( EVEN(sts)) return;
if ( EVEN(sts)) {
gectx->message( sts);
return;
}
cdh_ToLower( filename, name);
if ( ! strrchr( filename, '.'))
strcat( filename, ".pwg");
gectx->graph->save( filename);
sts = gectx->graph->save( filename);
if ( EVEN(sts)) {
gectx->message( sts);
return;
}
gectx->message( 'I', "SubGraph saved");
}
......
/*
* Proview $Id: ge_graph.cpp,v 1.50 2008-03-19 07:33:02 claes Exp $
* Proview $Id: ge_graph.cpp,v 1.51 2008-04-07 14:57:13 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -414,6 +414,7 @@ int Graph::save( char *filename)
{
pwr_tFileName fname;
int grow_version, graph_version;
int sts;
grow_GetVersion( grow->ctx, &grow_version, &graph_version);
if ( graph_version < 4000) {
......@@ -423,7 +424,9 @@ int Graph::save( char *filename)
}
get_filename( filename, fname);
grow_Save( grow->ctx, fname);
sts = grow_Save( grow->ctx, fname);
if ( EVEN(sts))
return sts;
grow_SetModified( grow->ctx, 0);
return 1;
......@@ -436,6 +439,7 @@ int Graph::save_subgraph( char *filename)
{
pwr_tFileName fname;
int grow_version, graph_version;
int sts;
grow_GetVersion( grow->ctx, &grow_version, &graph_version);
if ( graph_version < 4000) {
......@@ -445,8 +449,8 @@ int Graph::save_subgraph( char *filename)
}
get_filename( filename, fname);
grow_SaveSubGraph( grow->ctx, fname);
return 1;
sts = grow_SaveSubGraph( grow->ctx, fname);
return sts;
}
//
......
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