OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [host/] [tools/] [configtool/] [standalone/] [win32/] [ConfigToolDoc.cpp] - Blame information for rev 817

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
// ####ECOSHOSTGPLCOPYRIGHTBEGIN####                                        
2
// -------------------------------------------                              
3
// This file is part of the eCos host tools.                                
4
// Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.            
5
//
6
// This program is free software; you can redistribute it and/or modify     
7
// it under the terms of the GNU General Public License as published by     
8
// the Free Software Foundation; either version 2 or (at your option) any   
9
// later version.                                                           
10
//
11
// This program is distributed in the hope that it will be useful, but      
12
// WITHOUT ANY WARRANTY; without even the implied warranty of               
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU        
14
// General Public License for more details.                                 
15
//
16
// You should have received a copy of the GNU General Public License        
17
// along with this program; if not, write to the                            
18
// Free Software Foundation, Inc., 51 Franklin Street,                      
19
// Fifth Floor, Boston, MA  02110-1301, USA.                                
20
// -------------------------------------------                              
21
// ####ECOSHOSTGPLCOPYRIGHTEND####                                          
22
// ConfigToolDoc.cpp : implementation of the CConfigToolDoc class
23
//
24
//
25
//===========================================================================
26
//===========================================================================
27
//#####DESCRIPTIONBEGIN####
28
//
29
// Author(s):   sdf
30
// Contact(s):  sdf
31
// Date:                1998/08/11
32
// Version:             0.01
33
// Purpose:     
34
// Description: This is the implementation of the document class
35
// Requires:    
36
// Provides:    
37
// See also:    
38
// Known bugs:  
39
// Usage:       
40
//
41
//####DESCRIPTIONEND####
42
//
43
//===========================================================================
44
 
45
#include "stdafx.h"
46
 
47
#include "CTUtils.h"
48
#include "CdlTemplatesDialog.h"
49
#include "CellView.h"
50
#include "ConfigItem.h"
51
#include "ConfigTool.h"
52
#include "ConfigToolDoc.h"
53
#include "eCosTest.h"
54
#include "IdleMessage.h"
55
#include "MainFrm.h"
56
#include "PlatformDialog.h"
57
#include "PkgAdminDlg.h"
58
#include "RegKeyEx.h"
59
#include "RunTestsSheet.h"
60
#include "Thermometer.h"
61
 
62
#define INCLUDEFILE "build.hxx"
63
#include "IncludeSTL.h"
64
 
65
#ifdef _DEBUG
66
#define new DEBUG_NEW
67
#undef THIS_FILE
68
static char THIS_FILE[] = __FILE__;
69
#endif
70
 
71
// a trivial CDL parse error handler
72
 
73
/////////////////////////////////////////////////////////////////////////////
74
// CConfigToolDoc
75
 
76
IMPLEMENT_DYNCREATE(CConfigToolDoc, CDocument)
77
 
78
BEGIN_MESSAGE_MAP(CConfigToolDoc, CDocument)
79
//{{AFX_MSG_MAP(CConfigToolDoc)
80
ON_COMMAND(ID_CONFIGURATION_REPOSITORY, OnConfigurationRepository)
81
ON_COMMAND(ID_BUILD_TEMPLATES, OnBuildTemplates)
82
ON_COMMAND(ID_BUILD_PACKAGES, OnBuildPackages)
83
ON_COMMAND(ID_TOOLS_ADMINISTRATION, OnToolsAdministration)
84
ON_COMMAND(ID_FILE_EXPORT, OnFileExport)
85
ON_COMMAND(ID_FILE_IMPORT, OnFileImport)
86
//}}AFX_MSG_MAP
87
END_MESSAGE_MAP()
88
 
89
/////////////////////////////////////////////////////////////////////////////
90
// CConfigToolDoc construction/destruction
91
 
92
 
93
CConfigToolDoc::CConfigToolDoc():
94
  m_bUseCustomViewer(false),
95
  m_nFindFlags(0),
96
  m_nFindWhere(InMacro),
97
  m_bUseExternalBrowser(false),
98
  m_bAutoExpand(false),
99
  m_bMacroNames(false),
100
  m_bHex(false),
101
  m_CdlConfig(NULL),
102
  m_CdlPkgData(NULL),
103
  m_CdlInterp(NULL),
104
  m_template_version(""),
