[GME-commit]
GMESRC/GME/Gme MainFrm.h, 1.28, 1.29 MainFrm.cpp, 1.37, 1.38
gme-commit at list.isis.vanderbilt.edu
gme-commit at list.isis.vanderbilt.edu
Wed Sep 26 14:08:30 CDT 2007
Update of /project/gme-repository/GMESRC/GME/Gme
In directory escher:/tmp/cvs-serv20348
Modified Files:
MainFrm.h MainFrm.cpp
Log Message:
Mgx files or directories can be dropped onto GME.
ShowUsers menuitem added.
CVS User: Zoltan Molnar, ISIS (zolmol)
Index: MainFrm.cpp
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/MainFrm.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** MainFrm.cpp 7 Mar 2007 22:22:52 -0000 1.37
--- MainFrm.cpp 26 Sep 2007 19:08:28 -0000 1.38
***************
*** 11,14 ****
--- 11,16 ----
#include "GMEEventLogger.h"
#include ".\mainfrm.h"
+ #include <sys/types.h>
+ #include <sys/stat.h>
#ifdef _DEBUG
***************
*** 78,83 ****
ON_COMMAND(ID_VIEW_CONSOLE, OnViewConsole)
ON_UPDATE_COMMAND_UI(ID_VIEW_CONSOLE, OnUpdateViewConsole)
! ON_COMMAND(ID_VIEW_REFRESH_SOURCECONTROL, OnViewRefreshSourcecontrol)
! ON_UPDATE_COMMAND_UI(ID_VIEW_REFRESH_SOURCECONTROL, OnUpdateViewRefreshSourcecontrol)
ON_WM_CLOSE()
ON_WM_DROPFILES()
--- 80,89 ----
ON_COMMAND(ID_VIEW_CONSOLE, OnViewConsole)
ON_UPDATE_COMMAND_UI(ID_VIEW_CONSOLE, OnUpdateViewConsole)
! ON_COMMAND(ID_VIEW_REFRESH_SOURCECONTROL, OnViewMultiUserRefreshSourceControl)
! ON_UPDATE_COMMAND_UI(ID_VIEW_REFRESH_SOURCECONTROL, OnUpdateViewMultiUserRefreshSourceControl)
! ON_COMMAND(ID_MULTIUSER_ACTIVEUSERS, OnViewMultiUserActiveUsers)
! ON_UPDATE_COMMAND_UI(ID_MULTIUSER_ACTIVEUSERS, OnUpdateViewMultiUserActiveUsers)
! ON_COMMAND(ID_VIEW_CLEARCONSOLE, OnViewClearConsole)
! ON_UPDATE_COMMAND_UI(ID_VIEW_CLEARCONSOLE, OnUpdateViewClearConsole)
ON_WM_CLOSE()
ON_WM_DROPFILES()
***************
*** 921,942 ****
! void CMainFrame::OnViewRefreshSourcecontrol()
{
! BeginWaitCursor();
! try
! {
! theApp.mgaProject->UpdateSourceControlInfo();
! m_browser.RefreshAll();
! }
! catch(...)
! {
! }
! EndWaitCursor();
!
}
! void CMainFrame::OnUpdateViewRefreshSourcecontrol(CCmdUI* pCmdUI)
{
! pCmdUI->Enable(CGMEDoc::theInstance != 0);
}
--- 927,973 ----
! void CMainFrame::OnViewMultiUserRefreshSourceControl()
{
! BeginWaitCursor();
! try
! {
! theApp.mgaProject->UpdateSourceControlInfo( 0);
! m_browser.RefreshAll();
! }
! catch(...)
! {
! }
! EndWaitCursor();
}
! void CMainFrame::OnUpdateViewMultiUserRefreshSourceControl(CCmdUI* pCmdUI)
{
! pCmdUI->Enable(CGMEDoc::theInstance != 0);
! }
!
! void CMainFrame::OnViewMultiUserActiveUsers()
! {
! BeginWaitCursor();
! try
! {
! theApp.mgaProject->SourceControlActiveUsers();
! }
! catch(...) { ASSERT(0); }
! EndWaitCursor();
! }
!
! void CMainFrame::OnUpdateViewMultiUserActiveUsers(CCmdUI* pCmdUI)
! {
! pCmdUI->Enable(CGMEDoc::theInstance != 0);
! }
!
! void CMainFrame::OnViewClearConsole()
! {
! m_console.Clear();
! }
!
! void CMainFrame::OnUpdateViewClearConsole(CCmdUI* pCmdUI)
! {
! pCmdUI->Enable();
}
***************
*** 960,965 ****
if (res > 0)
{
CString conn( szFileName);
! if( conn.Right(4).CompareNoCase(".mga") == 0)
{
if( one_just_opened)
--- 991,1001 ----
if (res > 0)
{
+ bool is_dir = false;
+ struct _stat fstatus;
+ if( 0 == _tstat( szFileName, &fstatus))
+ is_dir = (fstatus.st_mode & _S_IFDIR) == _S_IFDIR;
+
CString conn( szFileName);
! if( is_dir || conn.Right(4).CompareNoCase(".mga") == 0 || conn.Right(4).CompareNoCase(".mgx") == 0)
{
if( one_just_opened)
***************
*** 967,972 ****
else if( theApp.guiMetaProject == NULL && theApp.mgaProject == 0)
{
! m_console.Message( "Opening " + conn + ".", 1);
! conn = "MGA=" + conn;
theApp.OpenProject(conn);
one_just_opened = true;
--- 1003,1017 ----
else if( theApp.guiMetaProject == NULL && theApp.mgaProject == 0)
{
! if( conn.Right(4).CompareNoCase(".mga") == 0) {
! m_console.Message( "Opening " + conn + ".", 1);
! conn = "MGA=" + conn;
! } else {
! int pos = conn.ReverseFind( '\\'); // we don't need the file name, only the path
! if( is_dir)
! conn = "MGX=\"" + conn + "\""; // directory dropped
! else if( pos != -1)
! conn = "MGX=\"" + conn.Left( pos) + "\""; // the .mgx file dropped, cut off the file part
! m_console.Message( "Opening multiuser project " + conn + ".", 1);
! }
theApp.OpenProject(conn);
one_just_opened = true;
***************
*** 994,998 ****
}
else
! m_console.Message( ".MGA, .XME, .MTA, .XMP files may be dropped only. Can't open file: " + conn + "!", 3);
}
else
--- 1039,1043 ----
}
else
! m_console.Message( ".MGX, .MGA, .XME, .MTA, .XMP files may be dropped only. Can't open file: " + conn + "!", 3);
}
else
Index: MainFrm.h
===================================================================
RCS file: /project/gme-repository/GMESRC/GME/Gme/MainFrm.h,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** MainFrm.h 7 Mar 2007 22:22:52 -0000 1.28
--- MainFrm.h 26 Sep 2007 19:08:28 -0000 1.29
***************
*** 128,133 ****
afx_msg void OnViewConsole();
afx_msg void OnUpdateViewConsole(CCmdUI* pCmdUI);
! afx_msg void OnViewRefreshSourcecontrol();
! afx_msg void OnUpdateViewRefreshSourcecontrol(CCmdUI* pCmdUI);
afx_msg void CMainFrame::OnClose();
afx_msg void OnDropFiles(HDROP);
--- 128,137 ----
afx_msg void OnViewConsole();
afx_msg void OnUpdateViewConsole(CCmdUI* pCmdUI);
! afx_msg void OnViewMultiUserRefreshSourceControl();
! afx_msg void OnUpdateViewMultiUserRefreshSourceControl(CCmdUI* pCmdUI);
! afx_msg void OnViewMultiUserActiveUsers();
! afx_msg void OnUpdateViewMultiUserActiveUsers(CCmdUI* pCmdUI);
! afx_msg void OnViewClearConsole();
! afx_msg void OnUpdateViewClearConsole( CCmdUI* pCmdUI);
afx_msg void CMainFrame::OnClose();
afx_msg void OnDropFiles(HDROP);
More information about the GME-commit
mailing list