[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: CVS update: project.c



  User: werner  
  Date: 05/03/25 05:02:18

  Modified:    .        project.c
  Log:
  added file check (Bug #156)
  
  
  
  
  Revision  Changes    Path
  1.7       +22 -13    eda/geda/devel/geda/src/project.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: project.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/devel/geda/src/project.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -b -r1.6 -r1.7
  --- project.c	12 Feb 2005 22:06:03 -0000	1.6
  +++ project.c	25 Mar 2005 10:02:18 -0000	1.7
  @@ -1,4 +1,4 @@
  -/* $Id: project.c,v 1.6 2005/02/12 22:06:03 danmc Exp $ */
  +/* $Id: project.c,v 1.7 2005/03/25 10:02:18 werner Exp $ */
   
   /*******************************************************************************/
   /*                                                                             */
  @@ -102,8 +102,8 @@
   	{
   		iResult = MsgBox(
   			pWindowMain,
  -			"Question ...",
  -			"Project already exists. Overwrite ?",
  +			_("Question..."),
  +			_("Project already exists. Overwrite?"),
   			MSGBOX_QUESTION | MSGBOX_YES | MSGBOX_NOD | MSGBOX_CANCEL
   			);
   		if (iResult != MSGBOX_YES)
  @@ -139,18 +139,27 @@
   	
   	chdir(pDefaultProjectDir);
   	
  +	/* this functions fail if the szPath is a directory */
  +	/* lets do an extra file test */
  +	if (g_file_test(szPath,G_FILE_TEST_IS_REGULAR)) {
   	strcpy(Project.szName, FileGetName(szPath));
   	strcpy(Project.szExt, FileGetExt(szPath));
   	strcpy(Project.szDir, FileGetDir(szPath));
  +	  
   	chdir(Project.szDir);
   
   	iResult = DocLoad(szPath);
  +	}
  +	else {
  +	  iResult = FAILURE;
  +	}
  +
   	if (iResult != SUCCESS)
   	{
   		MsgBox(
   			pWindowMain,
  -			"Error !",
  -			"Cannot load project !",
  +			_("Error!"),
  +			_("Cannot load project!"),
   			MSGBOX_ERROR | MSGBOX_OKD
   			);
   		return;
  @@ -189,8 +198,8 @@
   	{
   		MsgBox(
   			pWindowMain,
  -			"Error !",
  -			"Cannot save project !",
  +			_("Error!"),
  +			_("Cannot save project!"),
   			MSGBOX_ERROR | MSGBOX_OKD
   			);
   		return FAILURE;