105
  m_bRepositoryOpen(false)
106
{
107
  CConfigTool::SetDocument(this);
108
  LoadProfileSettings();
109
}
110
 
111
CConfigToolDoc::~CConfigToolDoc()
112
{
113
  CConfigTool::SetDocument(0);
114
  SaveProfileSettings();
115
}
116
 
117
/////////////////////////////////////////////////////////////////////////////
118
// CConfigToolDoc serialization
119
 
120
void CConfigToolDoc::Serialize(CArchive& ar)
121
{
122
  if (ar.IsStoring())
123
  {
124
    // TODO: add storing code here
125
  }
126
  else
127
  {
128
    // TODO: add loading code here
129
  }
130
}
131
 
132
/////////////////////////////////////////////////////////////////////////////
133
// CConfigToolDoc diagnostics
134
 
135
#ifdef _DEBUG
136
void CConfigToolDoc::AssertValid() const
137
{
138
  CDocument::AssertValid();
139
}
140
 
141
void CConfigToolDoc::Dump(CDumpContext& dc) const
142
{
143
  CDocument::Dump(dc);
144
}
145
#endif //_DEBUG
146
 
147
/////////////////////////////////////////////////////////////////////////////
148
// CConfigToolDoc commands
149
 
150
bool CConfigToolDoc::SwitchMemoryLayout (BOOL bNewTargetPlatform)
151
{
152
  bool rc=true;
153
  if (bNewTargetPlatform && ! m_strBuildTree.IsEmpty ()) // the user has changed target/platform within a build tree
154
  {
155
    // copy default MLT save files for the selected target/platform from the repository to the build tree if they do not already exist
156
 
157
    CFileFind ffFileFind;
158
    BOOL bLastFile = ffFileFind.FindFile (CFileName (m_strPackagesDir, m_strMemoryLayoutFolder, _T("include\\pkgconf\\*.mlt")));
159
    while (bLastFile)
160
    {
161
      bLastFile = ffFileFind.FindNextFile ();
162
      if (! CFileName(MLTDir (), ffFileFind.GetFileName ()).Exists () &&
163
        !CUtils::CopyFile (ffFileFind.GetFilePath (), CFileName(MLTDir (), ffFileFind.GetFileName ()))){
164
        return false; // message already emitted
165
      }
166
    }
167
  }
168
 
169
  if (m_strBuildTree.IsEmpty ()) // load the memory layout from the repository
170
    rc&=NewMemoryLayout (CFileName (m_strPackagesDir, m_strMemoryLayoutFolder, _T("include\\pkgconf")));
171
  else // load the memory layout from the build tree
172
    rc&=NewMemoryLayout (MLTDir ());
173
 
174
  return true; // FIXME
175
}
176
 
177
void CConfigToolDoc::OnCloseDocument()
178
{
179
  MemoryMap.new_memory_layout (); // called to free up memory
180
  CloseRepository();
181
  CDocument::OnCloseDocument();
182
}
183
 
184
 
185
BOOL CConfigToolDoc::OnNewDocument()
186
{
187
  m_strBuildTree=_T("");
188
  if (!CDocument::OnNewDocument()){
189
    return FALSE;
190
  }
191
  m_bRepositoryOpen = false;
192
  if(!OpenRepository()){
193
    PostQuitMessage (1);
194
    return FALSE;
195
  }
196
  // load the memory layout for the default target-platform-startup from the current repository
197
 
198
  MemoryMap.set_map_size (0xFFFFFFFF); // set the maximum memory map size
199
  NewMemoryLayout (CFileName (m_strPackagesDir, m_strMemoryLayoutFolder, _T("include\\pkgconf")));
200
  UpdateBuildInfo();
201
  return TRUE;
202
}
203
 
