Commit 276a04ab authored by claes's avatar claes

Classname in vrepwbl renamed whan classname changed in classeditor

parent 5775f386
/*
* Proview $Id: wb_cdrep.cpp,v 1.31 2006-05-21 22:30:50 lw Exp $
* Proview $Id: wb_cdrep.cpp,v 1.32 2006-05-24 15:00:41 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -793,4 +793,8 @@ ldh_eVolRep wb_cdrep::vtype() const
return m_orep->vtype();
}
bool wb_cdrep::renameClass( pwr_tStatus *sts, wb_name &name)
{
return m_orep->vrep()->renameObject( sts, m_orep, name);
}
/*
* Proview $Id: wb_cdrep.h,v 1.21 2005-09-06 10:43:31 claes Exp $
* Proview $Id: wb_cdrep.h,v 1.22 2006-05-24 15:00:41 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -89,6 +89,7 @@ public:
void updateTemplate( pwr_eBix bix, void *b, pwr_tOid oid, pwr_tOid toid);
pwr_tStatus sts() { return m_sts;}
ldh_eVolRep vtype() const;
bool renameClass( pwr_tStatus *sts, wb_name &name);
};
#endif
......
/*
* Proview $Id: wb_vrepmem.cpp,v 1.22 2006-05-11 07:12:20 claes Exp $
* Proview $Id: wb_vrepmem.cpp,v 1.23 2006-05-24 15:00:41 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -38,6 +38,7 @@
#include "wb_volume.h"
#include "wb_palfile.h"
#include "pwr_baseclasses.h"
#include "co_msgwindow.h"
extern "C" {
#include "co_dcli.h"
......@@ -1168,6 +1169,16 @@ bool wb_vrepmem::renameObject(pwr_tStatus *sts, wb_orep *orep, wb_name &name)
return LDH__NAMALREXI;
}
if ( m_classeditor && memo->m_cid == pwr_eClass_ClassDef) {
pwr_tCid cid = cdh_ClassObjidToId( memo->m_oid);
wb_cdrep *cdrep = m_merep->cdrep( sts, cid);
if ( cdrep) {
cdrep->renameClass( sts, name);
printf( "cdrep: %s\n", cdrep->name());
}
}
memo->m_ohtime = time;
*sts = LDH__SUCCESS;
......@@ -1884,6 +1895,12 @@ bool wb_vrepmem::commit(pwr_tStatus *sts)
wb_print_wbl wprint( fp);
wprint.printVolume( vol);
if ( wprint.getErrCnt() != 0) {
char str[400];
sprintf( str, "Errors when saving volume: %d error%s found", wprint.getErrCnt(),
(wprint.getErrCnt() == 1) ? "" : "s");
MsgWindow::message( 'E', str);
}
}
catch ( wb_error& e) {
*sts = e.sts();
......@@ -2297,3 +2314,4 @@ void wb_vrepmem::printPaletteFile()
PalFile::config_tree_print( pal_cLocalPaletteFile, menu, &psts);
}
/*
* Proview $Id: wb_vrepwbl.cpp,v 1.52 2006-05-22 10:30:00 claes Exp $
* Proview $Id: wb_vrepwbl.cpp,v 1.53 2006-05-24 15:00:41 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -315,7 +315,8 @@ int wb_vrepwbl::load( const char *fname)
if ( error_cnt || wblparser_error_cnt) {
char str[80];
sprintf( str, "Errors when loading volume: %d errors found", error_cnt + wblparser_error_cnt);
sprintf( str, "Errors when loading volume: %d error%s found",
error_cnt + wblparser_error_cnt, (error_cnt + wblparser_error_cnt == 1) ? "" : "s");
MsgWindow::message( 'F', str);
}
else
......@@ -1699,3 +1700,14 @@ void *wb_vrepwbl::readBody(pwr_tStatus *sts, const wb_orep *o, pwr_eBix bix, voi
return 0;
}
}
bool wb_vrepwbl::renameObject(pwr_tStatus *sts, wb_orep *orep, wb_name &name)
{
*sts = LDH__SUCCESS;
wb_wblnode *n = ((wb_orepwbl *) orep)->wblNode();
string sname( name.object());
n->setText( sname);
return true;
}
/*
* Proview $Id: wb_vrepwbl.h,v 1.36 2006-05-11 07:12:20 claes Exp $
* Proview $Id: wb_vrepwbl.h,v 1.37 2006-05-24 15:00:41 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -165,7 +165,7 @@ public:
bool deleteFamily(pwr_tStatus *sts, wb_orep *orep) {return false;}
bool deleteOset(pwr_tStatus *sts, wb_oset *oset) {return false;}
bool renameObject(pwr_tStatus *sts, wb_orep *orep, wb_name &name) { return false;}
bool renameObject(pwr_tStatus *sts, wb_orep *orep, wb_name &name);
bool commit(pwr_tStatus *sts) {return false;}
......
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