summaryrefslogtreecommitdiff
path: root/win/Libdlg.cpp
diff options
context:
space:
mode:
authorleo2002-12-21 05:05:30 +0000
committerleo2002-12-21 05:05:30 +0000
commit168c7cc98f87aa9e37553cbaf580743aabb6f2a5 (patch)
tree7102968552f22d160982b60153d119c1bd444188 /win/Libdlg.cpp
parenta3f30483bd20556a1e01e718950ba3989df8862b (diff)
More PLM cross platform improvements
git-svn-id: http://svn.leocad.org/trunk@321 c7d43263-9d01-0410-8a33-9dba5d9f93d6
Diffstat (limited to 'win/Libdlg.cpp')
-rw-r--r--win/Libdlg.cpp37
1 files changed, 2 insertions, 35 deletions
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;
}