204
BOOL CConfigToolDoc::OnOpenDocument(LPCTSTR lpszPathName)
205
{
206
  BOOL rc=FALSE; // Assume the worst
207
  CString strFileName;
208
  CdlInterpreter NewCdlInterp = NULL;
209
  CdlConfiguration NewCdlConfig = NULL;
210
 
211
 
212
  CFileName strFolder (lpszPathName);
213
  strFolder = strFolder.Left (strFolder.ReverseFind (_TCHAR('\\'))); // extract folder from file path
214
 
215
  if(CConfigTool::GetMain()){
216
    CString str;
217
    str.Format(_T("Opening save file %s"),lpszPathName);
218
    CConfigTool::GetMain()->m_wndStatusBar.SetPaneText(CMainFrame::StatusPane,str);
219
    CConfigTool::GetMain()->m_wndStatusBar.SetPaneText(CMainFrame::FailRulePane,_T(""));
220
  }
221
 
222
  TRACE(_T("###Open document - save file=%s\n"), lpszPathName);
223
 
224
  // disable the transaction callback before attempting changes
225
 
226
  EnableCallbacks(false);
227
 
228
  // load the new configuration
229
 
230
  try
231
  {
232
    NewCdlInterp = CdlInterpreterBody::make ();
233
    NewCdlConfig = CdlConfigurationBody::load (CUtils::UnicodeToStdStr (lpszPathName), m_CdlPkgData, NewCdlInterp, &CdlLoadErrorHandler, &CdlLoadWarningHandler);
234
    rc = TRUE;
235
  }
236
  catch (CdlStringException exception)
237
  {
238
    CUtils::MessageBoxF(_T("Error opening eCos configuration:\n\n%s"), CString (exception.get_message ().c_str ()));
239
  }
240
  catch (...)
241
  {
242
    CUtils::MessageBoxF(_T("Error opening eCos configuration"));
243
  }
244
 
245
  if (rc)
246
  {
247
    rc=false;
248
    // check the new configuration
249
 
250
    ASSERT (NewCdlConfig->check_this (cyg_extreme));
251
 
252
    // switch to the new configuration
253
 
254
    deleteZ(m_CdlConfig);
255
    deleteZ(m_CdlInterp);
256
    m_CdlInterp = NewCdlInterp;
257
    m_CdlConfig = NewCdlConfig;
258
          SetPathName (lpszPathName, TRUE); // called to ensure that MLTDir() will work in this function
259
 
260
    AddAllItems (); // must precede NewMemoryLayout() [CurrentLinkerScript() calls Find()]
261
 
262
    // load the memory layout from the build tree
263
    NewMemoryLayout (MLTDir ());
264
 
265
    // generate the CConfigItems from their CDL descriptions
266
 
267
 
268
    UpdateAllViews (NULL,AllSaved,0);
269
    UpdateFailingRuleCount();
270
    UpdateBuildInfo();
271
    rc=true;
272
  }
273
 
274
  // re-enable the transaction callback
275
 
276
  EnableCallbacks(true);
277
 
278
  return rc;
279
}
280
 
281
BOOL CConfigToolDoc::OnSaveDocument(LPCTSTR lpszPathName)
282
{
283
  const CString strOldPath(GetPathName());
284
  bool bSaveAs=(lpszPathName!=strOldPath);
285
  if(!bSaveAs && !IsModified()){
286
    return true;
287
  }
288
 
289
  bool rc=false;
290
  if(CheckConflictsBeforeSave()){ // errors already emitted
291
 
292
    const CFileName strPathName(lpszPathName);
293
 
294
    TRACE(_T("###Save document %s\n"),lpszPathName);
295
 
296
    CString str;
297
    str.Format(_T("Saving configuration %s"), lpszPathName);
298
    CIdleMessage IM(str);
299
    if(CConfigTool::GetCellView()){
300
      CConfigTool::GetCellView()->CancelCellEdit();
301
    }
302
 
303
    // check the configuration
304
 
305
    ASSERT (m_CdlConfig->check_this (cyg_extreme));
306
 
307
    // save the configuration
308
 
309
    try
310
    {
311
      m_CdlConfig->save (CUtils::UnicodeToStdStr (lpszPathName));
312
      rc=true;
313
    }
314
 
315
    catch (CdlStringException exception)
316
    {
317
      CUtils::MessageBoxF(_T("Error saving eCos configuration:\n\n%s"), CString (exception.get_message ().c_str ()));
318
    }
319
 
320
    catch (...)
321
    {
322
      CUtils::MessageBoxF(_T("Error saving eCos configuration"));
323
    }
324
 
325
    if(rc){
326
      rc=false;
327
      SetPathName (lpszPathName, FALSE); // called to ensure that MLTDir() will work in this function
328
 
329
      // save the memory layout files to the build tree and copy to the install tree
330
 
331
      if (bSaveAs || MemoryMap.map_modified ()) {
332
        SaveMemoryMap();
333
      } else {
334
        TRACE(_T("Memory layout not modified\n"));
335
      }
336
 
337
      UpdateAllViews (NULL,AllSaved,0);
338
 
339
      if(!m_strBuildTree.CreateDirectory() || !m_strInstallTree.CreateDirectory()){
340
        CUtils::MessageBoxF(_T("Failed to save %s - %s"),lpszPathName,CUtils::GetLastErrorMessageString());
341
      } else if(GenerateHeaders() && CopyMLTFiles()){ // in each case errors already emitted
342
         // copy new MLT files to the build tree as necessary
343
        rc=generate_build_tree (GetCdlConfig(), CUtils::UnicodeToStdStr(m_strBuildTree), CUtils::UnicodeToStdStr(m_strInstallTree));
344
      }
345
    }
346
  }
347
  if(rc){
348
    SetModifiedFlag (false);
349
    SetPathName (lpszPathName, TRUE); // add to MRU
350
  } else {
351
    SetPathName (strOldPath, FALSE);
352
  }
353
  return rc;
354
}
355
 
