1. I either use QSettings which picks the proper place to store, or if the
app is platform specific I just store a yaml file in the standard user
config area of that platform.

2. You can save your application reference as an APP global var in your
module, or as a private instance member of your class, so that you can
check and reshow it. This will probably get reset if you use reload() on
the module for any reason. So an alternative is to set a useful objectName
on the window, and check the children of the Maya QMainWindow for an
existing match of name and type.
On 31/07/2014 2:54 AM, "Michael Donovan" <[email protected]> wrote:

> how about some answers ?? =) !
>
>
> On Wed, Jul 30, 2014 at 2:51 AM, Marcus Ottosson <[email protected]>
> wrote:
>
>> Ah! Got it, no it was just quite the coincidence. :)
>>
>>
>> On 30 July 2014 07:37, Justin Israel <[email protected]> wrote:
>>
>>> LOL, I totally misread that whole link. It looked so similar, that at a
>>> glance I thought it was a cross post! :-)
>>> Now I properly recognize it for what it is. Ignore me on that comment.
>>>
>>>
>>> On Wed, Jul 30, 2014 at 6:14 PM, Marcus Ottosson <[email protected]
>>> > wrote:
>>>
>>>> > Busted on cross-posting? :-)
>>>>
>>>> Was this for me?
>>>>
>>>>
>>>> On 28 July 2014 23:07, Tony Barbieri <[email protected]> wrote:
>>>>
>>>>> Ah, thanks for the additional info, Justin!
>>>>>
>>>>>
>>>>> On Mon, Jul 28, 2014 at 6:05 PM, Justin Israel <[email protected]
>>>>> > wrote:
>>>>>
>>>>>> Busted on cross-posting? :-)
>>>>>>
>>>>>> @Tony, I also like QSettings since it handles a few things for you
>>>>>> like platform-specific storage locations that can resolve from User ->
>>>>>> System. You can actually pass a Format flag to the constructor to tell it
>>>>>> to use INI (I do that do keep it consistent on OSX/Linux), and can pass
>>>>>> names or even pre-constructed absolute paths, to control which config it
>>>>>> sources. QSettings is nice because it is already thread safe and handles
>>>>>> syncing for you.
>>>>>>
>>>>>> Some annoying downsides of QSettings is how it seemingly handles
>>>>>> booleans and some other types when it stores. I've noticed it will store
>>>>>> (at least in my version of PySide) a bool as a string, so I have to 
>>>>>> convert
>>>>>> it to an int before storing it. In some cases I have found it easier to
>>>>>> just use a normal yaml config. QSettings can at least tell you the target
>>>>>> storage location of where it would store a conf on the given platform.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Tue, Jul 29, 2014 at 9:50 AM, md <[email protected]> wrote:
>>>>>>
>>>>>>> omg
>>>>>>>
>>>>>>>
>>>>>>> On Monday, July 28, 2014 4:56:36 PM UTC-4, Marcus Ottosson wrote:
>>>>>>>
>>>>>>>> This couldn't have been a coincidence, could it? :-)
>>>>>>>>
>>>>>>>> http://tech-artists.org/forum/showthread.php?4872-Storing-
>>>>>>>> settings-for-tools&p=25084#post25084
>>>>>>>>
>>>>>>>>
>>>>>>>> On 28 July 2014 21:51, md <[email protected]> wrote:
>>>>>>>>
>>>>>>>>> I have a couple general housekeeping questions for you guys ...
>>>>>>>>>
>>>>>>>>> 1. Where do you store your persistent application settings ?
>>>>>>>>> 2. How/Where do you check to see if a dialog you have wrapped in
>>>>>>>>> the Maya application exists so it does not create multiple instances ?
>>>>>>>>>
>>>>>>>>> Thanks
>>>>>>>>>
>>>>>>>>> M
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> You received this message because you are subscribed to the Google
>>>>>>>>> Groups "Python Programming for Autodesk Maya" group.
>>>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>>>> send an email to [email protected].
>>>>>>>>> To view this discussion on the web visit
>>>>>>>>> https://groups.google.com/d/msgid/python_inside_maya/
>>>>>>>>> 7bb471e0-016e-45cf-a495-3af04d45a72d%40googlegroups.com
>>>>>>>>> <https://groups.google.com/d/msgid/python_inside_maya/7bb471e0-016e-45cf-a495-3af04d45a72d%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>>>> .
>>>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> *Marcus Ottosson*
>>>>>>>> [email protected]
>>>>>>>>
>>>>>>>  --
>>>>>>> You received this message because you are subscribed to the Google
>>>>>>> Groups "Python Programming for Autodesk Maya" group.
>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>> send an email to [email protected].
>>>>>>>  To view this discussion on the web visit
>>>>>>> https://groups.google.com/d/msgid/python_inside_maya/c0c101c9-d9c0-4043-a824-b48ba2f769b7%40googlegroups.com
>>>>>>> <https://groups.google.com/d/msgid/python_inside_maya/c0c101c9-d9c0-4043-a824-b48ba2f769b7%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>> .
>>>>>>>
>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>
>>>>>>
>>>>>>  --
>>>>>> You received this message because you are subscribed to the Google
>>>>>> Groups "Python Programming for Autodesk Maya" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>> send an email to [email protected].
>>>>>>  To view this discussion on the web visit
>>>>>> https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA3tropYd0xmwObiCz_RR6N12pWsT37F%2BVb-xK5YnJ684w%40mail.gmail.com
>>>>>> <https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA3tropYd0xmwObiCz_RR6N12pWsT37F%2BVb-xK5YnJ684w%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>>
>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Tony
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Python Programming for Autodesk Maya" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to [email protected].
>>>>>  To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/python_inside_maya/CAJhmvsQWP8i%3D6AMgYAPbhPGa8QPRMVoiB-YQ7ASxO9bwZ_euFw%40mail.gmail.com
>>>>> <https://groups.google.com/d/msgid/python_inside_maya/CAJhmvsQWP8i%3D6AMgYAPbhPGa8QPRMVoiB-YQ7ASxO9bwZ_euFw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> *Marcus Ottosson*
>>>> [email protected]
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Python Programming for Autodesk Maya" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to [email protected].
>>>>  To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/python_inside_maya/CAFRtmODsiyo-0n%3DhHzsVK%2BLYbKXFt317sAugOefFjdbM0%3DkmdA%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/python_inside_maya/CAFRtmODsiyo-0n%3DhHzsVK%2BLYbKXFt317sAugOefFjdbM0%3DkmdA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "Python Programming for Autodesk Maya" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>>  To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0KJtMVyo2sBFwEQvoJaejHNUdRN_hZnssXz264P%3DLR6A%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0KJtMVyo2sBFwEQvoJaejHNUdRN_hZnssXz264P%3DLR6A%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> *Marcus Ottosson*
>> [email protected]
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Python Programming for Autodesk Maya" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/python_inside_maya/z0cZGsK5X8g/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, send an email to
>> [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOA-BXOr6aYQxFGD1spXGZ0bY05AXCU3M8LkRbZ6LUOL_Q%40mail.gmail.com
>> <https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOA-BXOr6aYQxFGD1spXGZ0bY05AXCU3M8LkRbZ6LUOL_Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/CALbtmpGi7VMf%3D3j8hkT-YtCMCR9eR-HHNikcyJBGs9fZnuHPBg%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CALbtmpGi7VMf%3D3j8hkT-YtCMCR9eR-HHNikcyJBGs9fZnuHPBg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA3RkusPvUJ2DoTNjJ8FLbGFHN3fZpU5dZtH7r%2BD0eJFvA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to