Loading ...
Sorry, an error occurred while loading the content.

Re: Mac OS X option.ini file writing issue

Expand Messages
  • D20 Books and More
    ... This is an inherent problem with Mac OS X. This is not necessarily an issue with PCGen. ... Apple-Q will kill the application without writing the
    Message 1 of 5 , May 30 1:53 PM
    • 0 Attachment
      > Wouldn't that be clasified as a bug then?
      >
      > I would assume that there is a common routine that is used farther
      > down the logic stream that could be overloaded to do the file
      > save...but since I don't code that heavily (some, but not THAT much),
      > I'm not sure.

      This is an inherent problem with Mac OS X. This is not necessarily an issue with
      PCGen.

      > I do understand that one is probably the window manager (the "Close"
      > method") and the other is the app...so maybe it's not possible.
      >
      > Shouldn't saving of the options.ini file be performed automatically
      > when someone clicks on "OK"? If not, maybe another button should be
      > added ("Save" or "Apply"?) to save it at that time (and change the
      > already loaded values as is already done)...?
      >
      > Just some more thoughts...
      >
      > Kevin Colagio

      Apple-Q will kill the application without writing the option.ini because this is a
      system call outside of PCGen.

      Ctrl-Q is the call within the application and will close down PCGen properly and save
      all the data necessary to the INI files.

      Jeff Pawlowski
    • kelly_cochran
      ... Well, if the .ini is supposed to be written on application exit, no matter how it exits, then it in theory could be thrown into a Thread to be fed to
      Message 2 of 5 , May 30 2:34 PM
      • 0 Attachment
        --- In pcgen@yahoogroups.com, "Kevin Colagio" <kcolagio@y...> wrote:
        > Wouldn't that be clasified as a bug then?
        >
        > I would assume that there is a common routine that is used farther
        > down the logic stream that could be overloaded to do the file
        > save...but since I don't code that heavily (some, but not THAT much),
        > I'm not sure.
        >
        > I do understand that one is probably the window manager (the "Close"
        > method") and the other is the app...so maybe it's not possible.
        >
        > Shouldn't saving of the options.ini file be performed automatically
        > when someone clicks on "OK"? If not, maybe another button should be
        > added ("Save" or "Apply"?) to save it at that time (and change the
        > already loaded values as is already done)...?

        Well, if the .ini is supposed to be written on application exit, no
        matter how it exits, then it in theory could be thrown into a Thread
        to be fed to Runtime.addShutdownHook(). Haven't looked at the code
        path myself, but it at least sounds feasible.
      • John Kono
        ... No, it s not an inherent problem with Mac OS X. It may be a problem with JRE, but *native* apps -- Carbon or Cocoa -- all have the option of reacting to
        Message 3 of 5 , May 30 6:35 PM
        • 0 Attachment
          On Friday, May 30, 2003, at 13:53 US/Pacific, D20 Books and More wrote:

          >> Wouldn't that be clasified as a bug then?
          >>
          >> I would assume that there is a common routine that is used farther
          >> down the logic stream that could be overloaded to do the file
          >> save...but since I don't code that heavily (some, but not THAT much),
          >> I'm not sure.
          >
          > This is an inherent problem with Mac OS X. This is not necessarily an
          > issue with
          > PCGen.

          No, it's not an "inherent" problem with Mac OS X. It may be a problem
          with JRE, but *native* apps -- Carbon or Cocoa -- all have the option
          of reacting to a close or quit event and saving anything that needs to
          be saved. The only time this isn't a case is if the process is
          SIGKILLed from, say, the CL. In that case, it just dies. But if PCGen
          behaves like it's received a SIGKILL when the user closes the app,
          that's an application bug, not an OS bug.


          >> I do understand that one is probably the window manager (the "Close"
          >> method") and the other is the app...so maybe it's not possible.
          >
          > Apple-Q will kill the application without writing the option.ini
          > because this is a
          > system call outside of PCGen.

          Er, nope. The system generates an event which the app developer has
          the option of watching for or not. Now, since PCGen is running on top
          of JRE, someone should probably look at the JRE docs to figure out how
          to catch the exception that the runtime is almost certainly throwing
          when it receives the quit event from the OS.


          > Ctrl-Q is the call within the application and will close down PCGen
          > properly and save
          > all the data necessary to the INI files.

          That's a poor design decision and violates all the UI guidelines I've
          ever read on *any* platform. It's a really bad idea to have two quit
          commands that do different things, and there is almost certainly a way
          around it -- if someone is willing to invest the time to look for it.
          Might I suggest starting with the ApplicationListener interface from
          the com.apple.eawt package?

          John Kono
        Your message has been successfully submitted and would be delivered to recipients shortly.