356
BOOL CConfigToolDoc::Reload()
357
{
358
  TRACE(_T("###ReOpen document - build tree=%s\n"),m_strBuildTree);
359
  UpdateAllViews (NULL,AllSaved,0);
360
  UpdateAllViews (NULL,ExternallyChanged,0);
361
  UpdateFailingRuleCount();
362
 
363
  return TRUE;
364
}
365
 
366
void CConfigToolDoc::OnConfigurationRepository()
367
{
368
  SaveModified ();
369
  m_bRepositoryOpen=false;
370
  if(OpenRepository(Repository(),true)){
371
    // reset the document title as shown in the frame window
372
    GetDocTemplate ()->SetDefaultTitle (this);
373
 
374
    // load the memory layout for the default target-platform-startup from the new repository
375
    NewMemoryLayout (CFileName (m_strPackagesDir, m_strMemoryLayoutFolder, _T("include\\pkgconf")));
376
    UpdateAllViews(NULL);
377
    UpdateFailingRuleCount();
378
  } else {
379
    m_bRepositoryOpen=true; // keep what we had
380
  }
381
 
382
}
383
 
384
//////////////////////////////////////////////////////////////
385
// MLT-specific member functions
386
 
387
void CConfigToolDoc::OnUpdateEditDelete(CCmdUI* pCmdUI)
388
{
389
  // enable the 'delete' menu item and toolbar button only if there is a region or section selected
390
 
391
  pCmdUI->Enable ((strSelectedRegion != _T("")) || (strSelectedSection != _T("")));
392
}
393
 
394
 
395
void CConfigToolDoc::OnUpdateEditNewSection(CCmdUI* pCmdUI)
396
{
397
  // enable the 'new section' menu item and toolbar button only if there is at least one memory region defined
398
 
399
  pCmdUI->Enable (MemoryMap.region_list.size () > 0);
400
}
401
 
402
void CConfigToolDoc::OnUpdateEditProperties(CCmdUI* pCmdUI)
403
{
404
  // enable the 'properties' menu item and toolbar button if there is a memory region or section selected       
405
  pCmdUI->Enable ((strSelectedRegion != _T("")) || (strSelectedSection != _T("")));
406
}
407
 
408
void CConfigToolDoc::LoadProfileSettings()
409
{
410
  CConfigToolApp *pApp=(CConfigToolApp *)AfxGetApp();
411
  m_eUseCustomBrowser=(BrowserType)pApp->GetProfileInt   (_T("View"),   _T("CustomBrowser"), Internal);
412
  m_bHex=                                                     pApp->GetProfileInt   (_T("Format"),_T("Hex"),    0);
413
  m_bMacroNames=                            pApp->GetProfileInt   (_T("Format"),_T("MacroNames"),       0);
414
  m_nFindFlags=                             pApp->GetProfileInt   (_T("Find"),  _T("Flags"), FR_DOWN);
415
  m_strFind=                                        pApp->GetProfileString(_T("Find"),  _T("String"));
416
  m_nFindWhere=(WhereType)pApp->GetProfileInt   (_T("Find"),    _T("Where"),0);
417
  m_bUseCustomViewer=       pApp->GetProfileInt   (_T("View"),  _T("CustomViewer"), 0);
418
  m_bAutoExpand=                            pApp->GetProfileInt   (_T("View"),  _T("Auto-expand"),      1);
419
  m_nRuleChecking=        pApp->GetProfileInt   (_T("Rule"),    _T("Checking"), Immediate|Deferred|SuggestFixes);
420
 
421
  CRegKeyEx k(HKEY_CURRENT_USER,CUtils::LoadString(IDS_REPOSITORY_REGKEY), KEY_READ);
422
 
423
  if(!k.QueryValue(CUtils::LoadString(IDS_REPOSITORY_REGVALUE), m_strRepository)){
424
    CStringArray arstr;
425
    switch(pApp->GetRepositoryRegistryClues(arstr,_T("eCos"))){
426
      case 0:
427
        break;
428
      case 1:
429
      default:
430
        SetRepository(arstr[0]);
431
        break;
432
    }
433
  }
434
}
435
 
