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

gEDA-cvs: pcb.git: branch: master updated (57573ccab81b7125526bd4b311bbc61569e7ea35)



The branch, master has been updated
       via  57573ccab81b7125526bd4b311bbc61569e7ea35 (commit)
      from  17ae6c24c0ac2cd49b104496e3e650866d7ff29b (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
=========

 src/hid/gtk/gtkhid-main.c |   45 +++++++++++++++++++++++++++++++++++++++++++++
 src/hid/gtk/gui-dialog.c  |   11 ++++++++++-
 2 files changed, 55 insertions(+), 1 deletions(-)


=================
 Commit Messages
=================

commit 57573ccab81b7125526bd4b311bbc61569e7ea35
Author: Stuart Brorson <sdb@xxxxxxxxxx>
Commit: Stuart Brorson <sdb@xxxxxxxxxx>

    Open schematic file chooser dialog if PCB name is not set.
    
    (cherry picked from commit 209e1031656f58ffe40189d93893457975c4042f)

:100644 100644 b8fdc75... fb2aff1... M	src/hid/gtk/gtkhid-main.c
:100644 100644 7fcbf6d... 1697324... M	src/hid/gtk/gui-dialog.c

=========
 Changes
=========

commit 57573ccab81b7125526bd4b311bbc61569e7ea35
Author: Stuart Brorson <sdb@xxxxxxxxxx>
Commit: Stuart Brorson <sdb@xxxxxxxxxx>

    Open schematic file chooser dialog if PCB name is not set.
    
    (cherry picked from commit 209e1031656f58ffe40189d93893457975c4042f)

diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c
index b8fdc75..fb2aff1 100644
--- a/src/hid/gtk/gtkhid-main.c
+++ b/src/hid/gtk/gtkhid-main.c
@@ -2196,7 +2196,51 @@ Popup (int argc, char **argv, int x, int y)
     }
   return 0;
 }
+/* ------------------------------------------------------------ */
+static const char importgui_syntax[] =
+"Popup(MenuName, [Button])";
+
+static const char importgui_help[] =
+"Asks user which schematics to import into PCB.\n";
+
+/* %start-doc actions ImportGUI
+
+Asks user which schematics to import into PCB.
+
+%end-doc */
+
+
+static int
+ImportGUI (int argc, char **argv, int x, int y)
+{
+    char *name = NULL;
+    static gchar *current_layout_dir = NULL;
+    static int I_am_recursing = 0; 
+    int rv;
 
+    if (I_am_recursing)
+	return 1;
+
+
+    name = ghid_dialog_file_select_open (_("Load schematics"),
+					 &current_layout_dir,
+					 Settings.FilePath);
+
+#ifdef DEBUG
+    printf("File selected = %s\n", name);
+#endif
+
+    AttributePut (PCB, "import::src0", name);
+    free (name);
+
+    I_am_recursing = 1;
+    rv = hid_action ("Import");
+    I_am_recursing = 0;
+
+    return rv;
+}
+
+/* ------------------------------------------------------------ */
 static int
 Busy (int argc, char **argv, int x, int y)
 {
@@ -2214,6 +2258,7 @@ HID_Action ghid_main_action_list[] = {
   {"DoWindows", 0, DoWindows, dowindows_help, dowindows_syntax},
   {"Export", 0, Export},
   {"GetXY", "", GetXY, getxy_help, getxy_syntax},
+  {"ImportGUI", 0, ImportGUI, importgui_help, importgui_syntax},
   {"LayerGroupsChanged", 0, LayerGroupsChanged},
   {"LibraryChanged", 0, LibraryChanged},
   {"Load", 0, Load},
diff --git a/src/hid/gtk/gui-dialog.c b/src/hid/gtk/gui-dialog.c
index 7fcbf6d..1697324 100644
--- a/src/hid/gtk/gui-dialog.c
+++ b/src/hid/gtk/gui-dialog.c
@@ -44,6 +44,7 @@
 
 RCSID ("$Id$");
 
+/* ---------------------------------------------- */
 gchar *
 ghid_dialog_input (gchar * prompt, gchar * initial)
 {
@@ -87,6 +88,7 @@ ghid_dialog_input (gchar * prompt, gchar * initial)
   return string;
 }
 
+/* ---------------------------------------------- */
 void
 ghid_dialog_about (void)
 {
@@ -103,6 +105,7 @@ ghid_dialog_about (void)
   gtk_widget_destroy (dialog);
 }
 
+/* ---------------------------------------------- */
 gint
 ghid_dialog_confirm_all (gchar * all_message)
 {
@@ -131,6 +134,7 @@ ghid_dialog_confirm_all (gchar * all_message)
   return response;
 }
 
+/* ---------------------------------------------- */
 void
 ghid_dialog_message (gchar * message)
 {
@@ -147,6 +151,7 @@ ghid_dialog_message (gchar * message)
   gtk_widget_destroy (dialog);
 }
 
+/* ---------------------------------------------- */
 gboolean
 ghid_dialog_confirm (gchar * message, gchar * cancelmsg, gchar * okmsg)
 {
@@ -188,6 +193,7 @@ ghid_dialog_confirm (gchar * message, gchar * cancelmsg, gchar * okmsg)
   return confirm;
 }
 
+/* ---------------------------------------------- */
 gint
 ghid_dialog_close_confirm ()
 {
@@ -255,6 +261,7 @@ ghid_dialog_close_confirm ()
   return rv;
 }
 
+/* ---------------------------------------------- */
 /* Caller must g_free() the returned filename.*/
 gchar *
 ghid_dialog_file_select_open (gchar * title, gchar ** path, gchar * shortcuts)
@@ -353,7 +360,7 @@ ghid_dialog_file_select_open (gchar * title, gchar ** path, gchar * shortcuts)
   return result;
 }
 
-
+/* ---------------------------------------------- */
 /* Caller must g_free() the returned filename. */
 gchar *
 ghid_dialog_file_select_save (gchar * title, gchar ** path, gchar * file,
@@ -408,6 +415,7 @@ ghid_dialog_file_select_save (gchar * title, gchar ** path, gchar * file,
 }
 
 
+/* ---------------------------------------------- */
 /* how many files and directories to keep for the shortcuts */
 #define NHIST 8
 typedef struct ghid_file_history_struct
@@ -427,6 +435,7 @@ typedef struct ghid_file_history_struct
 static int n_recent_dirs = 0;
 static ghid_file_history * recent_dirs = NULL;
 
+/* ---------------------------------------------- */
 /* Caller must g_free() the returned filename. */
 gchar *
 ghid_fileselect (const char *title, const char *descr,




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs