mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-22 23:26:15 +00:00
Remove georges4cvs feature
This commit is contained in:
parent
f84aab54c0
commit
ce88e5836a
20 changed files with 32 additions and 129 deletions
|
@ -44,7 +44,7 @@ public:
|
|||
UFormElm& getRootNode ();
|
||||
const UFormElm& getRootNode () const;
|
||||
const std::string &getComment () const;
|
||||
void write (class NLMISC::IStream &stream, bool georges4CVS);
|
||||
void write (class NLMISC::IStream &stream);
|
||||
void getDependencies (std::set<std::string> &dependencies) const;
|
||||
uint getNumParent () const;
|
||||
UForm *getParentForm (uint parent) const;
|
||||
|
@ -73,7 +73,7 @@ public:
|
|||
|
||||
// ** IO functions
|
||||
// Set the filename before saving the form
|
||||
void write (xmlDocPtr doc, const char *filename, bool georges4CVS);
|
||||
void write (xmlDocPtr doc, const char *filename);
|
||||
|
||||
// ** Parent access
|
||||
|
||||
|
|
|
@ -161,7 +161,7 @@ public:
|
|||
};
|
||||
|
||||
// ** IO functions
|
||||
void write (xmlDocPtr root, const char *filename, bool georges4CVS);
|
||||
void write (xmlDocPtr root, const char *filename);
|
||||
|
||||
// Count parent DFN
|
||||
uint countParentDfn (uint32 round=0) const;
|
||||
|
|
|
@ -63,7 +63,7 @@ private:
|
|||
TTypeMap _MapType;
|
||||
|
||||
// Map of filename / CRefPtr<CFormDfnCFormDfn>
|
||||
TFormDfnMap _MapFormDfn;
|
||||
TFormDfnMap _MapFormDfn;
|
||||
|
||||
// Map of form / CRefPtr<CForm>
|
||||
TFormMap _MapForm;
|
||||
|
|
|
@ -54,9 +54,6 @@ public:
|
|||
/// State of the form
|
||||
TState State;
|
||||
|
||||
/// CVS Revision string
|
||||
std::string Revision;
|
||||
|
||||
/// Comments of the form
|
||||
std::string Comments;
|
||||
|
||||
|
@ -65,7 +62,7 @@ public:
|
|||
|
||||
/// ** IO functions
|
||||
void read (xmlNodePtr root);
|
||||
void write (xmlNodePtr node, bool georges4CVS) const;
|
||||
void write (xmlNodePtr node) const;
|
||||
|
||||
// Get state string
|
||||
static const char *getStateString (TState state);
|
||||
|
|
|
@ -55,7 +55,7 @@ public:
|
|||
static bool uiCompatible (TType type, TUI ui);
|
||||
|
||||
// ** IO functions
|
||||
void write (xmlDocPtr doc, bool georges4CVS) const;
|
||||
void write (xmlDocPtr doc) const;
|
||||
|
||||
// Header
|
||||
CFileHeader Header;
|
||||
|
|
|
@ -53,9 +53,8 @@ public:
|
|||
/** Write the form in a stream.
|
||||
*
|
||||
* \param stream is the stream used to write the form
|
||||
* \param georges4CVS should be true if you use Georges with CVS false else
|
||||
*/
|
||||
virtual void write (NLMISC::IStream &stream, bool georges4CVS) = 0;
|
||||
virtual void write (NLMISC::IStream &stream) = 0;
|
||||
|
||||
/**
|
||||
* Access form parents
|
||||
|
|
|
@ -289,7 +289,7 @@ int main(void)
|
|||
// and finally save the form out in case we made changes.
|
||||
// if you're accessing a form read-only (not using set*) you can skip this.
|
||||
NLMISC::COFile saveSample(sampleConfigFile);
|
||||
form->write(saveSample, false);
|
||||
form->write(saveSample);
|
||||
nlinfo("Saved sample config file.");
|
||||
} else {
|
||||
// CPath didn't find the file, just print an error and exit.
|
||||
|
|
|
@ -104,7 +104,7 @@ CForm::~CForm ()
|
|||
|
||||
// ***************************************************************************
|
||||
|
||||
void CForm::write (xmlDocPtr doc, const char *filename, bool georges4CVS)
|
||||
void CForm::write (xmlDocPtr doc, const char *filename)
|
||||
{
|
||||
// Save the filename
|
||||
if (filename)
|
||||
|
@ -137,7 +137,7 @@ void CForm::write (xmlDocPtr doc, const char *filename, bool georges4CVS)
|
|||
}
|
||||
|
||||
// Header
|
||||
Header.write (node, georges4CVS);
|
||||
Header.write (node);
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
|
@ -259,14 +259,14 @@ const std::string &CForm::getComment () const
|
|||
|
||||
// ***************************************************************************
|
||||
|
||||
void CForm::write (class NLMISC::IStream &stream, bool georges4CVS)
|
||||
void CForm::write (class NLMISC::IStream &stream)
|
||||
{
|
||||
// Xml stream
|
||||
COXml xmlStream;
|
||||
xmlStream.init (&stream);
|
||||
|
||||
// Write the file
|
||||
write (xmlStream.getDocument (), NULL, georges4CVS);
|
||||
write (xmlStream.getDocument (), NULL);
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
|
|
|
@ -41,7 +41,7 @@ void warning (bool exception, const char *format, ... );
|
|||
|
||||
// ***************************************************************************
|
||||
|
||||
void CFormDfn::write (xmlDocPtr doc, const char *filename, bool georges4CVS)
|
||||
void CFormDfn::write (xmlDocPtr doc, const char *filename)
|
||||
{
|
||||
// Save filename
|
||||
_Filename = CFile::getFilename (filename);
|
||||
|
@ -101,7 +101,7 @@ void CFormDfn::write (xmlDocPtr doc, const char *filename, bool georges4CVS)
|
|||
}
|
||||
|
||||
// Header
|
||||
Header.write (node, georges4CVS);
|
||||
Header.write (node);
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
|
|
|
@ -38,27 +38,16 @@ CFileHeader::CFileHeader ()
|
|||
MajorVersion = 0;
|
||||
MinorVersion = 0;
|
||||
State = Modified;
|
||||
Revision = "$R";
|
||||
Revision += "evision$";
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
|
||||
void CFileHeader::write (xmlNodePtr node, bool georges4CVS) const
|
||||
void CFileHeader::write (xmlNodePtr node) const
|
||||
{
|
||||
// Version for CVS ?
|
||||
if (georges4CVS)
|
||||
{
|
||||
// Georges version system
|
||||
xmlSetProp (node, (const xmlChar*)"Revision", (const xmlChar*)Revision.c_str ());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Georges version system
|
||||
char tmp[512];
|
||||
smprintf (tmp, 512, "%d.%d", MajorVersion, MinorVersion);
|
||||
xmlSetProp (node, (const xmlChar*)"Version", (const xmlChar*)tmp);
|
||||
}
|
||||
// Georges version system
|
||||
char tmp[512];
|
||||
smprintf (tmp, 512, "%d.%d", MajorVersion, MinorVersion);
|
||||
xmlSetProp (node, (const xmlChar*)"Version", (const xmlChar*)tmp);
|
||||
|
||||
// State
|
||||
if (State == Modified)
|
||||
|
@ -137,23 +126,6 @@ void CFileHeader::read (xmlNodePtr root)
|
|||
MinorVersion = 0;
|
||||
}
|
||||
|
||||
// Get the revision
|
||||
value = (const char*)xmlGetProp (root, (xmlChar*)"Revision");
|
||||
if (value)
|
||||
{
|
||||
// Set the value
|
||||
Revision = value;
|
||||
|
||||
// Delete the value
|
||||
xmlFree ((void*)value);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Set default
|
||||
Revision = "$R";
|
||||
Revision += "evision$";
|
||||
}
|
||||
|
||||
// Get the version
|
||||
value = (const char*)xmlGetProp (root, (xmlChar*)"State");
|
||||
if (value)
|
||||
|
|
|
@ -54,7 +54,7 @@ CType::~CType ()
|
|||
|
||||
// ***************************************************************************
|
||||
|
||||
void CType::write (xmlDocPtr doc, bool georges4CVS) const
|
||||
void CType::write (xmlDocPtr doc) const
|
||||
{
|
||||
// Create the first node
|
||||
xmlNodePtr node = xmlNewDocNode (doc, NULL, (const xmlChar*)"TYPE", NULL);
|
||||
|
@ -98,7 +98,7 @@ void CType::write (xmlDocPtr doc, bool georges4CVS) const
|
|||
}
|
||||
|
||||
// Header
|
||||
Header.write (node, georges4CVS);
|
||||
Header.write (node);
|
||||
}
|
||||
|
||||
// ***************************************************************************
|
||||
|
|
|
@ -1200,7 +1200,7 @@ void convertCsvFile( const string &file, bool generate, const string& sheetType
|
|||
}
|
||||
else
|
||||
{
|
||||
form->write(output, true);
|
||||
form->write(output);
|
||||
output.close();
|
||||
|
||||
if (!CPath::exists(filename + ext))
|
||||
|
|
|
@ -73,7 +73,6 @@ CGeorgesEditApp::CGeorgesEditApp() : MemStream (false, false, 1024*1024)
|
|||
ResizeMain = true;
|
||||
ExeStandalone = false;
|
||||
StartExpanded = true;
|
||||
Georges4CVS = true;
|
||||
|
||||
FormClipBoardFormatStruct = RegisterClipboardFormat ("GeorgesFormStruct");
|
||||
FormClipBoardFormatVirtualStruct = RegisterClipboardFormat ("GeorgesFormVirtualStruct");
|
||||
|
@ -547,11 +546,6 @@ bool CGeorgesEditApp::loadCfg ()
|
|||
if (start_expanded)
|
||||
StartExpanded = start_expanded->asInt () != 0;
|
||||
|
||||
// Georges4CVS
|
||||
CConfigFile::CVar *georges_for_cvs = cf.getVarPtr ("GeorgesForCvs");
|
||||
if (georges_for_cvs)
|
||||
Georges4CVS = georges_for_cvs->asInt () != 0;
|
||||
|
||||
// MaxUndo
|
||||
CConfigFile::CVar *max_undo = cf.getVarPtr ("MaxUndo");
|
||||
if (max_undo)
|
||||
|
@ -633,11 +627,6 @@ bool CGeorgesEditApp::saveCfg ()
|
|||
if (start_expanded)
|
||||
start_expanded->setAsInt (StartExpanded);
|
||||
|
||||
// Georges4CVS
|
||||
CConfigFile::CVar *georges_for_cvs= cf.getVarPtr ("GeorgesForCvs");
|
||||
if (georges_for_cvs)
|
||||
georges_for_cvs->setAsInt (Georges4CVS);
|
||||
|
||||
// MaxUndo
|
||||
CConfigFile::CVar *max_undo= cf.getVarPtr ("MaxUndo");
|
||||
if (max_undo)
|
||||
|
|
|
@ -99,9 +99,6 @@ public:
|
|||
// If true, expand document's content node at loading
|
||||
bool StartExpanded;
|
||||
|
||||
// Georges for CVS
|
||||
bool Georges4CVS;
|
||||
|
||||
// Clipboards ID
|
||||
UINT FormClipBoardFormatStruct;
|
||||
UINT FormClipBoardFormatVirtualStruct;
|
||||
|
|
|
@ -766,7 +766,7 @@ BOOL CGeorgesEditDoc::OnSaveDocument(LPCTSTR lpszPathName)
|
|||
Type->Header.MinorVersion++;
|
||||
flushValueChange ();
|
||||
}
|
||||
Type->write (xmlStream.getDocument (), theApp.Georges4CVS);
|
||||
Type->write (xmlStream.getDocument ());
|
||||
modify (NULL, NULL, false);
|
||||
flushValueChange ();
|
||||
UpdateAllViews (NULL);
|
||||
|
@ -782,7 +782,7 @@ BOOL CGeorgesEditDoc::OnSaveDocument(LPCTSTR lpszPathName)
|
|||
Dfn->Header.MinorVersion++;
|
||||
flushValueChange ();
|
||||
}
|
||||
Dfn->write (xmlStream.getDocument (), lpszPathName, theApp.Georges4CVS);
|
||||
Dfn->write (xmlStream.getDocument (), lpszPathName);
|
||||
modify (NULL, NULL, false);
|
||||
UpdateAllViews (NULL);
|
||||
return TRUE;
|
||||
|
@ -797,7 +797,7 @@ BOOL CGeorgesEditDoc::OnSaveDocument(LPCTSTR lpszPathName)
|
|||
((CForm*)(UForm*)Form)->Header.MinorVersion++;
|
||||
flushValueChange ();
|
||||
}
|
||||
((CForm*)(UForm*)Form)->write (xmlStream.getDocument (), lpszPathName, theApp.Georges4CVS);
|
||||
((CForm*)(UForm*)Form)->write (xmlStream.getDocument (), lpszPathName);
|
||||
if (strcmp (xmlStream.getErrorString (), "") != 0)
|
||||
{
|
||||
char message[512];
|
||||
|
|
|
@ -513,7 +513,7 @@ void CGeorgesImpl::MakeTyp( const std::string& filename, TType type, TUI ui, con
|
|||
outputXml.init (&output);
|
||||
|
||||
// Write
|
||||
t.write (outputXml.getDocument (), theApp.Georges4CVS);
|
||||
t.write (outputXml.getDocument ());
|
||||
}
|
||||
catch (Exception &e)
|
||||
{
|
||||
|
@ -560,7 +560,7 @@ void CGeorgesImpl::createInstanceFile (const std::string &_sxFullnameWithoutExt,
|
|||
if (f.open (fullName))
|
||||
{
|
||||
ox.init(&f);
|
||||
((NLGEORGES::CForm*)((UForm*)Form))->write (ox.getDocument(), _sxFullnameWithoutExt.c_str (), theApp.Georges4CVS);
|
||||
((NLGEORGES::CForm*)((UForm*)Form))->write (ox.getDocument(), _sxFullnameWithoutExt.c_str ());
|
||||
ox.flush();
|
||||
f.close();
|
||||
}
|
||||
|
|
|
@ -96,7 +96,6 @@ BOOL CHeaderDialog::OnInitDialog()
|
|||
IncrementVersion.Create ("Increment Version", WS_VISIBLE|WS_TABSTOP, currentPos, this, BtIncrement);
|
||||
initWidget (IncrementVersion);
|
||||
getNextPos (currentPos);
|
||||
IncrementVersion.EnableWindow ( theApp.Georges4CVS ? FALSE : TRUE );
|
||||
|
||||
// Create the state combo
|
||||
setStaticSize (currentPos);
|
||||
|
@ -243,55 +242,11 @@ void CHeaderDialog::getFromDocument (const NLGEORGES::CFileHeader &header)
|
|||
{
|
||||
if (View)
|
||||
{
|
||||
if (theApp.Georges4CVS)
|
||||
{
|
||||
// CVS revision number
|
||||
IncrementVersion.EnableWindow ( theApp.Georges4CVS ? FALSE : TRUE );
|
||||
|
||||
// Performs some checks
|
||||
bool ok = false;
|
||||
const char *revision = header.Revision.c_str ();
|
||||
char name[32];
|
||||
char name2[512];
|
||||
if (strncmp (revision, "$Revision: ", 11) == 0)
|
||||
{
|
||||
// String start
|
||||
const char *start = revision + 11;
|
||||
|
||||
// String end
|
||||
const char *end = strchr (start, '$');
|
||||
if (end)
|
||||
{
|
||||
// Build a string
|
||||
int length = std::min (31, (int)(end-start));
|
||||
memcpy (name, start, length);
|
||||
name[length] = 0;
|
||||
|
||||
// Nice version
|
||||
smprintf (name2, 512, "CVS Revision %s", name);
|
||||
|
||||
// Set the label
|
||||
LabelVersion.SetWindowText (name2);
|
||||
|
||||
// Success
|
||||
ok = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Revision not found ?
|
||||
if (!ok)
|
||||
{
|
||||
LabelVersion.SetWindowText ("CVS Revision number not found");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Nel standard version number
|
||||
ComboState.SetCurSel (header.State);
|
||||
char name[512];
|
||||
smprintf (name, 512, "Version %d.%d", header.MajorVersion, header.MinorVersion);
|
||||
LabelVersion.SetWindowText (name);
|
||||
}
|
||||
// Nel standard version number
|
||||
ComboState.SetCurSel (header.State);
|
||||
char name[512];
|
||||
smprintf (name, 512, "Version %d.%d", header.MajorVersion, header.MinorVersion);
|
||||
LabelVersion.SetWindowText (name);
|
||||
|
||||
// Set comments
|
||||
setEditTextMultiLine (Comments, header.Comments.c_str());
|
||||
|
|
|
@ -39,7 +39,6 @@ CSettingsDialog::CSettingsDialog(CWnd* pParent /*=NULL*/)
|
|||
TypeDfnSubDirectory = _T("");
|
||||
MaxUndo = 0;
|
||||
StartExpanded = TRUE;
|
||||
Georges4CVS = TRUE;
|
||||
//}}AFX_DATA_INIT
|
||||
}
|
||||
|
||||
|
@ -55,7 +54,6 @@ void CSettingsDialog::DoDataExchange(CDataExchange* pDX)
|
|||
DDX_Text(pDX, IDC_TYP_DFN_PATH, TypeDfnSubDirectory);
|
||||
DDX_Text(pDX, IDC_MAX_UNDO, MaxUndo);
|
||||
DDX_Check(pDX, IDC_START_EXPANDED, StartExpanded);
|
||||
DDX_Check(pDX, IDC_GEORGES_4_CVS, Georges4CVS);
|
||||
//}}AFX_DATA_MAP
|
||||
}
|
||||
|
||||
|
@ -93,7 +91,6 @@ BOOL CSettingsDialog::OnInitDialog()
|
|||
DefaultDfn = theApp.DefaultDfn.c_str ();
|
||||
DefaultType = theApp.DefaultType.c_str ();
|
||||
StartExpanded = theApp.StartExpanded;
|
||||
Georges4CVS = theApp.Georges4CVS;
|
||||
|
||||
UpdateData (FALSE);
|
||||
|
||||
|
@ -110,7 +107,6 @@ void CSettingsDialog::OnOK()
|
|||
theApp.TypeDfnSubDirectory = TypeDfnSubDirectory;
|
||||
theApp.RememberListSize = RememberListSize;
|
||||
theApp.StartExpanded = StartExpanded ? TRUE : FALSE;
|
||||
theApp.Georges4CVS = Georges4CVS ? TRUE : FALSE;
|
||||
theApp.MaxUndo = MaxUndo;
|
||||
theApp.DefaultDfn = DefaultDfn;
|
||||
theApp.DefaultType = DefaultType;
|
||||
|
|
|
@ -44,7 +44,6 @@ public:
|
|||
CString TypeDfnSubDirectory;
|
||||
UINT MaxUndo;
|
||||
BOOL StartExpanded;
|
||||
BOOL Georges4CVS;
|
||||
//}}AFX_DATA
|
||||
|
||||
NLMISC::CConfigFile ConfigFile;
|
||||
|
|
|
@ -11,6 +11,5 @@ SuperUser = 1;
|
|||
UserType = {
|
||||
};
|
||||
StartExpanded = 1;
|
||||
GeorgesForCvs = 1;
|
||||
SamplePath = "L:\sound_files\samplebanks";
|
||||
PackedSheetPath = "L:\sound_files\";
|
||||
|
|
Loading…
Reference in a new issue