[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: gaf.git: branch: master updated (1.5.1-20081221-192-g985966c)
The branch, master has been updated
via 985966c57e1d3f57b8e6407756ecc7a7150484fd (commit)
via 48103eca0ded6fd42a2e3abe48c0cdcdc381f902 (commit)
via f4af51afc5af2059cfb9389cea25589d6a1ba8eb (commit)
via 5a31a49d4d1635a1f3a8f82dc68fa8e78ebc0f44 (commit)
via 94694e4b1470378172c2ca65964b51d381c84cf3 (commit)
from b5fbfa5f8734c215fb632a29699889b7decf910c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
gschem/src/g_rc.c | 2 +-
gschem/src/x_menus.c | 89 ++++++++++++++++++++++++++++++++-------------
utils/gschlas/s_util.c | 5 ++-
utils/src/gsch2pcb.c | 3 +-
utils/src/sarlacc_schem.c | 2 +-
5 files changed, 71 insertions(+), 30 deletions(-)
=================
Commit Messages
=================
commit 985966c57e1d3f57b8e6407756ecc7a7150484fd
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Date: Wed Jan 21 13:46:00 2009 +0000
gsch2pcb: Change load path for user's gsch2pcb rc file.
Load the user gsch2pcb configuration from ~/.gEDA/gsch2pcbrc instead
of ~/.gsch2pcb.
:100644 100644 8315b5a... f8031e7... M utils/src/gsch2pcb.c
commit 48103eca0ded6fd42a2e3abe48c0cdcdc381f902
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Date: Wed Jan 21 13:45:56 2009 +0000
gschem: Open recent files in the same window.
All of the other methods of opening files open them in the current
window. The recent files mechanism should match.
:100644 100644 3eb32ea... bf40173... M gschem/src/x_menus.c
commit f4af51afc5af2059cfb9389cea25589d6a1ba8eb
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Date: Wed Jan 21 09:39:22 2009 +0000
gschem: Recent files list fixes.
1. List a maximum of 10 recent files.
2. Normalize pathnames before storing.
:100644 100644 258ea88... 3eb32ea... M gschem/src/x_menus.c
commit 5a31a49d4d1635a1f3a8f82dc68fa8e78ebc0f44
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Date: Tue Jan 20 15:32:06 2009 +0000
gschem: Change load path for gschem-gtkrc.
Expect the GTK rc file for gschem to be read from
$HOME/.gEDA/gschem-gtkrc instead of $HOME/.gschem-gtkrc.
:100644 100644 30cc44a... 52f1ae5... M gschem/src/g_rc.c
commit 94694e4b1470378172c2ca65964b51d381c84cf3
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Date: Tue Jan 20 15:52:09 2009 +0000
utils: Fix some minor compile warnings.
Fix a signedness warning in sarlacc, and cast away a const qualifier
in gschlas.
:100644 100644 0f3d33d... 28c22ff... M utils/gschlas/s_util.c
:100644 100644 f025b7a... 1a19ea6... M utils/src/sarlacc_schem.c
=========
Changes
=========
commit 985966c57e1d3f57b8e6407756ecc7a7150484fd
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Date: Wed Jan 21 13:46:00 2009 +0000
gsch2pcb: Change load path for user's gsch2pcb rc file.
Load the user gsch2pcb configuration from ~/.gEDA/gsch2pcbrc instead
of ~/.gsch2pcb.
diff --git a/utils/src/gsch2pcb.c b/utils/src/gsch2pcb.c
index 8315b5a..f8031e7 100644
--- a/utils/src/gsch2pcb.c
+++ b/utils/src/gsch2pcb.c
@@ -1285,7 +1285,8 @@ load_extra_project_files(void)
load_project("/etc/gsch2pcb");
load_project("/usr/local/etc/gsch2pcb");
- path = g_build_filename((gchar *) g_get_home_dir(), ".gsch2pcb", NULL);
+ path = g_build_filename((gchar *) g_get_home_dir(), ".gEDA",
+ "gsch2pcb", NULL);
load_project(path);
g_free(path);
commit 48103eca0ded6fd42a2e3abe48c0cdcdc381f902
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Date: Wed Jan 21 13:45:56 2009 +0000
gschem: Open recent files in the same window.
All of the other methods of opening files open them in the current
window. The recent files mechanism should match.
diff --git a/gschem/src/x_menus.c b/gschem/src/x_menus.c
index 3eb32ea..bf40173 100644
--- a/gschem/src/x_menus.c
+++ b/gschem/src/x_menus.c
@@ -389,6 +389,11 @@ static GList *recent_files = NULL;
#define RECENT_FILES_STORE ".gEDA/gschem-recent-files"
#define MAX_RECENT_FILES 10
+struct recent_file_menu_data {
+ GSCHEM_TOPLEVEL *w_current;
+ gchar *filename;
+};
+
/*! \brief Make all toplevels reflect changes to the
* recent files list.
*/
@@ -436,11 +441,19 @@ static void clear_recent_file_list(gpointer data)
update_recent_files_menus();
}
-static void recent_file_clicked(gpointer filename)
+static void
+recent_file_free_menu_data (gpointer data, GClosure *closure) {
+ g_free (data);
+}
+
+static void recent_file_clicked(GtkMenuItem *menuitem, gpointer user_data)
{
FILE *fp;
PAGE *page;
- GSCHEM_TOPLEVEL *w_current;
+ struct recent_file_menu_data *data =
+ (struct recent_file_menu_data *) user_data;
+ GSCHEM_TOPLEVEL *w_current = data->w_current;
+ gchar *filename = data->filename;
/* Check if the file exists */
fp = fopen((char *) filename, "r");
@@ -453,12 +466,8 @@ static void recent_file_clicked(gpointer filename)
}
fclose(fp);
- w_current = gschem_toplevel_new();
- w_current->toplevel = s_toplevel_new();
- x_window_setup(w_current);
page = x_window_open_page(w_current, (char *)filename);
x_window_set_current_page(w_current, page);
- s_log_message (_("New Window created [%s]\n"), (char *)filename);
}
/*! \brief Attach a submenu with filenames to the 'Recent files'
@@ -494,12 +503,17 @@ void x_menu_attach_recent_files_submenu(GSCHEM_TOPLEVEL *w_current)
recent_submenu = gtk_menu_new();
GList *p = recent_files;
while(p) {
- tmp = gtk_menu_item_new_with_label((gchar *)p->data);
- gtk_signal_connect_object(GTK_OBJECT(tmp), "activate",
- GTK_SIGNAL_FUNC (recent_file_clicked),
- p->data);
- gtk_menu_append(GTK_MENU(recent_submenu), tmp);
- p = g_list_next(p);
+ struct recent_file_menu_data *menu_data = g_new0 (struct recent_file_menu_data, 1);
+ menu_data->filename = p->data;
+ menu_data->w_current = w_current;
+ tmp = gtk_menu_item_new_with_label((gchar *)p->data);
+ g_signal_connect_data (GTK_OBJECT(tmp), "activate",
+ (GCallback) recent_file_clicked,
+ menu_data,
+ (GClosureNotify) recent_file_free_menu_data,
+ 0);
+ gtk_menu_append(GTK_MENU(recent_submenu), tmp);
+ p = g_list_next(p);
}
if(recent_files != NULL) {
commit f4af51afc5af2059cfb9389cea25589d6a1ba8eb
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Date: Wed Jan 21 09:39:22 2009 +0000
gschem: Recent files list fixes.
1. List a maximum of 10 recent files.
2. Normalize pathnames before storing.
diff --git a/gschem/src/x_menus.c b/gschem/src/x_menus.c
index 258ea88..3eb32ea 100644
--- a/gschem/src/x_menus.c
+++ b/gschem/src/x_menus.c
@@ -387,6 +387,7 @@ out:
static GList *recent_files = NULL;
#define RECENT_FILES_STORE ".gEDA/gschem-recent-files"
+#define MAX_RECENT_FILES 10
/*! \brief Make all toplevels reflect changes to the
* recent files list.
@@ -521,10 +522,16 @@ void x_menu_attach_recent_files_submenu(GSCHEM_TOPLEVEL *w_current)
}
/*! \brief Add a filename to the list of recent files.
+ *
+ * If filename is already in the list, moves it to the head of the
+ * list.
*/
void recent_files_add(const char *filename)
{
gchar *basename;
+ gchar *save_fn;
+ GError *err = NULL;
+ GList *p = recent_files;
basename = g_path_get_basename(filename);
if(strstr(basename, "untitled_") == basename) {
@@ -534,16 +541,34 @@ void recent_files_add(const char *filename)
g_free(basename);
- /* check if it is a duplicate */
- GList *p = recent_files;
- while(p) {
- if(strcmp((char *)p->data, filename) == 0 )
- return;
- p = g_list_next(p);
+ /* Normalize the filename. */
+ save_fn = f_normalize_filename (filename, &err);
+ if (err != NULL) {
+ save_fn = g_strdup (filename);
+ g_error_free (err);
+ }
+
+ /* Check if the file is already in the list. */
+ while (p != NULL) {
+ if (strcmp (save_fn, (gchar *) p->data) == 0) {
+ break;
+ }
+ p = g_list_next (p);
+ }
+
+ if (p != NULL) {
+ /* Since we found the filename already in the list, move it to
+ * the head of the list. */
+ g_free (save_fn);
+ save_fn = (gchar *) p->data;
+ recent_files = g_list_delete_link (recent_files, p);
+ recent_files = g_list_prepend (recent_files, save_fn);
+ } else {
+ /* Otherwise, just add the new filename to the front of the
+ * list. */
+ recent_files = g_list_prepend (recent_files, save_fn);
}
- filename = g_strdup(filename);
- recent_files = g_list_prepend(recent_files, (gpointer)filename);
update_recent_files_menus();
}
@@ -571,7 +596,7 @@ static void recent_files_create_empty()
*/
void recent_files_save(gpointer user_data)
{
- gchar **files = NULL;
+ gchar *files[MAX_RECENT_FILES];
int num = 0;
gchar *c;
gchar *file = g_build_filename(g_get_home_dir(), RECENT_FILES_STORE, NULL);
@@ -582,10 +607,9 @@ void recent_files_save(gpointer user_data)
return;
}
- while(p) {
- files = g_realloc(files, (num + 1) * sizeof(gchar *));
- files[num++] = (gchar *)p->data;
- p = g_list_next(p);
+ while((p != NULL) && (num < MAX_RECENT_FILES)) {
+ files[num++] = (gchar *)p->data;
+ p = g_list_next(p);
}
GKeyFile *kf = g_key_file_new();
@@ -597,7 +621,6 @@ void recent_files_save(gpointer user_data)
g_free(c);
g_free(file);
- g_free(files);
g_key_file_free(kf);
}
commit 5a31a49d4d1635a1f3a8f82dc68fa8e78ebc0f44
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Date: Tue Jan 20 15:32:06 2009 +0000
gschem: Change load path for gschem-gtkrc.
Expect the GTK rc file for gschem to be read from
$HOME/.gEDA/gschem-gtkrc instead of $HOME/.gschem-gtkrc.
diff --git a/gschem/src/g_rc.c b/gschem/src/g_rc.c
index 30cc44a..52f1ae5 100644
--- a/gschem/src/g_rc.c
+++ b/gschem/src/g_rc.c
@@ -59,7 +59,7 @@ void g_rc_parse_gtkrc()
if (home == NULL)
home = g_get_home_dir ();
if (home != NULL) {
- filename = g_build_filename (home, ".gschem-gtkrc", NULL);
+ filename = g_build_filename (home, ".gEDA", "gschem-gtkrc", NULL);
gtk_rc_parse (filename);
g_free (filename);
}
commit 94694e4b1470378172c2ca65964b51d381c84cf3
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Date: Tue Jan 20 15:52:09 2009 +0000
utils: Fix some minor compile warnings.
Fix a signedness warning in sarlacc, and cast away a const qualifier
in gschlas.
diff --git a/utils/gschlas/s_util.c b/utils/gschlas/s_util.c
index 0f3d33d..28c22ff 100644
--- a/utils/gschlas/s_util.c
+++ b/utils/gschlas/s_util.c
@@ -52,9 +52,12 @@ s_util_embed(TOPLEVEL *pr_current, int embed_mode)
p_iter = g_list_next (p_iter)) {
PAGE *p_current = p_iter->data;
- for (o_iter = s_page_objects (p_current);
+ /* Cast removes const qualifier from return value of
+ * s_page_objects() */
+ for (o_iter = (GList *) s_page_objects (p_current);
o_iter != NULL;
o_iter = g_list_next (o_iter)) {
+
OBJECT *o_current = o_iter->data;
if (o_current->type == OBJ_COMPLEX ||
diff --git a/utils/src/sarlacc_schem.c b/utils/src/sarlacc_schem.c
index f025b7a..1a19ea6 100644
--- a/utils/src/sarlacc_schem.c
+++ b/utils/src/sarlacc_schem.c
@@ -171,7 +171,7 @@ void parse_header(int fd1,int fd2)
int length;
read(fd1,localbuf,32);
- if( strncmp(localbuf,"Schematic FILE",14) )
+ if( strncmp((char *) localbuf,"Schematic FILE",14) )
{
fprintf(stderr,"\nFile is not an ORCAD 16 Bit Schematic\n");
exit(1);
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs