[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: CVS update: Makefile.am
User: sdb
Date: 06/03/02 10:21:07
Modified: . Makefile.am m_file.c m_project.c
Added: . filechoose.c filechoose.h
Removed: . filesel.c filesel.h
Log:
Applied patch from Andy Spenser to update file chooser dialog.
Revision Changes Path
1.13 +2 -2 eda/geda/devel/geda/src/Makefile.am
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Makefile.am
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/devel/geda/src/Makefile.am,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- Makefile.am 21 Feb 2005 14:18:20 -0000 1.12
+++ Makefile.am 2 Mar 2006 15:21:06 -0000 1.13
@@ -21,8 +21,8 @@
doc.c\
file.h\
file.c\
- filesel.h\
- filesel.c\
+ filechoose.h\
+ filechoose.c\
filetool.h\
filetool.c\
global.h\
1.5 +3 -3 eda/geda/devel/geda/src/m_file.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: m_file.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/devel/geda/src/m_file.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- m_file.c 12 Feb 2005 22:06:03 -0000 1.4
+++ m_file.c 2 Mar 2006 15:21:06 -0000 1.5
@@ -1,4 +1,4 @@
-/* $Id: m_file.c,v 1.4 2005/02/12 22:06:03 danmc Exp $ */
+/* $Id: m_file.c,v 1.5 2006/03/02 15:21:06 sdb Exp $ */
/*******************************************************************************/
/* */
@@ -39,7 +39,7 @@
#include "doc.h"
#include "file.h"
-#include "filesel.h"
+#include "filechoose.h"
#include "filetool.h"
#include "interface.h"
#include "msgbox.h"
@@ -393,7 +393,7 @@
/* enter file name and location */
strcpy(szName, "");
strcpy(szExtension, "*");
- iResult = FileSelection(szExtension, szName);
+ iResult = FileChoose(szExtension, szName);
if (iResult != SUCCESS)
{
/* not an error, simply action cancelled */
1.8 +3 -3 eda/geda/devel/geda/src/m_project.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: m_project.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/devel/geda/src/m_project.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- m_project.c 12 Feb 2005 22:06:03 -0000 1.7
+++ m_project.c 2 Mar 2006 15:21:06 -0000 1.8
@@ -1,4 +1,4 @@
-/* $Id: m_project.c,v 1.7 2005/02/12 22:06:03 danmc Exp $ */
+/* $Id: m_project.c,v 1.8 2006/03/02 15:21:06 sdb Exp $ */
/*******************************************************************************/
/* */
@@ -38,7 +38,7 @@
#endif
#include "doc.h"
-#include "filesel.h"
+#include "filechoose.h"
#include "filetool.h"
#include "global.h"
#include "interface.h"
@@ -114,7 +114,7 @@
/* ask for project name */
strcpy(szProjectFileName, DEF_PRJNAME);
- iResult = FileSelection(DEF_PRJEXT, szProjectFileName);
+ iResult = FileChoose(DEF_PRJEXT, szProjectFileName);
if (iResult != SUCCESS)
{
strcpy(szProjectFileName, "");
1.1 eda/geda/devel/geda/src/filechoose.c
Index: filechoose.c
===================================================================
/* $Id: filechoose.c,v 1.1 2006/03/02 15:21:06 sdb Exp $ */
/*******************************************************************************/
/* */
/* gEDA Suite Project Manager */
/* */
/* Copyright (C) 2002 Piotr Miarecki, sp9rve@xxxxxxxxxxxxxxx */
/* */
/* This program is free software; you can redistribute it and/or */
/* modify it under the terms of the GNU General Public License */
/* as published by the Free Software Foundation version 2. */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program; if not, write to the Free Software */
/* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* */
/*******************************************************************************/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <gtk/gtk.h>
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#include "filechoose.h"
#include "global.h"
/* file choose phase */
#define FILECHOOSE_GOING 0
#define FILECHOOSE_DONE 1
#define FILECHOOSE_CANCELED 2
/* private functions and variables */
static GtkWidget *pFileChoose;
static char szFileChoose[TEXTLEN];
static int iFileChooseStatus;
int FileChoose(char *szPattern, char *szFileName)
{
//GtkWidget *pButtonOk, *pButtonCancel;
char szMask[TEXTLEN];
/* prepare variables */
strcpy(szMask, "*.");
strcat(szMask, szPattern);
/* create main widget */
pFileChoose = gtk_file_chooser_dialog_new(
"Choose file",
NULL,
GTK_FILE_CHOOSER_ACTION_OPEN,
GTK_STOCK_CANCEL,
GTK_RESPONSE_CANCEL,
GTK_STOCK_OPEN,
GTK_RESPONSE_ACCEPT,
NULL
);
gtk_object_set_data(GTK_OBJECT(pFileChoose), "FileChooseWindow", pFileChoose);
gtk_container_set_border_width(GTK_CONTAINER(pFileChoose), 10);
gtk_window_set_position(GTK_WINDOW(pFileChoose), GTK_WIN_POS_CENTER);
gtk_window_set_modal(GTK_WINDOW(pFileChoose), TRUE);
gtk_window_set_policy(GTK_WINDOW(pFileChoose), FALSE, FALSE, FALSE);
gtk_window_set_wmclass(GTK_WINDOW(pFileChoose), "*.prj", "");
gtk_window_set_transient_for(GTK_WINDOW(pFileChoose), GTK_WINDOW(pWindowMain));
gtk_widget_show(pFileChoose);
gtk_widget_show(pFileChoose);
if (gtk_dialog_run(GTK_DIALOG (pFileChoose)) == GTK_RESPONSE_ACCEPT) {
char *filename;
filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (pFileChoose));
strcpy(szFileName, filename);
strcpy(szFileChoose, filename);
iFileChooseStatus = FILECHOOSE_DONE;
g_free (filename);
} else {
iFileChooseStatus = FILECHOOSE_CANCELED;
}
gtk_widget_destroy (pFileChoose);
return (iFileChooseStatus == FILECHOOSE_DONE)
? SUCCESS
: FAILURE;
}
1.1 eda/geda/devel/geda/src/filechoose.h
Index: filechoose.h
===================================================================
/*******************************************************************************/
/* */
/* gEDA Suite Project Manager */
/* */
/* Copyright (C) 2002 Piotr Miarecki, sp9rve@xxxxxxxxxxxxxxx */
/* */
/* This program is free software; you can redistribute it and/or */
/* modify it under the terms of the GNU General Public License */
/* as published by the Free Software Foundation version 2. */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program; if not, write to the Free Software */
/* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* */
/*******************************************************************************/
#ifndef __FILECHOOSE_H_INCLUDED
#define __FILECHOOSE_H_INCLUDED
/* public functions */
int FileChoose(char *szPattern, char *szFileName);
#endif