Changeset 3200

Show
Ignore:
Timestamp:
06/22/2007 11:07:20 AM (2 years ago)
Author:
paul
Message:

Added property dApp.PreferenceDialogClass? so developers can write their own
user-preference dialog and then when the user chooses to show it, dApp will
handle that.

Removed the delegation to uiApp, as that should never be necessary.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/dabo/dApp.py

    r3199 r3200  
    647647    def onShowSizerLines(self, evt): 
    648648        self.uiApp.onShowSizerLines(evt) 
     649 
    649650    def onEditPreferences(self, evt): 
    650651        try: 
    651652            self.ActiveForm.onEditPreferences(evt) 
    652653        except: 
    653             self.uiApp.onEditPreferences(evt) 
     654            if self.PreferenceDialogClass: 
     655                dlgPref = self.PreferenceDialogClass() 
     656                dlgPref.show() 
     657                if dlgPref.Modal: 
     658                    dlgPref.release() 
     659            else: 
     660                dabo.infoLog.write(_("Stub: dApp.onEditPreferences()")) 
     661 
    654662    # These handle MRU menu requests 
    655663    def addToMRU(self, menu, prmpt, bindfunc=None, *args, **kwargs): 
     
    864872 
    865873 
     874    def _getPreferenceDialogClass(self): 
     875        return getattr(self, "_preferenceDialogClass", None) 
     876 
     877    def _setPreferenceDialogClass(self, val): 
     878        self._preferenceDialogClass = val 
     879 
     880 
    866881    def _getSearchDelay(self): 
    867882        try: 
     
    10391054            one of 'Mac', 'Win' or 'GTK'.  (str)""") ) 
    10401055 
     1056    PreferenceDialogClass = property(_getPreferenceDialogClass, _setPreferenceDialogClass, None, 
     1057            _("""Specifies the dialog to use for the application's user preferences. 
     1058 
     1059            If None, the application will try to run the active form's onEditPreferences() 
     1060            method, if any. Otherwise, the preference dialog will be instantiated and  
     1061            shown when the user chooses to see the preferences.""")) 
     1062 
    10411063    SearchDelay = property(_getSearchDelay, _setSearchDelay, None, 
    10421064            _("""Specifies the delay before incrementeal searching begins.  (int) 
  • trunk/dabo/ui/uiwx/uiApp.py

    r3199 r3200  
    451451        return ret 
    452452         
    453          
    454     def onEditPreferences(self, evt): 
    455         dabo.infoLog.write(_("Stub: uiApp.onEditPreferences()")) 
    456  
    457453 
    458454    def onEditUndo(self, evt):