436
void CConfigToolDoc::SaveProfileSettings()
437
{
438
  CConfigToolApp *pApp=(CConfigToolApp *)AfxGetApp();
439
  pApp->WriteProfileInt   (_T("Find"),   _T("Where"),m_nFindWhere);
440
  pApp->WriteProfileString(_T("View"),   _T("Viewer"), m_strViewer);
441
  pApp->WriteProfileInt   (_T("View"),   _T("CustomViewer"), m_bUseCustomViewer);
442
  pApp->WriteProfileInt   (_T("View"),   _T("CustomBrowser"), m_eUseCustomBrowser);
443
  pApp->WriteProfileInt   (_T("View"),   _T("Auto-expand"),     m_bAutoExpand);
444
 
445
  pApp->WriteProfileInt   (_T("Format"), _T("Hex"),     m_bHex);
446
  pApp->WriteProfileInt   (_T("Format"), _T("MacroNames"),      m_bMacroNames);
447
 
448
  pApp->WriteProfileInt   (_T("Find"),   _T("Flags"), m_nFindFlags);
449
  pApp->WriteProfileString(_T("Find"),   _T("String"), m_strFind);
450
 
451
  pApp->WriteProfileInt   (_T("Rule"),   _T("Checking"), m_nRuleChecking);
452
 
453
  CRegKeyEx k(HKEY_CURRENT_USER,CUtils::LoadString(IDS_REPOSITORY_REGKEY), KEY_WRITE);
454
  k.SetValue(m_strRepository, CUtils::LoadString(IDS_REPOSITORY_REGVALUE));
455
}
456
 
457
void CConfigToolDoc::OnBuildTemplates ()
458
{
459
  CCdlTemplatesDialog dlg (FALSE);
460
 
461
  if (IDOK == dlg.DoModal ()){
462
    SelectHardware(dlg.GetSelectedHardware());
463
    SelectTemplate(dlg.GetSelectedTemplate(), dlg.GetSelectedTemplateVersion());
464
  }
465
}
466
 
467
void CConfigToolDoc::OnBuildPackages()
468
{
469
  SelectPackages ();
470
}
471
 
472
 
473
bool CConfigToolDoc::ShowURL(LPCTSTR pszURL)
474
{
475
  bool rc=true;
476
 
477
  CString strURL(pszURL);
478
  if(!QualifyDocURL(strURL)){
479
    return false; // error message already output
480
  }
481
 
482
  CConfigToolApp*pApp=(CConfigToolApp*)AfxGetApp();
483
 
484
  switch(m_eUseCustomBrowser){
485
    case Internal:
486
      rc=CConfigToolDoc::ShowHtmlHelp(strURL);
487
      break;
488
    case AssociatedExternal:
489
      {
490
        // A bit of a problem here: we can't execute the document, because this doesn't work with "file" schemes or
491
        // with URL fragments (#...).  So we'll launch the associated program and hope there aren't too many interesting
492
        // flags specified with the association
493
        CString strBrowser;
494
        if(DefaultExternalBrowser().IsEmpty()){
495
          CUtils::MessageBoxF(_T("Failed to to determine associated external browser to open %s"),strURL);
496
        } else {
497
          pApp->Launch(strURL,DefaultExternalBrowser());
498
        }
499
      }
500
      break;
501
    case CustomExternal:
502
      pApp->Launch(strURL,m_strBrowser);
503
      break;
504
    default:
505
      ASSERT(FALSE);
506
  }
507
  return rc;
508
}
509
 
