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

Mac OS X option.ini file writing issue

Expand Messages
  • merton_monk
    In Mac OS X there are 2 ways to close PCGen. One is the Exit menu, one is Close . If you Quit/Close PCGen, the ini files will not be written - they ll
    Message 1 of 5 , May 30, 2003
    • 0 Attachment
      In Mac OS X there are 2 ways to close PCGen. One is the "Exit" menu,
      one is "Close". If you Quit/Close PCGen, the ini files will not be
      written - they'll only be written if you use the Exit menu item.
      This would seem to explain why some users experience this problem and
      others don't, it all depends on how you get out of the app.

      -Bryan
    • Kevin Colagio
      ... 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
      Message 2 of 5 , May 30, 2003
      • 0 Attachment
        --- In pcgen@yahoogroups.com, "merton_monk" <merton_monk@y...> wrote:
        > In Mac OS X there are 2 ways to close PCGen. One is the "Exit" menu,
        > one is "Close". If you Quit/Close PCGen, the ini files will not be
        > written - they'll only be written if you use the Exit menu item.
        > This would seem to explain why some users experience this problem and
        > others don't, it all depends on how you get out of the app.
        >
        > -Bryan

        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)...?

        Just some more thoughts...

        Kevin Colagio
      • 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 3 of 5 , May 30, 2003
        • 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 4 of 5 , May 30, 2003
          • 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 5 of 5 , May 30, 2003
            • 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.