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

gEDA-cvs: pcb.git: branch: master updated (897640d7b920b4d593d2b0a6644a061698610b69)



The branch, master has been updated
       via  897640d7b920b4d593d2b0a6644a061698610b69 (commit)
      from  af5b9b3a96e9f42089ecfbe878807b68044dbdfd (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/global.h |    1 -
 src/main.c   |   46 ++++++++++++++++++----------------------------
 src/misc.c   |   11 +----------
 3 files changed, 19 insertions(+), 39 deletions(-)


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

commit 897640d7b920b4d593d2b0a6644a061698610b69
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    Remove Settings.init_done variable and its usage
    
    This variable was previously used to allow action scripts run prior to
    loading the GUI to avoid GUI startup if they executed a "Quit" action.
    
    The requirement dates back prior to the HID split, where the "Quit"
    action would cause PCB to call gtk_main_quit(), an operation which is
    illegal if the GUI main loop was not yet started. The init_done flag
    was used in QuitApplication(), both to determine whether the GUI had
    started, and if not - to note that the GUI should not be initialised
    later. (Instead of calling gtk_main_quit()).
    
    With the HID split, the QuitApplication() function was changed to call
    exit(0) rather than gtk_main_quit(), so this dance isn't necessary at
    all now.. in either case, we can just exit the application immediately.

:100644 100644 19f4454... 80bea72... M	src/global.h
:100644 100644 bb79991... 162a0e0... M	src/main.c
:100644 100644 b675090... cca9e1b... M	src/misc.c

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

commit 897640d7b920b4d593d2b0a6644a061698610b69
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    Remove Settings.init_done variable and its usage
    
    This variable was previously used to allow action scripts run prior to
    loading the GUI to avoid GUI startup if they executed a "Quit" action.
    
    The requirement dates back prior to the HID split, where the "Quit"
    action would cause PCB to call gtk_main_quit(), an operation which is
    illegal if the GUI main loop was not yet started. The init_done flag
    was used in QuitApplication(), both to determine whether the GUI had
    started, and if not - to note that the GUI should not be initialised
    later. (Instead of calling gtk_main_quit()).
    
    With the HID split, the QuitApplication() function was changed to call
    exit(0) rather than gtk_main_quit(), so this dance isn't necessary at
    all now.. in either case, we can just exit the application immediately.

diff --git a/src/global.h b/src/global.h
index 19f4454..80bea72 100644
--- a/src/global.h
+++ b/src/global.h
@@ -668,7 +668,6 @@ typedef struct			/* some resources... */
     /* connections is done */
     AutoPlace;			/* flag which says we should force placement of the
 				   windows on startup */
-  int init_done;
 }
 SettingType, *SettingTypePtr;
 
diff --git a/src/main.c b/src/main.c
index bb79991..162a0e0 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1021,12 +1021,6 @@ main (int argc, char *argv[])
 #ifdef HAVE_LIBSTROKE
   stroke_init ();
 #endif
-  /*
-   * Set this flag to zero.  Then if we have a startup
-   * action which includes Quit(), the flag will be set
-   * to -1 and we can avoid ever calling gtk_main();
-   */
-  Settings.init_done = 0;
 
   if (Settings.ScriptFilename)
     {
@@ -1040,37 +1034,33 @@ main (int argc, char *argv[])
       hid_parse_actions (Settings.ActionString, 0);
     }
 
-  if (Settings.init_done == 0)
-    {
-      Settings.init_done = 1;
 #if HAVE_DBUS
-      pcb_dbus_setup();
+  pcb_dbus_setup();
 #endif
 
-      EnableAutosave ();
+  EnableAutosave ();
 
 #ifdef DEBUG
-      printf ("Settings.LibraryCommandDir = \"%s\"\n",
-	      Settings.LibraryCommandDir);
-      printf ("Settings.FontPath          = \"%s\"\n", 
-	      Settings.FontPath);
-      printf ("Settings.ElementPath       = \"%s\"\n", 
-	      Settings.ElementPath);
-      printf ("Settings.LibraryPath       = \"%s\"\n", 
-	      Settings.LibraryPath);
-      printf ("Settings.LibraryTree       = \"%s\"\n", 
-	      Settings.LibraryTree);
-      printf ("Settings.MakeProgram = \"%s\"\n",
-	      UNKNOWN (Settings.MakeProgram));
-      printf ("Settings.GnetlistProgram = \"%s\"\n",
-	      UNKNOWN (Settings.GnetlistProgram));
+  printf ("Settings.LibraryCommandDir = \"%s\"\n",
+          Settings.LibraryCommandDir);
+  printf ("Settings.FontPath          = \"%s\"\n", 
+          Settings.FontPath);
+  printf ("Settings.ElementPath       = \"%s\"\n", 
+          Settings.ElementPath);
+  printf ("Settings.LibraryPath       = \"%s\"\n", 
+          Settings.LibraryPath);
+  printf ("Settings.LibraryTree       = \"%s\"\n", 
+          Settings.LibraryTree);
+  printf ("Settings.MakeProgram = \"%s\"\n",
+          UNKNOWN (Settings.MakeProgram));
+  printf ("Settings.GnetlistProgram = \"%s\"\n",
+          UNKNOWN (Settings.GnetlistProgram));
 #endif
 
-      gui->do_export (0);
+  gui->do_export (0);
 #if HAVE_DBUS
-      pcb_dbus_finish();
+  pcb_dbus_finish();
 #endif
-    }
 
   return (0);
 }
diff --git a/src/misc.c b/src/misc.c
index b675090..cca9e1b 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -879,16 +879,7 @@ QuitApplication (void)
   else
     DisableEmergencySave ();
 
-  /*
-   * if Settings.init_done is not > 0 then we haven't even called
-   * gtk_main() yet so gtk_main_quit() will give an error.  In
-   * this case just set the flag to -1 and we will exit instead
-   * of calling gtk_main()
-   */
-  if (Settings.init_done > 0)
-    exit (0);
-  else
-    Settings.init_done = -1;
+  exit (0);
 }
 
 /* ---------------------------------------------------------------------------




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