Commit 71752f09 authored by claes's avatar claes

Wiew history selection in history method if more than one SevHist

parent fadeefff
/* /*
* Proview $Id: xtt_c_object.cpp,v 1.19 2008-07-17 11:23:07 claes Exp $ * Proview $Id: xtt_c_object.cpp,v 1.20 2008-09-18 14:58:00 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -405,7 +405,7 @@ static pwr_tStatus OpenHistory( xmenu_sMenuCall *ip) ...@@ -405,7 +405,7 @@ static pwr_tStatus OpenHistory( xmenu_sMenuCall *ip)
pwr_tAName name; pwr_tAName name;
char cmd[800]; char cmd[800];
int sts; int sts;
pwr_tObjid child; pwr_tOid oid, child;
pwr_tClassId classid; pwr_tClassId classid;
int found; int found;
pwr_sAttrRef defhist; pwr_sAttrRef defhist;
...@@ -419,7 +419,7 @@ static pwr_tStatus OpenHistory( xmenu_sMenuCall *ip) ...@@ -419,7 +419,7 @@ static pwr_tStatus OpenHistory( xmenu_sMenuCall *ip)
sts = gdh_GetAttrRefTid( objar, &classid); sts = gdh_GetAttrRefTid( objar, &classid);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
if ( classid == pwr_cClass_DsHist || classid == pwr_cClass_PlotGroup) { if ( classid == pwr_cClass_SevHist || classid == pwr_cClass_PlotGroup) {
sts = gdh_AttrrefToName( &ip->Pointed, name, sizeof(name), sts = gdh_AttrrefToName( &ip->Pointed, name, sizeof(name),
cdh_mName_volumeStrict); cdh_mName_volumeStrict);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
...@@ -441,7 +441,7 @@ static pwr_tStatus OpenHistory( xmenu_sMenuCall *ip) ...@@ -441,7 +441,7 @@ static pwr_tStatus OpenHistory( xmenu_sMenuCall *ip)
// Default XttGraph found // Default XttGraph found
sts = gdh_GetAttrRefTid( &defhist, &classid); sts = gdh_GetAttrRefTid( &defhist, &classid);
if ( ODD(sts) && if ( ODD(sts) &&
(classid == pwr_cClass_DsHist || classid == pwr_cClass_PlotGroup)) { (classid == pwr_cClass_SevHist || classid == pwr_cClass_PlotGroup)) {
sts = gdh_AttrrefToName( &defhist, name, sizeof(name), sts = gdh_AttrrefToName( &defhist, name, sizeof(name),
cdh_mName_volumeStrict); cdh_mName_volumeStrict);
...@@ -454,25 +454,27 @@ static pwr_tStatus OpenHistory( xmenu_sMenuCall *ip) ...@@ -454,25 +454,27 @@ static pwr_tStatus OpenHistory( xmenu_sMenuCall *ip)
} }
} }
// Look for DsHist as child // Look for SevHist as child
if ( !ip->Pointed.Flags.b.Object) if ( !ip->Pointed.Flags.b.Object)
return 0; return 0;
found = 0; found = 0;
sts = gdh_GetChild( objar->Objid, &child); sts = gdh_GetChild( objar->Objid, &oid);
while ( ODD(sts)) { while ( ODD(sts)) {
sts = gdh_GetObjectClass( child, &classid); sts = gdh_GetObjectClass( oid, &classid);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
if ( classid == pwr_cClass_DsHist) { if ( classid == pwr_cClass_SevHist) {
found = 1; found++;
break; if ( found == 1)
child = oid;
} }
sts = gdh_GetNextSibling( child, &child); sts = gdh_GetNextSibling( oid, &oid);
} }
if ( !found) if ( !found)
return 1; return 1;
if ( found == 1) {
sts = gdh_ObjidToName( child, name, sizeof(name), sts = gdh_ObjidToName( child, name, sizeof(name),
cdh_mName_volumeStrict); cdh_mName_volumeStrict);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
...@@ -480,7 +482,16 @@ static pwr_tStatus OpenHistory( xmenu_sMenuCall *ip) ...@@ -480,7 +482,16 @@ static pwr_tStatus OpenHistory( xmenu_sMenuCall *ip)
// Open history // Open history
sprintf( cmd, "open history /name=%s /title=\"%s\"", name, name); sprintf( cmd, "open history /name=%s /title=\"%s\"", name, name);
((XNav *)ip->EditorContext)->command( cmd); ((XNav *)ip->EditorContext)->command( cmd);
}
else {
// Open history selection
sts = gdh_AttrrefToName( &ip->Pointed, name, sizeof(name),
cdh_mName_volumeStrict);
if ( EVEN(sts)) return sts;
sprintf( cmd, "open shist /name=%s", name);
((XNav *)ip->EditorContext)->command( cmd);
}
return 1; return 1;
} }
...@@ -502,7 +513,7 @@ static pwr_tStatus OpenHistoryFilter( xmenu_sMenuCall *ip) ...@@ -502,7 +513,7 @@ static pwr_tStatus OpenHistoryFilter( xmenu_sMenuCall *ip)
sts = gdh_GetAttrRefTid( objar, &classid); sts = gdh_GetAttrRefTid( objar, &classid);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
if ( classid == pwr_cClass_DsHist || classid == pwr_cClass_PlotGroup) { if ( classid == pwr_cClass_SevHist || classid == pwr_cClass_PlotGroup) {
return XNAV__SUCCESS; return XNAV__SUCCESS;
} }
...@@ -517,11 +528,11 @@ static pwr_tStatus OpenHistoryFilter( xmenu_sMenuCall *ip) ...@@ -517,11 +528,11 @@ static pwr_tStatus OpenHistoryFilter( xmenu_sMenuCall *ip)
// Default XttGraph found // Default XttGraph found
sts = gdh_GetAttrRefTid( &defhist, &classid); sts = gdh_GetAttrRefTid( &defhist, &classid);
if ( ODD(sts) && if ( ODD(sts) &&
(classid == pwr_cClass_DsHist || classid == pwr_cClass_PlotGroup)) (classid == pwr_cClass_SevHist || classid == pwr_cClass_PlotGroup))
return XNAV__SUCCESS; return XNAV__SUCCESS;
} }
// Check if object has a DsHist as child // Check if object has a SevHist as child
if ( !objar->Flags.b.Object) if ( !objar->Flags.b.Object)
return XNAV__INVISIBLE; return XNAV__INVISIBLE;
...@@ -530,7 +541,7 @@ static pwr_tStatus OpenHistoryFilter( xmenu_sMenuCall *ip) ...@@ -530,7 +541,7 @@ static pwr_tStatus OpenHistoryFilter( xmenu_sMenuCall *ip)
sts = gdh_GetObjectClass( child, &classid); sts = gdh_GetObjectClass( child, &classid);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
if ( classid == pwr_cClass_DsHist) if ( classid == pwr_cClass_SevHist)
return XNAV__SUCCESS; return XNAV__SUCCESS;
sts = gdh_GetNextSibling( child, &child); sts = gdh_GetNextSibling( child, &child);
......
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