[Igarden-commit] Garden/source/Document CGardenForm.cpp, 1.4.2.9, 1.4.2.10
Status: Beta
Brought to you by:
jlbedell
|
From: Jeffrey B. <jlb...@us...> - 2008-04-06 04:05:05
|
Update of /cvsroot/igarden/Garden/source/Document In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv31392/source/Document Modified Files: Tag: Release_branch_v1 CGardenForm.cpp Log Message: Handle double-clicking an example plan file Index: CGardenForm.cpp =================================================================== RCS file: /cvsroot/igarden/Garden/source/Document/CGardenForm.cpp,v retrieving revision 1.4.2.9 retrieving revision 1.4.2.10 diff -C2 -d -r1.4.2.9 -r1.4.2.10 *** CGardenForm.cpp 3 Apr 2008 00:10:09 -0000 1.4.2.9 --- CGardenForm.cpp 6 Apr 2008 04:05:07 -0000 1.4.2.10 *************** *** 52,55 **** --- 52,56 ---- #include "XGProgress.h" #include "XGStaticText.h" + #include "RGSimpleDialogs.h" static OSStatus WindowEventHandler(EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData); *************** *** 1146,1150 **** CGardenPanel *sub; DocumentTags *tags; ! char str[256]; XGString top; CGardenForm *doc = NULL, *oldDoc; --- 1147,1151 ---- CGardenPanel *sub; DocumentTags *tags; ! char str[256], ext[64]; XGString top; CGardenForm *doc = NULL, *oldDoc; *************** *** 1153,1156 **** --- 1154,1201 ---- PRECONDITION(inFileSpec != NULL); inFileSpec->GetName(str); + inFileSpec->GetFileExtension(ext); + if(strcmp(ext, kRedstartExamplePlanExt) == 0) + { + long errLine; + + if(_numDocuments >= 1) + { + CGardenForm* oldForm; + XGString title; + ClientDocument *doc; + const char *name; + + oldForm = TopDocument(); + doc = oldForm->GetFile(); + + if(doc->IsDocumentNamed()) + { + oldForm->GetTitle(title); + name = title.c_str(); + } + else + name = stx("Untitled"); + + if(BooleanQueryDialog::DoBooleanQueryDialog(198, name)) + { + doc->ImportPlan(*inFileSpec, RSGardenTemplateType, errLine); + return oldForm; + } + else + return NULL; + } + else + { + if(BooleanQueryDialog::DoBooleanQueryDialog(199)) + { + CGardenForm* newForm = NewDocument(); + newForm->GetFile()->ImportPlan(*inFileSpec, RSGardenTemplateType, errLine); + return newForm; + } + else + return NULL; + } + } + nameLen = strlen(str); #if 0 |