From 168c7cc98f87aa9e37553cbaf580743aabb6f2a5 Mon Sep 17 00:00:00 2001 From: leo Date: Sat, 21 Dec 2002 05:05:30 +0000 Subject: More PLM cross platform improvements git-svn-id: http://svn.leocad.org/trunk@321 c7d43263-9d01-0410-8a33-9dba5d9f93d6 --- win/Libdlg.cpp | 37 ++----------------------------------- 1 file changed, 2 insertions(+), 35 deletions(-) (limited to 'win/Libdlg.cpp') diff --git a/win/Libdlg.cpp b/win/Libdlg.cpp index 72c1c78..453b4c3 100644 --- a/win/Libdlg.cpp +++ b/win/Libdlg.cpp @@ -262,42 +262,9 @@ BOOL CLibraryDlg::OnCommand(WPARAM wParam, LPARAM lParam) case ID_FILE_IMPORTPIECE: { - CString filename; - LC_LDRAW_PIECE piece; - - CFileDialog dlg(TRUE, ".dat\0", NULL,OFN_ALLOWMULTISELECT | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, - "LDraw Files (*.dat)|*.dat|All Files (*.*)|*.*||",this); - dlg.m_ofn.lpstrFile = filename.GetBuffer(_MAX_PATH); - dlg.m_ofn.nMaxFile = _MAX_PATH; - - if (dlg.DoModal() != IDOK) - return TRUE; - - POSITION pos = dlg.GetStartPosition (); - - while (pos != NULL) - { - CString str = dlg.GetNextPathName (pos); - - SystemDoWaitCursor(1); - - if (ReadLDrawPiece(str, &piece)) - { - if (project->GetPiecesLibrary ()->FindPieceInfo (piece.name) != NULL) - AfxMessageBox("Piece already exists in the library !", MB_OK|MB_ICONINFORMATION); - - if (SaveLDrawPiece(&piece)) - AfxMessageBox("Piece successfully imported.", MB_OK|MB_ICONINFORMATION); - else - AfxMessageBox("Error saving library.", MB_OK|MB_ICONINFORMATION); - } - else - AfxMessageBox("Error reading file", MB_OK|MB_ICONINFORMATION); + m_Manager.HandleCommand (LC_LIBDLG_FILE_IMPORTPIECE, 0); + UpdateList(); - SystemDoWaitCursor(-1); - FreeLDrawPiece(&piece); - } -// update m_Parts return TRUE; } -- cgit v1.2.3