510
const CString CConfigToolDoc::CurrentTargetPrefix()
511
{
512
  CConfigItem *pItem=Find(_T("CYGBLD_GLOBAL_COMMAND_PREFIX"));
513
  return pItem?pItem->StringValue():_T("");
514
}
515
 
516
int CConfigToolDoc::GetCompilationCount(LPCTSTR psz)
517
{
518
  int rc=0;
519
  CStringArray arstr;
520
  const CString strPrefix(CurrentTargetPrefix());
521
  for(int i=CUtils::Chop(psz,arstr,_T("\n"))-1;i>=0;--i){
522
    if(-1!=arstr[i].Find(strPrefix)){
523
      rc++;
524
    }
525
  }
526
        return rc;
527
}
528
 
529
void CConfigToolDoc::RunTests()
530
{
531
  const CString strTarget(CurrentTestingIdentifier());
532
  TRACE (_T("OnRunSim(): test target ID = '%s'\n"), strTarget);
533
 
534
  if (NULL==CeCosTestPlatform::Get(strTarget)) {
535
    if(IDNO==CUtils::MessageBoxFT(MB_YESNO,_T("%s is not a recognized platform - do you wish to add it?"),strTarget)){
536
      return;
537
    }
538
    CPlatformDialog dlg;
539
    dlg.m_strPlatform=strTarget;
540
    dlg.m_strPrefix=CurrentTargetPrefix();
541
    dlg.m_strCaption=_T("New Platform");
542
    if(IDCANCEL==dlg.DoModal()){
543
      return;
544
    }
545
    CeCosTestPlatform::Add(CeCosTestPlatform(dlg.m_strPlatform,dlg.m_strPrefix,dlg.m_strPrompt,dlg.m_strGDB,dlg.m_bServerSideGdb,dlg.m_strInferior));
546
    CeCosTestPlatform::Save();
547
  }
548
 
549
  CFileNameArray ar;
550
  CFileNameArray arTestsMissing;
551
  int nTests=GetTestExeNames(ar,arTestsMissing);
552
  CRunTestsSheet sheet(_T("Run Tests"), NULL, 0, 0);
553
  sheet.SetTarget(strTarget);
554
  const CeCosTestPlatform * etPlatform = CeCosTestPlatform::Get(strTarget);
555
  ASSERT (NULL != etPlatform);
556
  if (-1 != CString (etPlatform->GdbCmds ()).Find (_T("cyg_test_is_simulator"))) { // if a simulator target
557
    sheet.SetResetNone(); // disable 'reset hardware' message box
558
  }
559
  sheet.HideRemoteControls();
560
  if(arTestsMissing.GetSize()){
561
    if(IDYES==CUtils::MessageBoxFT(MB_YESNO,_T("Not all tests are built.  Do you wish to build them now?"))){
562
      CConfigTool::GetMain()->SendMessage(WM_COMMAND,ID_BUILD_TESTS);
563
      return;
564
    }
565
  }
566
  if(CConfigTool::GetMain()->PrepareEnvironment()){
567
    for(int i=0;i<nTests;i++){
568
      sheet.Populate(ar[i],true);
569
    }
570
    for(i=0;i<arTestsMissing.GetSize();i++){
571
      sheet.Populate(arTestsMissing[i],false);
572
    }
573
    sheet.DoModal();
574
  }
575
}
576
 
577
void CConfigToolDoc::OnToolsAdministration()
578
{
579
  if(IDYES==CUtils::MessageBoxFT(MB_YESNO,_T("This command will close the current document.\n\nDo you wish to continue?"))){
580
    // ensure that the user tools are on the path for use by ecosadmin.tcl
581
    if(CConfigTool::GetMain()->PrepareEnvironment(/* bWithBuildTools = */ false)){
582
      CConfigToolApp *pApp=(CConfigToolApp *)AfxGetApp();
583
      CPkgAdminDlg dlg(PackagesDir(),pApp->m_strUserToolsDir); // make sure we use doc data before the doc is destroyed
584
      CMainFrame *pMain=CConfigTool::GetMain();
585
      if(IDOK==dlg.DoModal()){
586
        pMain->PostMessage(WM_COMMAND,ID_FILE_NEW);
587
      }
588
    }
589
  }
590
}

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.